/* ============================================================================
   EASTON CHILD — global header + mega menu  (consumes tokens.css)
   Desktop: sticky bar + Programs/Locations mega panels.
   Mobile : hamburger → full-screen menu with Programs/Locations accordions and
            a pinned "Try a Free Class" CTA. Red is an ACCENT only.
   ============================================================================ */

/* --- Scoped reset --------------------------------------------------------- */
/* The header chrome renders on two surfaces that do NOT share a baseline:
   GeneratePress supplies `*{box-sizing:border-box}` on every normal page, and
   page-bversion.php dequeues GP, leaving that declaration only inside the `.eb`
   artboard — which the header sits outside of. This file never declared its own,
   so the front page has been laying the header out in content-box while every
   other page used border-box, and it shows: `.e-header__inner` is max-width
   1200px + 40px of padding a side, which measured 1280px wide on `/` against
   1200px everywhere else, putting the logo 40px too far left and the CTA 40px
   too far right ON THE FRONT PAGE. The Programs panel came out 402px tall
   instead of 366px for the same reason (`.e-tile` is min-height 300 + 18px
   padding). Declaring it here is what makes the chrome identical on `/` and
   /longmont/ rather than merely similar — the same fix footer.css carries. */
.e-announce, .e-announce *, .e-announce *::before, .e-announce *::after,
.e-header, .e-header *, .e-header *::before, .e-header *::after,
.e-mobile, .e-mobile *, .e-mobile *::before, .e-mobile *::after { box-sizing: border-box; }

/* Shared header button (compact variant of the page .easton-btn). */
.e-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: var(--font-label); font-weight: var(--fw-label); font-size: var(--fs-eyebrow);
  letter-spacing: 0.1em; text-transform: uppercase; line-height: 1;
  padding: 13px 22px; border: none; border-radius: var(--radius-control);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-standard);
}
.e-btn--primary { background: var(--red); color: var(--text-on-red); box-shadow: var(--shadow-cta-red); }
.e-btn--primary:hover, .e-btn--primary:focus-visible { background: var(--red-shadow); color: var(--text-on-red); }
.e-btn--block { width: 100%; }
.e-btn--lg { font-size: var(--fs-body); padding: 16px; }

/* --- Announcement bar ----------------------------------------------------- */
.e-announce { background: var(--surface-dark); color: var(--text-on-dark); }
.e-announce__inner {
  max-width: var(--container-max); margin-inline: auto; padding: 9px 40px; text-align: center;
  font-family: var(--font-label); font-weight: 500; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
}
.e-announce__arrow { color: var(--red); }

/* --- Sticky header bar ----------------------------------------------------- */
.e-header { position: sticky; top: 0; z-index: 100; }
.e-header__bar {
  position: relative; background: var(--canvas);
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--dur-toggle) var(--ease-standard);
}
.e-header.is-compact .e-header__bar { box-shadow: 0 1px 0 var(--line), 0 10px 30px -22px rgba(13,13,12,0.5); }
.e-header.is-panel-open .e-header__bar { border-bottom-color: transparent; }
/* Fixed reserved height (scroll-shake fix): the sticky bar sits IN FLOW, so its
   box height is part of document.scrollHeight. The old compact state shrank this
   box (inner padding 19→12 + logo 44→36 ≈ 18px), which changed scrollHeight and,
   near a short page's bottom, clamped the scroll — the /about/ shake. Keep the
   box height constant across the toggle: inner padding stays 19px and the logo's
   reserved height stays 44px; the compact cue is delivered by TRANSFORMING the
   logo (scale, no layout change) + the shadow, not by resizing the box. */
.e-header__inner {
  max-width: var(--container-max); margin-inline: auto; padding: 19px 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
}

/* --- Logo ----------------------------------------------------------------- */
.e-logo { display: inline-flex; align-items: center; text-decoration: none; }
/* Full Easton lockup (badge + wordmark baked into one image). Fixed box
   (width/height in markup too) so it never shifts layout; sized by height with
   width:auto to hold the source ratio. Transition only the height when the
   sticky bar compacts. */
.e-logo__mark {
  height: 44px; width: auto; flex: 0 0 auto; display: block;
  transform-origin: left center;
  transition: transform var(--dur-toggle) var(--ease-standard);
}
/* Compact: scale the logo (36/44 ≈ .818) rather than shrink its box, so the
   reserved 44px — and therefore the header height and scrollHeight — is fixed. */
.e-header.is-compact .e-logo__mark { transform: scale(0.818); }

