/* Country report pages (/country_report/{slug}), generated by generate_country_pages.py.
   Loaded after root-pages.css. Colours: tokens only (see DESIGN_NOTES.md → Design Tokens). */

.cr {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 2rem 3.5rem;
}

/* Anchor targets clear the fixed navbar and the sticky timeline (--cr-tl-h set by JS) */
.cr [id] { scroll-margin-top: calc(var(--nav-h) + var(--cr-tl-h, 0px) + 16px); }

/* ── Head ─────────────────────────────────────────────── */
.cr-head {
  padding-bottom: 1.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.cr-crumbs {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 0.9rem;
}
.cr-crumbs a { color: var(--text-muted); text-decoration: none; }
.cr-crumbs a:hover { color: var(--text); }
.cr-crumbs span[aria-current] { color: var(--text-muted); }

.cr-head h1 {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-strong);
  margin: 0 0 0.35rem;
}
.country-intro {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  margin: 1.1rem 0 0;
}
.cr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1.25rem;
}
.cr-action {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 14px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--text-strong);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cr-action:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.cr-action--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}
.cr-action--ghost:hover { background: var(--hover-overlay); border-color: var(--border-hover); color: var(--text); }

/* ── Timeline (sticky; drawn by country-report.js) ─────── */
.cr-timeline {
  position: sticky;
  top: var(--nav-h);
  z-index: 50;
  background: var(--bg);
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--border);
}
.cr-tl-chart {
  touch-action: pan-y;          /* horizontal drag scrubs, vertical swipe still scrolls */
  cursor: pointer;
  user-select: none;
  outline: none;
}
.cr-tl-chart:focus-visible { box-shadow: 0 0 0 2px var(--accent); border-radius: 2px; }
.cr-tl-chart svg { display: block; overflow: visible; }
.cr-tl-tick {
  font-family: 'Mulish', sans-serif;
  font-size: 12px;
  fill: var(--text-muted);
}
.cr-tl-nc {
  font-family: 'Mulish', sans-serif;
  font-size: 12px;
  font-style: italic;
  fill: var(--text-faint);
  pointer-events: none;
}
.cr-tl-readout {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-height: 24px;
  margin-top: 6px;
  font-size: 14px;
  line-height: 24px;
  color: var(--text-muted);
}
.cr-tl-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cr-tl-text b { color: var(--text-strong); font-weight: 700; }
.cr-tl-years { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cr-tl-sep { margin: 0 10px; color: var(--text-faint); }
.cr-tl-entry { color: var(--text); }
.cr-tl-hint { font-style: italic; color: var(--text-faint); }
.cr-tl-bg {
  flex-shrink: 0;
  order: 2;
  font-size: 13px;
  color: var(--accent-hover);
  text-decoration: none;
}
.cr-tl-bg::before { content: "↑ "; }
.cr-tl-bg:hover { text-decoration: underline; }

/* ── Period blocks (one per run of the yearly label) ─── */
.cr-block {
  padding: 1.75rem 0 0.5rem;
  border-bottom: 1px solid var(--border);
}
.cr-block-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-strong);
  margin: 0 0 0.2rem;
}
.cr-block-head a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-hover); text-underline-offset: 3px; }
.cr-block-head a:hover { text-decoration-color: var(--text); }
.cr-swatch {
  flex-shrink: 0;
  align-self: center;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--border-hover);   /* stays visible for "part of" blocks without a colour */
  overflow: hidden;
}
.cr-swatch svg { display: block; width: 100%; height: 100%; }
.cr-years {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.cr-gov {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0 0 0.25rem;
}
.cr-gov a { color: var(--accent); text-decoration: none; }
.cr-gov a:hover { text-decoration: underline; }
.cr-empty {
  font-size: 13px;
  font-style: italic;
  color: var(--text-faint);
  margin: 0.6rem 0 1.25rem;
}

/* ── Entries (one per report row) ─────────────────────── */
.cr-entry { padding: 1.1rem 0 0.6rem; }
.cr-entry + .cr-entry { border-top: 1px solid var(--divider); }
.cr-entry-head time {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.cr-entry-head h3 {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  margin: 0 0 0.25rem;
}
.cr-prev { font-weight: 400; color: var(--text-muted); }

.cr-text p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 0.8rem;
  text-align: justify;
  hyphens: auto;
}
.cr-text a.cite {
  color: inherit;
  text-decoration: underline dotted var(--text-faint);
  text-underline-offset: 2px;
}
.cr-text a.cite:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
.fn { line-height: 0; }
.fn a {
  font-size: 0.72em;
  font-weight: 700;
  color: var(--accent-hover);
  text-decoration: none;
  padding: 0 1px;
}
.fn a:hover { text-decoration: underline; }

/* ── Back matter ──────────────────────────────────────── */
.cr-back section { padding-top: 2rem; }
.cr-back h2 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}
.cr-refs ol {
  margin: 0;
  padding-left: 2.2em;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-muted);
}
.cr-refs li { padding: 1px 0; overflow-wrap: anywhere; }
.cr-refs a { color: var(--accent-hover); text-decoration: none; }
.cr-refs a:hover { text-decoration: underline; }
.cr-refs a.backref { color: var(--text-faint); margin-left: 2px; }

