/* ==========================================================================
   base.css — fonts, reset, typography, layout utilities, focus rings, shared part styles
   (crest, heading-header, icons), motion switches. Live parity: docs/scout/GLOBAL-SPEC.md §1–§2,
   §15; BEHAVIOUR.md §4. Mobile-first; breakpoints in tokens.css.
   ========================================================================== */

/* ---- Fonts (self-hosted; byte-identical to live). Nimbus bold is declared at 900 exactly as live,
        so font-weight 700 resolves to it (GLOBAL-SPEC §1.3, DI-D26). ------------------------------ */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/Inter-Medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../fonts/Inter-Bold.woff2") format("woff2"); }
@font-face { font-family: "Bebas Neue"; font-weight: 400; font-display: swap; src: url("../fonts/bebasneue-regular.woff2") format("woff2"); }
@font-face { font-family: "Nimbus Sans Becker DExt"; font-weight: 400; font-display: swap; src: url("../fonts/nimbus-sans-becker-dext-regular.woff2") format("woff2"); }
@font-face { font-family: "Nimbus Sans Becker DExt"; font-weight: 900; font-display: swap; src: url("../fonts/nimbus-sans-becker-dext-bold.woff2") format("woff2"); }

/* ---- Reset ------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

:root { interpolate-size: allow-keywords; }

html {
  font-size: var(--root-font-size) !important;   /* 62.5% → 1rem = 10px */
  background-color: var(--secondary);            /* the page background: body is transparent (live) */
  scroll-behavior: smooth;                       /* in-page anchors (#join, skip links) scroll natively */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-block-size: 100vh;
  margin: 0 auto;
  background: none;
  color: var(--body-color);
  font-family: var(--font-body);
  font-size: var(--text-m);
  line-height: var(--text-line-height);
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll { overflow: hidden; }            /* off-canvas scroll lock (main.js) */

[id] { scroll-margin-top: var(--offset, 0); }
[hidden] { display: none !important; }

body :where(p, h1, h2, h3, h4, h5, h6, ul, ol, li) { margin-block: 0; }   /* ACSS; list padding is left to components */

img { max-width: 100%; height: auto; }
img { border-style: none; vertical-align: middle; }
svg:not([width]) { min-width: 1em; }
svg:not([height]) { min-height: 1em; }

input, button, textarea, select { font: inherit; }
button { padding: 0; border: none; cursor: pointer; }
:where(a) { cursor: pointer; }

/* Live's normalize (Bricks frontend-layer.min.css, every page): a superscript / subscript does not grow its line box.
   Round 4: "3<sup>rd</sup> Yearling parade" (+10.41px on that story card at 768 without it); also the stable single
   /horse/half-blood/ ("2<sup>nd</sup>", not exported). No other exported page prints a sub / sup. */
sub, sup { position: relative; font-size: 75%; line-height: 0; vertical-align: baseline; }
sub { bottom: -.25em; }
sup { top: -.5em; }

/* ---- Typography -------------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--heading-font-family);
  font-weight: var(--heading-font-weight);
  line-height: var(--heading-line-height);
  color: var(--heading-color);
  text-wrap: pretty;
  max-width: 100%;
  text-rendering: optimizeLegibility;
}
h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); }
h4 { font-size: var(--h4); }
h5 { font-size: var(--h5); }
h6 { font-size: var(--h6); }

/* p/li get the ex-relative line height from their OWN font (e.g. Bebas lines are 32.4px at 16px). */
p, li { line-height: var(--text-line-height); }

/* Links (ACSS): colour + transition from custom properties, hover only on fine pointers.
   Components set --link-color / --link-color-hover instead of overriding colour + :hover. */
body a:where(:not([class*="btn--"])) {
  color: var(--link-color);
  font-weight: inherit;
  text-decoration: inherit;
  text-underline-offset: auto;
  transition: var(--link-transition);
}
@media (hover: hover) and (pointer: fine) {
  body a:where(:not([class*="btn--"])):hover { color: var(--link-color-hover); }
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---- Focus rings (live parity, GLOBAL-SPEC §2 / §15): keyboard only; mouse focus draws nothing.
        2px solid #1263FF offset 2px by default; #B3CDFF on buttons, skip links and the form submit. -- */
body :focus:not(:focus-visible) { outline: none; box-shadow: none; }
body :focus-visible {
  outline-style: solid;
  outline-color: var(--focus-color);
  outline-width: var(--focus-width);
  outline-offset: var(--focus-offset);
}
[class*="btn--"], .skip-link, .ff-btn-submit { --focus-color: var(--primary-light); }

/* ---- Skip links (live: Bricks + ACSS .skip-link; appear at 10,10 on focus, primary button look) ---- */
.skip-link {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: var(--z-skip-link);
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
  transform: translateY(-250%);
  display: inline-block;
  padding: 1.6rem 2.4rem;                                 /* 242 × 44 box, as live (BUTTONS.md §4.4) */
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-family: var(--btn-font-family);
  font-size: var(--btn-md-font);
  font-weight: var(--btn-font-weight);
  line-height: var(--btn-line-height);
  letter-spacing: var(--btn-letter-spacing);
  text-transform: var(--btn-text-transform);
  text-align: center;
  text-decoration: none;
  border: 0 solid var(--primary);
  border-radius: var(--btn-radius);
  transition: var(--transition);
}
.skip-link:focus {
  clip: auto;
  width: auto;
  height: auto;
  overflow: visible;
  transform: translateY(0);
}
@media (hover: hover) and (pointer: fine) {
  .skip-link:hover { background: var(--primary); color: var(--white); }
}

/* ---- Layout: sections, containers, tones ---------------------------------------------------------
   Block roots: <section class="block-<name> section section--<tone> [section--no-top|--no-bottom|--no-pad]">
   (wfx_section_class() builds the list). Nested block roots are <div>s without .section. */
.section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--container-gap);
  width: 100%;
  margin-inline: auto;
  padding-block: var(--section-padding-block);
  padding-inline: var(--gutter);
  overflow-x: clip;                                  /* DI-D7: clips live's ≤419px slider-arrow overflow */
}
.section--no-top { padding-top: 0; }                 /* live .wlp-pad-top--none */
.section--no-bottom { padding-bottom: 0; }           /* live .wlp-pad-bottom--none */
.section--no-pad { padding-block: 0; }

