/* ═══════════════════════════════════════════════════════════
   treigtnett.no — style.css
   Brand-vars (--c-*) injiseres fra config via header.php.
   Lyst tema som standard; mørkt tema via [data-theme="dark"].
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* ── Tema-tokens ─────────────────────────────────────────── */
:root, [data-theme="light"] {
  --bg:        var(--c-light);
  --bg-2:      #EBEFF5;
  --surface:   #ffffff;
  --surface-2: #F0F3F8;
  --text:      #1E2735;
  --text-muted:#5A6678;
  --heading:   #0F172A;
  --border:    #DDE3EC;
  --border-2:  #C8D1DE;
  --link:      var(--c-primary);
  --link-hover:var(--c-primary-d);
  --shadow:    0 6px 24px rgba(15,23,42,.08);
  --shadow-sm: 0 2px 10px rgba(15,23,42,.06);
  --radius:    12px;
  --radius-lg: 20px;
  --transition:.2s ease;
  --header-bg: rgba(246,248,251,.88);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg:        var(--c-dark);
  --bg-2:      #16202F;
  --surface:   #1B2638;
  --surface-2: #233044;
  --text:      #E4E9F1;
  --text-muted:#9AA6B8;
  --heading:   #ffffff;
  --border:    rgba(255,255,255,.10);
  --border-2:  rgba(255,255,255,.16);
  --link:      #6FA3FA;
  --link-hover:#93BAFB;
  --shadow:    0 6px 24px rgba(0,0,0,.35);
  --shadow-sm: 0 2px 10px rgba(0,0,0,.25);
  --header-bg: rgba(15,23,42,.85);
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

/* ── Typografi ───────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; color: var(--heading); letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.45rem, 3.4vw, 2rem); }
h3 { font-size: 1.2rem; }
p  { color: var(--text); }
a  { color: var(--link); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--link-hover); }
strong, b { font-weight: 700; color: var(--heading); }
img, svg { max-width: 100%; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--c-primary); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ── Layout ──────────────────────────────────────────────── */
.container  { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; }
.section    { padding: 60px 0; }
.section-sm { padding: 36px 0; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--heading); }
.logo:hover { color: var(--heading); }
.logo-tile { display: inline-flex; line-height: 0; filter: drop-shadow(0 3px 8px rgba(26,86,219,.35)); }
.logo-mark { display: block; border-radius: 9px; }
.logo-word { font-family: var(--font-heading); font-weight: 700; font-size: 1.2rem; letter-spacing: -.02em; }
.logo-dot  { color: var(--c-accent); }

.main-nav ul { list-style: none; display: flex; gap: 2px; flex-wrap: wrap; }
.main-nav a {
  display: block; color: var(--text); font-size: .92rem; font-weight: 500;
  padding: 8px 12px; border-radius: 9px; transition: var(--transition);
}
.main-nav a:hover, .main-nav a.active { background: var(--surface-2); color: var(--heading); }

.header-actions { display: flex; align-items: center; gap: 6px; }
.theme-toggle, .nav-toggle {
  background: var(--surface-2); border: 1px solid var(--border); cursor: pointer;
  border-radius: 10px; width: 40px; height: 40px; display: inline-flex;
  align-items: center; justify-content: center; transition: var(--transition);
}
.theme-toggle:hover, .nav-toggle:hover { border-color: var(--border-2); }
.theme-toggle { font-size: 1.05rem; line-height: 1; }
.theme-icon { display: none; }
[data-theme="light"] .theme-icon-dark { display: inline; }
[data-theme="dark"] .theme-icon-light { display: inline; }
.nav-toggle { flex-direction: column; gap: 4px; display: none; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; }

/* ── Brødsmuler ──────────────────────────────────────────── */
.breadcrumb { background: var(--bg-2); border-bottom: 1px solid var(--border); font-size: .82rem; }
.breadcrumb .container { padding-top: 11px; padding-bottom: 11px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--link); }
.breadcrumb .sep { color: var(--text-muted); margin: 0 8px; }
.breadcrumb span[aria-current] { color: var(--text); font-weight: 600; }

