/* Flomutredning.no -- shared foundation stylesheet.
   Distinct from skredgrunn.no's commercial layout: single-column,
   long-form reading design with a teal accent instead of skredgrunn's
   blue, and no hero/service-card patterns. Shares the same broad
   typography family (Space Grotesk / Public Sans) as a brand-family cue. */

:root {
  --ink: #16232C;
  --ink-soft: #45525C;
  --muted: #5A6570;
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --border: rgba(22,35,44,0.12);
  --accent: #0E7C74;
  --accent-dark: #0A5F59;
  --accent-tint: rgba(14,124,116,0.08);
  --focus-ring: #0A5F59;
  --radius: 12px;
  --content-width: 720px;
  --wide-width: 1080px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.7;
}

h1, h2, h3 {
  font-family: 'Space Grotesk', 'Public Sans', sans-serif;
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 0.6em;
}

h1 { font-size: 32px; font-weight: 700; }
h2 { font-size: 23px; font-weight: 700; margin-top: 1.8em; }
h3 { font-size: 18px; font-weight: 600; margin-top: 1.4em; }

p { margin: 0 0 1.1em; overflow-wrap: break-word; }

a { color: var(--accent-dark); text-decoration-color: rgba(10,95,89,0.35); }
a:hover { color: var(--accent); }
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.4em; }

/* Skip link -- visually hidden until keyboard-focused */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  z-index: 200;
  border-radius: 0 0 8px 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Header / navigation ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.header-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}
.wordmark {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--accent-dark); }
.wordmark-dot { color: var(--accent); }

.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  position: relative;
}
.nav-toggle-bars::before { position: absolute; top: -6px; }
.nav-toggle-bars::after { position: absolute; top: 6px; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.site-nav a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
}
.site-nav a:hover { background: var(--accent-tint); color: var(--accent-dark); }
.site-nav a[aria-current="page"] {
  color: var(--accent-dark);
  background: var(--accent-tint);
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 18px;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 2px; }
  .site-nav a { padding: 12px 10px; font-size: 16px; }
}

/* ---------- Layout wrappers ---------- */
.wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 40px 24px 64px;
}
.wrap-wide {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 40px 24px 64px;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 22px;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-dark); }
.breadcrumb [aria-current="page"] { color: var(--ink-soft); }

/* ---------- Dev-status callout ---------- */
.dev-status {
  background: var(--accent-tint);
  border: 1px solid rgba(14,124,116,0.25);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 15px;
  color: var(--ink-soft);
  margin: 20px 0 32px;
}
.dev-status strong { color: var(--accent-dark); }

/* ---------- Topic cards (homepage only) ---------- */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 8px 0 32px;
}
.topic-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.topic-card:hover { border-color: var(--accent); }
.topic-card-thumb {
  width: 100%;
  height: 128px;
  object-fit: cover;
  display: block;
}
.topic-card-body {
  padding: 18px 22px 20px;
}
.topic-card-body h3 {
  margin: 0 0 6px;
  font-size: 16.5px;
  color: var(--ink);
}
.topic-card-body p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}
@media (max-width: 640px) {
  .topic-grid { grid-template-columns: 1fr; }
}

/* ---------- Page figures (topic-page technical illustrations) ---------- */
figure.figure {
  margin: 24px 0 32px;
}
.figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.figure figcaption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* ---------- Two-column compare block (e.g. "kartet viser / viser ikke") ---------- */
.compare-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0 28px;
}
.compare-cols > div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.compare-cols h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.compare-cols ul {
  margin: 0;
  padding-left: 1.1em;
  font-size: 14.5px;
}
.compare-cols li { margin-bottom: 6px; }
@media (max-width: 640px) {
  .compare-cols { grid-template-columns: 1fr; }
}

/* ---------- Skredgrunn ownership logo (footer + /om/) ---------- */
.footer-logo {
  height: 20px;
  width: auto;
  display: block;
  margin-bottom: 10px;
}
.about-logo {
  height: 38px;
  width: auto;
  display: block;
  margin-bottom: 18px;
}

/* ---------- Restrained CTA / contextual link line ---------- */
.contextual-link {
  font-size: 15px;
  color: var(--ink-soft);
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 32px;
}

/* ---------- Content tables ---------- */
.table-wrap {
  overflow-x: auto;
  margin: 20px 0 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  min-width: 480px;
}
.data-table caption {
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 16px 8px;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table thead th {
  background: var(--bg);
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}
.data-table tbody tr:last-child td { border-bottom: none; }

/* ---------- Checklist ---------- */
ul.checklist {
  list-style: none;
  padding: 0;
  margin: 20px 0 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
ul.checklist li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  margin: 0;
}
ul.checklist li::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 5px;
  border: 1.5px solid var(--accent);
  background: var(--accent-tint);
}

/* ---------- Callout (common misunderstanding, etc.) ---------- */
.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 20px 0 28px;
}
.callout p:last-child { margin-bottom: 0; }
.callout-label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 8px;
}

/* ---------- Decision tree ---------- */
.decision-tree {
  margin: 20px 0 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.decision-tree .question {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
}
.decision-tree .question > strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
}
.decision-tree .branch {
  display: flex;
  gap: 8px;
  padding: 6px 0 6px 18px;
  font-size: 14.5px;
  color: var(--ink-soft);
  border-left: 2px solid var(--border);
  margin-left: 4px;
}
.decision-tree .branch-arrow {
  flex: none;
  color: var(--accent);
  font-weight: 700;
}

/* ---------- Step timeline ---------- */
ol.step-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 28px;
  counter-reset: step;
}
ol.step-list li {
  counter-increment: step;
  position: relative;
  padding: 0 0 20px 40px;
  border-left: 2px solid var(--border);
  margin-left: 15px;
}
ol.step-list li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}
ol.step-list li::before {
  content: counter(step);
  position: absolute;
  left: -15px;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
ol.step-list .step-title {
  font-weight: 700;
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
}
ol.step-list .step-note {
  font-size: 13.5px;
  color: var(--muted);
  font-style: italic;
}

/* ---------- Small inline status badge (e.g. on homepage cards) ---------- */
.badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: var(--accent-tint);
  border-radius: 5px;
  padding: 2px 7px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 28px 24px 32px;
}
.footer-disclosure {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 12px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.footer-links a {
  font-size: 13.5px;
  color: var(--ink-soft);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Print (light touch) ---------- */
@media print {
  .site-header, .site-footer, .skip-link { display: none; }
}
