/* Elbilnerden — hovedstil. Rent nordisk blogg-oppsett, mobil-først. */
:root {
  --bg: #ffffff;
  --bg-soft: #f4f6f8;
  --text: #16202a;
  --text-soft: #51606e;
  --line: #e2e8ee;
  --brand: #0a7d4b;        /* elbil-grønn */
  --brand-dark: #086b40;
  --accent: #0b5cad;
  --warn-bg: #fff6e6;
  --warn-line: #f0c14b;
  --ok-bg: #eafaf2;
  --maxw: 760px;
  --radius: 12px;
  font-size: 18px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  line-height: 1.7; -webkit-font-smoothing: antialiased;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* Topp */
.site-head { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: inline-flex; align-items: center; text-decoration: none; }
.logo img { height: 30px; width: auto; display: block; }
.site-nav a { color: var(--text-soft); text-decoration: none; margin-left: 18px; font-size: 0.95rem; }
.site-nav a:hover { color: var(--brand); }

/* Artikkel */
article { padding: 28px 0 10px; }
.kicker { color: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; margin: 0 0 8px; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 14px; }
h2 { font-size: clamp(1.35rem, 3.6vw, 1.7rem); line-height: 1.25; letter-spacing: -0.01em; margin: 40px 0 12px; scroll-margin-top: 70px; }
h3 { font-size: 1.15rem; margin: 26px 0 8px; }
p { margin: 0 0 18px; }
a { color: var(--accent); }
.byline { display: flex; align-items: center; gap: 12px; color: var(--text-soft); font-size: 0.92rem; margin: 0 0 24px; }
.byline .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand) url('/bilder/henrik.jpg') center/cover no-repeat; color: transparent; display: grid; place-items: center; font-weight: 800; overflow: hidden; flex: 0 0 auto; }
.byline b { color: var(--text); }

/* Bilder */
figure { margin: 24px 0; }
figure img, .img-placeholder {
  width: 100%; height: auto; border-radius: var(--radius); display: block; background: var(--bg-soft);
}
.img-placeholder {
  aspect-ratio: 16 / 9; border: 2px dashed var(--line); display: grid; place-items: center;
  color: var(--text-soft); font-size: 0.9rem; text-align: center; padding: 16px;
}
.img-placeholder.hero { aspect-ratio: 16 / 8; }
figcaption { color: var(--text-soft); font-size: 0.85rem; margin-top: 8px; text-align: center; }

/* Bokser */
.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 24px 0; background: var(--bg-soft); }
.box.verdict { background: var(--ok-bg); border-color: var(--brand); }
.box.warn { background: var(--warn-bg); border-left: 4px solid var(--warn-line); }
.box h3 { margin-top: 0; }
.box ul { margin: 8px 0 0; padding-left: 20px; }
.rating { font-size: 1.8rem; font-weight: 800; color: var(--brand); }
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
.pros-cons > div { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.pros-cons h3 { margin-top: 0; }
.pros-cons ul { margin: 0; padding-left: 20px; }
@media (max-width: 560px) { .pros-cons { grid-template-columns: 1fr; } }

/* Tabell */
.table-wrap { overflow-x: auto; margin: 24px 0; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
thead th { background: var(--bg-soft); font-weight: 700; }
tbody tr:last-child td { border-bottom: none; }
td:first-child, th:first-child { position: sticky; left: 0; background: var(--bg); }
thead th:first-child { background: var(--bg-soft); }

/* Annonseplass (AdSense) */
.ad-slot {
  margin: 32px 0; min-height: 90px; border: 1px dashed var(--line); border-radius: var(--radius);
  display: grid; place-items: center; color: var(--text-soft); font-size: 0.8rem; background: var(--bg-soft);
}

/* FAQ */
.faq details { border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 18px; margin: 10px 0; background: var(--bg-soft); }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; }
.faq details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }

