/* Obesity Health Centre — shared components (nav, footer, buttons, cards, thread, forms) */

/* ================= Header / Nav ================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  /* Solid (not translucent+blurred) on purpose: backdrop-filter/filter on an
     ancestor creates a new containing block for position:fixed descendants,
     which breaks the full-viewport mobile nav panel nested inside. */
  background: var(--paper);
  border-bottom: 1px solid var(--color-border);
}

/* The header needs more room than the standard 1200px content container —
   8 top-level nav items + logo + CTA button don't fit that width. */
.site-header .container { max-width: 1600px; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  height: var(--header-h);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--fw-semibold);
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: var(--track-tight);
  flex: none;
}
.nav-brand img { height: 34px; width: auto; }
.nav-brand small {
  display: block;
  font-size: 0.625rem;
  font-weight: var(--fw-medium);
  letter-spacing: var(--track-wider);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--paper-raised);
  cursor: pointer;
  flex: none;
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.nav-panel {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--paper);
  overflow-y: auto;
  padding: var(--space-4) var(--container-pad) var(--space-7);
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), visibility var(--dur-base);
}
.nav-panel.is-open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.nav-list > li { border-bottom: 1px solid var(--color-border); }

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-1);
  font-weight: var(--fw-medium);
  color: var(--ink);
  text-decoration: none;
  font-size: 1.05rem;
}
.nav-link:hover, .nav-link:focus-visible, .nav-link[aria-current="page"] { color: var(--color-brand); }

.nav-sublist {
  list-style: none;
  margin: 0 0 var(--space-2);
  padding: 0 0 0 var(--space-3);
  border-left: 2px solid var(--color-accent-tint);
  display: none;
}
.nav-sublist.is-open { display: block; }
.nav-sublist a {
  display: block;
  padding: var(--space-2) var(--space-1);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.nav-sublist a:hover { color: var(--color-brand); }

.nav-caret {
  width: 18px; height: 18px; flex: none;
  transition: transform var(--dur-fast) var(--ease-out);
}
.nav-has-children[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }

.nav .nav-cta { display: none; }

/* Mobile-drawer-only CTA (bottom of the slide-out menu). Must be hidden at
   desktop, where .nav-panel itself becomes permanently visible/inline —
   otherwise it renders as a stray extra button inside the horizontal nav row. */
.nav-panel .nav-panel-cta { display: flex; }

/* Desktop nav breakpoint is deliberately higher than the site's usual
   1024px (used elsewhere for layout shifts): 8 top-level items + logo + CTA
   need real room, so the horizontal nav only appears once there's space for
   it. Below this, the mobile drawer pattern is used even on small laptops. */
@media (min-width: 1280px) {
  .nav-toggle { display: none; }

  .nav-panel {
    position: static;
    inset: auto;
    background: none;
    padding: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    overflow: visible;
    flex: 1;
    min-width: 0;
  }

  .nav-list {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex-wrap: nowrap;
  }
  .nav-list > li { border-bottom: none; position: relative; }

  .nav-link {
    padding: var(--space-1) 0.5rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }
  .nav-link[aria-current="page"] { color: var(--color-brand); }

  .nav-sublist {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--paper-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--space-2);
    border-left: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), visibility var(--dur-fast);
  }
  .nav-has-children:hover .nav-sublist,
  .nav-has-children:focus-within .nav-sublist,
  .nav-sublist.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .nav-sublist a { border-radius: var(--radius-sm); }
  .nav-sublist a:hover { background: var(--teal-deep-tint); }
  .nav-caret { display: none; }

  .nav .nav-cta {
    display: inline-flex;
    flex: none;
  }

  .nav-panel .nav-panel-cta { display: none; }
}

