/* =============================================================
   TeleSpecialists — Meet the Team  (Iron Tele Team Module)
   Ported from the hand-authored prototype. Values anchored to the
   Figma file (fileKey Qqbb7bo5XhNoeOtVk1qQiS, frame 1:10) at 1440 desktop.
   All lengths are in rem (root = 16px) reproducing the exact Figma px.

   Every class/id is namespaced `ittm-` so themes and other plugins can't
   collide with — or override — the module's styling. Desktop column count
   is driven by --ittm-cols (set inline from the shortcode `columns` attr).
   ============================================================= */

/* ---------- Design tokens (scoped to the module root) ---------- */
.ittm-team {
  /* Brand colors */
  --ittm-navy: #01174d;
  --ittm-tab-active: #b11a62;
  --ittm-pink: #ed1878;
  --ittm-card-bg: #fff;
  --ittm-role: #000;

  /* Layout — desktop reference is a 1440 page */
  --ittm-content-max: 76.5rem;          /* 1224px */
  --ittm-grid-col-gap: clamp(0.875rem, 1.39vw, 1.25rem);    /* 14 -> 20 */
  --ittm-grid-row-gap: 1.6875rem;                            /* 27px, fixed */

  /* Card */
  --ittm-card-radius: 0.1875rem;                             /* 3px */
  --ittm-card-pad-x: clamp(1rem, 1.7vw, 1.5rem);             /* 16 -> 24 */

  /* Layered drop shadow pulled straight from Figma (43:12) */
  --ittm-card-shadow:
    0 0.293125rem 0.58625rem rgba(0, 0, 0, 0.20),       /* 4.69 / 9.38 */
    0 1.1138125rem 1.1138125rem rgba(0, 0, 0, 0.18),    /* 17.821 */
    0 2.52075rem 1.5241875rem rgba(0, 0, 0, 0.10),      /* 40.332 / 24.387 */
    0 4.4553125rem 1.7586875rem rgba(0, 0, 0, 0.03);    /* 71.285 / 28.139 */

  /* Fluid type — clamp max values anchored to the exact Figma px sizes. */
  --ittm-fs-intro:   clamp(0.9375rem, 0.6vw + 0.8125rem,  1.081rem);      /* 15 -> 17.296 */
  --ittm-fs-tab:     clamp(0.59375rem, 0.55vw + 0.53125rem, 0.862375rem); /* 9.5 -> 13.798 */
  --ittm-fs-divider: clamp(1.25rem, 1.0vw + 0.6875rem, 1.55675rem);       /* 20 -> 24.908 */
  --ittm-fs-name:    clamp(0.875rem, 0.6vw + 0.5rem, 0.9965625rem);       /* 14 -> 15.945 */
  --ittm-fs-role:    clamp(0.65625rem, 0.4vw + 0.375rem, 0.7035rem);      /* 10.5 -> 11.256 */
  --ittm-fs-bio:     clamp(0.75rem, 0.5vw + 0.4375rem, 0.8600625rem);     /* 12 -> 13.761 */

  --ittm-font-sans: "Work Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --ittm-font-display: "Big Shoulders Display", "Work Sans", sans-serif;
}

/* ---------- Section-scoped reset ---------- */
.ittm-team *,
.ittm-team *::before,
.ittm-team *::after { box-sizing: border-box; }

/* ---------- Section wrapper (no padding — the host layout owns spacing) ---------- */
.ittm-team {
  font-family: var(--ittm-font-sans);
  color: var(--ittm-navy);
}

.ittm-team__inner {
  max-width: var(--ittm-content-max);
  margin-inline: auto;
}

.ittm-team img { display: block; max-width: 100%; }

.ittm-team a { text-decoration: none; }

.ittm-team :focus-visible {
  outline: 0.125rem solid var(--ittm-pink);   /* 2px */
  outline-offset: 0.1875rem;                  /* 3px */
  border-radius: 0.125rem;                    /* 2px */
}

/* No focus outline on pointer/click focus; keyboard focus (:focus-visible)
   still shows its ring above. */
.ittm-team button:focus:not(:focus-visible) {
  outline: none;
}

