/* Oculus Omnividens — fact pages. Newspaper data desk: paper, ink, one red. */

:root {
  --paper: #F4F1EA;
  --paper-2: #EBE7DD;
  --ink: #141414;
  --ink-2: #3D3A35;
  --muted: #6B675F;
  --rule: #141414;
  --hair: #CFC9BC;
  --red: #C8102E;
  --up: #9A1B1B;
  --down: #1F5E3A;
  --s1: #C8102E;
  --s2: #1F6FB2;
  --s3: #B57B12;
  --s4: #7A4FA0;
  --grid: #DDD8CC;
  --focus: #1F6FB2;
  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1180px;
  --rhythm: clamp(56px, 8vw, 104px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141414; --paper-2: #1D1D1C; --ink: #ECE8DF; --ink-2: #C9C4B9; --muted: #9A958B;
    --rule: #ECE8DF; --hair: #34322E; --red: #E8475C; --up: #E8475C; --down: #5BBF86;
    --s1: #E8475C; --s2: #4E95D9; --s3: #B88518; --s4: #A07ACC; --grid: #2A2927; --focus: #4E95D9;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #141414; --paper-2: #1D1D1C; --ink: #ECE8DF; --ink-2: #C9C4B9; --muted: #9A958B;
  --rule: #ECE8DF; --hair: #34322E; --red: #E8475C; --up: #E8475C; --down: #5BBF86;
  --s1: #E8475C; --s2: #4E95D9; --s3: #B88518; --s4: #A07ACC; --grid: #2A2927; --focus: #4E95D9;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.55 var(--body); font-variation-settings: 'wdth' 100;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }

/* ── Masthead ───────────────────────────────────────────── */
.dateline {
  border-bottom: 1px solid var(--hair);
  font: 500 12px/1 var(--mono); color: var(--muted); letter-spacing: .02em;
}
.dateline .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; height: 34px; }
.dateline .live::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-right: 7px; vertical-align: 1px; }
.theme-btn { background: none; border: 1px solid var(--hair); color: var(--ink-2); font: inherit; padding: 5px 9px; border-radius: 3px; cursor: pointer; }

.masthead .wrap { padding-top: 22px; padding-bottom: 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand svg { width: 46px; height: 46px; flex: none; }
.brand-name { font: 800 clamp(26px, 4.4vw, 44px)/.92 var(--display); font-variation-settings: 'wdth' 82; letter-spacing: -.01em; text-transform: uppercase; }
.brand-tag { font: 500 14px/1.3 var(--body); color: var(--ink-2); max-width: 300px; }

.topics { border-top: 3px solid var(--rule); border-bottom: 1px solid var(--rule); }
.topics .wrap { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; }
.topics .wrap::-webkit-scrollbar { display: none; }
.topics a {
  flex: none; padding: 12px 14px; text-decoration: none; font: 600 15px/1 var(--body);
  border-right: 1px solid var(--hair); white-space: nowrap;
}
.topics a:first-child { padding-left: 0; }
.topics a[aria-current="page"] { color: var(--red); box-shadow: inset 0 -3px 0 var(--red); }
.topics a.tools { margin-left: auto; border-right: 0; color: var(--muted); font-weight: 500; }

/* ── Front page ─────────────────────────────────────────── */
.hero { padding: clamp(36px, 6vw, 72px) 0 clamp(28px, 4vw, 44px); border-bottom: 1px solid var(--rule); }
.hero h1 { font: 800 clamp(36px, 6.4vw, 76px)/.98 var(--display); font-variation-settings: 'wdth' 78; letter-spacing: -.015em; margin: 0 0 18px; max-width: 15ch; text-wrap: balance; }
.hero p { font-size: clamp(17px, 1.7vw, 20px); color: var(--ink-2); max-width: 60ch; margin: 0; }
.hero .promise { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 22px; font: 500 13px/1.4 var(--mono); color: var(--muted); }
.hero .promise span::before { content: '→ '; color: var(--red); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); border-left: 1px solid var(--hair); }
.card {
  display: flex; flex-direction: column; gap: 14px; padding: 22px 22px 20px;
  border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
  text-decoration: none; min-height: 250px; transition: background .15s;
}
.card:hover { background: var(--paper-2); color: var(--ink); }
.card .kicker { font: 700 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--red); }
.card h2 { font: 700 21px/1.18 var(--display); margin: 0; text-wrap: balance; }
.card .nums { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: auto; }
.card .num b { display: block; font: 800 34px/1 var(--display); font-variation-settings: 'wdth' 75; font-variant-numeric: tabular-nums; }
.card .num span { display: block; font-size: 13px; line-height: 1.3; color: var(--ink-2); margin-top: 5px; }
.card .more { font: 600 14px/1 var(--body); }
.card .more::after { content: ' →'; }
.card.skeleton .nums { opacity: .35; }

