/* ============================================================
   Grund: återställning, typografi och sidlayout.
   ============================================================ */

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--step-0) / 1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

body > main, .page { flex: 1 0 auto; }

img, svg, video { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

h1, h2, h3, h4 {
  margin: 0 0 var(--s-3);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); letter-spacing: -0.02em; }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 var(--s-3); }
p, li { text-wrap: pretty; }
small { font-size: var(--step--1); }

a { color: var(--primary); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }

::selection { background: var(--highlight); color: var(--on-highlight); }

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

.skip-link {
  position: absolute; left: var(--s-4); top: -100px; z-index: 200;
  background: var(--surface); color: var(--text); padding: var(--s-2) var(--s-4);
  border-radius: var(--r-sm); box-shadow: var(--shadow-2);
}
.skip-link:focus { top: var(--s-3); }

/* Sidbredd */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--s-4);
}
.page { padding-block: var(--s-6) var(--s-7); }
.page--narrow { max-width: 760px; }

/* Sidrubrik */
.page-head { margin-bottom: var(--s-5); }
.page-head h1 { margin-bottom: var(--s-2); }
.page-head .lead { color: var(--muted); font-size: var(--step-1); line-height: 1.45; max-width: 46ch; margin: 0; }

/* Överstrykning med logotypens gula, som en penna över texten */
.mark, mark {
  color: inherit;
  background: linear-gradient(to bottom, transparent 52%, var(--highlight-soft) 52%, var(--highlight-soft) 90%, transparent 90%);
  padding: 0 0.08em;
  border-radius: 2px;
}
:root[data-theme="dark"] .mark, :root[data-theme="dark"] mark {
  background: linear-gradient(to bottom, transparent 52%, rgb(255 201 60 / 0.38) 52%, rgb(255 201 60 / 0.38) 90%, transparent 90%);
}

.muted { color: var(--muted); }
.read { font-family: var(--font-read); }

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

@media (min-width: 720px) {
  .container { padding-inline: var(--s-5); }
}

/* ============================================================
   Utskrift: svart på vitt, inga menyer eller knappar.
   ============================================================ */
@media print {
  :root, :root[data-theme="dark"] {
    color-scheme: light;
    --bg: #fff; --surface: #fff; --surface-2: #f2f2f2; --text: #000; --muted: #444;
    --line: #bbb; --line-strong: #888; --primary: #000; --primary-soft: #eee; --on-primary: #fff;
    --ok: #000; --ok-soft: #fff; --bad: #000; --bad-soft: #fff; --highlight-soft: #ddd;
    --shadow-1: none; --shadow-2: none;
  }
  body { font-size: 11pt; background: #fff; }
  .site-header, .site-footer, .toasts, .no-print, .skip-link { display: none !important; }
  a { color: inherit; text-decoration: none; }
  .page { padding: 0; }
  h1, h2, h3 { break-after: avoid; }
}