/* ---------- 1. Intro paragraph ---------- */
.ittm-team__intro {
  max-width: 67.25rem;                 /* 1076px */
  margin: 0 auto;
  text-align: center;
  font-weight: 400;
  font-size: var(--ittm-fs-intro);
  line-height: 1.32;
  color: #000;
}

/* ---------- 2. Filter tabs ---------- */
.ittm-team__filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8125rem;                      /* 13px */
  margin-top: clamp(1.75rem, 3vw, 2.5rem);   /* 28 -> 40 */
}

.ittm-filter-tab {
  flex: 0 0 auto;
  height: 2.8125rem;                   /* 45px */
  padding: 1.125rem 1.375rem;          /* 18px 22px */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0.25rem;              /* 4px */
  background: var(--ittm-navy);
  color: #fff;
  font-family: var(--ittm-font-sans);
  font-weight: 600;
  font-size: var(--ittm-fs-tab);
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.ittm-filter-tab:hover { background: #02205f; color: #fff; }
.ittm-filter-tab:active { transform: translateY(0.0625rem); }   /* 1px */

.ittm-filter-tab--active {
  background: var(--ittm-tab-active);
}
.ittm-filter-tab--active:hover {
  background: #9f1759;
}

/* ---------- 3. Divider heading ---------- */
.ittm-team__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8125rem;                      /* 13px */
  margin: clamp(2.25rem, 4vw, 3.25rem) 0 clamp(1.75rem, 3vw, 2.5rem);  /* 36->52 / 28->40 */
}

.ittm-team__divider::before,
.ittm-team__divider::after {
  content: "";
  flex: 0 1 15.25rem;                  /* 244px Figma rule, shrinks on small screens */
  height: 0.1146875rem;                /* 1.835px */
  background: var(--ittm-pink);
}

.ittm-team__divider-text {
  flex: 0 0 auto;
  font-family: var(--ittm-font-display);
  font-weight: 700;
  font-size: var(--ittm-fs-divider);
  line-height: 1;
  color: var(--ittm-navy);
  text-align: center;
  white-space: nowrap;
}

/* ---------- 4. Card grid ---------- */
.ittm-team__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* Desktop columns come from the shortcode `columns` attr (default 4).
     The responsive breakpoints below override this with explicit counts. */
  grid-template-columns: repeat(var(--ittm-cols, 4), 1fr);
  column-gap: var(--ittm-grid-col-gap);
  row-gap: var(--ittm-grid-row-gap);
  /* Every card in a row stretches to the tallest one (assert explicitly so a
     theme rule on the list can't leave the cards at their natural heights). */
  align-items: stretch;
  /* Bottom padding gives the layered shadow room without clipping */
  padding-bottom: 0.5rem;              /* 8px */
}

/* ---------- Member card ---------- */
.ittm-member-card {
  display: flex;
  flex-direction: column;
  height: 100%;              /* fill the stretched grid cell so bodies bottom-align */
  background: var(--ittm-card-bg);
  border-radius: var(--ittm-card-radius);
  box-shadow: var(--ittm-card-shadow);
  overflow: hidden;
}

.ittm-member-card__photo {
  width: 100%;
  height: auto;              /* height driven by the image's intrinsic ratio */
  /* Lock the Figma 290.767 x 224.172 ratio so rows stay perfectly even and
     there's no load-time layout shift. object-fit guards off-ratio sources. */
  aspect-ratio: 290.767 / 224.172;
  object-fit: cover;
  object-position: top center;
}

/* Fallback box when a member has no featured image. */
.ittm-member-card__photo--placeholder {
  display: block;
  background: #e9eaee;
}

.ittm-member-card__body {
  flex: 1 1 auto;
  display: grid;
  /* Role takes all remaining width; View Bio is a FIXED column wide enough for
     its label. A fixed (non-intrinsic) second track can't be inflated by the
     full-width name spanning 1 / -1, so the role column is never starved. */
  grid-template-columns: minmax(0, 1fr) 4.5rem;
  align-items: center;                 /* View Bio centers against the role block */
  column-gap: 0.5rem;                  /* 8px */
  padding: 1.375rem var(--ittm-card-pad-x) 1.25rem;   /* 22px _ 20px */
}

