/* ───────────────────────────────────────────────────────────────────────────
   /tuben — YouTube-arkivet.

   Text colours are the site's own (--text-main / --text-soft / --accent), so
   nothing here adds a text pair to test/contrast.test.js. The --tb-* tokens are
   chart fills and the hatch stroke: non-text meaning-bearers, held to 3:1
   against the card, and pinned in that test's PAIRS + TOKEN_SOURCES.

   The palette is three buckets that must never read as two. Shorts and long
   form are the two colours the eye compares; "ukjend" is deliberately the
   dullest of the three and is always drawn hatched, because it is not a third
   kind of video, it is the absence of a measurement.
   ─────────────────────────────────────────────────────────────────────────── */

:root {
  --tb-shorts: #ff9575;   /* the 2025 flood */
  --tb-lang:   #6fd3ff;   /* long form */
  --tb-ukjend: #9aa8a0;   /* no duration at all — never a fact, always hatched */
  --tb-usikker:#e8c86a;   /* uncertain export coverage */
  --tb-grid:   rgba(244, 255, 232, 0.14);
}

.layout {
  width: min(760px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 1rem;
  align-content: start;
  padding: 0.7rem 0;
}

.card {
  padding: 1.9rem 1.7rem 1.5rem;
  border-radius: 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  animation: card-enter 0.55s ease-out both;
}

h1 { margin: 0.25rem 0 0.4rem; font-size: clamp(1.55rem, 2vw, 1.95rem); }
h2 { margin: 0 0 0.55rem; font-size: 1.15rem; }
h3 { margin: 1.2rem 0 0.5rem; font-size: 0.98rem; color: var(--text-soft); }

.lead { margin: 0 0 0.4rem; color: var(--text-soft); line-height: 1.6; }
p { line-height: 1.62; }

/* ── numbers ─────────────────────────────────────────────────────────────── */

.tal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.8rem;
  margin: 0.7rem 0 0;
}

.tal div { padding: 0.55rem 0; }

.tal-n {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.tal-l { display: block; font-size: 0.83rem; color: var(--text-soft); margin-top: 0.15rem; }

/* R1 — the watch-time triple. Three figures side by side, never one, and the
   readout keeps its shape when they are null so "ikkje målt" lands where a
   number would have. */
.tid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.7rem;
  margin: 0.6rem 0 0.7rem;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--card-border);
  border-radius: 0.9rem;
}

.tid-n {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
}

.tid-n.umaalt { font-size: 1rem; color: var(--text-soft); font-weight: 600; }
.tid-l { display: block; font-size: 0.8rem; color: var(--text-soft); line-height: 1.4; margin-top: 0.2rem; }

/* R3 — what a ranking could not include. Axis-label weight on purpose: it is
   part of the chart furniture, not a disclaimer bolted underneath it. */
.utelate {
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  color: var(--text-soft);
  line-height: 1.5;
}

.note { margin: 0.5rem 0 0; font-size: 0.86rem; color: var(--text-soft); line-height: 1.55; }
.chart-summary { margin: 0.55rem 0 0; font-size: 0.88rem; color: var(--text-soft); line-height: 1.55; }
.empty { margin: 0.6rem 0 0; color: var(--text-soft); font-style: italic; }

/* ── charts ──────────────────────────────────────────────────────────────── */

svg.graf { width: 100%; height: auto; display: block; overflow: visible; }
.grid-line { stroke: var(--tb-grid); stroke-width: 1; }
.axis-text { fill: var(--text-soft); font-size: 20px; font-variant-numeric: tabular-nums; }
.axis-title { fill: var(--text-soft); font-size: 20px; }
.merke { fill: var(--tb-usikker); font-size: 20px; }
.merke-line { stroke: var(--tb-usikker); stroke-width: 2; stroke-dasharray: 5 4; }

.b-shorts { fill: var(--tb-shorts); }
.b-lang   { fill: var(--tb-lang); }
.b-ukjend { fill: url(#hatch-ukjend); stroke: var(--tb-ukjend); stroke-width: 1.5; }

/* R2 — uncertain coverage is drawn, not explained. Outlined and hatched rather
   than filled, so the year reads as "we do not know" at a glance and cannot be
   compared by area with a year we do know. No animation: test/a11y.test.js
   demands a prefers-reduced-motion block from any page that animates. */
.usikker { fill: url(#hatch-usikker); stroke: var(--tb-usikker); stroke-width: 2; }

.legende {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.legende li { display: flex; align-items: center; gap: 0.4rem; }

.legende i {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 0.2rem;
  flex: none;
  background: var(--tb-lang);
}

.legende i.l-shorts { background: var(--tb-shorts); }
.legende i.l-ukjend {
  background: repeating-linear-gradient(45deg, transparent 0 3px, var(--tb-ukjend) 3px 5px);
  border: 1px solid var(--tb-ukjend);
}
.legende i.l-usikker {
  background: repeating-linear-gradient(45deg, transparent 0 3px, var(--tb-usikker) 3px 5px);
  border: 1px solid var(--tb-usikker);
}

/* ── ranked bars (the /poppis idiom) ─────────────────────────────────────── */

.rad {
  display: grid;
  grid-template-columns: 1.6rem minmax(6rem, 1fr) 3.4rem;
  align-items: center;
  gap: 0.6rem;
  padding: 0.32rem 0;
  border-bottom: 1px solid rgba(244, 255, 232, 0.07);
}

.rad:last-child { border-bottom: 0; }
.rad .nr { color: var(--text-soft); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.rad .kven { min-width: 0; }
.rad .namn { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rad .stolpe { display: block; height: 0.32rem; border-radius: 0.2rem; background: var(--tb-lang); margin-top: 0.22rem; }
.rad .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--accent); font-size: 0.92rem; }
.rad .n .om-lag { color: var(--text-soft); font-size: 0.78rem; }

/* ── chips (the site-wide filter idiom) ──────────────────────────────────── */

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.2rem 0 0.9rem; padding: 0; list-style: none; }

.chip {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.32rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}

.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #0d2a17; font-weight: 600; }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ── cards that link on ──────────────────────────────────────────────────── */

.vegar { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.7rem; margin-top: 0.5rem; }

.veg {
  display: block;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid var(--card-border);
  text-decoration: none;
  color: var(--text-main);
}

.veg:hover, .veg:focus-visible { border-color: var(--accent); }
.veg b { display: block; margin-bottom: 0.15rem; }
.veg span { font-size: 0.84rem; color: var(--text-soft); line-height: 1.45; }

.aar-liste { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; padding: 0; list-style: none; }

.aar-liste a {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid var(--card-border);
  text-decoration: none;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

.aar-liste a:hover, .aar-liste a:focus-visible { border-color: var(--accent); }
.aar-liste a .n { color: var(--text-soft); font-size: 0.78rem; margin-left: 0.3rem; }
.aar-liste a.usikker-lenkje { border-style: dashed; border-color: var(--tb-usikker); }

/* ── sist sett ───────────────────────────────────────────────────────────── */

.sist { margin: 0.4rem 0 0; }
.sist .tittel { font-size: 1.05rem; font-weight: 600; }
.sist .kanal { color: var(--text-soft); }
.sist .naar { display: block; margin-top: 0.35rem; font-size: 0.85rem; color: var(--text-soft); }
.sist.uavklart .tittel { color: var(--text-soft); font-style: italic; font-weight: 500; }

a { color: var(--accent); }

.site-foot { margin: 0.6rem 0 1.4rem; text-align: center; font-size: 0.82rem; color: var(--text-soft); }
