/*
 * Stop the header covering the top of every page.
 *
 * `.header__bar` is `position: fixed`, so it is out of flow and every mirrored
 * page begins underneath it. Live has the same bug — its own H1 on a treatment
 * page sits at y=64 behind a 137px bar — but inheriting it is not a reason to
 * ship it. /faq/ and /providers/ were worse than the treatment pages Mari
 * reported: their H1 was hidden outright.
 *
 * Sticky would be the tidier fix, since a sticky header takes its own space
 * and needs no measured constant. It does not work here: `header.header` is
 * zero-height, so a sticky child has nothing to push and the content stays
 * underneath. Hence an explicit offset, with the bar left fixed.
 *
 * Injected only into mirrored pages — it rides MOTION_TAGS, which the
 * from-scratch home page does not receive — and loaded after live's own
 * stylesheets, so matching selectors win on source order without !important.
 */

:root {
  --header-h: 117px;
}

/* The desktop bar is taller. 1024 is forced to the mobile bar below. */
@media (min-width: 1025px) {
  :root {
    --header-h: 137px;
  }
}

main {
  padding-top: var(--header-h);
}

/*
 * Live offsets this wrapper by 64px to buy back part of what the bar covered —
 * less than the bar, and only above 1024. The padding above replaces it.
 */
.single-treatment__wrapper {
  margin-top: 0;
}

/*
 * Sticky panels stick to the viewport top, which is behind the bar.
 *
 * Only the FAQ image qualifies. `.steps-trigger-wrapper` is also sticky, but
 * it is a 6,300px container wrapping four ordinary sections, and a sticky
 * element taller than the viewport never sticks, so its `top: 0` does nothing.
 *
 * That wrapper is the pin for the theme's own step-by-step scroller — not, as
 * written here first, a GSAP ScrollTrigger we had stripped; `initScrollSteps`
 * in the theme's main.js is alive and running. Because the pin never engages,
 * the scroller translates the step list inside a window nothing holds still.
 * The step-by-step is rebuilt in steps.css / steps.js / src/lib/steps.mjs, and
 * it needed a design fix rather than an offset, so nothing for it belongs
 * here.
 */
.single-treatment__faq-image {
  top: var(--header-h);
}

/* In-page jumps land under the bar for the same reason. */
[id] {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

/*
 * Known, pre-existing, NOT fixed here: at exactly 1024px — iPad landscape —
 * two plugins disagree about where desktop starts. Foundation reveals
 * `.nav-bar--desktop` at `show-for-large` (64em = 1024px), but Max Mega Menu
 * only lays its menu out horizontally from 1025px, so the desktop nav appears
 * with its items still stacked and the bar grows to 365px, covering the top
 * of the page.
 *
 * Two fixes were tried and both made it worse — forcing the menu horizontal
 * left it wrapping to 185px, and forcing the mobile header pushed it to 401px.
 * The width is left exactly as it was rather than shipping a half-fix; every
 * other width is clear. Worth its own change with the plugin CSS in hand.
 */
