/* krifak.no – felles stil for forsiden og de juridiske sidene.
   Fargene er appens «Lys ro»-palett (src/theme.ts). Mørk modus følger telefonen. */

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

:root {
  color-scheme: light dark;
  --bg:     #FAF7F2;
  --card:   #FFFCF8;
  --ink:    #191817;
  --sub:    #716B65;
  --line:   #E5DED4;
  --accent: #C95016;
  --link:   #B74612;
  --green:  #34744A;
  --soft:   #FBE0CA;
  --soft-ink: #5E2A0E;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:     #1B1917;
    --card:   #25211E;
    --ink:    #F8F3EC;
    --sub:    #C1B5A9;
    --line:   #493F36;
    --accent: #F7B183;
    --link:   #F7B183;
    --green:  #8ACA98;
    --soft:   #3A2A20;
    --soft-ink: #F8F3EC;
  }
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ── Topp ── */
.site-header {
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  max-width: 760px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.2px;
}
.brand img { width: 28px; height: 28px; border-radius: 7px; display: block; box-shadow: 0 0 0 1px var(--line); }
.brand:hover { text-decoration: none; }

/* ── Innhold ── */
.page { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 48px 20px 80px; }

h1 { font-size: clamp(30px, 6vw, 40px); font-weight: 750; letter-spacing: -0.8px; line-height: 1.12; }
.meta { margin-top: 10px; font-size: 15px; color: var(--sub); }

.toc {
  margin: 32px 0 36px; padding: 20px 22px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
}
.toc-title { font-size: 14px; font-weight: 650; color: var(--sub); margin-bottom: 8px; }
.toc ol { padding-left: 22px; }
.toc li { margin: 4px 0; font-size: 16px; }

.doc-section { scroll-margin-top: 24px; margin-bottom: 36px; }
.doc-section h2 {
  font-size: 21px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.3;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.doc-section h3 { font-size: 17px; font-weight: 650; margin: 22px 0 6px; }
.doc-section p { margin-bottom: 12px; }
.doc-section ul, .doc-section ol { margin: 0 0 14px 22px; }
.doc-section li { margin-bottom: 6px; }
.doc-section strong { font-weight: 650; }

.doc-section table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 15.5px; }
.doc-section th, .doc-section td {
  text-align: left; vertical-align: top; padding: 9px 10px;
  border-bottom: 1px solid var(--line); overflow-wrap: break-word;
}
.doc-section th { font-weight: 650; }

.highlight-box {
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--green);
  border-radius: 12px; padding: 18px 20px; margin: 28px 0 32px;
}
.warning-box {
  background: var(--soft); color: var(--soft-ink);
  border-radius: 12px; padding: 18px 20px; margin: 0 0 18px;
}
.highlight-box p, .warning-box p { margin-bottom: 10px; }
.highlight-box p:last-child, .warning-box p:last-child { margin-bottom: 0; }

.muted { color: var(--sub); font-size: 15px; }

/* ── Forsiden ── */
.home { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 64px 20px 72px; }
.home-block + .home-block { margin-top: 36px; padding-top: 36px; border-top: 1px solid var(--line); }
.home-icon { width: 80px; height: 80px; border-radius: 18px; display: block; margin-bottom: 22px; box-shadow: 0 0 0 1px var(--line); }
.home h1 { font-size: clamp(36px, 9vw, 48px); letter-spacing: -1px; }
.tagline { margin-top: 10px; font-size: 19px; line-height: 1.45; color: var(--sub); }
.home p + p { margin-top: 12px; }
.status { font-weight: 650; }
.links { list-style: none; }
.links li { margin: 6px 0; }
.links-other { margin-top: 16px; font-size: 15.5px; color: var(--sub); }
.links-other p + p { margin-top: 4px; }

/* ── Bunn ── */
.site-footer { border-top: 1px solid var(--line); }
.site-footer p {
  max-width: 760px; margin: 0 auto; padding: 24px 20px 32px;
  font-size: 14.5px; color: var(--sub); text-align: center;
}
.site-footer a { color: var(--sub); }

@media (max-width: 640px) {
  .doc-section table { font-size: 14px; }
  .doc-section th, .doc-section td { padding: 8px 6px; }
}

@media print {
  .site-header, .site-footer, .toc { display: none; }
  .page { padding: 0; }
  a { color: inherit; }
}