/* ================= Buttons ================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: var(--fw-semibold);
  font-size: 0.9375rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--color-brand);
  color: #fff;
}
.btn-primary:hover { background: var(--color-brand-hover); color: #fff; box-shadow: var(--shadow-md); }

.btn-accent {
  background: var(--color-accent);
  color: var(--ink);
}
.btn-accent:hover { background: var(--color-accent-hover); color: var(--ink); box-shadow: var(--shadow-md); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-secondary:hover { border-color: var(--color-brand); color: var(--color-brand); }

.btn-ghost {
  background: transparent;
  color: var(--color-brand);
  padding-inline: 0.5rem;
}
.btn-ghost:hover { color: var(--color-brand-hover); }

.btn-block { width: 100%; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ================= Sections & page hero ================= */

.section {
  padding-block: var(--section-pad-y);
  position: relative;
}
.section-tight { padding-block: var(--space-6); }
.section-alt { background: var(--paper-raised); }
.section-dark { background: var(--teal-deep); color: var(--paper); }
.section-dark h1, .section-dark h2, .section-dark h3 { color: var(--paper); }
.section-dark .eyebrow { color: var(--signal-amber); }
.section-dark .eyebrow::before { background: var(--paper); }

.section-head {
  max-width: 46rem;
  margin-bottom: var(--space-5);
}
.section-head.center { margin-inline: auto; text-align: center; }

.page-hero {
  padding-top: clamp(2.5rem, 2rem + 2vw, 4rem);
  padding-bottom: var(--section-pad-y);
}
.page-hero .eyebrow { margin-bottom: var(--space-3); }
.page-hero h1 {
  font-size: var(--text-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--track-tighter);
  max-width: 20ch;
}
.page-hero .lead {
  font-size: var(--text-lead);
  color: var(--color-text-muted);
  max-width: var(--measure);
  margin-top: var(--space-3);
  line-height: var(--lh-relaxed);
}

.hero-grid {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}
@media (min-width: 1024px) {
  .hero-grid.with-media { grid-template-columns: 1.05fr 0.95fr; }
}

.hero-media {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--teal-deep-tint);
  position: relative;
}

/* placeholder image frame — swap for <img> when real photography arrives */
.media-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(155deg, var(--teal-deep-tint) 0%, var(--teal-sage-tint) 100%);
  color: var(--teal-sage);
}
.media-placeholder svg { width: 42%; height: 42%; opacity: 0.9; }
.media-placeholder .caption {
  position: absolute;
  left: var(--space-3);
  bottom: var(--space-3);
  background: rgba(22, 36, 31, 0.72);
  color: var(--paper);
  font-size: var(--text-caption);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-pill);
}

/* ================= Eyebrow label variant for numbered phases ================= */

.phase-label {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-eyebrow);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--track-wider);
  text-transform: uppercase;
  color: var(--color-brand);
}
.phase-label .num {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: var(--track-normal);
  color: var(--color-accent-hover);
}

/* ================= Cards ================= */

.card-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: var(--paper-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
a.card { display: block; text-decoration: none; color: inherit; }
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--teal-deep-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
  flex: none;
}
.card-icon svg { width: 26px; height: 26px; }

.card h3 { font-size: 1.1rem; margin-bottom: var(--space-1); }
.card p { color: var(--color-text-muted); font-size: var(--text-small); }

.card-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: var(--space-3);
  font-size: var(--text-small);
  font-weight: var(--fw-semibold);
  color: var(--color-brand);
}
.card-arrow svg { width: 16px; height: 16px; transition: transform var(--dur-fast) var(--ease-out); }
.card:hover .card-arrow svg { transform: translateX(3px); }

/* ================= The Thread ================= */
/* A single continuous line connecting the 6 phases of care. Used on
   the homepage "Full continuum of care" section and the care-pathway
   page. Structurally meaningful: order = clinical sequence. */

.thread {
  position: relative;
  padding-block: var(--space-5);
}

.thread-track {
  position: relative;
}

/* the base (unfilled) line */
.thread-track::before {
  content: "";
  position: absolute;
  background: var(--line-strong);
  border-radius: var(--radius-pill);
  /* mobile: vertical line on the left */
  left: 23px;
  top: 0;
  bottom: 0;
  width: 3px;
}

