/**
 * Base layer — resets and element defaults.
 * Every value references a theme.json token; no raw hex or magic numbers here.
 */

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

/* The root font-size is the fluid one every rem token hangs off:
   clamp(1.0625rem, 0.9018rem + 0.1786vw, 1.1875rem) — a flat 17px up to the 1440
   design anchor, then rising to 19px at 2560 and capped there. The design's px
   sizes are the floor, not a midpoint, so nothing below 1440 shrinks. It is
   declared in theme.json `styles.css`, not here, so theme.json stays the single
   source of the token and the same rule reaches the editor canvas. */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--wp--preset--color--cream);
  color: var(--wp--preset--color--ink-2);
  font-family: var(--wp--preset--font-family--sans);
  font-size: var(--wp--preset--font-size--body);
  font-weight: 300;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img,
picture,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
  max-width: var(--wp--custom--container--measure);
}

blockquote {
  margin: 0;
  text-wrap: pretty;
}

/* Kicker / caption / mono are used often enough to earn element-level helpers. */
.tt-kicker {
  font-size: var(--wp--preset--font-size--kicker);
  font-weight: 400;
  letter-spacing: var(--wp--custom--tracking--kicker);
  text-transform: uppercase;
  line-height: 1;
}

.tt-caption {
  font-size: var(--wp--preset--font-size--caption);
  font-weight: 400;
  letter-spacing: var(--wp--custom--tracking--caption);
  text-transform: uppercase;
  line-height: 1;
}

.tt-mono {
  font-family: var(--wp--preset--font-family--mono);
  font-size: var(--wp--preset--font-size--mono);
  font-weight: 400;
  letter-spacing: var(--wp--custom--tracking--mono);
  text-transform: uppercase;
}

/* Visible only to screen readers, but focusable (skip link). */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  width: auto;
  height: auto;
  clip-path: none;
  padding: 12px 20px;
  background: var(--wp--preset--color--cream);
  color: var(--wp--preset--color--ink);
}

/* Not :where() — that has zero specificity, so a plain `outline: none` from any
   other rule silently wins and the keyboard focus ring disappears. A focus
   indicator has to be hard to override. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--wp--preset--color--royal);
  outline-offset: 3px;
}

/* On the dark surfaces royal has too little contrast against forest; the focus
   ring switches to the light accent there. */
.tt-header :is(a, button):focus-visible,
.tt-menu :is(a, button):focus-visible,
.tt-footer a:focus-visible,
.tt-cta a:focus-visible,
.tt-section--forest-3 :is(a, button):focus-visible,
.tt-section--forest-1 :is(a, button):focus-visible,
.tt-fa-body :is(a, button):focus-visible,
.tt-fa-masthead :is(a, button):focus-visible {
  outline-color: var(--wp--preset--color--sage-3);
}

/* Tap targets — SPEC 03. */
:where(a, button, summary)[class*="tt-"] {
  min-height: var(--wp--custom--tap-target--min);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
