/* Färger. Mörkt läge följer besökarens systeminställning. */
:root {
  color-scheme: light dark;
  --bakgrund: #ffffff;
  --yta: #f3f6f4;
  --text: #17211c;
  --dampad: #55635c;
  --linje: #d5ddd8;
  --accent: #0b6e4f;
  --accent-text: #ffffff;
  --markering: #e2f3eb;
  /* Introt på startsidan har varumärkets mörka färg i både ljust och mörkt läge.
     De här tre får därför inte ändras i blocket för mörkt läge nedan. */
  --intro-bakgrund: #0b1f33;
  --intro-huvudrad: #ffffff;
  --intro-underrad: #a9bdd3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bakgrund: #111614;
    --yta: #1a211e;
    --text: #e8eeea;
    --dampad: #a3b0a9;
    --linje: #303a35;
    --accent: #5fd0a3;
    --accent-text: #0c1a14;
    --markering: #1d3329;
  }
}

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

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

body {
  margin: 0;
  background: var(--bakgrund);
  color: var(--text);
  /* Systemets egna typsnitt: inget laddas från någon annan server. */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.ram {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1rem;
}

h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.9rem, 6vw, 2.75rem);
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.4rem, 4vw, 1.75rem);
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 1.125rem;
  margin: 1.5rem 0 0.25rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

li {
  margin-bottom: 0.35rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.hoppa {
  position: absolute;
  left: -999rem;
}

.hoppa:focus {
  left: 1rem;
  top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--bakgrund);
  z-index: 1;
}

/* Sidhuvud och sidfot */

.sidhuvud {
  border-bottom: 1px solid var(--linje);
}

.sidhuvud-rad {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.logotyp {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
}

/* Dagens logotyp har vit bakgrund. Hörnen rundas så att den ser avsiktlig ut i
   mörkt läge. Med en genomskinlig logotyp syns rundningen inte. */
.logotyp img {
  display: block;
  height: 3.25rem;
  width: auto;
  border-radius: 0.5rem;
}

.sidhuvud ul,
.sidfot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidhuvud li,
.sidfot li {
  margin: 0;
}

.sidfot {
  border-top: 1px solid var(--linje);
  padding: 2rem 0;
  color: var(--dampad);
  font-size: 0.9375rem;
}

.sidfot p {
  margin: 1rem 0 0;
}

/* Sektioner */

section {
  padding: 3rem 0;
}

.tonad {
  background: var(--yta);
}

.intro {
  padding: clamp(2.5rem, 9vw, 4.5rem) 0;
  background: var(--intro-bakgrund);
}

.intro h1 {
  margin: 0;
  color: var(--intro-huvudrad);
  font-size: clamp(2.1rem, 9vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.underrad {
  margin: 0.75rem 0 0;
  color: var(--intro-underrad);
  font-size: clamp(1.2rem, 4.5vw, 1.75rem);
  font-weight: 500;
  line-height: 1.3;
}

.hjalte {
  padding: 2.5rem 0 3rem;
}

.lofte {
  font-size: clamp(1.3rem, 4vw, 1.6rem);
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
}

.text {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.text h2 {
  margin-top: 2.25rem;
}

.ingress {
  font-size: 1.2rem;
  color: var(--dampad);
}

.finstilt {
  font-size: 0.9375rem;
  color: var(--dampad);
}

.knapp {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  border: 0;
  border-radius: 0.5rem;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.knapp:hover {
  filter: brightness(1.1);
}

/* Exemplet med assistentens svar */

.exempel {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid var(--linje);
  border-radius: 0.75rem;
  background: var(--yta);
}

/* Märkningen av ett exempel som är påhittat. */
.exempelmarke {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dampad);
}

.replik {
  margin: 0;
  padding: 0.6rem 0.9rem;
  border-radius: 0.6rem;
}

.replik.svar {
  margin-top: 0.5rem;
  background: var(--bakgrund);
  border: 1px solid var(--linje);
}

/* Stegen i "Så fungerar det" */

.steg {
  list-style: none;
  padding: 0;
  counter-reset: steg;
}

.steg li {
  counter-increment: steg;
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.25rem;
}

.steg li::before {
  content: counter(steg);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  text-align: center;
  line-height: 2rem;
}

.steg h3 {
  margin-top: 0;
}

/* Tabell. På smala skärmar rullar tabellen i sidled i stället för hela sidan. */

.tabellram {
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--linje);
  border-radius: 0.75rem;
  background: var(--bakgrund);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  white-space: nowrap;
}

caption {
  caption-side: bottom;
  padding: 0.6rem 0.9rem;
  color: var(--dampad);
  text-align: left;
  white-space: normal;
}

th,
td {
  padding: 0.6rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--linje);
}

thead th {
  color: var(--dampad);
  font-weight: 600;
}

/* Tabeller med längre text i cellerna får bryta rader. */
table.bryt {
  white-space: normal;
}

table.bryt td,
table.bryt th {
  vertical-align: top;
  min-width: 8rem;
}

.tal {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.billigast {
  background: var(--markering);
}

.ej-kopbar {
  color: var(--dampad);
}

.ej-kopbar .tal {
  text-decoration: line-through;
}

tbody tr:last-child > * {
  border-bottom: 0;
}
