/* ============================================================
   NAMSEZANA TRADING & PROJECTS
   Team Section — Visual Hierarchy System
   
   Hierarchy principle: Express rank through SIZE + COLOR + SPACE
   simultaneously (never size alone). Director must read at 3:1
   minimum ratio vs team members when squinting.
   ============================================================ */

.team {
  background: var(--color-dominant);
  position: relative;
}

/* ---- Section header: left-aligned for visual weight ---- */
.team-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-8);
  margin-bottom: var(--space-16);
  flex-wrap: wrap;
}

.team-section-head .section-label {
  color: var(--color-secondary);
}

.team-section-head .section-label::before {
  background: var(--color-secondary);
}

.team-section-head .section-title {
  color: var(--color-secondary);
  margin-bottom: 0;
}

.team-intro-text {
  font-size: var(--text-base);
  color: var(--gray-600);
  max-width: 38ch;
  line-height: 1.6;
  /* Aligns to bottom of heading — creates baseline tension */
  align-self: flex-end;
  margin: 0;
}

/* ================================================================
   HIERARCHY LEVEL SYSTEM
   Each level is a row with a side label (level tag) + cards
   Space increases as level narrows: Director has most breathing room
   ================================================================ */

.hier-level {
  display: flex;
  align-items: flex-start;
  gap: var(--space-8);
  width: 100%;
}

/* Left side label — wayfinding for the org hierarchy */
.hier-label {
  flex-shrink: 0;
  width: 100px;
  padding-top: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.hier-level-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gray-400);
  writing-mode: horizontal-lr;
  /* Right-align tag to the card edge */
  text-align: right;
}

/* Cards row */
.hier-cards {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
  flex-wrap: wrap;
  flex: 1;
}

.hier-cards--wide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
  align-items: start;
}

/* ================================================================
   CARD BASE — shared structure, differentiated by modifier
   ================================================================ */
.hier-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
  background: var(--color-secondary);
  border: 1px solid transparent;
  padding: var(--space-6);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  position: relative;
}

.hier-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(26, 58, 92, 0.18);
}

/* ================================================================
   DIRECTOR — Hierarchy Level 1
   Size: LARGE avatar (80px). Space: Generous padding. Color: Yellow border.
   Result: Immediately dominant in squint test.
   ================================================================ */
.hier-card--director {
  border-color: var(--color-accent);
  border-width: 2px;
  padding: var(--space-8);
  /* Wider than supervisors — communicates importance through space too */
  align-self: stretch;
}

.hier-card--director .hier-level-pip {
  display: block;
  width: 10px;
  height: 10px;
  background: var(--color-accent);
  border-radius: 50%;
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
}

.hier-card--director .hier-name {
  /* 3:1 size ratio vs roster-member (1rem vs ~0.8rem) */
  font-size: clamp(1.2rem, 2vw, 1.5rem);
}

.hier-card--director .hier-role {
  color: var(--color-accent);
}

/* Description — only Director gets a one-liner description */
.hier-card-desc {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.72);
  line-height: 1.5;
  margin-top: var(--space-3);
  max-width: 38ch;
}

/* ================================================================
   SUPERVISORS — Hierarchy Level 2
   Size: MEDIUM avatar (60px). Space: Normal padding. Border: Blue tint.
   ================================================================ */
.hier-card--supervisor {
  border-color: rgba(255,255,255,0.15);
}

.hier-card--supervisor .hier-name {
  font-size: 1.1rem;
}

/* ================================================================
   SUPPORT ROLES (Driver) — Hierarchy Level 3
   Size: SMALL avatar (44px). Color: Muted. Space: Compact.
   ================================================================ */
.hier-card--support {
  border-color: rgba(255,255,255,0.08);
  background: rgba(26, 58, 92, 0.65);
}

.hier-card--support .hier-name {
  font-size: 1rem;
}

/* ================================================================
   AVATAR SIZES — Express hierarchy through size (3:1 ratio)
   lg = 80px, md = 60px, sm = 44px
   ================================================================ */
.hier-avatar {
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hier-avatar--lg {
  width: 80px;
  height: 80px;
}

.hier-avatar--md {
  width: 60px;
  height: 60px;
}

.hier-avatar--sm {
  width: 44px;
  height: 44px;
}

.hier-avatar svg,
.hier-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.hier-avatar svg {
  color: rgba(255,255,255,0.6);
  padding: 20%; /* Keep icon smaller than circle */
}

.hier-avatar--lg svg { width: 44px; height: 44px; padding: 0; }
.hier-avatar--md svg { width: 32px; height: 32px; }
.hier-avatar--sm svg { width: 24px; height: 24px; }

/* ================================================================
   CARD TEXT — Common typography
   ================================================================ */
.hier-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
}

.hier-name {
  font-family: var(--font-secondary);
  font-weight: 700;
  /* Base size overridden by modifier */
  font-size: 1.1rem;
  color: #ffffff;
  line-height: 1.2;
  margin: 0;
}

.hier-role {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  /* Default muted — Director overrides to yellow */
  color: rgba(255,255,255,0.55);
  line-height: 1;
}

/* ================================================================
   FLOW CONNECTORS — subtle visual thread between levels
   Three spans: vertical line → node dot → horizontal branch
   ================================================================ */
.hier-flow {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  /* Indent to align under the cards (label width = 100px + gap = 32px) */
  padding-left: calc(100px + var(--space-8));
  gap: 0;
  margin: var(--space-2) 0;
}

.hier-flow-line {
  display: block;
  width: 2px;
  height: 24px;
  background: linear-gradient(to bottom, var(--color-secondary), rgba(26,58,92,0.3));
  margin-left: 39px; /* center under card avatar (80/2 = 40, -1px) */
}

.hier-flow-node {
  display: block;
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
  margin-left: 36px; /* center: 40 - 4 */
}

.hier-flow-branch {
  display: block;
  width: 200px;
  height: 2px;
  background: linear-gradient(to right, rgba(26,58,92,0.6), rgba(26,58,92,0.1));
  margin-left: 40px;
}

/* ================================================================
   TEAM ROSTERS — Level 3 team groups
   These are NOT cards within cards. They use spacing + border
   to create grouping (per spec: never nest cards inside cards).
   ================================================================ */
.team-roster {
  border: 1px solid var(--gray-200);
  border-top: 3px solid var(--color-secondary);
  padding: var(--space-5) var(--space-5);
  background: var(--color-dominant);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.roster-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Team label — larger, darker, more weight = hierarchy anchor */
.roster-label {
  font-family: var(--font-secondary);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-secondary);
}

/* "Under Simangele" — smaller, lighter, subordinate read */
.roster-supervisor {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-500);
}

.roster-members {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Member names: readable, not micro — 0.85rem minimum */
.roster-member {
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-700);
  padding: var(--space-1) var(--space-3);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  line-height: 1.4;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
  .team-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    margin-bottom: var(--space-10);
  }

  .team-intro-text {
    max-width: 100%;
  }

  .hier-level {
    flex-direction: column;
    gap: var(--space-4);
  }

  .hier-label {
    width: auto;
    align-items: flex-start;
    padding-top: 0;
  }

  .hier-level-tag {
    text-align: left;
  }

  .hier-flow {
    padding-left: 0;
  }

  .hier-flow-line {
    margin-left: var(--space-5);
  }

  .hier-flow-node {
    margin-left: calc(var(--space-5) - 3px);
  }

  .hier-flow-branch {
    margin-left: var(--space-5);
    width: 80px;
  }

  .hier-cards--wide {
    grid-template-columns: 1fr;
  }
}
