/* ===========================================================
   Bas: reset, typografi, tillgänglighet
   =========================================================== */

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

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

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

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

a { color: inherit; text-decoration: none; }

ul, ol { margin: 0; padding: 0; list-style: none; }

button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }

input, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--text-strong);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); letter-spacing: var(--tracking-display); }
h2 { font-size: var(--fs-h2); letter-spacing: -0.015em; }
h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); letter-spacing: -0.01em; }
h4 { font-size: var(--fs-h4); line-height: var(--lh-snug); }

p { text-wrap: pretty; }

strong, b { font-weight: 600; color: var(--text-strong); }

/* Accentord i rubriker — solid färg, ingen gradient */
.accent-word { color: var(--accent); }

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

/* Fokusmarkering — synlig för tangentbord, aldrig borttagen */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Ankarlänkar ska inte hamna under den klistrade headern */
[id] { scroll-margin-top: calc(var(--header-h) + var(--space-6)); }

/* Hoppa till innehåll — första tabbstoppet */
.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 200;
  padding: var(--space-3) var(--space-5);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform var(--transition);
}
.skip-link:focus-visible { transform: translateY(0); }

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

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