.cr-lit ul { list-style: none; margin: 0; padding: 0; }
.cr-lit li {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
  padding: 2px 0 2px 1.5em;
  text-indent: -1.5em;          /* hanging indent */
  overflow-wrap: anywhere;
}
.cr-lit a { color: var(--accent-hover); text-decoration: none; }

.cr-acr dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 1rem;
  margin: 0;
  font-size: 12.5px;
}
.cr-acr dt { font-weight: 700; color: var(--text); }
.cr-acr dd { margin: 0; color: var(--text-muted); }

.cr-cite p {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow-wrap: anywhere;
}

.cr-related ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cr-related a {
  display: inline-block;
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.cr-related a:hover { color: var(--text); border-color: var(--border-hover); background: var(--hover-overlay); }

/* ── Phones ───────────────────────────────────────────── */
@media (max-width: 767px) {
  .cr { padding: 1.25rem 1rem 2.5rem; }
  .cr-head h1 { font-size: 1.45rem; }
  .country-intro { font-size: 0.95rem; }
  .cr-block-head { font-size: 1.05rem; }
  .cr-text p { text-align: left; }
  .cr-timeline { padding-top: 8px; }
  .cr-tl-readout { font-size: 13px; }
  .cr-action { min-height: 44px; }
  .cr-related a { padding: 8px 12px; }
}

/* ════════════════════════════════════════════════════════
   Country index (/country_report), drawn by country-index.js
   ════════════════════════════════════════════════════════ */
.ci {
  --ci-cols: minmax(140px, 210px) 1fr minmax(140px, 230px);
  --ci-gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 2rem 3.5rem;
}

/* ── Filters (group by, regime chips) ─────────────────── */
.ci-filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 1rem; }
.ci-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-right: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ci-seg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ci-btn {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ci-btn:hover { background: var(--hover-overlay); border-color: var(--border-hover); color: var(--text); }
.ci-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--text-strong); }
.ci-btn:focus-visible, .ci-chip:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 1px; }

.ci-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.ci-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 12px;
  line-height: 1.3;
  padding: 3px 9px 3px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}
.ci-chip:hover { background: var(--hover-overlay); border-color: var(--border-hover); color: var(--text); }
.ci-chip[aria-pressed="true"] { background: var(--active-overlay); border-color: var(--highlight-soft); color: var(--text-strong); }
.ci-chip.is-zero { opacity: 0.4; }
.ci-chip-n { color: var(--text-faint); font-variant-numeric: tabular-nums; }
.ci-chip[aria-pressed="true"] .ci-chip-n { color: var(--text-muted); }
.ci-sw {
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  border: 1px solid var(--border-hover);
  overflow: hidden;
}
.ci-sw svg { display: block; width: 100%; height: 100%; }
.ci-clear {
  font: inherit;
  font-size: 12px;
  background: none;
  border: none;
  color: var(--accent-hover);
  cursor: pointer;
  padding: 3px 6px;
}
.ci-clear:hover { text-decoration: underline; }