.ittm-member-card__name {
  grid-column: 1 / -1;                 /* full width above the role/bio row */
  margin: 0 0 0.5625rem;               /* 9px gap to role */
  font-weight: 700;
  font-size: var(--ittm-fs-name);
  line-height: 1.1;
  color: var(--ittm-navy) !important;
}

.ittm-member-card__role {
  grid-column: 1;
  margin: 0;
  font-weight: 400;
  font-size: var(--ittm-fs-role);
  line-height: 1.039;                  /* Figma 43:269 — tight stacked block */
  letter-spacing: -0.035175rem;        /* -0.5628px */
  text-transform: uppercase;
  color: var(--ittm-role);
}

.ittm-member-card__bio {
  grid-column: 2;
  justify-self: end;
  /* Button reset — a real <button> for the modal. */
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-weight: 700;
  font-size: var(--ittm-fs-bio);
  line-height: 1.039;
  color: var(--ittm-pink);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.18s ease;
}

.ittm-member-card__bio:hover {
  color: #c4115f;
}

/* Photo and name are also clickable triggers — signal it. */
.ittm-member-card__photo,
.ittm-member-card__name {
  cursor: pointer;
}

.ittm-team__empty {
  text-align: center;
  font-size: var(--ittm-fs-intro);
  color: var(--ittm-navy);
}

/* =============================================================
   Responsive — grid steps 4 -> 3 -> 2 -> 1.
   ============================================================= */

@media (max-width: 64rem) {            /* 1024px */
  .ittm-team__grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 47.5rem) {          /* 760px */
  .ittm-team__grid { grid-template-columns: repeat(2, 1fr); }

  .ittm-team__filters {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.625rem;                     /* 10px */
  }
  .ittm-filter-tab,
  .ittm-filter-tab--active {
    width: auto;
    height: auto;
    min-height: 2.375rem;              /* 38px — stays comfortably tappable */
    padding: 0.6875rem 1rem;           /* 11px 16px — pills get visually smaller */
  }
}

@media (max-width: 28.75rem) {         /* 460px */
  .ittm-team__filters { gap: 0.5rem; } /* 8px */

  .ittm-filter-tab,
  .ittm-filter-tab--active {
    min-height: 2.25rem;               /* 36px */
    padding: 0.5625rem 0.8125rem;      /* 9px 13px */
  }
}

/* Single column on phones. Card fills the column (capped so it stays card-like). */
@media (max-width: 35rem) {            /* 560px */
  .ittm-team__grid {
    grid-template-columns: 1fr;
  }

  .ittm-member-card {
    width: 100%;
    max-width: 26.25rem;               /* 420px */
    margin-inline: auto;
  }

  .ittm-team__divider {
    flex-wrap: wrap;
    gap: 0.625rem 0.8125rem;           /* 10px 13px */
  }
  .ittm-team__divider-text {
    white-space: normal;
    flex-basis: 100%;
    order: -1;                         /* text on its own line, rules beneath */
  }
  .ittm-team__divider::before,
  .ittm-team__divider::after {
    flex: 1 1 5rem;                    /* 80px */
  }
}

/* =============================================================
   Member bio modal
   Values anchored to Figma frame 1:499 (container 1:500, 696x528.905).
   Native <dialog>: the element itself is the centered scrim layer,
   .ittm-member-modal__card is the white 696px bio panel.
   ============================================================= */

/* The <dialog> acts as the full-screen centering layer. Tokens are
   redeclared here because the dialog renders in the top layer. */
.ittm-member-modal {
  /* override UA dialog defaults */
  margin: auto;
  padding: 0;
  border: 0;
  max-width: none;
  max-height: none;
  width: min(43.5rem, 92vw);          /* 696px cap, fluid below */
  background: transparent;
  overflow: visible;
  color: var(--ittm-navy);
  font-family: var(--ittm-font-sans);

  --ittm-navy: #01174d;
  --ittm-pink: #ed1878;
  --ittm-modal-pink-hover: #c4115f;
  --ittm-modal-track: #d9d9d9;
  --ittm-font-sans: "Work Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --ittm-fs-modal-name: clamp(1.625rem, 1.4vw + 1.15rem, 2.428565rem);
  --ittm-fs-modal-role: clamp(1rem, 0.55vw + 0.78rem, 1.26625rem);
  --ittm-fs-modal-bio:  clamp(0.9375rem, 0.18vw + 0.86rem, 1.0356875rem);
}

