/* CPIN Explorer theme, inspired by Shu Ding’s COBE demo (https://cobe.vercel.app): white page, one electric blue,
   square corners, blue label tags with white pixel lettering, thin blue rules, soft motion.
   Reading text uses Geist Sans; Geist Pixel and Geist Mono carry labels, numbers and chrome. */

@font-face { font-family: "Geist"; src: url("../vendor/fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../vendor/fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Pixel"; src: url("../vendor/fonts/GeistPixel-Square.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Geist Pixel Line"; src: url("../vendor/fonts/GeistPixel-Line.woff2") format("woff2"); font-display: swap; }

:root {
  --font-text: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-pixel: "Geist Pixel", "Geist Mono", ui-monospace, monospace;
  --font-display: "Geist Pixel Line", "Geist Pixel", ui-monospace, monospace;

  --bg: #ffffff;
  --surface: #ffffff;
  --sunken: #f6f7f9;
  --ink: #171d24;                          /* COBE body: lab(13 -1.8 -7) */
  --ink-2: #66717c;                        /* COBE secondary: lab(48 -2 -7) */
  --ink-3: #9aa3ad;
  --line: #e4e7eb;
  --line-strong: #cfd4da;
  --blue: #2a3cf5;
  --blue: lab(36 55.64 -107.68);           /* COBE's blue */
  --blue-ink: #ffffff;
  --blue-wash: color-mix(in oklab, var(--blue) 7%, var(--bg));
  --blue-line: color-mix(in oklab, var(--blue) 35%, var(--bg));

  /* Redline: never colour alone. Insertions are COBE blue and underlined; deletions red and struck through. */
  --ins: var(--blue);
  --ins-wash: color-mix(in oklab, var(--blue) 10%, var(--bg));
  --del: #c2262e;
  --del-wash: color-mix(in oklab, #e0434b 12%, var(--bg));

  /* No longer current: archived, withdrawn and superseded editions, and countries with no current note.
     Red text and red tags stay above 4.5:1 (WCAG AA) on the page and on --sunken in both themes. */
  --red: #b4232b;                          /* 6.5:1 on white; white on it 6.5:1 */
  --red-ink: #ffffff;
  --red-wash: color-mix(in oklab, #e0434b 9%, var(--bg));
  --red-line: color-mix(in oklab, var(--red) 45%, var(--bg));

  --focus: var(--blue);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --t-fast: 160ms;
  --t: 280ms;
  --t-slow: 520ms;

  /* Half the height of a capital letter. A mark beside a line of capitals or digits (a dot, a flag, a
     tick box) stands on their baseline and is then moved to their middle: up by this, less half its own
     height. .355em is Geist's and Geist Mono's (Geist Pixel's is .361em); where the browser has the cap
     unit (below) it is read from the font in use. */
  --half-cap: .355em;

  /* Fluid sizing: 16px on a 1080p laptop, ~21px on a 4K monitor, 15px on a phone. */
  font-size: clamp(15px, 0.42vw + 8.6px, 22px);
  color-scheme: light;
}
@supports (width: 1cap) { :root { --half-cap: .5cap; } }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c10; --surface: #10131a; --sunken: #151922;
    --ink: #e7eaf0; --ink-2: #9aa4b2; --ink-3: #6b7480;
    --line: #232834; --line-strong: #323949;
    --blue: #6b7cff; --blue: lab(58 38 -82);
    --ins: var(--blue); --ins-wash: color-mix(in oklab, var(--blue) 22%, var(--bg));
    --del: #ff7b81; --del-wash: color-mix(in oklab, #e0434b 22%, var(--bg));
    --red: #ff8088; --red-ink: #0a0c10; --red-wash: color-mix(in oklab, #e0434b 16%, var(--bg)); --red-line: color-mix(in oklab, var(--red) 45%, var(--bg));
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0c10; --surface: #10131a; --sunken: #151922;
  --ink: #e7eaf0; --ink-2: #9aa4b2; --ink-3: #6b7480;
  --line: #232834; --line-strong: #323949;
  --blue: #6b7cff; --blue: lab(58 38 -82);
  --ins: var(--blue); --ins-wash: color-mix(in oklab, var(--blue) 22%, var(--bg));
  --del: #ff7b81; --del-wash: color-mix(in oklab, #e0434b 22%, var(--bg));
  --red: #ff8088; --red-ink: #0a0c10; --red-wash: color-mix(in oklab, #e0434b 16%, var(--bg)); --red-line: color-mix(in oklab, var(--red) 45%, var(--bg));
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* The whole site at 75% on a computer: sizes are in rem, so the
   root size scales type and spacing alike, as the browser's own 75% zoom did. A phone keeps the full size. */
@media (min-width: 700px) { html { font-size: 75%; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-text); line-height: 1.55; letter-spacing: .005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: color-mix(in oklab, var(--blue) 22%, transparent); }

/* Components */

/* One-line labels in boxes (tags, buttons, chips) are set with no leading (line-height: normal). A taller
   line carries leading above and below the letters, and browsers round the upper share down to a whole
   pixel, which lifts the letters by up to a pixel in their box. With none, the line is the font's own
   height, and centring it centres the capitals (Geist's ascent less its descent is its cap height). */

/* Blue label tag, as on the COBE globe ("TOKYO"). As tall as a 1em line with .72em of padding. */
.tag {
  display: inline-flex; align-items: center; gap: .4em;
  font-family: var(--font-pixel); font-size: .72rem; line-height: normal; letter-spacing: .06em;
  text-transform: uppercase; white-space: nowrap;
  height: 1.72em; padding: 0 .55em; background: var(--blue); color: var(--blue-ink);
}
/* A tag set on the baseline of a line of bigger words (a row whose words may run to more lines: the tag
   keeps to the first). Its capitals are shorter than theirs, so it is raised by half the difference to be
   level with them: .722em is the height of its own capitals, .71 of --words (the words' font size, set by
   the row) the height of theirs. Used as: position: relative; top: var(--rise). */
.tag { --rise: calc((.722em - .71 * var(--words, 1em)) / 2); }
.tag--outline { background: var(--bg); color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.tag--muted { background: var(--sunken); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
/* No longer current guidance (archived, withdrawn, superseded): red, never colour alone (the word says it). */
.tag--red { background: var(--red); color: var(--red-ink); }

/* Small uppercase section label ("USAGE"). */
.eyebrow {
  font-family: var(--font-pixel); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-2); margin: 0;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: 2.4rem; padding: 0 .85rem; border: 1px solid var(--line-strong); border-radius: 0;
  background: var(--surface); color: var(--ink); cursor: pointer;
  font-family: var(--font-mono); font-size: .8rem; line-height: normal; letter-spacing: .02em;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.btn:hover { border-color: var(--blue); color: var(--blue); }
/* A link drawn as a button is a button: its hover is the blue border and text, never the link underline. */
a.btn:hover, a.btn:focus-visible { text-decoration: none; }
.btn--primary { background: var(--blue); border-color: var(--blue); color: var(--blue-ink); }
.btn--primary:hover { color: var(--blue-ink); filter: brightness(1.08); }
kbd {
  font-family: var(--font-mono); font-size: .7em; padding: .1em .4em; border: 1px solid var(--line-strong);
  color: var(--ink-2); background: var(--sunken);
}

/* Big pixel numerals (counts, the odometer date). */
.numeral { font-family: var(--font-pixel); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: .08em; color: var(--blue); }

/* Entrance: things pop in (scale, fade and de-blur), never jump. */
@keyframes pop-in { from { opacity: 0; transform: translateY(.35rem) scale(.985); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.pop-in { animation: pop-in var(--t) var(--ease) both; }

/* Folding (owner, 4 Nov 2026: "smooth ... slower animation rather than snap"). Whatever opens and closes in place
   eases its height and fades over --t, never snapping and never bouncing; with reduced motion it is instant.
   A <details> does this by itself: below where the browser can ease a height to "auto", else shared/fold.js.
   Anything else wraps what folds in <div class="fold-body"><div>...</div></div> and puts .is-folded on the
   .fold-body or on an element round it. A folded body is hidden (not focusable, not found by the browser's find). */
.fold-body { display: grid; grid-template-rows: 1fr; }
.fold-body > * { min-height: 0; overflow-y: clip; overflow-clip-margin: .4rem; }
.is-folded .fold-body, .fold-body.is-folded { grid-template-rows: 0fr; opacity: 0; visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .fold-body { transition: grid-template-rows var(--t) var(--ease-in-out), opacity var(--t) var(--ease-in-out), visibility 0s linear 0s; }
  .is-folded .fold-body, .fold-body.is-folded { transition-delay: 0s, 0s, var(--t); }   /* hidden only once it has closed */
  @supports (interpolate-size: allow-keywords) {
    details::details-content {   /* flow-root: a first child's top margin grows with the rest instead of jumping */
      display: flow-root; interpolate-size: allow-keywords; block-size: 0; opacity: 0; overflow-y: clip; overflow-clip-margin: .4rem;
      transition: block-size var(--t) var(--ease-in-out), opacity var(--t) var(--ease-in-out), content-visibility var(--t) allow-discrete;
    }
    details[open]::details-content { block-size: auto; opacity: 1; }
    details:not([open])::details-content { pointer-events: none; }   /* a menu that is fading out cannot be clicked */
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
}

/* A question asked in the page itself, never in a browser pop-up (shared/inline-ask.js;). */
.inline-ask { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; margin: .5rem 0; padding: .6rem .8rem; border: 1px solid var(--blue-line); background: var(--blue-wash); color: var(--ink); font-size: .86rem; }
.inline-ask-text { margin: 0; flex: 1 1 16rem; min-width: 0; overflow-wrap: anywhere; white-space: pre-line; }
.inline-ask-form { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem .9rem; width: 100%; }
.inline-ask-form label { display: grid; gap: .25rem; flex: 1 1 16rem; font-size: .8rem; color: var(--ink-2); }
.inline-ask-form input { padding: .45rem .6rem; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); font: inherit; }
.inline-ask-actions { display: inline-flex; flex-wrap: wrap; gap: .4rem; }
.inline-ask .inline-ask-yes { border-color: var(--red); color: var(--red); }
.inline-ask .inline-ask-yes:hover { background: var(--red); color: var(--red-ink); }

/* Lists in the site's style, in place of the browser's own: the court list and the suggested names. */
.dd { position: relative; display: inline-flex; align-items: center; gap: .5rem; }
.dd-label { font-family: var(--font-mono); font-size: .72rem; color: var(--ink-2); }
.dd-btn { display: inline-flex; align-items: center; gap: .6rem; max-width: 24rem; padding: .45rem .7rem; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); font: inherit; font-size: .84rem; cursor: pointer; text-align: left; }
.dd-btn:hover, .dd-btn[aria-expanded="true"] { border-color: var(--blue); }
.dd-caret { margin-left: auto; font-family: var(--font-mono); font-size: .7rem; color: var(--ink-2); }
.dd-menu { position: absolute; z-index: 30; top: calc(100% + .25rem); left: 0; min-width: 100%; max-height: 24rem; overflow: auto; margin: 0; padding: .3rem; list-style: none; border: 1px solid var(--line-strong); background: var(--surface); box-shadow: 0 .6rem 1.6rem rgb(0 0 0 / .28); }
.dd-menu li { padding: .45rem .7rem; font-size: .84rem; cursor: pointer; white-space: normal; }
.dd-menu li[role="option"]:hover, .dd-menu li.is-active, .dd-menu li[aria-selected="true"] { background: var(--blue-wash); }
.dd-menu li[aria-selected="true"] { color: var(--blue); }
.dd-menu .dd-group { cursor: default; padding: .5rem .7rem .2rem; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.pp-suggest { position: fixed; z-index: 60; top: auto; }
.pp-suggest[hidden] { display: none; }
.dd-native { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }
.dd--select { display: inline-flex; }
.dd--select .dd-btn { min-height: 2.2rem; width: 100%; }
.dd--select .dd-btn:disabled { opacity: .5; cursor: default; }
.dd-menu--select { position: fixed; z-index: 70; top: auto; }
.dd-menu--select li[role="option"]:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

/* The calendar for choosing a date (shared/date-picker.js), in the same style as the lists. */
.cal { position: fixed; z-index: 80; width: 17.5rem; padding: .6rem; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); box-shadow: 0 .6rem 1.6rem rgb(0 0 0 / .28); font-size: .84rem; }
.cal-head { display: flex; align-items: center; gap: .15rem; margin-bottom: .4rem; }
.cal-title { flex: 1 1 auto; text-align: center; font-family: var(--font-mono); font-size: .76rem; letter-spacing: .04em; }
.cal-nav { width: 1.8rem; height: 1.8rem; padding: 0; border: 1px solid transparent; background: transparent; color: var(--ink-2); font: 400 1rem/1 var(--font-text); cursor: pointer; }
.cal-nav:hover { border-color: var(--blue); color: var(--blue); }
.cal-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-wd { padding: .2rem 0; text-align: center; font-family: var(--font-mono); font-size: .64rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.cal-day { height: 2.1rem; padding: 0; border: 1px solid transparent; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.cal-day.is-out { color: var(--ink-3); }
.cal-day:hover { background: var(--blue-wash); }
.cal-day.is-today { border-color: var(--line-strong); }
.cal-day.is-chosen { background: var(--blue); color: var(--blue-ink); }
.cal :is(.cal-day, .cal-nav, .cal-today, .cal-close):focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.cal-foot { display: flex; justify-content: space-between; margin-top: .4rem; padding-top: .4rem; border-top: 1px solid var(--line); }
.cal-today, .cal-close { padding: .3rem .6rem; border: 0; background: transparent; color: var(--blue); font: inherit; cursor: pointer; }
.cal-today:hover, .cal-close:hover { text-decoration: underline; }

/* The facts under a country's name: a ticker strip, a small label over each figure with hairlines between (also the top right of a country schedule). */
.ticker { display: flex; flex-wrap: wrap; margin: 0 0 1.2rem; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.ticker > * { display: grid; gap: .15rem; padding: .55rem 1.3rem .6rem 0; margin-right: 1.3rem; border-right: 1px solid var(--line); text-decoration: none; }
.ticker > :last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.ticker .k { font-family: var(--font-mono); font-size: .64rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
.ticker .v { font-family: var(--font-pixel); font-size: 1.35rem; letter-spacing: .03em; color: var(--ink); }
.ticker a .v { color: var(--blue); }
.ticker a:hover .v { text-decoration: underline; }
.ticker .is-over .v { color: var(--red); }
