/* ==========================================================================
   Team — the Our Team page (Team directory section) and team member profiles
   --------------------------------------------------------------------------
   Loaded only where team members appear (see inc/team.php). Built from the
   team mock-ups reviewed on 6 Oct 2026; tokens only, like every other sheet.
   ========================================================================== */

/* --- Shared bits ----------------------------------------------------------- */
.gold-rule {
  display: flex; align-items: center; gap: var(--sp-3);
  margin: var(--sp-4) 0; color: var(--color-accent-gold);
}
.gold-rule::before, .gold-rule::after {
  content: ""; flex: 1; height: 2px; border-radius: 2px; background: var(--color-accent-gold);
}
.gold-rule::after { flex: 2.2; }
.gold-rule svg { flex: none; stroke-width: 1.5; }

.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip-list li {
  font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: 1.2;
  padding: 0.375rem 0.75rem; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--color-tile-teal) 55%, var(--color-surface));
  color: var(--color-text-on-tint);
}

/* --- Team page intro ------------------------------------------------------- */
.team-intro { padding-block: var(--sp-6) var(--sp-5); }
.team-intro__inner { max-width: 46rem; }
.team-intro__script { color: var(--color-link-accent); font-size: var(--fs-h4); margin: 0 0 var(--sp-1); }
.team-intro__title { color: var(--color-heading); font-size: clamp(2rem, 1.5rem + 1.7vw, 2.625rem); margin: 0; }
.team-intro__lede { font-size: var(--fs-lg); color: var(--color-text); margin: 0; }

/* Filter chips */
.team-filter { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-block-start: var(--sp-5); }
.team-filter button {
  font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-semi);
  padding: 0.5rem 1rem; border-radius: var(--radius-pill); cursor: pointer;
  border: 1px solid var(--color-border-input); background: var(--color-surface); color: var(--color-text);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.team-filter button:hover { border-color: var(--color-link); color: var(--color-link); }
.team-filter button[aria-pressed="true"] {
  background: var(--color-btn-primary-bg); border-color: var(--color-btn-primary-bg); color: var(--color-btn-primary-fg);
}
.team-filter button:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }

/* --- Team groups and cards ------------------------------------------------- */
.team-group + .team-group { margin-block-start: var(--sp-7); }
.team-group[hidden] { display: none; }
.team-group__head { display: flex; align-items: baseline; gap: var(--sp-3); margin-block-end: var(--sp-4); }
.team-group__title { color: var(--color-heading); font-size: var(--fs-h4); margin: 0; }
.team-group__count { color: var(--color-text-muted); font-size: var(--fs-sm); }

.team-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--sp-5) var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr));  /* five across in the standard container, so the five physiotherapists sit on one row */
}

.tcard {
  display: flex; flex-direction: column;
  background: var(--color-surface); border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.tcard:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.tcard__photo { display: block; aspect-ratio: 4 / 5; background: var(--color-surface-calm); overflow: hidden; position: relative; }
.tcard__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; transition: transform 400ms ease; }
.tcard:hover .tcard__photo img { transform: scale(1.03); }
.tcard__status {
  position: absolute; left: var(--sp-3); bottom: var(--sp-3);
  background: var(--color-surface); color: var(--color-text-strong);
  font-size: var(--fs-xs); font-weight: var(--fw-semi);
  padding: 0.25rem 0.625rem; border-radius: var(--radius-pill); box-shadow: var(--shadow-sm);
}

.tcard__body { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4); flex: 1; }
.tcard__role { margin: 0; font-size: var(--fs-xs); font-weight: var(--fw-semi); letter-spacing: var(--ls-wide); text-transform: uppercase; color: var(--color-eyebrow); min-block-size: 1.2em; }
.tcard__name { margin: 0; font-size: var(--fs-h5); line-height: var(--lh-snug); }
.tcard__name a { color: var(--color-heading); text-decoration: none; }
.tcard__name a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.tcard__creds { margin: 0; font-size: var(--fs-sm); color: var(--color-text-muted); line-height: var(--lh-snug); }
.tcard .chip-list { margin-block-start: var(--sp-1); }
.tcard__actions {
  margin-block-start: auto; padding-block-start: var(--sp-3);
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-1);
  border-top: 1px solid var(--color-divider);
}
.tcard__book, .tcard__more { font-size: var(--fs-sm); font-weight: var(--fw-semi); text-decoration: none; }
.tcard__book { color: var(--color-link); }
.tcard__more { color: var(--color-link-accent); }
.tcard__book:hover, .tcard__more:hover { text-decoration: underline; text-underline-offset: 0.2em; }