/* ── Knapper ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-heading); font-weight: 600; font-size: .95rem;
  padding: 12px 22px; border-radius: 11px; border: 1px solid transparent;
  cursor: pointer; transition: var(--transition); line-height: 1.2;
}
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn-primary { background: linear-gradient(135deg, var(--c-accent), var(--c-primary)); color: #fff; box-shadow: 0 4px 14px rgba(26,86,219,.35); }
.btn-primary:hover { background: linear-gradient(135deg, var(--c-primary), var(--c-primary-d)); color: #fff; }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-2); color: var(--heading); }
.btn[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; }

/* ── Hero (forside) ──────────────────────────────────────── */
.hero { position: relative; overflow: hidden; padding: 76px 0 64px; text-align: center; }
.hero h1 { margin-bottom: 18px; }
.hero h1 .grad { background: linear-gradient(120deg, var(--c-primary), var(--c-fresh)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-lead { font-size: 1.12rem; color: var(--text-muted); max-width: 640px; margin: 0 auto 26px; }
.hero-eyebrow {
  display: inline-block; font-family: var(--font-heading); font-weight: 600;
  font-size: .78rem; text-transform: uppercase; letter-spacing: .14em;
  color: var(--link); background: var(--surface-2); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Side-hero (hub/artikkel/verktøy) ────────────────────── */
.page-hero { position: relative; overflow: hidden; padding: 48px 0 40px; border-bottom: 1px solid var(--border); }
.page-hero .tag { margin-bottom: 14px; }
.page-hero h1 { margin-bottom: 10px; }
.page-hero .lead { color: var(--text-muted); font-size: 1.08rem; max-width: 680px; }
.byline { margin-top: 14px; font-size: .88rem; color: var(--text-muted); }
.byline-author { font-weight: 600; color: var(--text); }

/* ── Seksjonshoder ───────────────────────────────────────── */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }
.section-head h2 { margin-bottom: 4px; }
.section-sub { color: var(--text-muted); margin-bottom: 26px; max-width: 640px; }

/* ── Tags ────────────────────────────────────────────────── */
.tag {
  display: inline-block; font-family: var(--font-heading); font-weight: 600;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .1em;
  padding: 4px 11px; border-radius: 999px; border: 1px solid;
}
.tag--primary { color: var(--c-primary); background: rgba(26,86,219,.10);  border-color: rgba(26,86,219,.30); }
.tag--accent  { color: #2563EB;          background: rgba(63,131,248,.12); border-color: rgba(63,131,248,.32); }
.tag--energy  { color: #B45309;          background: rgba(217,119,6,.12);  border-color: rgba(217,119,6,.32); }
.tag--fresh   { color: #047857;          background: rgba(14,159,110,.12); border-color: rgba(14,159,110,.32); }
[data-theme="dark"] .tag--primary { color: #93BAFB; }
[data-theme="dark"] .tag--accent  { color: #93BAFB; }
[data-theme="dark"] .tag--energy  { color: #FBBF6E; }
[data-theme="dark"] .tag--fresh   { color: #5FD0A7; }

/* ── Kategorikort (forside) ──────────────────────────────── */
.kat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.kat-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm); transition: var(--transition);
  border-top: 4px solid var(--border-2); color: var(--text);
}
.kat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-2); color: var(--text); }
.kat-card--primary { border-top-color: var(--c-primary); }
.kat-card--accent  { border-top-color: var(--c-accent); }
.kat-card--energy  { border-top-color: var(--c-energy); }
.kat-card--fresh   { border-top-color: var(--c-fresh); }
.kat-card h3 { font-size: 1.15rem; }
.kat-card p { font-size: .92rem; color: var(--text-muted); }
.kat-card-foot { margin-top: auto; padding-top: 6px; }
.kat-card-go   { font-size: .85rem; font-weight: 600; color: var(--link); }
.kat-card-soon { font-size: .8rem; font-weight: 600; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); padding: 3px 10px; border-radius: 999px; }
.kat-card.is-soon, .tool-card.is-soon { opacity: .72; cursor: default; }
.kat-card.is-soon:hover, .tool-card.is-soon:hover { transform: none; box-shadow: var(--shadow-sm); }

/* ── Verktøykort ─────────────────────────────────────────── */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.tool-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm); transition: var(--transition); color: var(--text);
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--text); }
.tool-card .tag { align-self: flex-start; }
.tool-card h3 { font-size: 1.12rem; }
.tool-card p { font-size: .92rem; color: var(--text-muted); }
.tool-card-go { margin-top: auto; padding-top: 6px; font-size: .85rem; font-weight: 600; color: var(--link); }

/* ── Artikkelkort (hub-lister) ───────────────────────────── */
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.art-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow-sm); transition: var(--transition); color: var(--text);
}
.art-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text); }
.art-card h3 { font-size: 1.05rem; }
.art-card p { font-size: .9rem; color: var(--text-muted); }
.art-card-meta { margin-top: auto; font-size: .78rem; color: var(--text-muted); }

