/* base.css - structure and components. Assumes tokens.css is loaded first. */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
input, button, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { overflow-wrap: break-word; }

/* ---- Document ---- */
body {
  min-height: 100vh;
  display: flex; flex-direction: column; /* footer sits at the bottom of short pages */
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  line-height: var(--leading-tight);
}
h3, h4 { font-weight: var(--weight-heading-sm); }
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
small { font-size: var(--text-sm); color: var(--color-text-muted); }
code, pre { font-family: var(--font-mono); }
hr { border: 0; border-top: 1px solid var(--color-border); }

a { color: var(--color-accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 0.2em; }

/* The footer follows the content; it is not pushed to the bottom of tall windows (Reid, 2026-10-19, SG-36 review) */
main { flex: 0 0 auto; }

/* ---- Layout utilities ---- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.stack > * + * { margin-top: var(--space-4); }
.grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

/* Grid helpers: auto-fit, collapse on small screens */
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }

/* ---- Accessibility helpers ---- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -10rem;
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  border-radius: var(--radius-sm);
  z-index: 100;
}
.skip-link:focus { top: var(--space-2); }

:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* ---- Buttons ---- */
.button {
  display: inline-block;
  padding: var(--space-3) var(--space-5);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  font-family: var(--font-button);
  font-size: var(--text-sm);
  font-weight: var(--weight-button);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  line-height: var(--leading-tight);
  text-align: center;
  cursor: pointer;
}
.button:hover { text-decoration: none; filter: brightness(1.1); }
/* Outline: label takes the band's text color through the band remap */
.button--outline, .button--secondary {
  background: transparent;
  border-color: var(--color-accent);
  color: var(--color-text);
}

/* ---- Forms ---- */
label { display: block; margin-bottom: var(--space-1); font-size: var(--text-sm); }
input, select, textarea {
  width: 100%;
  padding: var(--space-3);
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
textarea { min-height: 8rem; resize: vertical; }
.field + .field { margin-top: var(--space-4); }
.field--error input, .field--error select, .field--error textarea { border-color: var(--color-down); }
.field--error label, .field__error { color: var(--color-down); }
/* Honeypot: keep it off-canvas, NOT display:none (bots skip hidden fields).
   In markup add aria-hidden="true", tabindex="-1" and autocomplete="off" on the
   wrapper/input so screen readers and keyboard users never reach it. */
.honeypot { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---- Bands ---- */
/* Dark bands remap the semantic tokens so every component inside just works */
.band--dark, .site-header, .site-footer, .hero {
  --color-bg: var(--band-dark-bg);
  --color-surface: var(--band-dark-surface);
  --color-text: var(--band-dark-text);
  --color-text-muted: var(--band-dark-text-muted);
  --color-border: var(--band-dark-border);
  background: var(--color-bg);
  color: var(--color-text);
}
.band { padding-block: var(--space-7); }

/* ---- Site chrome ---- */
.site-header, .site-footer { width: 100%; padding-block: var(--space-4); }
.site-header > .container {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: var(--space-4);
}
.site-brand { color: var(--color-text); font-family: var(--font-heading); font-weight: var(--weight-heading); }
.site-brand:hover { text-decoration: none; }
.site-nav ul {
  display: flex; flex-wrap: wrap; gap: var(--space-5);
  list-style: none; margin: 0; padding: 0;
}
.site-nav a {
  display: inline-block;
  padding-block: var(--space-1);
  border-bottom: 2px solid transparent;
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  text-decoration: none;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--color-accent); text-decoration: none; }
.site-nav a.is-active, .site-nav a[aria-current="page"] {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}
.site-footer {
  margin-top: var(--space-8);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.site-footer > .container {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4);
}

/* ---- Hero ---- */
.hero { position: relative; isolation: isolate; padding-block: var(--space-8); overflow: hidden; }
.hero__media { position: absolute; inset: 0; z-index: -1; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
/* Dark band color at 90% on the text side, clear on the image side */
.hero__media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--band-dark-bg) 90%, transparent) 0%,
    color-mix(in srgb, var(--band-dark-bg) 70%, transparent) 45%,
    transparent 100%);
}
.hero__content { width: 100%; }
.hero h1 { font-size: clamp(var(--text-2xl), 5vw, 3.5rem); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-5); }
@media (min-width: 48em) { .hero__content { max-width: 60%; } }

/* ---- Section heading, eyebrow ---- */
.section-heading {
  display: flex; align-items: center; gap: var(--space-3);
  color: var(--color-accent);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-heading-sm);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
.section-heading::after { content: ""; width: 2.5rem; height: 2px; background: var(--color-accent); }
.eyebrow {
  color: var(--color-accent);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

/* ---- Cards ---- */
.card {
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}
.card__media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card__body { padding: var(--space-4); }
.card__title {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-heading-sm);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
.card__link, .chevron-link {
  display: inline-block;
  color: var(--color-accent);
  font-size: var(--text-sm);
  font-weight: var(--weight-heading-sm);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
.card__link::after, .chevron-link::after { content: "\203A"; margin-left: var(--space-2); }

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

/* ---- Legal pages ---- */
.legal { max-width: 42rem; }
.legal h1 { margin-bottom: var(--space-2); }
.legal__meta { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: var(--space-6); }
.legal h2 { font-size: var(--text-xl); margin-top: var(--space-6); margin-bottom: var(--space-2); }
.legal p { margin-bottom: var(--space-4); }
.placeholder { background: var(--color-accent); color: var(--color-accent-contrast); padding: 0 var(--space-1); }
