/* Org-chart style team layout (grouped by role) */

.team-hierarchy-banner-actions {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.team-hierarchy-banner-link {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 700;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.team-hierarchy-banner-link:hover {
  background: rgba(255, 255, 255, 0.18);
  text-decoration: none;
}

.team-hierarchy-banner-divider {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
}

.team-hierarchy-section {
  padding: 60px 0 100px;
  background: #fff;
}

.night-mode .team-hierarchy-section {
  background: transparent;
}

/* Org chart container */
.org-chart {
  margin-top: 2.5rem;
}

.org-tier {
  position: relative;
  padding: 1.25rem 0 2.25rem;
}

.org-tier--top {
  padding-top: 0;
  padding-bottom: 1.5rem;
}

.org-tier-title-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.2rem;
}

.org-tier-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--charcoal-black, #1a1a1a);
  background: rgba(65, 143, 222, 0.08);
  border: 1px solid rgba(65, 143, 222, 0.18);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
}

.night-mode .org-tier-title {
  color: #fff;
  background: rgba(65, 143, 222, 0.15);
  border-color: rgba(65, 143, 222, 0.35);
}

.org-tier-members {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.1rem;
  position: relative;
}

.org-tier-members--center {
  justify-content: center;
}

/* Connector from top tier to the next tier */
.org-connector--after-top {
  position: relative;
  height: 46px;
}

.org-connector--after-top::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 3px;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(
    180deg,
    rgba(65, 143, 222, 0.85) 0%,
    rgba(65, 143, 222, 0.25) 100%
  );
}

/* Tier rail draws a horizontal line that nodes connect to */
.org-tier-rail {
  position: relative;
  height: 24px;
  margin-top: -6px;
  margin-bottom: 14px;
}

.org-tier-rail::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(920px, 92%);
  height: 3px;
  border-radius: 3px;
  background: rgba(65, 143, 222, 0.25);
}

.night-mode .org-tier-rail::before {
  background: rgba(65, 143, 222, 0.4);
}

.org-node {
  position: relative;
  width: 320px;
  max-width: 100%;
}

@media (max-width: 575px) {
  .org-node {
    width: 100%;
  }
}

/* Vertical connector from rail down into each node */
.org-node::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -26px;
  transform: translateX(-50%);
  width: 3px;
  height: 26px;
  border-radius: 3px;
  background: rgba(65, 143, 222, 0.25);
}

.org-node--top::before {
  display: none;
}

.org-node-pin {
  position: absolute;
  left: 50%;
  top: -34px;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-gold, #f5b700);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(65, 143, 222, 0.25);
}

.night-mode .org-node-pin {
  border-color: rgba(44, 62, 80, 0.9);
}

.team-hierarchy-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(65, 143, 222, 0.08);
  border: 1px solid var(--border-color, #e8eef5);
  height: 100%;
  width: 300px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.night-mode .team-hierarchy-card {
  background: rgba(44, 62, 80, 0.65);
  border-color: rgba(65, 143, 222, 0.3);
}

.team-hierarchy-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 28px rgba(65, 143, 222, 0.18);
}

.team-hierarchy-card-image {
  position: relative;
  height: 250px;
  overflow: hidden;
}

.team-hierarchy-card-image--top {
  height: 250px;
}

.team-hierarchy-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  transition: transform 0.3s ease;
}

.team-hierarchy-card:hover .team-hierarchy-card-image img {
  transform: scale(1.06);
}

.team-hierarchy-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(65, 143, 222, 0.92) 100%
  );
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.team-hierarchy-card:hover .team-hierarchy-card-overlay {
  opacity: 1;
}

.team-hierarchy-card-body {
  padding: 1.25rem 1.1rem;
  text-align: center;
}

.team-hierarchy-card-body h5 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--charcoal-black, #1a1a1a);
}

.night-mode .team-hierarchy-card-body h5 {
  color: #fff;
}

.team-hierarchy-card-body .team-title {
  display: block;
  color: var(--primary-blue, #418fde);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.team-hierarchy-card-body .team-email {
  font-size: 0.8rem;
}