/* ── Topic page ─────────────────────────────────────────── */
.t-head { padding: clamp(28px, 5vw, 56px) 0 22px; }
.t-head .kicker { font: 700 13px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--red); }
.t-head h1 { font: 800 clamp(32px, 5.2vw, 62px)/1 var(--display); font-variation-settings: 'wdth' 80; letter-spacing: -.012em; margin: 12px 0 16px; max-width: 20ch; text-wrap: balance; }
.t-head .lede { font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); max-width: 64ch; margin: 0; }

.headline { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); border-top: 3px solid var(--rule); border-bottom: 1px solid var(--rule); }
.stat { padding: 20px 20px 18px 0; border-right: 1px solid var(--hair); margin-right: 20px; }
.stat:last-child { border-right: 0; margin-right: 0; }
.stat .v { font: 800 clamp(44px, 5.6vw, 68px)/.95 var(--display); font-variation-settings: 'wdth' 72; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .v { white-space: nowrap; }
.stat .v small { font-size: .42em; font-weight: 700; margin-left: 4px; font-variation-settings: 'wdth' 90; }
.stat .l { font: 600 15px/1.3 var(--body); margin-top: 10px; }
.stat .meta { font: 500 12px/1.45 var(--mono); color: var(--muted); margin-top: 6px; }
.chg { font: 600 13px/1.3 var(--mono); margin-top: 8px; color: var(--ink-2); }
.chg .arrow { font-weight: 700; }
sup.fn { font: 700 11px/0 var(--mono); margin-left: 2px; }
sup.fn a { text-decoration: none; color: var(--red); }

.sec { padding-top: var(--rhythm); }
.sec-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; border-top: 1px solid var(--rule); padding-top: 14px; margin-bottom: 22px; }
.sec h2 { font: 800 clamp(24px, 3vw, 34px)/1.08 var(--display); font-variation-settings: 'wdth' 86; margin: 0; text-wrap: balance; max-width: 30ch; }
.sec .intro { color: var(--ink-2); margin: 0; max-width: 68ch; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0; border-top: 1px solid var(--hair); margin-top: 18px; }
.facts .stat { padding-top: 16px; }
.facts .stat .v { font-size: clamp(34px, 4vw, 46px); }

/* chart */
.chart-wrap { position: relative; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 10px; padding: 0; list-style: none; font-size: 14px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 7px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
svg.chart { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--mono); }
svg.chart .grid line { stroke: var(--grid); stroke-width: 1; }
svg.chart .axis text { fill: var(--muted); font-size: 12px; }
svg.chart .base { stroke: var(--ink); stroke-width: 1; }
svg.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.chart .end-label { font: 600 12px var(--body); fill: var(--ink-2); }
svg.chart .bar { transition: opacity .12s; }
svg.chart .hit { fill: transparent; cursor: crosshair; }
svg.chart .xhair { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 3; }
svg.chart .dot { stroke: var(--paper); stroke-width: 2; }
.tip {
  position: absolute; pointer-events: none; background: var(--ink); color: var(--paper);
  font: 500 13px/1.45 var(--body); padding: 8px 10px; border-radius: 4px; min-width: 140px;
  transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; z-index: 3; opacity: 0; transition: opacity .1s;
}
.tip b { font-family: var(--mono); font-weight: 700; }
.tip .row { display: flex; align-items: center; gap: 8px; }
.tip .row i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.tip .row span:last-child { margin-left: auto; padding-left: 12px; font-family: var(--mono); }
.chart-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; font: 500 12px/1.4 var(--mono); color: var(--muted); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

