:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #4b5563;
  --primary: #1d4ed8;
  --primary-soft: #dbeafe;
  --accent: #0f766e;
  --accent-soft: #ccfbf1;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --border: #d1d5db;
  --radius: 12px;
  --shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  --max-width: 920px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.65;
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 2.5vw, 2rem);
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin-top: 1.6em;
  margin-bottom: 0.55em;
  letter-spacing: 0.01em;
}

h1 {
  margin-top: 0.2em;
  font-size: clamp(1.8rem, 4.2vw, 2.4rem);
  color: #0b2a6f;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  color: #17398a;
}

h3 {
  font-size: clamp(1.1rem, 2.3vw, 1.35rem);
  color: #1e3a8a;
}

p {
  margin: 0 0 1rem;
  max-width: 72ch;
}

.lead {
  font-size: 1.12rem;
  color: #243447;
}

.ingress {
  padding: 0.95rem 1rem;
  background: #eff6ff;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  color: #1e3a8a;
}

ul,
ol {
  margin: 0.4rem 0 1rem 1.2rem;
  padding: 0;
}

li {
  margin: 0.3rem 0;
}

a {
  color: var(--primary);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover,
a:focus-visible {
  color: #1e40af;
  text-decoration-thickness: 0.14em;
}

/* Brukes til hoveddelen av saktekst-eksempler */
.example-text {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}

.example-text p + p {
  margin-top: 0.95rem;
}

/* Marker ett avsnitt for forklaring eller analyse */
.example-text .highlight {
  background: #fff7ed;
  border-left: 4px solid #ea580c;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
}

.tips,
.task,
.remember,
.definition {
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin: 1rem 0;
  border: 1px solid transparent;
}

.tips {
  background: var(--accent-soft);
  border-color: #5eead4;
}

.task {
  background: var(--primary-soft);
  border-color: #93c5fd;
}

.remember {
  background: var(--warning-soft);
  border-color: #fcd34d;
}

.definition {
  background: #eef2ff;
  border-color: #a5b4fc;
}

.tips h3,
.task h3,
.remember h3,
.definition h3 {
  margin-top: 0;
}

.meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.small {
  font-size: 0.92rem;
}

.center {
  text-align: center;
}

.mt-0 {
  margin-top: 0;
}

.mb-0 {
  margin-bottom: 0;
}

/* Fokusmarkering for tastaturnavigasjon */
:focus-visible {
  outline: 3px solid #60a5fa;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Enkel tabellstil for f.eks. avsnittstyper */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: #ffffff;
}

th,
td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: #eff6ff;
}

.exercise {
  margin-top: 2rem;
  padding-top: 0.5rem;
}

.exercise-form {
  display: grid;
  gap: 0.8rem;
}

.exercise-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem;
  background: #ffffff;
}

.exercise-item label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 500;
}

.exercise-item select {
  width: 100%;
  max-width: 320px;
  padding: 0.45rem 0.55rem;
  border: 1px solid #9ca3af;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.exercise-item.correct {
  background: #ecfdf3;
  border-color: #22c55e;
}

.exercise-item.incorrect {
  background: #fef2f2;
  border-color: #f87171;
}

.exercise-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary);
  color: #ffffff;
}

button:hover {
  background: #1e40af;
}

button.secondary {
  background: #e5e7eb;
  color: #111827;
  border-color: #d1d5db;
}

button.secondary:hover {
  background: #d1d5db;
}

@media (max-width: 720px) {
  .page {
    padding: 1rem 0.8rem 2rem;
  }

  .content-card {
    padding: 1rem;
    border-radius: 10px;
  }

  p,
  li {
    line-height: 1.7;
  }

  .exercise-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}
