/* ============================================
   AGENTS — agents.html
   The page is built around a single typographic Roster.
   Each row is a disclosure: clicking the name expands an
   editorial detail panel inline (portrait + Cormorant
   pull quote + bio + specialties + contact).
   Hero + dark CTA close are inherited from inner-pages.css.
   ============================================ */

/* ----- ROSTER SECTION ----- */
.roster-section {
  padding: 140px 0 160px;
  background: var(--off-white);
}

/* Wider container than the standard .container so the oversized names
   can breathe at full scale. */
.roster-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

.roster-head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 96px;
}

.roster-head .section-label {
  display: inline-block;
  margin-bottom: 24px;
}

.roster-headline {
  font-family: var(--font-heading);
  font-size: clamp(1.85rem, 3.4vw, 2.6rem);
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 18px;
}

.roster-headline strong { font-weight: 700; }

.roster-instruction {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-light);
  margin: 0;
}

/* ----- THE LIST ----- */
.roster {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--hairline-strong);
}

.roster-item {
  border-bottom: 1px solid var(--hairline-strong);
  scroll-margin-top: 96px;
}

/* The toggle is the entire row — a real <button> for a11y, restyled to
   look like an editorial credit line rather than a button.
   Flex (not grid) so the thumb can collapse to 0 width on expand. */
.roster-toggle {
  display: flex;
  align-items: center;
  gap: 36px;
  width: 100%;
  padding: 40px 0;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.roster-toggle:focus { outline: 0; }

.roster-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: var(--r-xs);
}

/* ----- Preview thumbnail — visible at rest, collapses on expand -----
   Square with subtle inset border. Sized to sit just under the cap-height
   of the name so type still dominates. When the row expands, the thumb
   fades and shrinks to 0 width, with a negative margin canceling the
   parent's gap so the name shifts cleanly leftward. */
.roster-thumb {
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  align-self: center;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--light-gray);
  position: relative;
  transition: flex-basis 520ms var(--ease-calm),
              width 520ms var(--ease-calm),
              opacity 380ms var(--ease-soft),
              margin-right 520ms var(--ease-calm);
}

.roster-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--t-base) var(--ease-calm);
}

.roster-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: var(--img-inset);
  pointer-events: none;
  border-radius: inherit;
}

@media (hover: hover) {
  .roster-toggle:hover .roster-thumb img { transform: scale(1.06); }
}

.roster-toggle[aria-expanded="true"] .roster-thumb {
  flex-basis: 0;
  width: 0;
  opacity: 0;
  margin-right: -36px;
}

.roster-name {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 6.2vw, 5.5rem);
  font-weight: 200;
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--ink);
  transition: color var(--t-base) var(--ease-soft);
}

.roster-meta {
  flex: 0 0 auto;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-light);
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  white-space: nowrap;
  text-align: right;
}

.roster-role {
  color: var(--warm);
  font-weight: 700;
}

.roster-sep {
  color: var(--text-light);
  opacity: 0.4;
}

.roster-area {
  color: var(--text-light);
  font-weight: 500;
  letter-spacing: 0.18em;
}

/* Plus icon — rotates 45° to become × when expanded */
.roster-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: var(--r-circle);
  background: var(--accent-tint);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  transition: transform var(--t-base) var(--ease-calm),
              background var(--t-fast) var(--ease-soft),
              color var(--t-fast) var(--ease-soft);
}

.roster-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Hover state — desktop only via hover media */
@media (hover: hover) {
  .roster-toggle:hover .roster-name { color: var(--accent); }
  .roster-toggle:hover .roster-icon {
    background: var(--accent);
    color: var(--white);
  }
}

/* Expanded state — name shifts to accent, icon rotates and inverts */
.roster-toggle[aria-expanded="true"] .roster-name { color: var(--accent); }
.roster-toggle[aria-expanded="true"] .roster-icon {
  background: var(--accent);
  color: var(--white);
  transform: rotate(45deg);
}

/* ----- DETAIL PANEL — animated via grid-template-rows trick -----
   The outer .roster-detail uses 0fr → 1fr to animate its height
   without requiring measured pixel values. The inner wrapper has
   min-height: 0 + overflow: hidden so the content collapses cleanly. */
.roster-detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 600ms var(--ease-calm);
}

.roster-toggle[aria-expanded="true"] + .roster-detail {
  grid-template-rows: 1fr;
}

.roster-detail-inner {
  min-height: 0;
  overflow: hidden;
}

/* When collapsed, hide from screen readers + tab order */
.roster-toggle[aria-expanded="false"] + .roster-detail {
  visibility: hidden;
  transition: grid-template-rows 600ms var(--ease-calm),
              visibility 0s linear 600ms;
}
.roster-toggle[aria-expanded="true"] + .roster-detail {
  visibility: visible;
  transition: grid-template-rows 600ms var(--ease-calm),
              visibility 0s linear 0s;
}

.roster-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 380px) 1fr;
  gap: 64px;
  padding: 16px 0 80px;
  align-items: start;
}

/* Inner content fades + lifts in slightly behind the grid expand */
.roster-toggle[aria-expanded="true"] + .roster-detail .roster-detail-grid > * {
  animation: rosterDetailIn 700ms var(--ease-calm) both;
}

.roster-toggle[aria-expanded="true"] + .roster-detail .roster-content > * {
  animation: rosterDetailIn 700ms var(--ease-calm) both;
}