table.data { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 8px; }
table.data th { text-align: left; font: 600 12px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--rule); padding: 8px 10px 8px 0; }
table.data td { border-bottom: 1px solid var(--hair); padding: 8px 10px 8px 0; font-variant-numeric: tabular-nums; }
table.data td.n, table.data th.n { text-align: right; }
.table-scroll { overflow-x: auto; }

.guide { margin-top: var(--rhythm); background: var(--paper-2); border-left: 4px solid var(--red); padding: 22px clamp(18px, 3vw, 30px); }
.guide h2 { font: 800 22px/1.1 var(--display); margin: 0 0 12px; }
.guide ul { margin: 0; padding-left: 20px; }
.guide li { margin: 8px 0; max-width: 72ch; }

.sources { margin-top: var(--rhythm); border-top: 3px solid var(--rule); padding-top: 14px; }
.sources h2 { font: 800 22px/1.1 var(--display); margin: 0 0 12px; }
.sources ol { margin: 0; padding-left: 26px; font-size: 14px; color: var(--ink-2); }
.sources li { margin: 7px 0; }
.sources li:target { background: var(--paper-2); }
.sources .tag { font: 600 11px/1 var(--mono); border: 1px solid var(--hair); padding: 2px 5px; border-radius: 3px; margin-left: 6px; color: var(--muted); }

.err { padding: 18px; border: 1px solid var(--hair); color: var(--ink-2); }

/* ── Footer ─────────────────────────────────────────────── */
.foot { margin-top: var(--rhythm); border-top: 3px solid var(--rule); padding: 30px 0 48px; }
.foot .big { font: 800 clamp(24px, 3.4vw, 40px)/1.05 var(--display); font-variation-settings: 'wdth' 80; max-width: 22ch; margin: 0 0 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 10px 24px; font-size: 15px; }
.foot small { display: block; margin-top: 20px; color: var(--muted); font: 500 12px/1.5 var(--mono); }