/* --- Desktop nav ---------------------------------------------------------- */
.e-nav__list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.e-nav__item { position: relative; }
/* Scoped to the .e-header root (0,2,0) so the trigger <button>s beat Elementor
   Kit 6's `.elementor-kit-6 button { background: … }` (0,1,1), which is enqueued
   on every unmigrated Elementor page and would otherwise fill the Programs/
   Locations triggers red. Also clears GeneratePress's bare `button` (0,0,1). */
.e-header .e-nav__link {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px;
  font-family: var(--font-label); font-weight: 500; font-size: 13px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink); background: transparent; border: none;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.e-nav__link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
  background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform var(--dur-toggle) var(--ease-standard);
}
.e-nav__link:hover::after,
.e-nav__trigger[aria-expanded="true"]::after { transform: scaleX(1); }
.e-nav__caret { font-size: 8px; line-height: 1; opacity: 0.55; transition: transform var(--dur-toggle) var(--ease-standard), color var(--dur-toggle) var(--ease-standard); }
.e-nav__trigger[aria-expanded="true"] .e-nav__caret { transform: rotate(180deg); color: var(--red); opacity: 1; }

.e-header__cta { margin-left: 4px; }
.e-header.is-compact .e-header__cta { padding: 11px 18px; }

/* --- Hamburger (mobile only) ---------------------------------------------- */
/* Both burger buttons live in either the .e-header bar (open) or the .e-mobile
   overlay (close); scope to those roots (0,2,0) so `background: transparent`
   beats Elementor Kit 6's `button { background: … }` (0,1,1). The `display`
   toggle that reveals the burger on mobile is likewise re-scoped below so it
   keeps out-specifying this rule. */
.e-header .e-burger, .e-mobile .e-burger { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--line); border-radius: var(--radius-control); cursor: pointer; }
.e-burger__box { position: relative; width: 20px; height: 14px; display: inline-block; }
.e-burger__box span { position: absolute; left: 0; right: 0; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s var(--ease-standard), opacity .2s var(--ease-standard); }
.e-burger__box span:nth-child(1) { top: 0; }
.e-burger__box span:nth-child(2) { top: 6px; }
.e-burger__box span:nth-child(3) { top: 12px; }
.e-burger.is-open .e-burger__box span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.e-burger.is-open .e-burger__box span:nth-child(2) { opacity: 0; }
.e-burger.is-open .e-burger__box span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

/* --- Desktop mega panels --------------------------------------------------- */
.e-panel {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 40;
  background: var(--paper); border-top: 2px solid var(--red);
  box-shadow: 0 30px 60px -28px rgba(13,13,12,0.5);
  padding: 0 40px;
}
.e-panel[hidden] { display: none; }
.e-panel__inner { max-width: var(--container-max); margin-inline: auto; display: grid; }
.e-panel__inner--programs { grid-template-columns: 1.1fr 0.82fr 308px; gap: 30px; padding: 30px 0 34px; }
.e-panel__inner--locations { grid-template-columns: 1fr 1fr 1fr 300px; gap: 36px; padding: 4px 0 32px; }
.e-panel__head { max-width: var(--container-max); margin: 0 auto; display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding-top: 28px; }
.e-panel__title { font-family: var(--font-display); font-size: 26px; line-height: 1; letter-spacing: 0.01em; text-transform: uppercase; color: var(--ink); margin: 0; }
.e-panel__all { font-family: var(--font-label); font-weight: 600; font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); text-decoration: none; white-space: nowrap; }
.e-panel__all span { color: var(--red); }
.e-panel__col--kids { border-left: 1px solid var(--line); padding-left: 32px; }
.e-panel__label { display: flex; align-items: center; gap: 10px; font-family: var(--font-label); font-weight: 600; font-size: 12.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink); margin: 0 0 6px; }
.e-panel__label::before { content: ""; width: 7px; height: 7px; background: var(--red); flex: 0 0 auto; }
.e-panel__label--muted { color: var(--text-muted); font-size: 11px; letter-spacing: 0.16em; }
.e-panel__label--muted::before { width: 6px; height: 6px; }

/* program / location rows */
.e-prow { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-control); text-decoration: none; }
.e-prow:hover { background: var(--surface-sunken); }
.e-prow__name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--font-display); font-size: 19px; line-height: 1.04; letter-spacing: 0.01em; text-transform: uppercase; color: var(--ink); }
.e-prow__arrow { color: var(--red); font-size: 17px; line-height: 1; justify-self: end; }

.e-chip { display: inline-flex; align-items: center; font-family: var(--font-label); font-weight: 700; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; padding: 3px 9px; border-radius: var(--radius-control); white-space: nowrap; }
.e-chip--start { background: var(--red); color: var(--text-on-red); padding: 4px 9px; }
.e-chip--next { background: transparent; color: var(--ink); border: 1.5px solid var(--line-strong); }
.e-chip--tag { background: var(--surface-sunken); color: var(--text-muted); border: 1px solid var(--line); font-weight: 600; font-size: 9.5px; }

