/*
 * civic.css — the "Nordic Civic Editorial" theme for the HAND-WRITTEN pages
 * (terms, privacy, delete-account, news, guide). The generated country pages
 * carry the same tokens in seo/src/layouts/Base.astro; seo/DESIGN.md is the
 * source of truth for both, so a token changes there first.
 *
 * Fonts come from /fonts/fonts.css, which seo/sync.py copies into
 * hosting/public. These pages are restyled only: their wording is the legal or
 * reference text and is not touched by a design change.
 */
:root {
  --heading: #0e1d31; --brand: #243247; --brand-ink: #0e1d31; --on-brand: #ffffff;
  --secondary: #4d5e83;
  --bg: #fbf9f4; --canvas: #f6f4f0; --surface: #ffffff; --cont: #f0eee9; --cont-high: #eae8e3;
  --ink: #1b1c19; --muted: #44474d; --subtle: #5b677c;
  --line: #e1dcd3; --line-strong: #7a8599; --ok: #1e6b52; --no: #ba1a1a;
  --band: #243247; --on-band: #ffffff; --on-band-muted: #b5c6f0;
  --accent: #005293;
  --shadow: 0 1px 2px rgba(36, 50, 71, .06), 0 1px 3px rgba(36, 50, 71, .04);
  --lift: 0 4px 16px -2px rgba(36, 50, 71, .10);
  --serif: 'EB Garamond', ui-serif, Georgia, 'Times New Roman', serif;
  --sans: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Consolas, monospace;
  --tap: 150ms cubic-bezier(.2, .6, .3, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --heading: #e3e9f3; --brand: #a9b9d9; --brand-ink: #c9d6ee; --on-brand: #0e1d31;
    --secondary: #a9b9d9;
    --bg: #10151d; --canvas: #0b1017; --surface: #18202b; --cont: #1f2834; --cont-high: #273141;
    --ink: #e6e8ec; --muted: #b8bfca; --subtle: #8f9bb0;
    --line: #2a3341; --line-strong: #6c7a91; --ok: #6fd3a3; --no: #ff9b9b;
    --band: #1a2433; --accent: #7fb6ec;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --lift: 0 6px 20px -4px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 .9375rem/1.65 var(--sans);
       -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-underline-offset: .2em; transition: color var(--tap), background var(--tap), box-shadow var(--tap); }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 3px; }
.skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { display: inline-block; padding: .5rem; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; color: var(--heading); text-wrap: balance; }
p, li { text-wrap: pretty; }
.wrap { max-width: 1140px; margin-inline: auto; padding-inline: 1.25rem; }
@media (min-width: 64rem) { .wrap { padding-inline: 3rem; } }
.eyebrow { font: 700 .75rem/1.33 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--secondary); margin: 0; }
.chip { display: inline-flex; align-items: center; gap: .375rem; padding: .125rem .625rem; border-radius: 999px;
        background: var(--cont-high); color: var(--secondary); font: 700 .75rem/1.33 var(--sans);
        letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; fill: currentColor; }

/* ── Site header (static: a fixed bar can cover a focused control) ── */
.site-head { background: var(--bg); box-shadow: 0 1px 8px rgba(0, 0, 0, .04); position: relative; z-index: 1; }
.site-head .head { min-height: 5rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
                   gap: .5rem 1.5rem; padding-block: .75rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; display: block; }
.brand .name { font-family: var(--serif); font-size: 1.375rem; font-weight: 500; color: var(--heading); }
.brand .by { font-size: .8125rem; color: var(--subtle); }
.site-nav { display: flex; flex-wrap: wrap; gap: .5rem 2rem; font-size: .875rem; font-weight: 600; }
.site-nav a { color: var(--muted); text-decoration: none; padding-block: .25rem; }
.site-nav a:hover { color: var(--heading); }
.site-nav a[aria-current='page'] { color: var(--heading); box-shadow: inset 0 -2px 0 var(--heading); }
.app-pill { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem 1rem; border-radius: 999px;
            background: var(--brand-ink); color: var(--on-brand); text-decoration: none; font-size: .875rem; font-weight: 600;
            box-shadow: var(--shadow); }