.join-line { margin: var(--sp-6) 0 0; color: var(--color-text-muted); font-size: var(--fs-sm); }
.join-line a { color: var(--color-link); font-weight: var(--fw-semi); }

/* --- Profile hero ---------------------------------------------------------- */
.profile { padding-block: var(--sp-6); background: linear-gradient(to bottom, color-mix(in srgb, var(--color-surface-calm) 55%, var(--color-surface)) 0%, var(--color-surface) 100%); }
.profile__inner { display: grid; gap: var(--sp-6); align-items: center; }
.profile__media { position: relative; max-width: 26rem; isolation: isolate; }  /* keeps the gold outline above the section's background */
.profile__media img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 15%;
  border-radius: var(--radius-lg); display: block; box-shadow: var(--shadow-lg);
}
/* Gold outline offset behind the photo, echoing the gold ring in the logo. */
.profile__media::before {
  content: ""; position: absolute; inset: var(--sp-4) calc(var(--sp-4) * -1) calc(var(--sp-4) * -1) var(--sp-4);
  border: 2px solid var(--color-accent-gold); border-radius: var(--radius-lg); z-index: -1;
}
.profile__role { margin: 0 0 var(--sp-1); }
.profile__name { color: var(--color-heading); font-size: clamp(2rem, 1.5rem + 1.7vw, 2.625rem); margin: 0; }
.profile__creds { margin: var(--sp-2) 0 0; color: var(--color-text-muted); font-size: var(--fs-sm); line-height: var(--lh-snug); }
.profile__lede { font-size: var(--fs-lg); font-weight: var(--fw-semi); color: var(--color-text-strong); margin: 0; text-wrap: pretty; }
.profile__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-block-start: var(--sp-5); }
.profile__facts {
  list-style: none; margin: var(--sp-5) 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5);
  font-size: var(--fs-sm); color: var(--color-text);
}
.profile__facts li { display: inline-flex; align-items: center; gap: var(--sp-2); }
.profile__facts svg { color: var(--color-heading); stroke-width: 1.6; flex: none; }

@media (min-width: 56rem) {
  .profile__inner { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--sp-8); }
}

/* --- Profile body: bio + sticky "at a glance" card ------------------------- */
.profile-body__inner { display: grid; gap: var(--sp-6); align-items: start; }
.profile-body__main { min-width: 0; }
.profile-body__main h2 { color: var(--color-heading); font-size: var(--fs-h4); margin: var(--sp-6) 0 var(--sp-3); }
.profile-body__main h2:first-child { margin-top: 0; }
.profile-body__main h3 { color: var(--color-heading); font-size: var(--fs-h5); margin: var(--sp-5) 0 var(--sp-2); }
.profile-body__main p { margin: 0 0 var(--sp-4); }
.profile-body__main .chip-list li { font-size: var(--fs-sm); }

.callout {
  margin: var(--sp-5) 0; padding: var(--sp-4) var(--sp-5);
  border-inline-start: 4px solid var(--color-accent-gold);
  background: color-mix(in srgb, var(--color-surface-calm) 60%, var(--color-surface));
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-family: var(--font-accent); font-style: italic; font-size: var(--fs-lg); color: var(--color-text-strong);
}

.glance-card-profile {
  background: var(--color-surface); border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: var(--sp-5);
}
.glance-card-profile h2 { color: var(--color-heading); font-size: var(--fs-h5); margin: 0 0 var(--sp-4); }
.glance-card-profile dl { margin: 0; }
.glance-card-profile dt { font-size: var(--fs-xs); font-weight: var(--fw-semi); letter-spacing: var(--ls-wide); text-transform: uppercase; color: var(--color-eyebrow); margin: 0 0 var(--sp-2); }
.glance-card-profile dd { margin: 0 0 var(--sp-5); font-size: var(--fs-sm); line-height: var(--lh-snug); }
.glance-card-profile dd ul { list-style: none; margin: 0; padding: 0; }
.glance-card-profile dd li { padding-block: 0.375rem; border-bottom: 1px solid var(--color-divider); }
.glance-card-profile dd li:last-child { border-bottom: 0; }
.glance-card-profile dd a { color: var(--color-link); text-decoration: none; font-weight: var(--fw-medium); }
.glance-card-profile dd a:hover { text-decoration: underline; }
.glance-card-profile .btn { width: 100%; }