.ittm-member-modal *,
.ittm-member-modal *::before,
.ittm-member-modal *::after { box-sizing: border-box; }

.ittm-member-modal :focus-visible {
  outline: 0.125rem solid var(--ittm-pink);
  outline-offset: 0.1875rem;
  border-radius: 0.125rem;
}

.ittm-member-modal::backdrop {
  background: rgba(1, 23, 77, 0.55);  /* navy scrim */
}

/* The white bio panel. */
.ittm-member-modal__card {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 1.25rem;                       /* 20px photo->text gap (Figma) */
  padding: 2.4rem;
  background: #fff;
  border: 0.0863125rem solid var(--ittm-pink);     /* 1.381px */
  border-radius: 0;                                /* Figma: sharp corners */
  box-shadow:
    0 0.4315625rem 0.863125rem rgba(0, 0, 0, 0.2),    /* 6.905 / 13.81 */
    0 1.639875rem 1.639875rem rgba(0, 0, 0, 0.18),    /* 26.238 */
    0 3.7113125rem 2.2440625rem rgba(0, 0, 0, 0.1),   /* 59.381 / 35.905 */
    0 6.5595rem 2.5893125rem rgba(0, 0, 0, 0.03);     /* 104.952 / 41.429 */
  height: auto;
  max-height: min(33.057rem, 90vh);
  min-height: 0;                      /* allow flex to clamp at max-height */
  overflow: hidden;                   /* only the viewport scrolls, not the card */
}

/* Left column: portrait photo box (Figma 219.571 x 266.524). */
.ittm-member-modal__photo-box {
  flex: 0 0 auto;
  align-self: start;                       /* height follows the image */
  width: clamp(10rem, 18vw, 13.723rem);   /* -> 219.571px */
  aspect-ratio: 219.57 / 266.52;
  overflow: hidden;
  background: #e9eaee;
}

.ittm-member-modal__photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-select: none;
  /* Revealed by JS once the new member's image loads (prevents the prior
     member's photo flashing through). */
  transition: opacity 0.15s ease;
}

/* Right column: name (fixed) + role (fixed) + scrollable bio. */
.ittm-member-modal__content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;                     /* take remaining row width */
  min-width: 0;
  min-height: 0;
  align-self: stretch;                /* fill the full card height */
}

.ittm-member-modal__name {
  margin: 0;
  font-weight: 700;
  font-size: var(--ittm-fs-modal-name);
  line-height: 1.039;
  color: var(--ittm-navy);
  text-wrap: balance;
}

/* Programmatic focus target on open — no visible ring (not interactive). */
.ittm-member-modal__name:focus,
.ittm-member-modal__name:focus-visible {
  outline: none;
}

.ittm-member-modal__role {
  margin: 0;                          /* sits at the top of the scroll viewport */
  max-width: 18.64rem;               /* 298.286px */
  font-weight: 700;
  font-size: var(--ittm-fs-modal-role);
  line-height: 1.039;
  text-transform: uppercase;
  color: var(--ittm-pink);
}

/* Scroll region wraps the viewport (role + bio) + the custom scrollbar. */
.ittm-member-modal__scroll {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0.75rem;               /* tighter — name sits just above */
  display: flex;
}

/* Links inside bio copy. Namespaced to the modal so the theme's global anchor
   styling can't decide how a member's bio reads. */
.ittm-member-modal__bio a {
  color: var(--ittm-pink);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  transition: color 0.18s ease;
}
.ittm-member-modal__bio a:hover,
.ittm-member-modal__bio a:focus-visible {
  color: var(--ittm-navy);
}

/* A trailing standalone link (podcast appearance, published book). Given a
   little more presence than an inline link — it was a button on the old site —
   without competing with the solid Publications button below it. */
.ittm-member-modal__bio .ittm-bio-link {
  margin: 0.875rem 0 0;
}
.ittm-member-modal__bio .ittm-bio-link a {
  display: inline-block;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 0.125rem solid currentColor;
  padding-bottom: 0.0625rem;
}