.roster-toggle[aria-expanded="true"] + .roster-detail .roster-portrait { animation-delay: 120ms; }
.roster-toggle[aria-expanded="true"] + .roster-detail .roster-quote    { animation-delay: 200ms; }
.roster-toggle[aria-expanded="true"] + .roster-detail .roster-bio      { animation-delay: 280ms; }
.roster-toggle[aria-expanded="true"] + .roster-detail .roster-tags     { animation-delay: 360ms; }
.roster-toggle[aria-expanded="true"] + .roster-detail .roster-contact  { animation-delay: 440ms; }

@keyframes rosterDetailIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ----- PORTRAIT ----- */
.roster-portrait {
  aspect-ratio: 4 / 5;
  border-radius: var(--r-md);
  overflow: hidden;
  background: linear-gradient(135deg, #d5d5d5, #ebebeb);
  position: relative;
}

.roster-portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: var(--img-inset);
  pointer-events: none;
}

.roster-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ----- CONTENT COLUMN ----- */
.roster-content {
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding-top: 8px;
}

.roster-quote {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.4rem, 2.2vw, 1.95rem);
  line-height: 1.45;
  color: var(--ink);
  margin: 0;
  padding-left: 24px;
  border-left: 3px solid var(--warm);
  max-width: 56ch;
}

.roster-bio p {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-body);
  font-weight: 300;
  margin: 0 0 16px;
  max-width: none;
}

.roster-bio p:last-child { margin-bottom: 0; }

.roster-tags {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.roster-tags li {
  font-family: var(--font-heading);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--accent-tint);
  color: var(--accent-soft);
}

.roster-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

.roster-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  background: var(--accent-tint);
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease-soft),
              color var(--t-fast) var(--ease-soft);
}

.roster-contact-link:hover {
  background: var(--accent);
  color: var(--white);
}

.roster-contact-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ----- RESPONSIVE ----- */
@media (max-width: 900px) {
  .roster-section { padding: 96px 0 112px; }
  .roster-container { padding: 0 24px; }
  .roster-head { margin-bottom: 64px; }

  /* Mobile: 2-row grid. Thumb spans both rows on the left, icon spans
     both rows on the right (so it visually anchors to the name + meta
     instead of floating beneath the meta). Column 1 sizes to the thumb
     so it can collapse cleanly via the thumb's own width transition —
     no parent grid-template-columns animation needed. */
  .roster-toggle {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 8px 18px;
    padding: 28px 0;
    align-items: center;
  }
  .roster-thumb {
    grid-column: 1;
    grid-row: 1 / span 2;
    flex: none;
    width: 72px;
    height: 72px;
    align-self: center;
    margin-right: 0;
  }
  .roster-name {
    grid-column: 2;
    grid-row: 1;
  }
  .roster-meta {
    grid-column: 2;
    grid-row: 2;
    flex-wrap: wrap;
    text-align: left;
    white-space: normal;
  }
  .roster-icon {
    grid-column: 3;
    grid-row: 1 / span 2;
    width: 44px;
    height: 44px;
    align-self: center;
  }

  /* Expanded: thumb shrinks to 0 width + fades. Negative margin cancels
     the parent's column-gap so the layout closes up cleanly. The auto-
     sized column tracks the thumb's width, so no grid template change
     is needed — the animation is purely the thumb's own width. */
  .roster-toggle[aria-expanded="true"] .roster-thumb {
    width: 0;
    opacity: 0;
    margin-right: -18px;
  }

  /* ----- Touch feedback ----- */
  /* :active gives an immediate (sub-100ms) visual confirmation on tap so
     the row doesn't feel laggy while the 600ms expand animation runs. */
  .roster-toggle:active .roster-icon {
    background: var(--accent);
    color: var(--white);
    transition: none;
  }

  /* Pulse ring on expand — a haptic-equivalent visual confirmation that
     the tap registered. Animates a transient box-shadow ripple outward
     from the icon. Doesn't conflict with the icon's existing transform
     (rotate 45°) since it's on a different property. */
  .roster-toggle[aria-expanded="true"] .roster-icon {
    animation: rosterIconPulse 520ms var(--ease-calm);
  }
  @keyframes rosterIconPulse {
    0%   { box-shadow: 0 0 0 0 rgba(44, 74, 110, 0.4); }
    100% { box-shadow: 0 0 0 16px rgba(44, 74, 110, 0); }
  }

  .roster-detail-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 8px 0 56px;
  }
  .roster-portrait {
    max-width: 320px;
  }
}

/* Tablet tier — the ≤900 layout is the phone grid; rebalance so the small
   thumbnail and oversized name aren't mismatched on an ~834px iPad. */
@media (min-width: 601px) and (max-width: 900px) {
  .roster-thumb { width: 96px; height: 96px; }
  .roster-name { font-size: clamp(2.4rem, 5.4vw, 4.2rem); }
}

@media (max-width: 520px) {
  .roster-meta {
    font-size: 0.65rem;
    gap: 8px;
  }
  .roster-sep { display: none; }
  .roster-meta { flex-direction: column; align-items: flex-start; gap: 4px; }
  .roster-quote { padding-left: 18px; }
  .roster-contact-link { padding: 10px 16px; font-size: 0.78rem; }
}

/* Honor reduced-motion — kill the staircase reveal, icon spin, and pulse */
@media (prefers-reduced-motion: reduce) {
  .roster-detail { transition: none; }
  .roster-icon { transition: none; }
  .roster-thumb { transition: none; }
  .roster-toggle[aria-expanded="true"] + .roster-detail .roster-detail-grid > *,
  .roster-toggle[aria-expanded="true"] + .roster-detail .roster-content > *,
  .roster-toggle[aria-expanded="true"] .roster-icon {
    animation: none;
  }
}