/* the filled (progress) line, scaled from 0 by JS via --thread-progress */
.thread-fill {
  position: absolute;
  left: 23px;
  top: 0;
  width: 3px;
  background: var(--signal-amber);
  border-radius: var(--radius-pill);
  height: 100%;
  transform: scaleY(var(--thread-progress, 0));
  transform-origin: top;
  will-change: transform;
}

.thread-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.thread-step {
  position: relative;
  padding-left: 56px;
}

.thread-dot {
  position: absolute;
  left: 12px;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--paper-raised);
  border: 3px solid var(--line-strong);
  transition: border-color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}
.thread-step.is-active .thread-dot {
  border-color: var(--signal-amber);
  background: var(--signal-amber-tint);
}

.thread-step h3 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.thread-step p { color: var(--color-text-muted); font-size: var(--text-small); }

@media (min-width: 1024px) {
  .thread-track::before,
  .thread-fill {
    left: 50%;
    width: 3px;
    transform: translateX(-50%) scaleY(var(--thread-progress, 0));
  }
  .thread-track::before { transform: translateX(-50%); }

  .thread-steps { gap: var(--space-7); }

  .thread-step {
    width: calc(50% - 40px);
    padding-left: 0;
  }
  .thread-step:nth-child(odd) { margin-right: calc(50% + 40px); text-align: right; }
  .thread-step:nth-child(even) { margin-left: calc(50% + 40px); }

  .thread-dot {
    left: auto;
    top: 2px;
  }
  .thread-step:nth-child(odd) .thread-dot { right: -52px; }
  .thread-step:nth-child(even) .thread-dot { left: -52px; }
}

/* ================= Journey selector (home) ================= */

.journey-card {
  display: block;
  background: var(--paper-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.journey-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

/* ================= FAQ accordion ================= */

.faq-item {
  border-bottom: 1px solid var(--color-border);
}
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  background: none;
  border: none;
  text-align: left;
  font-weight: var(--fw-semibold);
  font-size: 1.05rem;
  color: var(--ink);
  cursor: pointer;
}
.faq-q svg { width: 20px; height: 20px; flex: none; transition: transform var(--dur-base) var(--ease-out); color: var(--color-brand); }
.faq-q[aria-expanded="true"] svg { transform: rotate(45deg); }

.faq-a {
  overflow: hidden;
  height: 0;
  transition: height var(--dur-base) var(--ease-out);
}
.faq-a-inner { padding-bottom: var(--space-4); color: var(--color-text-muted); max-width: var(--measure); }

/* ================= Form ================= */

.form-card {
  background: var(--paper-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.field { margin-bottom: var(--space-4); }
.field label,
.fieldset legend {
  display: block;
  font-weight: var(--fw-semibold);
  font-size: var(--text-small);
  margin-bottom: var(--space-1);
}
.field .hint { color: var(--color-text-muted); font-size: var(--text-caption); margin-top: 0.3rem; }

.input, select.input, textarea.input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--paper);
  font-size: 1rem;
}
.input:focus-visible { border-color: var(--color-brand); }
textarea.input { min-height: 110px; resize: vertical; }

.fieldset {
  border: none;
  padding: 0;
  margin: 0 0 var(--space-4);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-2);
}

.choice {
  position: relative;
}
.choice input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}
.choice span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  font-size: var(--text-small);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.choice input:checked + span {
  border-color: var(--color-brand);
  background: var(--teal-deep-tint);
  font-weight: var(--fw-medium);
}
.choice input:focus-visible + span { box-shadow: var(--shadow-focus); }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: var(--text-small);
  color: var(--color-text-muted);
}
.consent input { margin-top: 0.25rem; flex: none; }