.section--dark { background-color: var(--secondary); }             /* live .bg--secondary */
.section--light { background-color: var(--base-light); }
.section--ultra-light { background-color: var(--base-ultra-light); } /* live .bg--base-ultra-light */
.section--white { background-color: var(--white); }                 /* live .bg--white */
.section--tertiary { background-color: var(--tertiary); }           /* content previews (PREVIEW-DESIGN §2.5) */
.section--dark-fade { background-color: transparent; }
.section--dark-fade::before {                                       /* S3: stop at 25 % of the whole section */
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--wfx-s3-overlay);
  pointer-events: none;
}
.section--dark-fade > * { position: relative; }

.container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--content-gap);
  width: var(--content-width);
  max-width: 100%;
  margin-inline: auto;
}
.container--gap-l { gap: var(--space-l); }

/* Sliders stay visible without JS (DI-D27): Splide's core CSS hides .splide until init. */
html:not(.js) .splide { visibility: visible; }

/* ---- Icons (wfx_icon(): inline SVG from live's own FA/themify/ionicons glyphs) ---------------------
   1em tall, width from the glyph's advance (viewBox), baseline-aligned like the icon font glyph. */
.icon {
  display: inline-block;
  flex-shrink: 0;
  height: 1em;                       /* width comes from the width="…em" attribute (the glyph's advance) */
  vertical-align: -0.125em;
  overflow: visible;
  fill: currentColor;
}

/* ---- Brand mark (parts/crest.php): live .wlp-logo__1 / .wlp-logo__1--dark, 20rem wide ----------- */
.crest {
  width: 20rem;
  max-width: 100%;
}
.crest :not([fill="none"]) { fill: var(--white); }
.crest--dark :not([fill="none"]) { fill: var(--tertiary); }

/* ---- Heading header (parts/heading-header.php): live .wlp-heading-header ------------------------ */
.heading-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: center !important;
  gap: var(--content-gap);
  width: 100%;
  max-width: 50rem;
  color: var(--white);
  text-align: center;
}
.heading-header--gap-10 { row-gap: 10px; }          /* live #brxe-fgihuc (measured one-off) */
.heading-header__heading { color: var(--white); }
.heading-header__text { color: var(--base-semi-light); }
.heading-header__text--bebas {
  font-family: var(--font-accent);
  text-transform: uppercase;
}

/* ---- 404 template ------------------------------------------------------------------------------- */
.error-404 { flex: 1 0 auto; justify-content: center; text-align: center; }
.error-404__inner { align-items: center; max-width: var(--width-l); }
.error-404__eyebrow {
  color: var(--primary);
  font-size: var(--text-xxl);
  font-weight: 700;
  letter-spacing: 4px;
  line-height: 1em;
  text-transform: uppercase;
}
.error-404__title { color: var(--white); }
.error-404__text { color: var(--base-semi-light); }

/* ---- Motion switches -----------------------------------------------------------------------------
   html.nomotion (set in <head> for ?nomotion=1, parity screenshots) kills every transition and
   animation, and the reveal targets are never hidden, so both states show the final layout.

   html.reveal-pending (set in <head> only when motion is on: JS, no ?nomotion=1, no reduced motion)
   keeps the GSAP reveal targets unpainted until animations.js has given them their inline start state
   and removed the class, so nothing in view is painted in its final state and then blanked (the hero
   flash). The <head> script removes the class after 3 s if the layer has not started, so content is
   never left hidden; with no JS, ?nomotion=1 or reduced motion this rule never matches. */
@media (prefers-reduced-motion: no-preference) {
  html.reveal-pending:not(.nomotion) [data-reveal] { opacity: 0; }
}

html.nomotion { scroll-behavior: auto; }
html.nomotion *,
html.nomotion *::before,
html.nomotion *::after {
  transition: none !important;
  animation: none !important;
  scroll-behavior: auto !important;
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Inertial scrolling (animations.js + GSAP ScrollSmoother; ARCHITECTURE "Motion") ---------------
   Only with a fine pointer wider than 640px and motion on. animations.js then wraps the page in
   <body> > #smooth-wrapper > #smooth-content (ScrollSmoother styles both inline: the wrapper fixed and
   full-viewport, the content translated) and sets html.has-smoother. Neither exists otherwise.
   The page scroll is eased by the smoother, so CSS smooth scrolling (which would also ease the native
   scroll position it drives) is off. #smooth-content carries the body's flex column, so <main> still
   fills a short page (404, upgrade page) exactly as it does as a child of <body>. */
html.has-smoother,
html.has-smoother body { scroll-behavior: auto; }

#smooth-content {
  display: flex;
  flex-direction: column;
  min-block-size: 100vh;
}

/* ---- Page landmarks (live #brx-content / #brx-footer in a flex-column body) ---------------------- */
.site-main {
  position: relative;
  flex: 1 1 0%;
  width: 100%;
}