/* Bunntekst */
.site-foot { border-top: 1px solid var(--line); margin-top: 48px; padding: 28px 0; color: var(--text-soft); font-size: 0.9rem; }
.author-card { display: flex; gap: 16px; align-items: flex-start; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 36px 0; }
.author-card .avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--brand) url('/bilder/henrik.jpg') center/cover no-repeat; color: transparent; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; flex: 0 0 auto; overflow: hidden; }
.author-card b { color: var(--text); }
.updated { color: var(--text-soft); font-size: 0.85rem; }

/* ===== GEO/SEO-komponenter ===== */

/* Skip link (tilgjengelighet + SEO) */
.skip-link { position: absolute; top: -100%; left: 0; background: var(--brand); color: #fff; padding: 8px 16px; z-index: 9999; border-radius: 0 0 8px 0; transition: top .2s; }
.skip-link:focus { top: 0; }

/* Lesefremdrift */
#reading-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--brand); z-index: 9999; width: 0; transition: width .1s; }

/* Brødsmuler (breadcrumb) */
.breadcrumb { padding: 16px 0 0; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; font-size: 0.82rem; color: var(--text-soft); }
.breadcrumb li + li::before { content: '/'; margin-right: 8px; color: var(--text-soft); }
.breadcrumb a { color: var(--text-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }

/* Ingress / lead (direkte svar for Featured Snippet) */
.post-lead { font-size: 1.15rem; line-height: 1.75; color: var(--text); margin: 0 0 22px; padding: 16px 18px; background: var(--bg-soft); border-left: 4px solid var(--brand); border-radius: 0 10px 10px 0; }

/* Innholdsfortegnelse */
.toc { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 28px 0; }
.toc-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-soft); margin: 0 0 10px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin-bottom: 6px; }
.toc a { color: var(--accent); text-decoration: none; font-size: 0.95rem; }
.toc a:hover { text-decoration: underline; }

/* Callout / infoboks */
.callout { border-radius: var(--radius); padding: 16px 20px; margin: 24px 0; font-size: 0.97rem; line-height: 1.65; border-left: 4px solid var(--accent); background: var(--bg-soft); }
.callout.tips { border-left-color: var(--warn-line); background: var(--warn-bg); }
.callout strong { color: var(--text); }

/* Relaterte tester — miniatyrer (det Rodrigo ba om) */
.related-posts { margin: 44px 0 10px; }
.related-posts h2 { margin-bottom: 16px; }
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .related-grid { grid-template-columns: 1fr; } }
.rel-card { display: flex; gap: 14px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; background: var(--bg); transition: border-color .15s; }
.rel-card:hover { border-color: var(--brand); }
.rel-thumb { width: 108px; min-width: 108px; aspect-ratio: 1/1; background: var(--bg-soft); border-right: 1px solid var(--line); display: grid; place-items: center; color: var(--text-soft); font-size: 0.68rem; text-align: center; padding: 6px; }
.rel-body { padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; }
.rel-body .tag { color: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .65rem; }
.rel-body h3 { margin: 4px 0 2px; font-size: 1rem; }
.rel-body p { margin: 0; font-size: 0.85rem; color: var(--text-soft); }

/* Del-knapper */
.post-share { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 32px 0; font-size: 0.9rem; color: var(--text-soft); }
.post-share a { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: 6px 14px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.85rem; }
.post-share a:hover { border-color: var(--brand); color: var(--brand); }

/* Kildeliste */
.sources { font-size: 0.85rem; color: var(--text-soft); border-top: 1px solid var(--line); margin-top: 32px; padding-top: 16px; }
.sources h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: .07em; margin: 0 0 8px; }
.sources ul { margin: 0; padding-left: 18px; }

