/* ==========================================================================
   LIMM — Clinical Editorial
   members.css · people header, PI block, sticky group sub-nav, member grid
   ========================================================================== */

/* ---- Page margins --------------------------------------------------------
   This page runs five cards wide, so it gets a deeper left/right inset than
   the site default. Scoped to <main> so the masthead, announcement bar and
   footer stay aligned with every other page.                                */
.members-page main .shell { padding-inline: clamp(48px, 9vw, 160px); }
@media (max-width: 760px) {
  .members-page main .shell { padding-inline: var(--page-x); }
}

/* ---- Hero ----------------------------------------------------------------
   Copy on the left, one photograph of the laboratory on the right.
   Higher specificity than .members-composition in chapters.css, which loads
   after this file.                                                          */
.members-page .members-composition {
  grid-template-columns: 1.2fr 1fr;
  gap: 5%;
  min-height: 360px;
}

/* The hero photograph is landscape, unlike the tall .chapter-portrait default
   this frame otherwise inherits from chapters.css.                          */
.members-page .members-hero__figure {
  aspect-ratio: 4 / 3;
  max-height: 520px;
}
.members-page .chapter--members .chapter-shell {
  min-height: min(620px, max(470px, calc(100svh - 210px)));
}

/* ---- Page header --------------------------------------------------------- */
.people-head { padding-bottom: clamp(48px, 5vw, 80px); }

.people-head__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-block: 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--navy);
}
.people-head__meta b { color: var(--accent-ink); font-weight: 500; }
.people-head__meta span:last-child { color: var(--muted); }

.people-head__title {
  grid-column: 1 / 8;
  font-size: var(--text-hero);
  font-weight: 300;
  margin-block: clamp(40px, 4.5vw, 76px) 0;
}

.people-head__sub {
  grid-column: 9 / 13;
  align-self: end;
  padding-bottom: 0.9rem;
  font-size: var(--text-lead);
  line-height: 1.45;
  color: var(--navy);
  text-wrap: pretty;
}
.people-head__sub b {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 60;
  font-weight: 500;
  font-size: 1.25em;
  color: var(--ink);
}

@media (max-width: 1023px) {
  .people-head__title { grid-column: 1 / 7; }
  .people-head__sub   { grid-column: 1 / 6; align-self: start; padding-bottom: 0; margin-top: 28px; }
}
@media (max-width: 640px) {
  .people-head__meta  { flex-direction: column; gap: 6px; }
  .people-head__title { grid-column: 1 / 5; }
  .people-head__sub   { grid-column: 1 / 5; }
}

/* ---- Sticky group sub-nav ------------------------------------------------ */
.subnav {
  position: sticky;
  top: var(--nav-h-compact);
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.subnav__inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-block: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.subnav__inner::-webkit-scrollbar { display: none; }

.subnav__chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 8px 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  /* Colour, not hairline grey: these four chips are the page's only control
     surface and have to read as such at a glance. */
  color: var(--accent-ink);
  border-color: var(--accent-ink);
  background: var(--paper-3);
  white-space: nowrap;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease),
              background var(--dur) var(--ease);
}
.subnav__chip i {
  font-style: normal;
  /* Was --rule, i.e. invisible. Slightly held back from the label, but not
     so far that the number stops passing contrast. */
  color: inherit;
  opacity: 0.85;
  transition: color var(--dur) var(--ease);
}
.subnav__chip:hover {
  color: var(--accent-ink);
  border-color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent) 16%, var(--paper));
}
.subnav__chip:active { background: color-mix(in srgb, var(--accent) 26%, var(--paper)); }
.subnav__chip.is-active {
  color: var(--paper);
  border-color: var(--navy);
  background: var(--navy);
}
.subnav__chip.is-active i { color: inherit; opacity: 0.8; }

/* ---- Group --------------------------------------------------------------- */
/* The 76px chip bar is stacked under the compacted masthead, so a jump to a
   chip's group — or the hero cue's jump to the list itself — has to clear both
   or the group title parks behind them. Members page only: alumni.css and
   photo.css set their own, deeper offsets for their own sticky rails. */
#member-groups,
.members-page .group { scroll-margin-top: calc(var(--nav-h-compact) + 76px); }

.group { padding-block: clamp(56px, 6vw, 104px) 0; }
.group:last-child { padding-bottom: clamp(72px, 7vw, 128px); }

.group__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: var(--gutter);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ink);
  margin-bottom: clamp(32px, 3.4vw, 52px);
}
.group__idx { grid-column: 1; margin-bottom: 14px; color: var(--navy); }
.group__idx b { color: var(--accent-ink); font-weight: 500; }
.group__title {
  grid-column: 1;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96;
  font-weight: 400;
  font-size: var(--text-h2);
  line-height: 1.02;
  letter-spacing: -0.022em;
}
.group__count { grid-column: 2; grid-row: 2; color: var(--muted); white-space: nowrap; }
.group__error { padding-block: 40px; color: var(--muted); }