/* ── Tom-tilstand (hubs uten artikler) ───────────────────── */
.empty-state {
  text-align: center; padding: 48px 24px; margin: 24px 0;
  background: var(--surface); border: 1px dashed var(--border-2); border-radius: var(--radius-lg);
}
.empty-state h2 { margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); }

/* ── Brødtekst ───────────────────────────────────────────── */
.prose { max-width: 760px; }
.prose h2 { margin: 40px 0 14px; padding-top: 8px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 26px 0 10px; }
.prose p { margin-bottom: 16px; font-size: 1.04rem; line-height: 1.75; }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 0 0 16px 22px; }
.prose li { margin-bottom: 8px; }
.content-block { padding: 36px 0; border-bottom: 1px solid var(--border); }
.content-block:last-child { border-bottom: none; }

/* Lister og tabeller (til innholdsrundene) */
.tips-list { list-style: none; margin-left: 0 !important; }
.tips-list li { padding-left: 26px; position: relative; }
.tips-list li::before { content: '✓'; position: absolute; left: 0; color: var(--c-fresh); font-weight: 700; }
.num-list { margin-left: 22px; }
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--border); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: .95rem; background: var(--surface); }
.data-table th { text-align: left; font-family: var(--font-heading); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); background: var(--surface-2); }
.data-table th, .data-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }

/* Steg-liste (feilsøkingstrinn — innhold kommer fra Chat) */
.steps { list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.steps li {
  counter-increment: step; position: relative; padding: 18px 20px 18px 64px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.steps li::before {
  content: counter(step); position: absolute; left: 18px; top: 16px;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--c-accent), var(--c-primary)); color: #fff;
  font-family: var(--font-heading); font-weight: 700; font-size: .9rem; border-radius: 9px;
}

/* Callout */
.callout { max-width: 760px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--c-accent); border-radius: var(--radius); padding: 22px 24px; margin: 24px 0; }
.callout h2 { font-size: 1.2rem; margin-bottom: 8px; }
.callout p { color: var(--text-muted); margin-bottom: 10px; }
.callout-links { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.callout-links a { font-weight: 600; }

/* Artikkelbilde med kreditering (art_figure() i functions.php) */
.art-figure { max-width: 760px; margin: 0 0 28px; }
.art-figure img {
  display: block; width: 100%; height: auto;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-2);
}
.art-figure figcaption {
  margin-top: 8px; font-size: .82rem; color: var(--text-muted);
}
.art-figure figcaption a { color: inherit; text-decoration: underline; }
.art-figure figcaption a:hover { color: var(--c-primary); }

/* Plassholder-markør (fjernes etter hvert som innhold fylles inn) */
.placeholder-note { color: var(--text-muted); font-style: italic; }