@media (max-width: 640px) {
  .stat { border-right: 0; margin-right: 0; border-bottom: 1px solid var(--hair); }
  .headline .stat:last-child, .facts .stat:last-child { border-bottom: 0; }
  .brand-tag { display: none; }
  .card { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ── Tjek politikerne ───────────────────────────────────── */
.tj-jump { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; font: 600 14px/1 var(--body); }
.tj-jump a { text-decoration: none; border-bottom: 2px solid var(--red); padding-bottom: 3px; }
.tj-list { display: grid; gap: 0; border-top: 1px solid var(--hair); margin-top: 18px; }
.tj-item { padding: 16px 0; border-bottom: 1px solid var(--hair); }
.tj-item h3 { font: 700 18px/1.25 var(--display); margin: 6px 0 8px; }
.tj-item blockquote { margin: 6px 0; padding-left: 14px; border-left: 3px solid var(--ink); color: var(--ink-2); max-width: 80ch; }
.tj-item blockquote a { font: 500 12px var(--mono); color: var(--muted); }
.tj-meta { font: 500 12px/1.4 var(--mono); color: var(--muted); }
.tj-tag { display: inline-block; font: 700 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .05em; padding: 3px 6px; border-radius: 3px; border: 1px solid var(--hair); color: var(--ink-2); }
.tj-tag.tj-ok { border-color: var(--ink); color: var(--ink); }
.tj-tag.tj-mid { border-style: dashed; }
.tj-bills { margin: 6px 0 0; padding-left: 18px; font-size: 14px; color: var(--ink-2); }
.tj-bills li { margin: 4px 0; }
.tj-official { margin-top: 8px; padding: 10px 12px; background: var(--paper-2); border-radius: 3px; font-size: 14px; }
.tj-official .tj-k { display: block; font: 700 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--red); margin-bottom: 4px; }
.tj-official b { font: 800 20px/1 var(--display); margin-right: 6px; font-variant-numeric: tabular-nums; }
.tj-filter { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.tj-filter input, .tj-filter select { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--hair); border-radius: 3px; padding: 7px 9px; }
.tj-filter input { flex: 1 1 220px; }
.tj-mf tbody tr:hover { background: var(--paper-2); }
.tj-card { margin-top: 18px; padding: 16px; border: 1px solid var(--ink); border-radius: 4px; }
.tj-card h3 { margin: 0 0 6px; font: 800 20px/1.1 var(--display); }
.tj-card h4 { margin: 12px 0 4px; font: 700 14px var(--body); }
.tj-links { list-style: none; padding: 0; margin: 14px 0 0; border-top: 1px solid var(--hair); }
.tj-links li { padding: 10px 0; border-bottom: 1px solid var(--hair); display: grid; gap: 3px; }
.tj-links span { font: 500 12px var(--mono); color: var(--muted); }
.tj-src { font: 500 12px/1.4 var(--mono); color: var(--muted); margin-top: 12px; }

/* ── Site switcher + steady menus (shared by Oculus and Statsbudget) ── */
.dl-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.site-switch { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; }
.site-switch::-webkit-scrollbar { display: none; }
.site-switch a { white-space: nowrap; text-decoration: none; color: var(--muted); padding: 4px 10px; border-left: 1px solid var(--hair); font: 600 12px/1 var(--mono); }
.site-switch a:first-child { border-left: 0; }
.site-switch a:hover { color: var(--ink); }
.site-switch a[aria-current] { color: var(--ink); }
.site-switch a[aria-current]::before { content: '● '; color: var(--red); }
.topics .wrap { min-height: 42px; align-items: stretch; }
.topics a { padding: 12px 12px; font-size: 14px; }
.topics a.nav-strong { font-weight: 700; }
@media (max-width: 760px) {
  .dateline .live { display: none; }
  .dateline .wrap { justify-content: flex-end; }
  .site-switch a { padding: 4px 8px; }
  .topics .wrap { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
}

/* Same header height on both sites so the menu never moves when you switch site */
@media (min-width: 761px) {
  .masthead { min-height: 117px; display: flex; align-items: flex-end; }
  .masthead > .wrap { width: 100%; }
}

/* Immigration deep dive: chapter strip and country table */
.topics.sub-nav { border-top: 0; background: var(--paper-2); }
.topics.sub-nav a { font-size: 13px; padding: 10px 12px; }
.lande-table th .linkbtn { font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; text-decoration: none; }
.lande-table tr.ref td { font-weight: 700; background: var(--paper-2); }
.lande-table td a { font-weight: 600; }
.topics.sub-nav a:first-child { padding-left: 0; }
.lande-table td:nth-child(2) { white-space: nowrap; }
.kom-q { margin-top: 18px; width: min(360px, 100%); font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--hair); border-radius: 3px; padding: 8px 10px; }
.stat .v small.u-long { display: block; font: 700 13px/1.2 var(--body); margin: 6px 0 0; white-space: normal; letter-spacing: 0; font-variation-settings: normal; }

/* ── Site bar: the three sites, always on top and easy to see ── */
.site-bar { background: var(--ink); color: var(--paper); }
.site-bar .wrap { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; }
.site-bar .wrap::-webkit-scrollbar { display: none; }
.site-bar a { display: flex; flex-direction: column; gap: 2px; padding: 9px 18px 8px; text-decoration: none; color: var(--paper); border-right: 1px solid rgba(127,127,127,.35); white-space: nowrap; }
.site-bar a:first-child { padding-left: 0; }
.site-bar a b { font: 700 14px/1.1 var(--body); }
.site-bar a span { font: 500 11px/1.2 var(--mono); opacity: .7; }
.site-bar a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.site-bar a[aria-current] { background: var(--paper); color: var(--ink); padding-left: 18px; box-shadow: inset 0 3px 0 var(--red); }
.site-bar a[aria-current]:first-child { margin-left: -18px; }
@media (max-width: 760px) { .site-bar a { padding: 8px 12px; } .site-bar a span { display: none; } .site-bar a[aria-current]:first-child { margin-left: 0; } }

/* Short tab names on phones so all three sites fit */
.site-bar a i { display: none; font: 700 14px/1.1 var(--body); font-style: normal; }
@media (max-width: 520px) { .site-bar a b { display: none; } .site-bar a i { display: block; } .site-bar .wrap { justify-content: space-between; } .site-bar a { flex: 1; align-items: center; padding: 10px 6px; } .site-bar a:first-child { padding-left: 6px; } }