.form-status {
  border-radius: var(--radius-md);
  padding: var(--space-3);
  font-size: var(--text-small);
  margin-top: var(--space-3);
  display: none;
}
.form-status.is-visible { display: block; }
.form-status.success { background: var(--teal-deep-tint); color: var(--teal-deep-hover); }
.form-status.error { background: #FBE9E5; color: #9A3B22; }

/* ================= Disclaimer / notice banners ================= */

.notice {
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  background: var(--paper-raised);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-size: var(--text-small);
  color: var(--color-text-muted);
}
.notice + .notice { margin-top: var(--space-3); }

/* ================= Footer ================= */

.site-footer {
  background: var(--ink);
  color: #C9D3CF;
  padding-block: var(--space-7) var(--space-5);
}
.site-footer a { color: #E4E9E6; }
.site-footer a:hover { color: var(--signal-amber); }

.footer-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); }
}

.footer-brand h4 { color: #fff; margin-bottom: var(--space-2); }
.footer-brand p { font-size: var(--text-small); color: #9FADA7; max-width: 32ch; }

.footer-col h5 {
  color: #fff;
  font-size: var(--text-caption);
  letter-spacing: var(--track-wider);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.footer-col a { text-decoration: none; font-size: var(--text-small); }

.footer-legal {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255,255,255,0.12);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  justify-content: space-between;
  font-size: var(--text-caption);
  color: #8B9994;
}
.footer-legal .legal-links { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.footer-legal .legal-links a { color: #8B9994; }

/* ================= Tag cloud (condition lists, etc.) ================= */

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--teal-deep-tint);
  color: var(--teal-deep);
  font-size: var(--text-small);
  font-weight: var(--fw-medium);
  border: 1px solid transparent;
}
.tag.tag-alt { background: var(--signal-amber-tint); color: var(--signal-amber-hover); }

/* ================= Pull-quote ================= */

.pull-quote {
  position: relative;
  padding-left: var(--space-5);
  border-left: 3px solid var(--signal-amber);
}
.pull-quote p {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: var(--track-tight);
  color: var(--ink);
}
.pull-quote p + p { margin-top: var(--space-3); font-size: var(--text-body); font-weight: var(--fw-regular); color: var(--color-text-muted); font-family: var(--font-body); }

/* ================= Checklist ================= */

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  color: var(--color-text-muted);
}
.checklist li svg {
  flex: none;
  width: 22px; height: 22px;
  margin-top: 1px;
  color: var(--color-brand);
}

/* ================= In-page table of contents (long pages) ================= */

.page-toc {
  /* Sticky only applies once .with-toc becomes a real two-column layout
     (see the 1024px breakpoint below) — on mobile this is a normal
     in-flow block, otherwise it overlaps the article as the page scrolls. */
  position: static;
  background: var(--paper-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  max-height: 60vh;
  overflow-y: auto;
}
.page-toc h2 {
  font-size: var(--text-caption);
  text-transform: uppercase;
  letter-spacing: var(--track-wider);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  padding-inline: var(--space-2);
}
.page-toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.page-toc a {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-small);
  font-weight: var(--fw-medium);
}
.page-toc a:hover { background: var(--teal-deep-tint); color: var(--color-brand); }
.page-toc a.is-active { background: var(--teal-deep-tint); color: var(--color-brand); }

.with-toc {
  display: grid;
  gap: var(--space-6);
  align-items: start;
}
@media (min-width: 1024px) {
  .with-toc { grid-template-columns: 260px 1fr; }
  .page-toc {
    position: sticky;
    top: calc(var(--header-h) + var(--space-3));
  }
}

/* ================= Quote card (stories) ================= */

.quote-card {
  background: var(--paper-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.quote-card blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--fw-medium);
  line-height: var(--lh-snug);
  color: var(--ink);
}
.quote-card cite {
  display: block;
  margin-top: var(--space-3);
  font-style: normal;
  font-size: var(--text-small);
  color: var(--color-text-muted);
}
.quote-card.is-placeholder {
  border-style: dashed;
  border-color: var(--line-strong);
  background: transparent;
}
.quote-card.is-placeholder blockquote { color: var(--color-text-muted); font-weight: var(--fw-regular); }

/* ================= Vow / promise statements (About) ================= */

.vow-list { display: grid; gap: var(--space-4); }
.vow {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.vow:last-child { border-bottom: none; padding-bottom: 0; }
.vow .mark { font-family: var(--font-display); font-size: var(--text-h2); color: var(--signal-amber); flex: none; line-height: 1; }
.vow p { font-family: var(--font-display); font-size: var(--text-h3); font-weight: var(--fw-medium); letter-spacing: var(--track-tight); color: var(--ink); line-height: var(--lh-snug); }

/* ================= Placeholder / legal notice ================= */

.placeholder-banner {
  background: var(--signal-amber-tint);
  border: 1px solid rgba(217, 164, 65, 0.4);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}
.placeholder-banner svg { flex: none; width: 24px; height: 24px; color: var(--signal-amber-hover); margin-top: 2px; }
.placeholder-banner strong { display: block; color: var(--ink); margin-bottom: 0.2rem; }
.placeholder-banner p { color: var(--color-text-muted); font-size: var(--text-small); }

/* ================= Reveal (JS hook classes) ================= */

.js-reveal { opacity: 0; transform: translateY(18px); }
.no-js .js-reveal { opacity: 1; transform: none; }

/* =====================================================================
   Photography
   ---------------------------------------------------------------------
   Editorial policy: this site shows spaces, hands, equipment and
   clinicians — never a patient's body. See scripts/images.manifest.js.

   Every media box declares its own aspect ratio in CSS (not inline), so
   the page reserves the right space before a single byte of image data
   arrives. The blurred LQIP sits behind as a background-image and the
   real photo simply paints over it as it decodes — no JS, no fade, no
   chance of a stuck-invisible image if a script fails.
   ===================================================================== */

figure { margin: 0; }

.media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background-color: var(--teal-deep-tint);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.media > picture,
.media > img {
  display: block;
  width: 100%;
  height: 100%;
}

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

/* Aspect presets — these MUST stay in step with PRESETS in
   scripts/images.manifest.js, or the reserved box won't match the file. */
.media--band      { aspect-ratio: 12 / 5; }
.media--wide      { aspect-ratio: 16 / 9; }
.media--landscape { aspect-ratio: 4 / 3; }
.media--portrait  { aspect-ratio: 3 / 4; }
.media--card      { aspect-ratio: 3 / 2; }
.media--square    { aspect-ratio: 1 / 1; }

.media--flush { border-radius: 0; }

/* Caption sitting under a figure */
.media-caption {
  margin-top: var(--space-2);
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  line-height: var(--lh-normal);
}

/* ---------- Full-bleed image band ----------
   A photographic breather between text sections. Placed as a direct child
   of <main> (outside .container) so it runs edge to edge. Height is fixed
   in CSS rather than by aspect ratio, so a 12:5 crop doesn't become a
   400px-tall slab on a phone. */

.image-band {
  position: relative;
  overflow: hidden;
  height: clamp(220px, 38vw, 520px);
  background-color: var(--teal-deep-tint);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.image-band img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Optional quiet caption over the lower edge of a band */
.image-band__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: var(--space-6) var(--container-pad) var(--space-3);
  background: linear-gradient(to top, rgba(22, 36, 31, 0.72), rgba(22, 36, 31, 0));
  color: var(--paper);
  font-size: var(--text-caption);
  letter-spacing: var(--track-wide);
}
.image-band__caption > span {
  display: block;
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
}

/* Inset variant — same idea, but held inside the container with a radius */
.image-band--inset {
  border-radius: var(--radius-lg);
  height: clamp(200px, 32vw, 420px);
}

/* ---------- Offset media pair ----------
   Two frames in a side column, the second overlapping the first. Gives a
   text/media row more presence than a single rectangle. */

.media-stack {
  position: relative;
  padding-bottom: clamp(2rem, 6vw, 4rem);
  padding-right: clamp(1.5rem, 5vw, 3.5rem);
}
.media-stack > .media:first-child {
  box-shadow: var(--shadow-md);
}
.media-stack > .media:last-child {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 46%;
  border: 4px solid var(--paper);
  box-shadow: var(--shadow-lg);
}
.section-alt .media-stack > .media:last-child { border-color: var(--paper-raised); }

@media (max-width: 599px) {
  /* Overlap gets cramped on a phone — stack them plainly instead. */
  .media-stack { padding: 0; display: grid; gap: var(--space-3); }
  .media-stack > .media:last-child {
    position: static;
    width: 100%;
    border: 0;
    box-shadow: var(--shadow-sm);
  }
}

/* ---------- Cards with a photographic top ---------- */

.card--photo,
.journey-card--photo {
  padding: 0;
  overflow: hidden;
}
.card--photo > .media,
.journey-card--photo > .media {
  border-radius: 0;
}
.card--photo > .card-body,
.journey-card--photo > .card-body {
  padding: var(--space-4);
}

.journey-card--photo .media img,
.card--photo .media img {
  transition: transform var(--dur-slow) var(--ease-out);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .journey-card--photo:hover .media img,
  .card--photo:hover .media img {
    transform: scale(1.04);
  }
}

/* ---------- Team portrait grid ---------- */

.team-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px) {
  .team-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
}

.team-member .media { box-shadow: var(--shadow-sm); }
.team-member figcaption { margin-top: var(--space-2); }
.team-member .name {
  display: block;
  font-weight: var(--fw-semibold);
  color: var(--ink);
  line-height: var(--lh-snug);
}
.team-member .role {
  display: block;
  font-size: var(--text-small);
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

/* ---------- Horizontal gallery strip ---------- */

.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 74%);
  gap: var(--space-3);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--space-3);
  /* bleed to the screen edges on small viewports so the strip reads as
     scrollable rather than as a clipped grid */
  margin-inline: calc(var(--container-pad) * -1);
  padding-inline: var(--container-pad);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.gallery > * { scroll-snap-align: start; }

