/* =========================================================================
   base.css — reset, element defaults, and accessibility globals.

   LOAD ORDER: after tokens.css (needs the custom properties); before
   layout.css, components.css, header.css, pages.css, legacy.css. Nothing
   here targets a class, so there is no cascade dependency on what loads
   after it.
   ========================================================================= */

/* -------------------------------------------------------------------------
   Reset + base
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-body);
  font: var(--weight-regular) var(--text-base)/var(--leading-normal) var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1 {
  font-family: var(--font-display);
  color: var(--text-heading);
  font-weight: var(--weight-semibold);
  margin: 0 0 var(--space-1);
  line-height: var(--leading-tight);
  font-size: var(--text-2xl); letter-spacing: .2px;
}
h2 {
  font-size: var(--text-sm); color: var(--text-muted); font-weight: var(--weight-semibold);
  margin: var(--space-8) 0 var(--space-3); text-transform: uppercase; letter-spacing: var(--tracking-caps);
  font-family: var(--font-body); line-height: var(--leading-tight);
}
/* sub-section labels nested inside a card body (e.g. admin.js's per-block
   headings) — same caption treatment as h2 but tighter margins since
   there's already card padding around them */
h3 {
  font-size: var(--text-xs); color: var(--text-muted); font-weight: var(--weight-semibold);
  margin: var(--space-5) 0 var(--space-2); text-transform: uppercase; letter-spacing: var(--tracking-caps);
  font-family: var(--font-body); line-height: var(--leading-tight);
}
p { margin: 0 0 var(--space-3); }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: 0; border-top: 1px solid var(--border-subtle); margin: var(--space-2) 0; }
footer { margin-top: var(--space-10); color: var(--text-muted); font-size: var(--text-xs); }

/* -------------------------------------------------------------------------
   Accessibility globals — focus, selection, motion
   ------------------------------------------------------------------------- */
:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}
a:focus-visible, button:focus-visible, .btn:focus-visible {
  box-shadow: var(--focus-ring);
}
::selection { background: var(--brand-fill); color: var(--text-on-brand); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

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