/* politikasanalize.lv - one stylesheet for both language trees.
   Fonts are self-hosted (SIL OFL, licences in fonts/). No third-party requests. */

@font-face {
  font-family: "Source Serif 4 Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/source-serif-4-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Source Serif 4 Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/source-serif-4-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4 Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/source-serif-4-latin-wght-italic.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Source Serif 4 Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/source-serif-4-latin-ext-wght-italic.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/inter-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/inter-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --surface: #faf8f3;
  --surface-2: #f2efe8;
  --surface-3: #e9e5db;
  --ink: #1c1b19;
  --ink-2: #55524b;
  --ink-3: #7f7b72;
  --rule: #dcd8ce;
  --rule-soft: #ebe7de;
  --accent: #0b6f63;          /* links, headings' accent, text-safe (6.6:1 on surface) */
  --accent-line: #0a9a88;     /* the base path in charts */
  --observed: #44423d;        /* recorded data dots */
  --band: #dedbd2;            /* uncertainty band */
  --s1: #2a78d6;              /* package lines, fixed order, validated for CVD */
  --s2: #d9572b;
  --s3: #8a5cf0;
  --s4: #b8872a;
  --s5: #c43a86;
  --focus: #0b6f63;
  --serif: "Source Serif 4 Variable", "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter Variable", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --measure: 720px;
  --wide: 880px;
  --rail: 220px;
  --gutter: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface: #17201f;
    --surface-2: #1f2928;
    --surface-3: #283432;
    --ink: #ebe8df;
    --ink-2: #b7b3a8;
    --ink-3: #8b877d;
    --rule: #34403e;
    --rule-soft: #2a3534;
    --accent: #5fcdbb;
    --accent-line: #2fb5a2;
    --observed: #c9c5ba;
    --band: #2b3736;
    --s1: #4d8fe0;
    --s2: #e0683f;
    --s3: #a07ff5;
    --s4: #c89a3d;
    --s5: #d35a9d;
    --focus: #5fcdbb;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #17201f;
  --surface-2: #1f2928;
  --surface-3: #283432;
  --ink: #ebe8df;
  --ink-2: #b7b3a8;
  --ink-3: #8b877d;
  --rule: #34403e;
  --rule-soft: #2a3534;
  --accent: #5fcdbb;
  --accent-line: #2fb5a2;
  --observed: #c9c5ba;
  --band: #2b3736;
  --s1: #4d8fe0;
  --s2: #e0683f;
  --s3: #a07ff5;
  --s4: #c89a3d;
  --s5: #d35a9d;
  --focus: #5fcdbb;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  font-feature-settings: "kern", "liga", "calt";
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 560; line-height: 1.2; margin: 0; color: var(--ink); letter-spacing: -0.005em; }
h1 { font-size: clamp(30px, 4.2vw, 42px); font-weight: 600; margin: 0 0 20px; text-wrap: balance; }
h2 { font-size: 27px; margin: 56px 0 16px; }
h3 { font-size: 21px; margin: 32px 0 10px; }
p { margin: 0 0 18px; }
ul, ol { margin: 0 0 18px; padding-left: 24px; }
li { margin-bottom: 6px; }
strong { font-weight: 640; }
em { font-style: italic; }
small, .small { font-size: 15px; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }
table { border-collapse: collapse; width: 100%; font-size: 16px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
th { font-weight: 600; color: var(--ink-2); font-size: 14px; letter-spacing: 0.01em; }
td.num, th.num { text-align: right; white-space: nowrap; }
thead th { border-bottom: 1px solid var(--rule); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface-2); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- header ---------- */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
.site-header .bar {
  max-width: 1200px; margin: 0 auto; padding: 14px var(--gutter);
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
}
.brand { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand:hover { text-decoration: underline; }
.lang-switch { font-size: 15px; color: var(--ink-2); }
.lang-switch a { color: var(--ink-2); }
.lang-switch .current { font-weight: 600; color: var(--ink); }

/* ---------- layout ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter) 64px; }
.question .page { display: grid; grid-template-columns: 1fr; gap: 0 48px; }
main { min-width: 0; }
/* the reading measure applies to prose; figures and tables may use the wide column */
.text { max-width: var(--wide); }
.text > p, .text > ul, .text > ol, .text > h3, .text > h4, .text > blockquote, .text > .note, .text > .packages { max-width: var(--measure); }
.wide { max-width: var(--wide); }
.eyebrow { font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin: 36px 0 10px; font-weight: 600; }
.lede { font-size: 20px; line-height: 1.55; color: var(--ink); }
.lede p { margin-bottom: 16px; }
.meta { color: var(--ink-3); font-size: 15px; margin: 0 0 32px; }

/* section rail */
.rail { display: none; }
@media (min-width: 1100px) {
  .question .page, .home .page { grid-template-columns: var(--rail) minmax(0, 1fr); }
  .rail { display: block; position: sticky; top: 0; align-self: start; padding-top: 44px; height: 100vh; overflow: auto; }
  .rail ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--rule); }
  .rail li { margin: 0; }
  .rail a { display: block; padding: 6px 0 6px 16px; font-size: 14px; color: var(--ink-2); text-decoration: none; margin-left: -1px; border-left: 1px solid transparent; line-height: 1.35; }
  .rail a:hover { color: var(--ink); border-left-color: var(--ink-3); }
  .rail a.active { color: var(--ink); border-left-color: var(--accent); font-weight: 600; }
  .rail .rail-title { font-size: 13px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 10px 16px; font-weight: 600; }
}
/* top bar version of the rail on narrow screens */
.topbar { display: block; margin: 20px 0 0; padding: 0; }
.topbar ol { list-style: none; display: flex; gap: 6px 14px; flex-wrap: wrap; padding: 0; margin: 0; font-size: 14px; }
.topbar li { margin: 0; }
.topbar a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 1px; }
.topbar a:hover { color: var(--ink); border-bottom-color: var(--ink); }
@media (min-width: 1100px) { .topbar { display: none; } }