/* Publications button — optional per member, pinned below the scroll area so
   it stays visible without scrolling a long bio to the end. `flex: 0 0 auto`
   keeps it out of the scroll container's height calculation. */
.ittm-member-modal__pubs {
  flex: 0 0 auto;
  align-self: flex-end;              /* bottom-right, as on the old page */
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1.125rem;
  background: var(--ittm-pink);
  color: #fff;
  font-weight: 700;
  font-size: var(--ittm-fs-tab);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 0.125rem;
  white-space: nowrap;
  transition: background 0.18s ease, transform 0.18s ease;
}
.ittm-member-modal__pubs:hover,
.ittm-member-modal__pubs:focus-visible {
  background: #c9145f;               /* darkened pink */
  color: #fff;
}
.ittm-member-modal__pubs svg {
  flex: 0 0 auto;
  transition: transform 0.18s ease;
}
.ittm-member-modal__pubs:hover svg {
  transform: translateX(0.1875rem);
}
/* `hidden` must win over the display above when the member has no link. */
.ittm-member-modal__pubs[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .ittm-member-modal__pubs,
  .ittm-member-modal__pubs svg {
    transition: none;
  }
  .ittm-member-modal__pubs:hover svg {
    transform: none;
  }
}

/* Scrollable viewport: role + bio scroll together. Native scrollbar is
   hidden; the custom track/thumb (synced by team.js) provides the
   visible Figma pink scrollbar. */
.ittm-member-modal__viewport {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 1.5rem;             /* 24px — clears the custom scrollbar */
  scrollbar-width: none;             /* Firefox: hide native */
  overscroll-behavior: contain;
}
.ittm-member-modal__viewport::-webkit-scrollbar { width: 0; height: 0; }

/* Bio text — role sits above it inside the same scroll viewport. */
.ittm-member-modal__bio {
  margin: 0.6875rem 0 0;             /* tighter gap below the role */
  font-weight: 400;
  font-size: var(--ittm-fs-modal-bio);
  line-height: 1.39;
  letter-spacing: -0.0517875rem;     /* -0.8286px */
  color: #000;
}
/* Bio paragraphs (post content may have several). */
.ittm-member-modal__bio p { margin: 0 0 0.85em; }
.ittm-member-modal__bio p:last-child { margin-bottom: 0; }
.ittm-member-modal__bio a { color: var(--ittm-pink); text-decoration: underline; }

/* Structured credentials block (Medical School / Residency / …). */
.ittm-member-modal__bio ul { margin: 0; padding: 0; list-style: none; }
.ittm-member-modal__bio li { margin: 0 0 0.5em; }
.ittm-member-modal__bio li:last-child { margin-bottom: 0; }
.ittm-member-modal__bio li strong { color: var(--ittm-navy); }

/* Custom scrollbar — track #d9d9d9, thumb #ed1878 (Figma 1:505 / 1:506). */
.ittm-member-modal__scrollbar {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 0.604rem;                   /* 9.667px */
  background: var(--ittm-modal-track);
  border-radius: 0.345rem;           /* 5.524px */
}
.ittm-member-modal__scrollbar[hidden] { display: none; }

.ittm-member-modal__thumb {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0;                         /* set by JS */
  background: var(--ittm-pink);
  border-radius: 0.345rem;           /* 5.524px */
  cursor: grab;
}
.ittm-member-modal__thumb:active { cursor: grabbing; }

/* Close button — pink × in the top-right corner. */
.ittm-member-modal__close {
  position: absolute;
  top: 1.64rem;                      /* ~26px from top */
  right: 1.5rem;                     /* ~24px from edge */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0.1875rem;
  border: 0;
  background: none;
  color: var(--ittm-pink);
  cursor: pointer;
  border-radius: 0.25rem;
  transition: color 0.18s ease, transform 0.18s ease;
}
.ittm-member-modal__close:hover { color: var(--ittm-modal-pink-hover); }
.ittm-member-modal__close:active { transform: scale(0.92); }
.ittm-member-modal__close svg { display: block; }