.e-loccol .e-panel__label--muted { margin-bottom: 6px; }
.e-loc { display: flex; align-items: center; justify-content: space-between; padding: 11px 4px; border-bottom: 1px solid var(--line); text-decoration: none; }
.e-loc__name { font-family: var(--font-display); font-size: 19px; letter-spacing: 0.01em; text-transform: uppercase; color: var(--ink); }
.e-loc__view { font-family: var(--font-label); font-weight: 600; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--red); }
.e-loc:hover .e-loc__name { color: var(--red); }

/* Programs featured tile (right rail, CSS-only — no image dependency) */
.e-tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; min-height: 300px; padding: 18px; border-radius: var(--radius-card); background: var(--surface-dark); color: var(--text-on-dark); text-decoration: none; overflow: hidden; }
.e-tile::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 80% at 80% 0%, rgba(240,65,55,0.22), transparent 60%); }
.e-tile__kicker { position: absolute; top: 16px; left: 18px; display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-label); font-weight: 600; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; }
.e-tile__kicker::before { content: ""; width: 5px; height: 5px; background: var(--red); }
.e-tile__title { position: relative; z-index: 2; font-family: var(--font-display); font-size: 27px; line-height: 1.02; letter-spacing: 0.01em; text-transform: uppercase; }
.e-tile__cta { position: relative; z-index: 2; align-self: flex-start; display: inline-flex; align-items: center; gap: 9px; background: var(--red); color: var(--text-on-red); padding: 12px 18px; border-radius: var(--radius-control); font-family: var(--font-label); font-weight: 600; font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; box-shadow: 0 2px 0 var(--red-shadow); }

/* The tile's art. It fills the rail exactly — the tile's own 308x300 box — so the
   panel's height and the two link columns beside it are unchanged. Sized in the
   layout, never by the file: the <img> carries its intrinsic 800x800 and this
   rule pins it to the box, so the panel cannot reflow as the image decodes.
   Everything above it is explicitly stacked (::before = 1, content = 2) because
   ::before generates the FIRST child box and the img would otherwise paint over
   the scrim.
   The scrim only exists on .e-tile--photo, which PHP adds only when a photo was
   actually emitted — so with the photo absent this tile is byte-for-byte the
   CSS-only card it has always been. */
.e-tile__photo { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.e-tile::before { z-index: 1; }
/* Scrim weights are set by the TEXT, not by taste: the kicker sits at the top
   over the (bright) logo wall and the Anton title runs roughly 62-88% down the
   tile, so those two bands carry the most ink and the 30% mark — where nothing
   is printed — stays open so the photo still reads as a photo. Weights were set
   by sampling the rendered backdrop with the text hidden, not by eye: worst-case
   contrast against the white type is 12.9:1 under the Anton title and 6.1:1
   under the 10px kicker (WCAG AA wants 3:1 large, 4.5:1 normal). */
.e-tile--photo::before {
  background:
    radial-gradient(120% 80% at 80% 0%, rgba(240,65,55,0.26), transparent 60%),
    linear-gradient(180deg, rgba(13,13,12,0.74) 0%, rgba(13,13,12,0.34) 30%, rgba(13,13,12,0.80) 62%, rgba(13,13,12,0.96) 100%);
}
.e-tile__kicker { z-index: 2; }

.e-locrail { display: flex; flex-direction: column; gap: 14px; }
.e-locrail__big { font-family: var(--font-display); font-size: 22px; line-height: 1; letter-spacing: 0.01em; text-transform: uppercase; color: var(--ink); margin: 0; }
.e-locrail__note { font-family: var(--font-body); font-size: 13px; line-height: 1.45; color: var(--text-muted); margin: 0; }
.e-locrail__cta { margin-top: auto; }

/* Abstract Front Range map (inc/header.php easton_header_locations_map).
   Ported verbatim from Ignacio's briefs/2026-08-14-locations-map-source.html —
   the .demo wrapper and its html,body rule were demo scaffolding and are gone.
   Zero JS: no hover states, no tooltips, no interactivity, by standing call.
   It needs no display:none for mobile — `.e-panel{display:none!important}` below
   981px already takes the whole desktop panel, and the drawer never receives the
   markup in the first place (the $media argument in inc/header.php). */
.easton-map { position: relative; width: 100%; height: 156px; border-radius: var(--radius-card); overflow: hidden; background: var(--ink); }
.easton-map .em-base { position: absolute; inset: 0; width: 100%; height: 100%; }
.easton-map .em-pin { position: absolute; transform: translate(-50%, -100%); width: 16px; height: 21px; }

/* --- Mobile full-screen menu ---------------------------------------------- */
.e-mobile { position: fixed; inset: 0; z-index: 200; background: var(--canvas); display: flex; flex-direction: column; }
.e-mobile[hidden] { display: none; }
.e-mobile__bar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.e-mobile__scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 18px 18px; -webkit-overflow-scrolling: touch; }
.e-mobile__list { list-style: none; margin: 0; padding: 0; }
/* Scoped to the .e-mobile root (0,2,0): the accordion trigger is a <button>, so
   `background: transparent` must beat Elementor Kit 6's `button` (0,1,1) or the
   Programs/Locations rows in the mobile menu fill red. (.e-mobile__direct is an
   <a> — the kit doesn't style bare `a`, but it's scoped here for consistency.) */
