/* =============================================================================
   base.css — reset + grunnstil for HTML-elementer
   Leser kun fra tokens.css. Ingen rå verdier her.
========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-feature-settings: "ss01", "cv05";
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-base);
  font-weight: var(--weight-regular);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}

/* Typografisk rytme ------------------------------------------------------- */
h1, h2, h3, h4 {
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { text-wrap: pretty; }

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

small { font-size: var(--text-xs); }

/* Tall som skal stå rett under hverandre (priser, antall, ordrenr). */
.tnum,
.price,
td.num, th.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/* Mono-rolle: SKU, ordrenummer, koder. */
.mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1, "zero" 1;
  letter-spacing: 0;
}

/* Liten versal-etikett — brukt som strukturmarkør, ikke pynt. */
.eyebrow {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--ink-subtle);
}

/* Skjema-elementer arver font (ellers blir de fremmede). */
input, button, select, textarea { font: inherit; color: inherit; }

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

hr {
  border: 0;
  border-top: var(--hairline) solid var(--line);
}

/* Fokus — synlig, konsekvent, aldri fjernet uten erstatning. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--accent-weak); color: var(--accent-hover); }

::placeholder { color: var(--ink-faint); }

/* Hjelpeklasser brukt av flere skjermer ---------------------------------- */
.u-muted   { color: var(--ink-muted); }
.u-subtle  { color: var(--ink-subtle); }
.u-right   { text-align: right; }
.u-center  { text-align: center; }
.u-nowrap  { white-space: nowrap; }
.u-hairline-t { border-top: var(--hairline) solid var(--line); }
.u-hairline-b { border-bottom: var(--hairline) solid var(--line); }

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

.container {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
@media (max-width: 640px) {
  .container { padding-inline: var(--space-5); }
}

.stack > * + * { margin-top: var(--space-5); }
.stack-sm > * + * { margin-top: var(--space-3); }
.stack-lg > * + * { margin-top: var(--space-7); }