/* ── Verktøypanel ────────────────────────────────────────── */
.tool-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-sm); margin-bottom: 28px;
}
.tool-panel-title { font-size: 1.3rem; margin-bottom: 18px; }
.tool-form { display: flex; flex-direction: column; gap: 16px; }
.tool-field { display: flex; flex-direction: column; gap: 6px; }
.tool-field label { font-weight: 600; font-size: .92rem; color: var(--heading); }
.tool-field input, .tool-field select {
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border-2); border-radius: 10px; padding: 11px 14px;
}
.tool-field input:focus, .tool-field select:focus { outline: 2px solid var(--c-accent); outline-offset: 1px; }
.tool-form .btn { align-self: flex-start; margin-top: 4px; }
.tool-result { margin-top: 20px; padding: 18px 20px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.tool-panel .placeholder-note { margin-top: 14px; font-size: .85rem; }

/* Hastighetstest-tolk: resultatvisning */
.tool-result p { margin-bottom: 12px; }
.tool-result p:last-child { margin-bottom: 0; }
.tolk-note { color: var(--text-muted); border-left: 3px solid var(--c-energy); padding-left: 12px; }
.tolk-dempet { color: var(--text-muted); }
.tolk-rekker { list-style: none; margin: 0 0 12px; }
.tolk-rekker li { padding: 2px 0; color: var(--heading); }
.tolk-bunn { font-size: .9rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 12px; }
.tool-feil { color: var(--c-energy); margin-top: 10px; }
.tool-field-check label { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--heading); cursor: pointer; }
.tool-field-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--c-primary); }

/* Veiviser (wifi-kanal-guide) */
.tool-wizard { display: flex; flex-direction: column; gap: 18px; }
.wizard-question { font-size: 1.05rem; margin-bottom: 10px; }
.wizard-options { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── CTA-bokser (verktøysider) ───────────────────────────── */
.cta-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 28px 0; }
.cta-box {
  background: var(--bg-2); border: 1px solid var(--border); border-left: 4px solid var(--c-energy);
  border-radius: var(--radius); padding: 20px 22px;
}
.cta-box h3 { font-size: 1.02rem; margin-bottom: 6px; }
.cta-box p { font-size: .9rem; color: var(--text-muted); }

/* ── FAQ ─────────────────────────────────────────────────── */
.faq-block { max-width: 760px; margin: 28px 0; }
.faq-block h2 { margin-bottom: 16px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 10px; overflow: hidden;
}
.faq-item summary {
  cursor: pointer; padding: 15px 18px; font-weight: 600; color: var(--heading);
  list-style: none; position: relative; padding-right: 40px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 1.2rem; color: var(--text-muted); }
.faq-item[open] summary::after { content: '–'; }
.faq-answer { padding: 0 18px 16px; color: var(--text); }
.faq-answer p { margin-bottom: 10px; }

/* ── Ad-slots (reservert — skjult til AdSense-kode legges inn) ── */
/* Aktivering senere: behold containeren, lim inn annonsekoden og
   sett .ad-slot { display:block } (eller en .is-active-modifier). */
.ad-slot { display: none; }

/* ── Juridiske sider ─────────────────────────────────────── */
.legal-section h2 { margin: 30px 0 10px; font-size: 1.25rem; }
.legal-section p { margin-bottom: 14px; line-height: 1.75; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--border); margin-top: 60px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding: 48px 0 36px; }
.footer-brand .footer-logo { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-heading); font-weight: 700; font-size: 1.05rem; color: var(--heading); margin-bottom: 10px; }
.footer-tagline { font-size: .9rem; color: var(--text-muted); max-width: 320px; }
.footer-nav-group h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: 12px; }
.footer-nav-group ul { list-style: none; }
.footer-nav-group li { margin-bottom: 8px; }
.footer-nav-group a { color: var(--text); font-size: .92rem; }
.footer-nav-group a:hover { color: var(--link); }
.footer-bottom { border-top: 1px solid var(--border); padding: 18px 0; }
.footer-bottom p { font-size: .82rem; color: var(--text-muted); }

/* ── Cookie-banner ───────────────────────────────────────── */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 200;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 20px; font-size: .9rem;
}
.cookie-actions { display: flex; gap: 10px; }

/* ── Responsivt ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0; display: none;
    background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; padding: 10px 16px; }
  .main-nav a { padding: 12px 10px; }
}
@media (max-width: 560px) {
  .footer-inner { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 44px; }
  .section { padding: 44px 0; }
}