.app-pill:hover { background: var(--brand); color: var(--on-brand); }
@media (prefers-color-scheme: dark) { .app-pill:hover { background: #e3e9f3; } }
@media (max-width: 47.99rem) {
  .site-nav { order: 3; width: 100%; padding-top: .5rem; border-top: 1px solid var(--line); gap: .5rem 1.25rem; }
}

/* ── Document hero ── */
.doc-hero { background: var(--canvas); padding-block: 2.5rem 3rem; }
.doc-hero .back { display: inline-flex; align-items: center; gap: .375rem; font-size: .875rem; font-weight: 600;
                  color: var(--secondary); text-decoration: none; margin-bottom: 1rem; }
.doc-hero .back:hover { color: var(--heading); }
.doc-hero .back .icon { width: 18px; height: 18px; }
.doc-hero h1 { margin: .5rem 0 .5rem; font-size: clamp(2.125rem, 1.6rem + 2.2vw, 3rem); line-height: 1.17; letter-spacing: -.015em; }
.doc-hero .sub { margin: 0; font-family: var(--serif); font-size: 1.1875rem; line-height: 1.47; color: var(--secondary); }
.doc-hero .lede { margin: 1rem 0 0; max-width: 46rem; font-size: 1.0625rem; color: var(--muted); }
.doc-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.doc-meta .chip { background: var(--surface); box-shadow: var(--shadow); color: var(--heading); }

/* ── Document body: sticky contents rail + section cards ── */
.doc-shell { display: grid; gap: 2rem; padding-block: 2.5rem 4rem; align-items: start; }
@media (min-width: 64rem) { .doc-shell.has-toc { grid-template-columns: 15rem minmax(0, 1fr); gap: 3rem; } }
.toc { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 1.25rem; }
@media (min-width: 64rem) { .toc { position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow: auto; } }
.toc .eyebrow { margin-bottom: .75rem; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .125rem; }
.toc a { display: block; padding: .375rem .625rem; border-radius: 8px; border-inline-start: 2px solid transparent;
         color: var(--muted); text-decoration: none; font-size: .8125rem; line-height: 1.4; }
.toc a:hover { background: var(--canvas); color: var(--heading); border-inline-start-color: var(--secondary); }
.toc li.sub a { padding-inline-start: 1.375rem; }
.doc { min-width: 0; display: grid; gap: 1.25rem; }
.doc-card { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 1.5rem; scroll-margin-top: 1.5rem; }
@media (min-width: 40rem) { .doc-card { padding: 2rem; } }
.doc-card > :first-child { margin-top: 0; }
.doc-card > :last-child { margin-bottom: 0; }
.doc-card.intro-card { border-inline-start: 3px solid var(--secondary); }
.doc-grid2 { display: grid; gap: 1.25rem; }
@media (min-width: 48rem) { .doc-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.doc-grid2 .doc-card { border-top: 3px solid var(--brand); }

.doc h2 { font-size: clamp(1.5rem, 1.3rem + .8vw, 1.875rem); line-height: 1.25; letter-spacing: -.01em; margin: 0 0 1rem; }
.doc h3 { font-size: 1.25rem; font-weight: 500; margin: 1.5rem 0 .5rem; }
.doc p { margin: 0 0 .875rem; color: var(--muted); max-width: 70ch; }
.doc p strong, .doc li strong { color: var(--heading); font-weight: 600; }
.doc ul, .doc ol { margin: 0 0 1rem; padding-inline-start: 1.25rem; color: var(--muted); max-width: 70ch; }
.doc li { margin-bottom: .375rem; }
.doc li::marker { color: var(--secondary); }
.doc ol > li::marker { font-weight: 700; }
.doc a.contact, .doc p a, .doc li a { color: var(--brand); font-weight: 600; }
.doc .version { display: inline-flex; margin: 0; }
.doc .intro { font-size: 1.0625rem; color: var(--ink); }
.doc table { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; font-size: .8125rem;
             border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.doc th { text-align: start; padding: .75rem 1rem; background: var(--cont); color: var(--secondary);
          font: 700 .75rem/1.33 var(--sans); letter-spacing: .09em; text-transform: uppercase; }
.doc td { padding: .75rem 1rem; border-top: 1px solid var(--line); color: var(--muted); vertical-align: top; }
.doc td:first-child { color: var(--heading); font-weight: 600; }
.doc .tablewrap { overflow-x: auto; }

/* ── News ── */
.news-list { display: grid; gap: 1.25rem; }
@media (min-width: 48rem) { .news-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.news-list article { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden;
                     display: flex; flex-direction: column; }
.news-list article:first-child { grid-column: 1 / -1; }
.news-list img { width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; display: block; }
.news-list .body { padding: 1.5rem; }
.news-list .date { font: 700 .75rem/1.33 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--secondary); margin: 0 0 .5rem; }
.news-list h2 { margin: 0 0 .5rem; font-size: 1.5rem; line-height: 1.25; }
.news-list p { margin: 0; color: var(--muted); }

/* ── Footer ── */
.site-foot { background: var(--canvas); border-top: 1px solid var(--line); padding-block: 4rem 2rem;
             font-size: .8125rem; color: var(--muted); }
.foot-grid { display: grid; gap: 2rem; }
@media (min-width: 48rem) { .foot-grid { grid-template-columns: 5fr 4fr 3fr; } }
.foot-org { display: flex; align-items: center; flex-wrap: wrap; gap: .625rem; margin: 0 0 .5rem; }
.foot-org .org { font-family: var(--serif); font-size: 1.375rem; font-weight: 500; color: var(--heading); }
.motto { font-family: var(--serif); font-style: italic; font-size: 1.1875rem; line-height: 1.47; color: var(--muted); margin: 0; }
.foot-about { margin: .75rem 0 0; max-width: 24rem; }
.foot-col ul { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .5rem; }
.foot-col a { color: var(--muted); text-decoration: none; }
.foot-col a:hover { color: var(--heading); }
@media (min-width: 48rem) { .foot-legal { justify-self: end; } }
.foot-base { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line);
             display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; }
.foot-base p { margin: 0; font-variant-numeric: tabular-nums; }
.dot-ok { display: inline-block; width: .375rem; height: .375rem; border-radius: 50%; background: var(--ok);
          margin-inline-end: .5rem; vertical-align: middle; }

@media print {
  .site-head, .toc, .site-foot, .skip { display: none !important; }
  .doc-card { box-shadow: none; padding: 0; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