/* ---- Member grid ---------------------------------------------------------
   Five people to a row, and the portrait is capped well below the column so
   a face reads at roughly half its former size — the roster, not the
   photography, is what the page is for. Alumni cards reuse both rules.      */
.mgrid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(30px, 2.6vw, 44px) 24px;
}

.mcard { display: flex; flex-direction: column; --mcard-photo: 148px; }

.mcard__figure {
  width: min(100%, var(--mcard-photo));
  margin: 0 0 13px;
  overflow: hidden;
  background: var(--paper-2);
}
.mcard__figure img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 50% 20%;
  transition: transform 500ms var(--ease);
}
.mcard:hover .mcard__figure img,
.mcard:focus-within .mcard__figure img { transform: scale(1.02); }

/* Underline grows from zero on hover — the accent marker language of the site. */
.mcard__name {
  display: inline;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 48;
  font-weight: 400;
  font-size: 1.1875rem;
  line-height: 1.2;
  letter-spacing: -0.012em;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 2px;
  transition: background-size var(--dur) var(--ease);
}
.mcard:hover .mcard__name,
.mcard:focus-within .mcard__name { background-size: 100% 2px; }

.mcard__kr { margin-top: 3px; color: var(--muted); font-size: var(--text-sm); }

.mcard__aff {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--rule-soft);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--navy);
}
.mcard__aff span { display: block; color: var(--muted); }

.mcard__pos { margin-top: 10px; color: var(--ink); text-transform: none; letter-spacing: 0.04em; }
.mcard__pos i { font-style: normal; color: var(--muted); }

/* The research field. It was 10px in --muted grey and unreadable; it is the
   one line on the card a visitor actually came to read. */
.mcard__tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.mcard__tags .chip {
  padding: 4px 8px;
  font-size: 0.75rem; /* 12px mono: a 26-character topic sits on one line in the 210px five-column card */
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-transform: none;
  white-space: normal;
  color: var(--ink);
}
/* The link inherits a flex display from the chip rules elsewhere; inline lets the
   topic wrap like text instead of breaking at every hyphen. */
.mcard__tags .chip a { color: inherit; display: inline; }

/* The chips are the line a row is read across, so the two variable-length
   lines above them hold a fixed number of lines from the 2-column layout up:
   a one-line department, or a course line short enough not to wrap, no longer
   lifts its card's chips above its neighbours'. Below 760px the cards stack
   two to a row and the reserved space would only read as a gap. */
@media (min-width: 760px) {
  .mcard__aff span { min-height: calc(2 * 1.45em); }
  .mcard__pos { min-height: calc(2 * 1.5em); }
}
/* Between the fourth column arriving and the fifth one growing wide the course
   line runs to three - "M.S.-.Ph.D. Integrated Course · since Jul. 2026" is the
   longest of them - so the reserve follows it up. Reserving a line more than the
   longest card needs costs a gap, never the alignment. */
@media (min-width: 900px) and (max-width: 1319px) {
  .mcard__pos { min-height: calc(3 * 1.5em); }
}

/* 5 columns >=1100 · 4 at 900 · 3 at 760 · 2 below · 2 compact at 560 */
@media (max-width: 1099px) { .mgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 899px)  { .mgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 759px)  { .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 16px; }
  .mcard { --mcard-photo: 132px; }
  .mcard__name { font-size: 1.0625rem; }
  .mcard__aff  { font-size: 0.75rem; }
  .mcard__tags .chip { font-size: 0.8125rem; padding: 3px 8px; }
}

/* ---- Alumni teaser ------------------------------------------------------- */
.alumni {
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  padding-block: clamp(64px, 6.5vw, 112px);
}
.alumni__inner { align-items: end; row-gap: 28px; }
.alumni__body { grid-column: 1 / 8; }
.alumni__label { display: block; color: var(--navy); margin-bottom: 20px; }
.alumni__title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144;
  font-weight: 300;
  font-size: clamp(2.25rem, 1.1rem + 3.3vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.026em;
}
.alumni__title b {
  font-weight: 500;
  font-style: italic;
  color: var(--accent-ink);
  font-variation-settings: "opsz" 144, "SOFT" 40, "WONK" 1;
}
.alumni__cta { grid-column: 9 / 13; justify-self: end; padding-bottom: 0.6rem; }
@media (max-width: 1023px) {
  .alumni__body { grid-column: 1 / 7; }
  .alumni__cta  { grid-column: 1 / 7; justify-self: start; }
}
@media (max-width: 640px) {
  .alumni__body, .alumni__cta { grid-column: 1 / 5; }
}
