/* IPTV Norge 7/24 — design system. Source of truth: references/design.md */

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face {
  font-family: 'Urbanist';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/urbanist-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Urbanist';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/urbanist-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Urbanist';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/urbanist-700.woff2') format('woff2');
}

/* ---------- Tokens ---------- */
:root {
  --bg: #ffffff;
  --band: #f1f3f5;
  --ink: #04000b;
  --body: #3d3d3d;
  --muted: #666666;      /* >=18px text only */
  --accent: #cdfe7d;     /* background use only, dark text on top */
  --border: #e4e7ea;
  --radius-card: 15px;
  --radius-pill: 40px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06);
  --container: 1140px;
  --measure: 740px;
  --font: 'Urbanist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--body);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 .5em;
  font-weight: 700;
}
h1 { font-size: 40px; }
h2 { font-size: 32px; font-weight: 600; margin-top: 1.6em; }
h3 { font-size: 26px; font-weight: 600; margin-top: 1.4em; }
h4 { font-size: 21px; font-weight: 600; }
p { margin: 0 0 1.1em; }
a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; border-radius: var(--radius-card); }
ul, ol { padding-left: 1.4em; margin: 0 0 1.1em; }
li { margin-bottom: .35em; }
strong { color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

@media (max-width: 640px) {
  h1 { font-size: 30px; }
  h2 { font-size: 26px; }
  h3 { font-size: 22px; }
}

/* ---------- Layout helpers ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section--band { background: var(--band); }
.section--dark { background: var(--ink); color: #fff; }
.section--dark h2, .section--dark h3 { color: #fff; }
.section--dark a { color: var(--accent); }
.measure { max-width: var(--measure); }

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header / nav (CSS-only mobile menu) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  text-decoration: none;
}
.logo__mark {
  background: var(--accent);
  color: var(--ink);
  border-radius: 10px;
  padding: 3px 8px;
  font-size: 16px;
  font-weight: 700;
}
.nav-toggle { display: none; }
.nav-toggle-label {
  display: none;
  cursor: pointer;
  padding: 12px;
  border-radius: 8px;
}
.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  position: relative;
  content: '';
}
.nav-toggle-label span::before { position: absolute; top: -7px; }
.nav-toggle-label span::after { position: absolute; top: 7px; }
.site-nav ul {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a { text-decoration: none; font-weight: 600; padding: 12px 0; display: inline-block; }
.site-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.site-nav .btn { padding: 10px 22px; min-height: 0; }

@media (max-width: 800px) {
  .nav-toggle-label { display: flex; align-items: center; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 20px 20px;
  }
  .nav-toggle:checked ~ .site-nav { display: block; }
  .site-nav ul { flex-direction: column; align-items: flex-start; gap: 4px; }
  .site-nav li { width: 100%; }
  .site-nav a { padding: 12px 0; width: 100%; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  border-radius: var(--radius-pill);
  padding: 14px 30px;
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  transition: background .2s, color .2s;
  min-height: 48px;
}
.btn--primary { background: var(--ink); color: #fff; border: 1px solid var(--ink); }
.btn--primary:hover { background: var(--accent); color: var(--ink); }
.btn--outline { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn--outline:hover { background: var(--band); }
.section--dark .btn--primary { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.section--dark .btn--primary:hover { background: #fff; color: var(--ink); border-color: #fff; }

/* ---------- Chips ---------- */
.chip {
  display: inline-block;
  background: var(--accent);
  color: var(--ink);
  border-radius: var(--radius-pill);
  padding: 4px 14px;
  font-weight: 600;
  font-size: 15px;
}

/* ---------- Hero ---------- */
.hero { padding: 80px 0 72px; }
.hero h1 { max-width: 720px; margin-bottom: .4em; }
.hero__sub { font-size: 20px; max-width: 640px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
@media (max-width: 640px) { .hero { padding: 48px 0 44px; } .hero__sub { font-size: 18px; } }

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}
@media (max-width: 900px) { .card-grid { grid-template-columns: 1fr; } }
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
  box-shadow: var(--shadow);
}
.section--band .card { border: none; }
.card h3 { margin-top: 0; font-size: 21px; }
.card p:last-child { margin-bottom: 0; }
.card--link { position: relative; }
.card--link:hover { outline: 2px solid var(--ink); }
.card--link .card__cover::after { content: ''; position: absolute; inset: 0; }
.card__cover { text-decoration: none; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { padding: 18px 0 0; font-size: 15px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: '›'; margin-right: 6px; color: var(--muted); }

/* ---------- Article ---------- */
.article { padding: 24px 0 64px; }
.article__inner { max-width: var(--measure); margin: 0 auto; }
.byline { font-size: 15px; color: var(--body); margin-bottom: 24px; }
.byline a { font-weight: 600; }
.article__hero img { width: 100%; display: block; }

/* TL;DR / callout box */
.tldr {
  background: var(--accent);
  color: var(--ink);
  border-radius: var(--radius-card);
  padding: 22px 26px;
  margin: 28px 0;
}
.tldr p { margin: 0; color: var(--ink); }
.tldr__label { font-weight: 700; display: block; margin-bottom: 6px; }

/* Disclosure box */
.disclosure {
  background: var(--band);
  border-radius: var(--radius-card);
  padding: 16px 22px;
  font-size: 15px;
  margin: 24px 0;
}
.disclosure p { margin: 0; }

/* Table of contents */
.toc {
  background: var(--band);
  border-radius: var(--radius-card);
  padding: 22px 26px;
  margin: 28px 0;
}
.toc h2 { margin: 0 0 10px; font-size: 18px; }
.toc ol { margin: 0; padding-left: 1.3em; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 24px 0; border-radius: var(--radius-card); border: 1px solid var(--border); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 16px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); }
th { background: var(--ink); color: #fff; font-weight: 600; position: sticky; left: auto; }
tbody tr:nth-child(even) { background: var(--band); }
tbody tr:last-child td { border-bottom: none; }

/* FAQ */
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 0;
  margin-bottom: 12px;
  background: var(--bg);
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  padding: 16px 22px;
  list-style-position: inside;
}
.faq details > div { padding: 0 22px 16px; }
.faq details > div p:last-child { margin-bottom: 0; }