/* Focus ring sits clear of the pink × and the pink card border. */
.ittm-member-modal__close:focus-visible {
  outline: 0.125rem solid var(--ittm-navy);   /* 2px */
  outline-offset: 0.3125rem;                  /* 5px — clears the × and border */
  border-radius: 0.125rem;                    /* 2px */
}

/* ---- Open / close transition (fade + slight scale & lift) ---- */
.ittm-member-modal,
.ittm-member-modal__card {
  opacity: 0;
}
.ittm-member-modal__card {
  transform: translateY(0.5rem) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.ittm-member-modal[open] { opacity: 1; }            /* scrim shows immediately */
.ittm-member-modal.ittm-is-open .ittm-member-modal__card {
  opacity: 1;
  transform: none;
}
.ittm-member-modal.ittm-is-closing .ittm-member-modal__card {
  opacity: 0;
  transform: translateY(0.5rem) scale(0.98);
}
/* fade the scrim out on close too */
.ittm-member-modal { transition: opacity 0.22s ease; }
.ittm-member-modal.ittm-is-closing { opacity: 0; }

/* =============================================================
   Modal responsive: side-by-side -> stacked on narrow phones.
   ============================================================= */
@media (max-width: 34rem) {            /* 544px — stacked layout */
  .ittm-member-modal {
    width: 92vw;
  }
  .ittm-member-modal__card {
    display: flex;                     /* column: photo (fixed) + scroll body */
    flex-direction: column;
    row-gap: 1.25rem;
    padding: 1rem;
    height: auto;
    max-height: 90vh;
    /* The whole card scrolls as one block — photo, name, role and bio
       together — instead of pinning the photo and scrolling only the text. */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(1, 23, 77, 0.3) transparent;
  }
  .ittm-member-modal__card::-webkit-scrollbar {
    width: 0.375rem;                   /* 6px — thin */
  }
  .ittm-member-modal__card::-webkit-scrollbar-track {
    background: transparent;
  }
  .ittm-member-modal__card::-webkit-scrollbar-thumb {
    background: rgba(1, 23, 77, 0.3);  /* muted navy */
    border-radius: 0.25rem;
  }
  .ittm-member-modal__card::-webkit-scrollbar-thumb:hover {
    background: rgba(1, 23, 77, 0.45);
  }
  .ittm-member-modal__photo-box {
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: auto;
    height: auto;
  }
  .ittm-member-modal__photo {
    height: auto;                      /* follow the image's natural height */
    object-position: center 25%;
  }
  .ittm-member-modal__content {
    flex: 0 0 auto;                    /* no longer the scroll container */
    min-height: 0;
    height: auto;
    max-width: none;
    overflow: visible;
  }
  .ittm-member-modal__scroll {
    margin-top: 0.5rem;
    display: block;                    /* not a flex row when stacked */
  }
  .ittm-member-modal__viewport {
    overflow: visible;
    padding-right: 0;
  }
  .ittm-member-modal__scrollbar { display: none; }

  /* Full-width tap target when stacked — 44px min height for touch. */
  .ittm-member-modal__pubs {
    align-self: stretch;
    justify-content: center;
    min-height: 2.75rem;
  }

  /* Stays pinned to the top-right while the card scrolls beneath it, and
     overlaps the photo (negative margin collapses the row it would add). */
  .ittm-member-modal__close {
    position: sticky;
    order: -1;                         /* pin to the top of the scrolling card */
    align-self: flex-end;              /* keep it at the right edge */
    top: 0;
    right: 0;
    /* Collapse the row it would occupy (button height 1.875 + flex row-gap
       1.25) so the photo still starts at the top and the chip overlaps it. */
    margin-bottom: -3.125rem;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    width: 1.875rem;
    height: 1.875rem;
    box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.25);
    z-index: 1;
  }
  .ittm-member-modal__name { padding-right: 0; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .ittm-member-modal,
  .ittm-member-modal__card { transition: none !important; }
  .ittm-member-modal.ittm-is-open .ittm-member-modal__card,
  .ittm-member-modal[open] .ittm-member-modal__card {
    opacity: 1;
    transform: none;
  }
  .ittm-member-modal[open] { opacity: 1; }
}