@media (min-width: 62rem) {
  .profile-body__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); gap: var(--sp-8); }
  .glance-card-profile { position: sticky; top: 7.5rem; }
}

/* --- Phones ---------------------------------------------------------------- */
@media (max-width: 39.99rem) {
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
  .tcard__body { padding: var(--sp-3); }
  .tcard__name { font-size: var(--fs-h6); }
  .tcard__creds { font-size: var(--fs-xs); }
  .tcard .chip-list { display: none; }
  .tcard__role { letter-spacing: 0.04em; font-size: 0.6875rem; }
  /* 'Book with Maegan' wraps in a half-width card; show 'Book' and keep the name for screen readers. */
  .tcard .tcard__book-who { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  /* Full width on phones; the outline offset shrinks so it stays inside the gutter. */
  .profile__media { max-width: none; margin-inline: 0 var(--sp-3); margin-block-end: var(--sp-3); }
  .profile__media img { aspect-ratio: 1 / 1; object-position: center 20%; }
  .profile__media::before { inset: var(--sp-3) calc(var(--sp-3) * -1) calc(var(--sp-3) * -1) var(--sp-3); }
  .profile__actions .btn { flex: 1 1 100%; justify-content: center; }
}
.tcard[hidden] { display: none; }

/* Even rows on the team page (19 Nov 2026). The cards keep the width they
   have when a full row fits (five, four or three across), and the number of
   columns is set per group so the rows come out level: six people sit 3 + 3
   with space at the side, seven 4 + 3, eight 4 + 4. The counts come from
   team-directory.php as --tg5 / --tg4 / --tg3. */
.team-grid--even { --tg3: 3; --tg4: 4; --tg5: 5; }   /* full rows unless the section sets its own */
@media (min-width: 46rem) {
  .team-grid--even { grid-template-columns: repeat(var(--tg3, 3), minmax(0, calc((100% - 2 * var(--sp-4)) / 3))); }
}
@media (min-width: 62rem) {
  .team-grid--even { grid-template-columns: repeat(var(--tg4, 4), minmax(0, calc((100% - 3 * var(--sp-4)) / 4))); }
}
@media (min-width: 77rem) {
  .team-grid--even { grid-template-columns: repeat(var(--tg5, 5), minmax(0, calc((100% - 4 * var(--sp-4)) / 5))); }
}

/* A short row (e.g. 'Other physiotherapists') fills the width instead of leaving an empty column. */
.team-grid--fill { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr)); }

/* --- Added for the live templates ------------------------------------------ */
.team-intro + .team-directory { padding-top: var(--sp-4); }
/* Cards keep their own text colours on a tinted band (base.css recolours
   every p on .section--tint). */
.tcard p.tcard__role { color: var(--color-eyebrow); }
.tcard p.tcard__creds { color: var(--color-text-muted); }
.tcard__photo { text-decoration: none; }
.tcard__initials, .profile__initials {
  display: grid; place-items: center; width: 100%; height: 100%;
  font-family: var(--font-heading); font-weight: var(--fw-semi);
  color: var(--color-heading); background: var(--color-surface-calm);
}
.tcard__initials { font-size: var(--fs-h2); }
.profile__initials { aspect-ratio: 4 / 5; font-size: var(--fs-h1); border-radius: var(--radius-lg); }
.tcard__note { font-size: var(--fs-sm); color: var(--color-text-muted); }
.profile__status { margin: var(--sp-3) 0 0; font-weight: var(--fw-semi); color: var(--color-text-strong); }
.profile-body__main ul:not(.chip-list), .profile-body__main ol { margin: 0 0 var(--sp-4); padding-inline-start: 1.25em; }
.profile-body__main .callout { margin: var(--sp-5) 0; }
@media (min-width: 62rem) {
  .profile-body__inner--aside-only { grid-template-columns: minmax(0, 22rem); }
}