/* landing page: the rail also lists the eight questions; the page may use a little more width for the diagram */
.home .page { display: grid; grid-template-columns: 1fr; gap: 0 48px; }
@media (min-width: 1100px) { .home .page { grid-template-columns: var(--rail) minmax(0, 1fr); } }
.rail .rail-qs { margin-top: 22px; }
.rail .rail-qs a { color: inherit; text-decoration: none; padding: 0; border: 0; margin: 0; display: inline; font-size: inherit; font-weight: inherit; }
.rail .rail-qs a:hover { color: var(--ink); }
.rail .rail-back { margin: 0 0 14px 16px; font-size: 14px; }
.rail .rail-back a { display: inline; padding: 0; border: 0; margin: 0; color: var(--accent); }
.rail span { display: block; padding: 6px 0 6px 16px; font-size: 14px; color: var(--ink-3); line-height: 1.35; }
.topbar ol.qs { margin-top: 8px; }
.topbar span { color: var(--ink-3); }
.topbar + .text, .topbar + section { margin-top: 24px; }

/* ---------- figures ---------- */
figure { margin: 28px 0 36px; }
figure.chart { max-width: var(--wide); }
figure.chart figcaption { margin: 0 0 10px; }
figure.chart .fig-title { font-family: var(--serif); font-size: 20px; font-weight: 600; margin: 0; }
figure.chart .fig-sub { font-size: 15px; color: var(--ink-2); margin: 2px 0 0; }
figure.chart .plot { position: relative; }
figure.chart svg { display: block; width: 100%; height: auto; font-family: var(--sans); }
figure.chart .chart-narrow { display: none; }
@media (max-width: 640px) {
  figure.chart .chart-wide { display: none; }
  figure.chart .chart-narrow { display: block; }
}
/* chart marks are drawn with CSS variables so dark mode follows */
.c-axis { stroke: var(--rule); stroke-width: 1; }
.c-tick { fill: var(--ink-3); font-size: 13px; }
.c-ylabel { fill: var(--ink-3); font-size: 13px; }
.c-obs { fill: var(--observed); stroke: var(--surface); stroke-width: 2; }
.c-base { fill: none; stroke: var(--accent-line); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.c-band { fill: var(--band); stroke: none; }
.c-pkg { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.c-rule { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 4; }
.c-rule-label { fill: var(--ink-3); font-size: 12.5px; }
.c-endlabel { fill: var(--ink-2); font-size: 13px; }
.c-endlabel.base { fill: var(--ink); font-weight: 600; }
.c-leader { stroke: var(--rule); stroke-width: 1; fill: none; }
.c-endmark { stroke: var(--surface); stroke-width: 2; }
.c-cross { stroke: var(--ink-3); stroke-width: 1; opacity: 0; }
.c-hit { fill: transparent; }
.s1 { stroke: var(--s1); } .s2 { stroke: var(--s2); } .s3 { stroke: var(--s3); } .s4 { stroke: var(--s4); } .s5 { stroke: var(--s5); }
.f-s1 { fill: var(--s1); } .f-s2 { fill: var(--s2); } .f-s3 { fill: var(--s3); } .f-s4 { fill: var(--s4); } .f-s5 { fill: var(--s5); }
.f-base { fill: var(--accent-line); } .f-obs { fill: var(--observed); } .f-band { fill: var(--band); }

/* key row: legend plus hover readout */
.key { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; color: var(--ink-2); }
.key li { margin: 0; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.key .sw { display: inline-block; width: 18px; height: 0; border-top: 2.5px solid; border-color: var(--accent-line); }
.key .sw.dot { width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--observed); }
.key .sw.band { width: 18px; height: 10px; border: 0; background: var(--band); }
.sw.s1 { border-color: var(--s1); } .sw.s2 { border-color: var(--s2); } .sw.s3 { border-color: var(--s3); } .sw.s4 { border-color: var(--s4); } .sw.s5 { border-color: var(--s5); }
.key .val { color: var(--ink); font-variant-numeric: tabular-nums; min-width: 0; }
.key .yr { font-weight: 600; color: var(--ink); }
.key-note { font-size: 14px; color: var(--ink-3); margin: 6px 0 0; }

/* data table under the chart */
details.data { margin: 12px 0 0; border-top: 1px solid var(--rule-soft); }
details.data summary { cursor: pointer; padding: 10px 0; font-size: 15px; color: var(--accent); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
details.data summary::-webkit-details-marker { display: none; }
details.data summary::before { content: "+"; display: inline-block; width: 14px; color: var(--ink-3); margin-right: 6px; }
details.data[open] summary::before { content: "\2212"; }
details.data summary .csv { font-size: 14px; color: var(--ink-2); margin-left: auto; }
details.data .tbl { overflow-x: auto; max-height: 420px; overflow-y: auto; border: 1px solid var(--rule-soft); border-radius: 4px; }
details.data table { font-size: 14px; min-width: 100%; }
details.data thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; }
details.data td, details.data th { padding: 5px 10px; white-space: nowrap; }
details.data tr.obs-row td:first-child { font-weight: 600; }
/* the table of packages that are not charted: the description wraps, the numbers do not */
details.scen td:nth-child(2) { white-space: normal; min-width: 320px; }
details.scen td:first-child { white-space: normal; min-width: 160px; font-weight: 600; }
details.scen th { white-space: normal; }
details.scen summary { justify-content: flex-start; }

/* loop diagram */
figure.loop { max-width: 560px; }
figure.loop svg { width: 100%; height: auto; display: block; font-family: var(--sans); }
.l-node { fill: var(--surface-2); stroke: var(--rule); stroke-width: 1; }
.l-text { fill: var(--ink); font-size: 14px; font-weight: 500; }
.l-edge { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.l-arrow { fill: var(--ink-2); }
.l-sign { fill: var(--ink); font-size: 15px; font-weight: 700; }
.l-centre { fill: var(--ink-3); font-size: 13px; font-style: italic; }
figure.loop figcaption { font-size: 15px; color: var(--ink-2); margin-top: 8px; }

/* lever cards */
.levers { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 20px 0 32px; max-width: var(--wide); list-style: none; padding: 0; }
.lever { background: var(--surface-2); border-radius: 6px; padding: 18px 20px; margin: 0; }
.lever h3 { margin: 0 0 10px; font-size: 20px; }
.lever dl { margin: 0; font-size: 15px; line-height: 1.5; }
.lever dt { color: var(--ink-3); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 10px; }
.lever dd { margin: 2px 0 0; color: var(--ink); }

/* package list */
.packages { list-style: none; padding: 0; margin: 16px 0 24px; max-width: var(--measure); }
.packages li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: baseline; margin: 0 0 10px; }
.packages .sw { display: inline-block; width: 18px; height: 0; border-top-width: 2.5px; border-top-style: solid; position: relative; top: -4px; }
.packages .name { font-weight: 600; }
.packages .desc { color: var(--ink-2); }

/* assessment table */
.assessment { max-width: var(--wide); overflow-x: auto; margin: 16px 0 20px; }
.assessment table { font-size: 14px; min-width: 640px; }
.assessment th, .assessment td { padding: 7px 6px; }
.assessment th { font-size: 13px; line-height: 1.3; }
.assessment th:first-child, .assessment td:first-child { font-weight: 600; white-space: nowrap; padding-left: 0; }
.assessment td { color: var(--ink); }
.assessment td.num, .assessment th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.assessment td.who { min-width: 150px; font-size: 13.5px; color: var(--ink-2); line-height: 1.4; }
.sec-assessment .text > p:first-of-type { font-size: 14px; color: var(--ink-3); }

/* callouts */
.note { background: var(--surface-2); border-left: 3px solid var(--accent-line); padding: 14px 18px; margin: 20px 0; font-size: 16px; border-radius: 0 4px 4px 0; max-width: var(--measure); }
.note p:last-child { margin-bottom: 0; }

/* question cards on the landing page */
.cards { display: grid; grid-template-columns: 1fr; gap: 18px; list-style: none; padding: 0; margin: 24px 0 40px; }
.card { background: var(--surface-2); border-radius: 6px; padding: 20px 22px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.card .n { font-size: 13px; color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.card h3 { margin: 0; font-size: 21px; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card .answer { color: var(--ink-2); font-size: 16px; margin: 0; }
.card .num { font-family: var(--serif); font-size: 26px; font-weight: 600; margin-top: auto; }
.card .num small { display: block; font-family: var(--sans); font-size: 14px; color: var(--ink-3); font-weight: 500; }
.card.soon { opacity: 0.6; }
@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr; } }
.home main h1 { margin-top: 44px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--rule); margin-top: 48px; }
.site-footer .inner { max-width: 1200px; margin: 0 auto; padding: 32px var(--gutter) 48px; font-size: 15px; color: var(--ink-2); }
.site-footer p { max-width: var(--measure); }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 16px; padding: 0; list-style: none; }

/* ---------- print ---------- */
@media print {
  body { font-size: 11pt; background: #fff; color: #000; }
  .site-header, .rail, .topbar, .site-footer .links, .skip { display: none !important; }
  figure.chart .chart-narrow { display: none; }
  figure.chart .chart-wide { display: block; }
  details.data { display: none; }
  a { color: inherit; text-decoration: none; }
  h2 { break-after: avoid; }
  figure { break-inside: avoid; }
}

/* model diagram (landing page) */
figure.model { max-width: none; margin: 20px 0 28px; }
.text figure.model { max-width: var(--wide); width: 100%; }
figure.model .scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
figure.model svg { width: 100%; height: auto; display: block; font-family: var(--sans); }
@media (max-width: 719px) { figure.model svg { min-width: 760px; } }
.m-box { fill: var(--surface-2); stroke: var(--rule); stroke-width: 1; }
.m-name { fill: var(--ink); font-family: var(--serif); font-size: 17px; font-weight: 600; }
.m-desc { fill: var(--ink-2); font-size: 14px; }
.m-edge { stroke-width: 1.6; }
.m-legend-title { fill: var(--ink-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.m-label { fill: var(--ink); font-size: 14px; font-weight: 500; }
.m-label-bg { fill: var(--surface); stroke: none; }
figure.model figcaption { font-size: 15px; color: var(--ink-2); margin-top: 8px; }
