/* Artikkel-layout for den datadrevne artikkelmotoren.
   Servert pa /css/article.css. Bruker design-tokens (--klar-*) fra delt styles.css.
   Rorer ikke styles.css. Dekker bade publisert /artikler/:slug, forhandsvisning
   og indeksen /artikler. */

/* ── Utkast-baand (kun forhandsvisning) ──────────────────────────────────── */
.draft-banner {
  background: #92400E;
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 8px 16px;
  position: sticky;
  top: 0;
  z-index: 150;
}

/* ── Lesefremgang-stripe ─────────────────────────────────────────────────── */
.read-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--klar-secondary, #1D4ED8), var(--klar-light, #22C3E0));
  z-index: 200; transition: width 0.08s linear;
}
@media (prefers-reduced-motion: reduce) { .read-progress { display: none; } }

/* ── Artikkel-side ───────────────────────────────────────────────────────── */
.article-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 72px;
}
.article-wrap h1 {
  font-size: 38px;
  line-height: 1.18;
  font-weight: 700;
  color: var(--klar-dark, #0F2A5E);
  margin: 28px 0 16px;
  letter-spacing: -0.01em;
}
.article-lede {
  font-size: 20px;
  line-height: 1.6;
  color: var(--klar-muted, #5C6B82);
  margin-bottom: 32px;
}
.article-body {
  font-size: 18px;
  line-height: 1.8;
  color: #1f2a3d;
}
.article-body p { margin: 0 0 22px; }
.article-body h2 {
  font-size: 27px; font-weight: 700; line-height: 1.3;
  color: var(--klar-dark, #0F2A5E);
  margin: 44px 0 16px;
}
.article-body h3 {
  font-size: 21px; font-weight: 600; line-height: 1.35;
  color: var(--klar-dark, #0F2A5E);
  margin: 32px 0 12px;
}
.article-body ul { margin: 0 0 22px; padding-left: 26px; }
.article-body li { margin-bottom: 10px; }
.article-body a { color: var(--klar-primary, #2563EB); text-underline-offset: 2px; }
.article-body strong { font-weight: 700; color: var(--klar-dark, #0F2A5E); }
.article-body blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 22px;
  border-left: 4px solid var(--klar-light, #22C3E0);
  font-size: 21px;
  line-height: 1.6;
  font-style: italic;
  color: var(--klar-dark, #0F2A5E);
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.article-hero {
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 8px;
  background: #EEF4FB;
}
.article-hero img { display: block; width: 100%; height: auto; }
.article-hero-placeholder {
  height: 260px;
  display: flex; align-items: center; justify-content: center;
  color: var(--klar-muted, #5C6B82);
  font-size: 15px;
  border: 2px dashed #C7D6E8;
}

/* ── Figur / bilde i brodtekst ───────────────────────────────────────────── */
.article-figure { margin: 30px 0; }
.article-figure img { display: block; width: 100%; height: auto; border-radius: 12px; }
.article-figure figcaption {
  margin-top: 10px; font-size: 14px; color: var(--klar-muted, #5C6B82); text-align: center;
}

/* Plassholder der et bilde mangler (vises pa riktig sted i layouten) */
.image-missing {
  margin: 30px 0;
  border: 2px dashed #C7D6E8;
  border-radius: 12px;
  background: #F7FAFE;
  padding: 36px 20px;
  text-align: center;
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.image-missing-label { font-weight: 600; color: #92400E; font-size: 15px; }
.image-missing-alt { font-size: 13px; color: var(--klar-muted, #5C6B82); }

/* ── Kilder (nyheter) ────────────────────────────────────────────────────── */
.article-sources {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--klar-border, #D8E3EF);
}
.article-sources h2 { font-size: 18px; font-weight: 600; color: var(--klar-dark, #0F2A5E); margin-bottom: 12px; }
.article-sources ul { padding-left: 22px; }
.article-sources li { margin-bottom: 8px; font-size: 15px; line-height: 1.5; }
.article-sources a { color: var(--klar-primary, #2563EB); word-break: break-word; }

/* ── Indeks /artikler ────────────────────────────────────────────────────── */
.article-index { max-width: 1100px; margin: 0 auto; padding: 56px 20px 72px; }
.article-index-head { text-align: center; margin-bottom: 44px; }
.article-index-head h1 { font-size: 40px; font-weight: 700; color: var(--klar-dark, #0F2A5E); margin-bottom: 12px; }
.article-index-head p { font-size: 18px; color: var(--klar-muted, #5C6B82); }
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}
.article-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--klar-border, #D8E3EF);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.article-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(37,99,235,0.10); }
.article-card-media { aspect-ratio: 16 / 9; background: #EEF4FB; overflow: hidden; }
.article-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-card-noimg { width: 100%; height: 100%; background: linear-gradient(135deg, #E2F3F9, #EEF4FB); }
.article-card-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.article-card-badge {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--klar-primary, #2563EB);
}
.article-card-body h2 { font-size: 19px; font-weight: 600; line-height: 1.35; color: var(--klar-dark, #0F2A5E); }
.article-card-body p { font-size: 14px; line-height: 1.55; color: var(--klar-muted, #5C6B82); }
.article-empty { text-align: center; color: var(--klar-muted, #5C6B82); grid-column: 1 / -1; padding: 40px; }

/* ── Mobil ───────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .article-wrap { padding: 32px 16px 56px; }
  .article-wrap h1 { font-size: 30px; }
  .article-lede { font-size: 18px; }
  .article-body { font-size: 17px; }
  .article-body h2 { font-size: 23px; }
  .article-index-head h1 { font-size: 30px; }
}
