/* team.css — styles specific to the Team page (Figma frame 245:844,
   "2nd round iteration - Ready")

   Values marked "FLAG: no token" come straight from the Figma frame and have
   no matching design token in tokens.css yet. */

/* Figma: 10px auto-layout gap around main, 32px between its sections, 100px
   below. FLAG: no token (10px, 100px). */
.page-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  width: 100%;
  margin: 10px 0;
  padding-bottom: 100px;
  background: var(--color-white);
}

.page-team section {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Opener ------------------------------------------------------------ */

/* Gradient plus Figma's "::after" layer: a 165px fade to white over the
   bottom edge. FLAG: no token (72/64px padding, 133.3deg angle, 35%/70%
   stops, 165px fade). */
.opener {
  align-items: center;
  padding: 72px var(--space-lg) 64px;
  background:
    linear-gradient(to bottom, transparent, var(--color-white)) bottom / 100% 165px no-repeat,
    linear-gradient(133.3deg, var(--color-white) 0%, var(--color-primary-25) 35%, var(--color-primary-50) 70%, var(--color-accent2-50) 100%);
}

/* FLAG: no token (1160px max-width, 12px gap). */
.opener__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  max-width: 1160px;
  width: 100%;
  padding: 0 var(--space-lg);
}

/* Figma "Caption" text style — same label as the legal and patients pages.
   FLAG: no token (line-height 1.8, letter-spacing 4%). */
.eyebrow {
  margin: 0;
  font-family: var(--font-caption-family);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-caption-size);
  line-height: 1.8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent1-500);
}

/* FLAG: no token (820px max-width). */
.opener__title {
  max-width: 820px;
  margin: 0;
  font-family: var(--font-title-family);
  font-weight: var(--font-title-weight);
  font-size: var(--font-title-size);
  line-height: var(--font-title-line-height);
  color: var(--color-neutral-900);
}

/* Team groups ------------------------------------------------------------ */

/* FLAG: no token (1160px max-width, 12.5px gap). */
.team-group {
  gap: 12.5px;
  max-width: 1160px;
  padding: var(--space-lg);
  align-items: flex-start;
}

/* FLAG: no token (letter-spacing 0.92px). */
.team-group__label {
  margin: 0;
  font-family: var(--font-body-bold-family);
  font-weight: var(--font-body-bold-weight);
  font-size: var(--font-size-0);
  line-height: var(--font-body-small-line-height);
  letter-spacing: 0.92px;
  text-transform: uppercase;
  color: var(--color-neutral-500);
}

.team-table {
  width: 100%;
  border-collapse: collapse;
}

/* Every cell carries Figma's top rule. FLAG: no token (12px cell padding). */
.team-table td {
  vertical-align: top;
  padding: 12px;
  border-top: 1px solid var(--color-neutral-200);
  font-family: var(--font-body-regular-family);
}

/* Column widths include the 12px padding (border-box).
   FLAG: no token (56px / 210px / 230px columns). */
.team-table__photo {
  width: 56px;
}

/* Name and title share Figma's 21.7px line on 14px text.
   FLAG: no token (line-height 1.55). */
.team-table__name {
  width: 210px;
  font-weight: var(--font-body-bold-weight);
  font-size: var(--font-body-small-size);
  line-height: 1.55;
  color: var(--color-neutral-900);
}

.team-table__title {
  width: 230px;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-body-small-size);
  line-height: 1.55;
  color: var(--color-tertiary-700);
}

/* Figma: 13px on a 20.15px line. FLAG: no token (13px, line-height 1.55). */
.team-table__bio {
  font-weight: var(--font-body-regular-weight);
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-neutral-500);
}

/* Headshots --------------------------------------------------------------
   32px circles from assets/images/team/thumbs/ — 64px (2x) WebP copies of
   the originals with each Figma crop already applied (including the custom
   zoom/rotation on Suma Bhat, Shafiq Rab and Waqaar Khawar), so every
   thumbnail is a plain square. Originals stay untouched in
   team-photo-originals/ at the project root (outside site/, so they never
   deploy). */

.team-photo {
  position: relative;
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
}

.team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   RESPONSIVE — tablet (481–768px) and mobile (≤480px).
   Desktop-first cascade: the 768px block covers both; the 480px block
   layers mobile-only changes on top. Heading sizes shrink automatically via
   the --font-*-size tokens in tokens.css.

   The four fixed columns squeeze the bio into an unreadable strip below
   desktop widths, so each row becomes a small grid per person instead:
   - tablet: photo | name over title | bio alongside
   - mobile: photo | name, title and bio stacked
   The role attributes in the HTML preserve table semantics for assistive
   tech, since overriding display drops the implicit ARIA roles.
   ========================================================================== */

@media (max-width: 768px) {
  /* Opener ----------------------------------------------------------------- */
  .opener {
    padding: 56px var(--space-lg) 48px;
  }

  .opener__inner {
    padding: 0;
  }

  /* Team groups -------------------------------------------------------------- */
  .team-group {
    padding: 0 var(--space-lg);
  }

  .team-table,
  .team-table tbody {
    display: block;
    width: 100%;
  }

  .team-table tr {
    display: grid;
    grid-template-columns: 32px minmax(0, 200px) minmax(0, 1fr);
    column-gap: var(--space-md);
    padding: var(--space-md) 0;
    border-top: 1px solid var(--color-neutral-200);
  }

  .team-table td {
    display: block;
    width: auto;
    padding: 0;
    border-top: none;
  }

  .team-table__photo {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .team-table__name {
    grid-column: 2;
    grid-row: 1;
  }

  .team-table__title {
    grid-column: 2;
    grid-row: 2;
  }

  .team-table__bio {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

@media (max-width: 480px) {
  /* Opener ----------------------------------------------------------------- */
  .opener {
    padding: 40px var(--space-md);
  }

  /* Team groups -------------------------------------------------------------- */
  .team-group {
    padding: 0 var(--space-md);
  }

  .team-table tr {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .team-table__photo {
    grid-row: 1 / span 3;
  }

  /* Slightly larger name for readability once it heads its own block. */
  .team-table__name {
    font-size: var(--font-body-regular-size);
  }

  .team-table__bio {
    grid-column: 2;
    grid-row: 3;
    margin-top: var(--space-xs);
  }

  /* No bio (e.g. Evan Goldstein) — drop the empty row. */
  .team-table__bio:empty {
    display: none;
  }
}