/* Author box */
.author-box {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--band);
  border-radius: var(--radius-card);
  padding: 24px;
  margin: 40px 0 0;
}
.author-box__mark {
  flex: 0 0 auto;
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
}
.author-box p { margin-bottom: 0; font-size: 16px; }
.author-box h3 { margin: 0 0 4px; font-size: 18px; }

/* Pros / cons */
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 24px 0; }
@media (max-width: 640px) { .pros-cons { grid-template-columns: 1fr; } }
.pros-cons > div { border: 1px solid var(--border); border-radius: var(--radius-card); padding: 20px 24px; }
.pros-cons h3 { margin-top: 0; font-size: 18px; }
.pros-cons .pros { border-top: 4px solid var(--accent); }
.pros-cons .cons { border-top: 4px solid var(--ink); }

/* Verdict */
.verdict {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-card);
  padding: 26px 30px;
  margin: 32px 0;
}
.verdict h2, .verdict h3 { color: #fff; margin-top: 0; }
.verdict p { color: #fff; }
.verdict p:last-child { margin-bottom: 0; }
.verdict a { color: var(--accent); }

/* Back to top */
.back-to-top { display: inline-block; margin-top: 32px; font-size: 15px; font-weight: 600; }

/* ---------- Post list ---------- */
.post-list { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 24px; }
.post-list__item {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 26px 30px;
  box-shadow: var(--shadow);
}
.post-list__item h2 { margin: 0 0 6px; font-size: 24px; }
.post-list__meta { font-size: 15px; margin-bottom: 10px; }
.post-list__item p:last-child { margin-bottom: 0; }

/* Empty state */
.empty-state {
  background: var(--band);
  border-radius: var(--radius-card);
  padding: 36px;
  margin-top: 32px;
  max-width: var(--measure);
}
.empty-state p:last-child { margin-bottom: 0; }

/* ---------- Steps (numbered highlights) ---------- */
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 14px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #d8e3f0;
  padding: 56px 0 32px;
  margin-top: 64px;
  font-size: 16px;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--accent); }
.site-footer h2 { color: #fff; font-size: 17px; margin: 0 0 12px; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .15);
  padding-top: 24px;
  font-size: 14px;
  color: #b9c4d0;
}
.footer-bottom p { margin-bottom: 6px; }

/* ---------- Annonse-slots (direktesolgte bannere, statiske bilder — ingen tredjeparts-JS) ---------- */
.ad-slot { margin: 28px 0; text-align: center; }
/* Annonse som egen seksjon (forsiden) — strammere luft enn en vanlig .section */
.section--ad { padding: 28px 0; }
.section--ad .ad-slot { margin: 0; }
.ad-slot__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--body);
  margin-bottom: 6px;
}
.ad-slot a { display: inline-block; line-height: 0; }
.ad-slot img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
}
