/* Dawson v7 Foundation — Base + typography
 * Body/html normalisation and typography primitives for any v7 template.
 * Expects v7-tokens.css to be loaded first.
 *
 * Scope: all rules gated by body.v7 class to avoid leaking into
 * Elementor pages. service-v7.php adds the v7 class via body_class
 * filter (see Task 7).
 */

/* ==========================================================
   Reset within v7 scope
   ========================================================== */
body.v7 {
  font-family: var(--v7-font-body);
  color: var(--v7-ink);
  background: var(--v7-bone);
  /* overflow-x: clip (not hidden) — 'hidden' silently coerces overflow-y
     to 'auto', turning body into a nested scroll container which breaks
     Lenis smooth scroll, iOS Safari momentum, anchor offsets, and sticky
     positioning. 'clip' prevents horizontal overflow without creating a
     scroll container. Supported in all modern browsers since 2022. */
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.v7 html { scroll-behavior: auto; }
body.v7.lenis, body.v7.lenis body { height: auto; }
body.v7.lenis.lenis-smooth { scroll-behavior: auto !important; }
body.v7.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

body.v7 img { max-width: 100%; height: auto; display: block; }

/* ==========================================================
   Typography primitives
   ========================================================== */
body.v7 .display {
  font-family: var(--v7-font-display);
  font-weight: 700;
  letter-spacing: var(--v7-type-display-tracking);
  line-height: 0.95;
}

body.v7 .display-italic {
  font-style: italic;
  font-weight: 400;
}

body.v7 .eyebrow {
  font-family: var(--v7-font-body);
  font-size: var(--v7-type-eyebrow-size);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--v7-type-eyebrow-tracking);
}

body.v7 .section-display { font-size: var(--v7-type-section); }
body.v7 .pull-out-type { font-size: var(--v7-type-pull-out); }
body.v7 .phone-xl { font-size: var(--v7-type-phone-xl); }
body.v7 .inner-hero-type { font-size: var(--v7-type-inner-hero); }

/* ==========================================================
   Focus styles (a11y non-negotiable)
   ========================================================== */
body.v7 a:focus-visible,
body.v7 button:focus-visible,
body.v7 [role="button"]:focus-visible,
body.v7 summary:focus-visible {
  outline: 2px solid var(--v7-orange);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ==========================================================
   prefers-reduced-motion — signature override
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  body.v7 .reveal,
  body.v7 .word,
  body.v7 .img-mask img {
    opacity: 1 !important;
    transform: none !important;
    clip-path: inset(0) !important;
    filter: none !important;
    transition: none !important;
  }
  body.v7 * { animation: none !important; }
}
