/* ==========================================================================
   base.css - reset, document defaults, typography primitives, focus and a11y helpers.
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word; /* long words/URLs in panel content never widen the page */
}

/* the page scrolls under the open drawer: layout.css / main.js set .is-locked on <html> */
html.is-locked { overflow: hidden; }

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

h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
:where(ul[class], ol[class]) { padding: 0; list-style: none; } /* :where keeps the specificity at zero so component rules can set padding */

a { color: inherit; text-decoration: none; }
a:not([class]) { color: var(--accent-text); text-decoration: underline; text-underline-offset: 0.18em; }

button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }

address { font-style: normal; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* the framework prints <main id="main">; it must never create a scroll container */
main { display: block; }

/* ---- headings: Barlow Condensed ---- */
h1, h2, h3, h4,
.display {
  font-family: var(--font-display);
  color: var(--heading);
  font-weight: 800;
  line-height: var(--lh-heading);
  letter-spacing: 0;
  text-wrap: balance;
}
h3, h4 { font-weight: 700; line-height: var(--lh-snug); }
/* body copy: no single-word last lines (browsers without text-wrap: pretty simply ignore it) */
p, li, dd { text-wrap: pretty; }

/* ---- focus: visible for keyboard users, quiet for pointer users ---- */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
/* on navy and orange surfaces the orange ring would vanish: switch to white */
.on-navy :focus-visible,
.on-orange :focus-visible { outline-color: var(--color-white); }

::selection { background: var(--accent); color: var(--color-navy-900); }

/* ---- helpers ---- */
.visually-hidden {
  position: absolute;
  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;
}
[hidden] { display: none !important; } /* the single !important of the project: an author `display` rule must never beat the hidden attribute */

.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-5);
  background: var(--accent);
  color: var(--color-navy-900);
  font-weight: 700;
  border-radius: var(--radius-lg);
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; outline-color: var(--color-navy-900); }

/* anchors never hide behind the sticky header */
[id] { scroll-margin-top: calc(var(--header-h) + var(--space-4)); }

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