/* ==========================================================================
   Base — reset, typography, links, buttons, focus, layout primitives
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body,
h1, h2, h3, h4,
p, ul, ol, dl, dd, figure, blockquote {
  margin: 0;
}

ul[class],
ol[class] {
  padding: 0;
  list-style: none;
}

img,
svg,
picture {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
}

/* ---- Document ---- */
body {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
  overflow-x: clip;
}

/* ---- Headings (§1.4): Archivo, sentence case, never hyphenated ---- */
h1, h2, h3 {
  font-family: var(--font-display);
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: manual;
}

h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  font-weight: var(--fw-heading);
  font-stretch: var(--stretch-heading);
}

h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  font-weight: var(--fw-heading);
  font-stretch: var(--stretch-heading);
}

h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: var(--fw-h3);
  font-stretch: var(--stretch-ui);
}

/* ---- Body text ---- */
p,
li,
dd {
  text-wrap: pretty;
}

p {
  max-width: var(--measure);
}

.lede {
  font-size: var(--fs-lede);
  line-height: var(--lh-lede);
  max-width: var(--measure-lede);
}

.small {
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  color: var(--color-text-soft);
}

strong,
b {
  font-weight: var(--fw-strong);
}

/* Spanish hyphenation on narrow screens only (§1.4) */
@media (max-width: 29.99em) {
  p,
  li,
  dd {
    hyphens: auto;
  }
}

/* ---- Links (§2.4): navy text, teal underline ---- */
a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--color-link-line);
  text-decoration-thickness: var(--link-line);
  text-underline-offset: 0.2em;
  transition: text-decoration-thickness var(--dur-state);
}

a:hover {
  text-decoration-thickness: var(--link-line-hover);
}

/* ---- Focus (§2.4) ---- */
:focus-visible {
  outline: var(--focus-width) solid var(--color-focus);
  outline-offset: var(--focus-offset);
}

[tabindex="-1"]:focus {
  outline: none;
}

/* Navy areas: gold focus + white text */
.on-navy {
  --color-focus: var(--gold);
  --color-text: var(--white);
  background: var(--navy);
  color: var(--white);
}

/* ---- Buttons (§2.4): 4px radius, no pills, no arrows ---- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--button-min-h);
  padding: var(--space-3) 1.25em;
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-display);
  font-size: var(--fs-ui);
  font-weight: var(--fw-button);
  font-stretch: var(--stretch-ui);
  line-height: var(--lh-ui);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-state), color var(--dur-state), border-color var(--dur-state);
}

.button:hover {
  background: var(--white);
  color: var(--navy);
}

.button--secondary {
  background: transparent;
  color: var(--navy);
}

.button--secondary:hover {
  background: var(--navy);
  color: var(--white);
}

/* Gold CTA — navy areas only (navy on gold 7.1:1) */
.button--gold {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--navy);
}

.button--gold:hover {
  background: var(--navy);
  color: var(--gold);
}

/* Mobile: full-width, wrapping allowed. Tablet up: content-sized, nowrap (§1.3) */
@media (max-width: 47.99em) {
  .button {
    width: 100%;
  }
}

@media (min-width: 48em) {
  .button {
    white-space: nowrap;
  }
}

/* ---- Layout primitives (§3.2) ---- */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-pad);
}

.section--alt {
  background: var(--color-bg-alt);
}

/* ---- Utilities ---- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Skip link (§7) ---- */
.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: var(--fw-button);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
  --color-focus: var(--gold);
}