/* ===== Kalkulatorer (3 faner) — grønn uthevingsboks ===== */
.kalk { border: 1px solid var(--brand-dark); border-radius: var(--radius); padding: 22px; margin: 36px 0; background: var(--brand); color: #fff; }
.kalk > h2 { margin: 0 0 14px; color: #fff; }
.kalk-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,0.3); }
.kalk-tab { appearance: none; border: none; background: transparent; color: rgba(255,255,255,0.75); font: inherit; font-weight: 600; font-size: 0.9rem; padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.kalk-tab:hover { color: #fff; }
.kalk-tab.active { color: #fff; border-bottom-color: #fff; }
.kalk-panel.hidden { display: none; }
.kalk-field { margin-bottom: 14px; }
.kalk-field label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; color: #fff; }
.kalk-field input[type=number], .kalk-field select { width: 100%; padding: 10px 12px; border: 1px solid rgba(255,255,255,0.5); border-radius: 8px; background: #fff; color: #16202a; font: inherit; }
.kalk-field input[type=range] { width: 100%; accent-color: #fff; }
.kalk-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .kalk-grid2 { grid-template-columns: 1fr; } }
.kalk-result { margin-top: 8px; padding: 16px 18px; border-radius: 10px; background: #fff; border: 1px solid rgba(255,255,255,0.6); }
.kalk-result .big { font-size: 1.55rem; font-weight: 800; color: var(--brand-dark); line-height: 1.2; }
.kalk-result .sub { font-size: 0.9rem; color: #51606e; margin-top: 6px; }
.kalk-note { font-size: 0.78rem; color: rgba(255,255,255,0.85); margin: 14px 0 0; }

/* imagens nos cards/miniaturas */
.card .thumb { padding: 0; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rel-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===== Meny responsiv (flere kategorier) ===== */
@media (max-width: 560px) {
  .site-head .wrap { height: auto; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .site-nav { width: 100%; margin-top: 2px; }
  .site-nav a { margin-left: 0; margin-right: 18px; font-size: .9rem; }
}
.site-nav a[aria-current="page"] { color: var(--brand); font-weight: 700; }

/* ===== Kort-grid + sammenlign-liste (kategori/forside) ===== */
.post-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 24px 0 10px; }
@media (max-width: 620px) { .post-grid { grid-template-columns: 1fr; } }
.card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg); display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: border-color .15s; }
.card:hover { border-color: var(--brand); }
.card .thumb { aspect-ratio: 16/9; background: var(--bg-soft); border-bottom: 1px solid var(--line); overflow: hidden; padding: 0; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: 16px 18px; }
.card .tag { color: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; font-size: .72rem; }
.card h2 { margin: 6px 0 6px; font-size: 1.2rem; }
.card p { margin: 0; color: var(--text-soft); font-size: .95rem; }
.cmp-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0; }
@media (max-width: 620px) { .cmp-list { grid-template-columns: 1fr; } }
.cmp-list a { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; text-decoration: none; color: var(--text); font-weight: 600; font-size: .95rem; transition: border-color .15s; }
.cmp-list a:hover { border-color: var(--brand); }
.cmp-list a span { color: var(--brand); font-weight: 800; margin: 0 5px; }

/* ===== Bilde-plassholder (venter på foto) ===== */
.img-ph { aspect-ratio: 16/9; background: var(--bg-soft); border: 1px dashed var(--line); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text-soft); text-align: center; padding: 16px; font-size: .82rem; }
.img-ph code { background: transparent; color: var(--brand); font-size: .85rem; }


/* ===== Språkvelger / language switcher (topp) ===== */
.lang-bar { background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.lang-bar .wrap { display: flex; justify-content: flex-end; }
.lang-switch { display: flex; gap: 4px; padding: 5px 0; flex-wrap: wrap; }
.lang { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: .8rem; line-height: 1; text-decoration: none; color: var(--text-soft); border: 1px solid transparent; }
.lang .flag { width: 20px; height: 14px; border-radius: 2px; overflow: hidden; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,.09); flex: 0 0 auto; }
.lang .flag svg { display: block; width: 100%; height: 100%; }
.lang.is-active { color: var(--text); font-weight: 700; background: var(--bg); border-color: var(--line); }
.lang[href]:hover { color: var(--brand); border-color: var(--line); }
.lang.is-soon { opacity: .42; cursor: default; }
@media (max-width: 560px) { .lang-t { display: none; } .lang { padding: 4px 6px; } }

.img-ph .ph-ico { display: block; opacity: .55; }
.img-ph .ph-txt { opacity: .7; letter-spacing: .02em; }