@media (min-width: 640px)  { .gallery { grid-auto-columns: minmax(260px, 44%); } }
@media (min-width: 1024px) { .gallery { grid-auto-columns: minmax(280px, 30%); } }

.gallery::-webkit-scrollbar { height: 8px; }
.gallery::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: var(--radius-pill);
}

.gallery-hint {
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ---------- Photographic section background ----------
   Used on the dark CTA blocks. The overlay is deliberately heavy: this
   carries white body copy and buttons, and must clear WCAG AA against
   every part of the photo underneath, not just the average. */

.section-photo {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background-color: var(--teal-deep);
}
.section-photo > .section-photo__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.section-photo > .section-photo__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.section-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(31, 77, 70, 0.88) 0%, rgba(22, 36, 31, 0.92) 100%);
}
.section-photo > .container { position: relative; }

/* ---------- Media inside a Thread step ---------- */

.thread-media {
  margin-top: var(--space-3);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 1024px) {
  /* Steps alternate either side of the centre line; keep the photo from
     dominating the column. */
  .thread-media { max-width: 320px; }
  .thread-step:nth-child(odd) .thread-media { margin-left: auto; }
}

/* ---------- Figure captions on the dark sections ---------- */

.section-dark .media-caption,
.section-photo .media-caption { color: #C9D8D3; }

/* Captioned figure: the aspect box clips overflow, so the caption sits
   outside it rather than inside. */
.media-figure { display: block; }

/* Phase photography reacts to the Thread's scroll progress: images ahead of
   the reader sit back, the active phase comes forward. Scoped to
   .thread.is-enhanced — a class thread.js only adds once it has successfully
   initialised — so the images stay at full strength if GSAP never loads. */
.thread.is-enhanced .thread-media {
  opacity: 0.45;
  filter: saturate(0.65);
  transition: opacity var(--dur-slow) var(--ease-out),
              filter var(--dur-slow) var(--ease-out);
}
.thread.is-enhanced .thread-step.is-active .thread-media {
  opacity: 1;
  filter: none;
}

@media (prefers-reduced-motion: reduce) {
  .thread.is-enhanced .thread-media { opacity: 1; filter: none; }
}