.e-mobile .e-acc__trigger, .e-mobile .e-mobile__direct {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 17px 4px; background: transparent; border: none; border-bottom: 1px solid var(--line);
  cursor: pointer; text-align: left; text-decoration: none;
  font-family: var(--font-display); font-size: 26px; line-height: 1; letter-spacing: 0.01em; text-transform: uppercase; color: var(--ink);
}
.e-acc__trigger[aria-expanded="true"] { color: var(--red); }
.e-mobile__direct span:last-child { color: var(--text-faint); font-size: 18px; }
.e-acc__icon { position: relative; width: 26px; height: 26px; flex: 0 0 auto; border: 1.5px solid var(--line-strong); border-radius: var(--radius-control); }
.e-acc__icon::before, .e-acc__icon::after { content: ""; position: absolute; top: 50%; left: 50%; width: 11px; height: 2px; background: currentColor; border-radius: 2px; transform: translate(-50%,-50%); }
.e-acc__icon::after { transform: translate(-50%,-50%) rotate(90deg); transition: transform var(--dur-toggle) var(--ease-standard); }
.e-acc__trigger[aria-expanded="true"] .e-acc__icon { border-color: var(--red); }
.e-acc__trigger[aria-expanded="true"] .e-acc__icon::after { transform: translate(-50%,-50%) rotate(0); opacity: 0; }
.e-acc__body { padding: 4px 0 14px; }
.e-acc__body[hidden] { display: none; }
/* Inside the mobile accordion, panel columns stack and the tile/rail hide for a clean list. */
.e-acc__body .e-panel__col { border: none; padding-left: 0; }
.e-acc__body .e-panel__col + .e-panel__col { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.e-acc__body .e-tile, .e-acc__body .e-locrail { display: none; }
.e-acc__body .e-prow { padding: 11px 4px; }

.e-mobile__reassure { display: flex; align-items: center; gap: 9px; padding: 18px 4px 4px; font-family: var(--font-body); font-size: 12.5px; color: var(--text-muted); }
.e-mobile__stars { color: var(--review-gold); letter-spacing: 1px; }
.e-mobile__cta { flex: 0 0 auto; padding: 14px 18px calc(18px + env(safe-area-inset-bottom)); background: var(--canvas); border-top: 1px solid var(--line); box-shadow: 0 -10px 24px -18px rgba(13,13,12,0.5); }

/* --- Breakpoint: collapse to mobile header below 980px -------------------- */
@media (max-width: 980px) {
  .e-nav, .e-header__cta { display: none; }
  /* Match the scoped base rule's (0,2,0) so this reveal still wins on mobile. */
  .e-header .e-burger, .e-mobile .e-burger { display: inline-flex; }
  .e-panel { display: none !important; }
  .e-header__inner { padding: 12px 16px; }
  .e-announce__inner { padding: 9px 16px; font-size: 10.5px; letter-spacing: 0.14em; }
}
@media (min-width: 981px) {
  .e-mobile { display: none !important; }
}

/* --- Focus visibility (a11y) ---------------------------------------------- */
.e-nav__link:focus-visible, .e-header__cta:focus-visible, .e-burger:focus-visible,
.e-prow:focus-visible, .e-loc:focus-visible, .e-panel__all:focus-visible, .e-tile:focus-visible,
.e-acc__trigger:focus-visible, .e-mobile__direct:focus-visible, .e-logo:focus-visible, .e-btn:focus-visible {
  outline: 3px solid var(--red); outline-offset: 2px; border-radius: var(--radius-control);
}
.e-announce__inner, .e-header__inner { } /* layout anchors */

/* Body scroll-lock while the mobile menu is open. */
body.easton-menu-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .e-nav__link::after, .e-nav__caret, .e-burger__box span, .e-acc__icon::after, .e-header__bar, .e-header__inner { transition: none; }
}