/* ── Sticky bar: search, year, axis ───────────────────── */
.ci-tools {
  position: sticky;
  top: var(--nav-h);
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 0 4px;
}
.ci-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.ci-find { position: relative; flex: 0 1 300px; min-width: 0; }
.ci-search {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
}
.ci-search::placeholder { color: var(--text-faint); }
.ci-search:focus { outline: none; border-color: var(--accent); }
.ci-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 260px;
  max-height: 340px;
  overflow-y: auto;
  z-index: 60;
  list-style: none;
  margin: 0;
  padding: 4px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 5px;
  box-shadow: 0 6px 18px var(--shadow);
}
.ci-suggest a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 13.5px;
  color: var(--text);
  text-decoration: none;
}
.ci-suggest [aria-selected="true"] a { background: var(--active-overlay); color: var(--text-strong); }
.ci-sug-name b { font-weight: 700; color: var(--text-strong); }
.ci-sug-reg { flex-shrink: 0; font-size: 11.5px; color: var(--text-faint); }
.ci-sug-none { padding: 7px 10px; font-size: 13px; font-style: italic; color: var(--text-faint); }
.ci-year { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.ci-year-inp {
  width: 64px;
  flex-shrink: 0;
  padding: 4px 6px;
  font-family: 'Mulish', monospace;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  -moz-appearance: textfield;
}
.ci-year-inp:focus { outline: none; border-color: var(--accent); }
.ci-year-inp::-webkit-outer-spin-button,
.ci-year-inp::-webkit-inner-spin-button { -webkit-appearance: none; }
/* same look as the year slider on the map pages (shared/controls.css) */
.ci-year-slider {
  flex: 1 1 0;
  min-width: 0;
  height: 20px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  outline: none;
}
.ci-year-slider::-webkit-slider-runnable-track { height: 3px; background: var(--input-bg); border: 1px solid var(--divider); border-radius: 2px; }
.ci-year-slider::-moz-range-track { height: 3px; background: var(--input-bg); border-radius: 2px; border: none; }
.ci-year-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--highlight); border: none;
  box-shadow: 0 1px 4px var(--shadow);
  cursor: pointer; margin-top: -6px;
}
.ci-year-slider::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--highlight); border: none;
  box-shadow: 0 1px 4px var(--shadow);
}
.ci-year-slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--accent); }
.ci-count { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.ci-count b { color: var(--text-strong); }

.ci-axisrow {
  display: grid;
  grid-template-columns: var(--ci-cols);
  column-gap: var(--ci-gap);
  align-items: end;
  padding: 8px 8px 0;
}
.ci-colhead {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding-bottom: 5px;
}
.ci-axis { position: relative; height: 24px; cursor: ew-resize; touch-action: pan-y; user-select: none; }
.ci-axis svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ci-tick { font-family: 'Mulish', sans-serif; font-size: 10.5px; fill: var(--text-muted); }
.ci-axis::after {                /* year knob on the axis, same position as the strip cursors */
  content: "";
  position: absolute;
  bottom: -5px;
  left: var(--ci-cursor, 100%);
  width: 11px;
  height: 11px;
  margin-left: -5.5px;
  border-radius: 50%;
  background: var(--highlight);
  box-shadow: 0 1px 4px var(--shadow);
  pointer-events: none;
}

.ci-hint { font-size: 12.5px; color: var(--text-faint); margin: 0.9rem 0 0; }

/* ── Groups and rows ──────────────────────────────────── */
.ci-group > h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-strong);
  margin: 2rem 0 0.25rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.ci-sub > h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 1.1rem 0 0.3rem;
}
.ci-n { font-weight: 600; color: var(--text-faint); letter-spacing: 0; }
.ci-rows { list-style: none; margin: 0; padding: 0; }
.ci-row {
  display: grid;
  grid-template-columns: var(--ci-cols);
  column-gap: var(--ci-gap);
  align-items: center;
  min-height: 28px;
  padding: 3px 8px;
  border-radius: 4px;
}
.ci-row:hover { background: var(--hover-overlay); }
.ci-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ci-name:hover, .ci-name:focus-visible { color: var(--text-strong); text-decoration: underline; text-underline-offset: 3px; }
.ci-strip { position: relative; display: block; height: 14px; cursor: pointer; }
.ci-strip svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ci-strip::after {               /* year cursor; --ci-cursor is set on .ci by country-index.js */
  content: "";
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: var(--ci-cursor, 100%);
  width: 2px;
  margin-left: -1px;
  background: var(--highlight);
  opacity: 0.8;
  pointer-events: none;
}
.ci-now {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 12.5px;
  color: var(--text-muted);
}
.ci-now span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-now .is-out { font-style: italic; color: var(--text-faint); }
.ci-empty { font-size: 14px; color: var(--text-muted); margin: 2rem 0; text-align: center; }

.ci-tip {
  position: fixed;
  z-index: 100;
  max-width: 320px;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
  background: var(--tooltip-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  box-shadow: 0 4px 14px var(--shadow);
  pointer-events: none;
}
.ci-tip b { color: var(--text-strong); }
.ci-tip-y { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ci-tip-go { display: block; margin-top: 2px; font-size: 11px; color: var(--text-faint); }

@media (max-width: 767px) {
  .ci { --ci-gap: 10px; padding: 1rem 1rem 2.5rem; }
  .ci-tools { padding-top: 8px; }
  .ci-find { flex: 1 1 100%; }
  .ci-search { height: 40px; }
  .ci-suggest a { padding: 10px; }
  .ci-year { flex: 1 1 100%; }
  .ci-year-slider::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -10px; }
  .ci-year-slider::-moz-range-thumb { width: 22px; height: 22px; }
  .ci-count { display: none; }
  .ci-axisrow { grid-template-columns: 1fr; padding: 6px 4px 0; }
  .ci-colhead { display: none; }
  .ci-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "name now" "strip strip";
    row-gap: 4px;
    padding: 7px 4px;
  }
  .ci-name { grid-area: name; font-size: 14px; }
  .ci-now { grid-area: now; justify-content: flex-end; font-size: 11.5px; max-width: 55vw; }
  .ci-strip { grid-area: strip; }
  .ci-btn { min-height: 40px; }
  .ci-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .ci-chip { flex-shrink: 0; padding: 6px 10px 6px 7px; }
}
