/* Country stories (wrp-country.html). Colours, type sizes and spacing are
   site.css's; the marks take the chart kit's --ck-* colours, so they follow
   the theme as they are. Everything here is named cs-. */

/* ---------- the hero: the country, its picker, three headline figures ---------- */
.cs-hero .hero-inner { align-items: start; }
/* the title takes the keyboard when the country changes, so a screen reader starts there: no ring */
.cs-hero h1:focus { outline: none; }
.cs-pick { margin-top: 1.5rem; max-width: 24rem; }
.cs-pick select { width: 100%; }
.cs-tiles { flex-direction: column; gap: 1.25rem; }
.cs-tile-sub { margin-top: 0.3rem; font-size: var(--t-2); line-height: 1.45; color: var(--muted); }
@media (max-width: 900px) {
  .cs-tiles { flex-direction: row; flex-wrap: wrap; gap: 1.25rem 1.5rem; }
  .cs-tiles .stat { flex: 1 1 13rem; }
}

/* ---------- the story ---------- */
.cs-page { padding-top: 0.5rem; }
.cs-steps {
  display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; padding: 0.6rem 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: var(--t-2); font-weight: 600;
}
.cs-steps a { display: inline-flex; align-items: center; min-height: var(--tap, 2.75rem); text-decoration: underline; text-underline-offset: 2px; }
.cs-step { margin-top: 3.25rem; }
.cs-step .stage-head { margin-bottom: 1.25rem; }
.cs-step .stage-head .eyebrow { margin-bottom: 0.35rem; }
.cs-say { max-width: 48rem; margin-bottom: 1.25rem; font-family: var(--font-serif); font-size: var(--t-4); line-height: 1.6; color: var(--ink-2); }
.cs-say:empty { display: none; }
.cs-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.cs-actions:empty { display: none; }

.cs-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1.25rem; margin-bottom: 0.25rem; font-size: var(--t-2); color: var(--ink-2); }
.cs-legend:empty { display: none; }
.cs-legend > span { display: inline-flex; align-items: center; gap: 0.45rem; }
.cs-legend .cs-arrow { margin-right: 0; }
.cs-key { flex: none; display: inline-block; }
.cs-key-me { width: 12px; height: 12px; border-radius: 50%; background: var(--ck-c1); }
.cs-key-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ck-grey); }
.cs-key-mid { width: 2px; height: 16px; background: var(--ck-strong); }
.cs-key-rest { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ck-strong); background: var(--ck-surface); }
.cs-caveat { max-width: 60rem; margin-top: 1.25rem; }
.cs-arrow { display: inline-block; margin-right: 0.35rem; font-style: normal; font-size: 0.8em; }
/* no clear change: a short level bar */
.cs-arrow-level { width: 0.7rem; height: 3px; vertical-align: middle; background: currentColor; }

.cs-group { margin-top: 1rem; padding: 1rem 1.25rem 0.9rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.cs-group > h3 { margin-bottom: 0.5rem; font-size: var(--t-1); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); }
.cs-group > h3 span { margin-left: 0.5rem; font-size: var(--t-2); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }

/* ---------- a row: a name, a 0 to 100 strip of marks, the figure ---------- */
.cs-row { display: grid; grid-template-columns: minmax(9rem, 16rem) minmax(0, 1fr) 8.75rem; align-items: center; gap: 0 1.25rem; min-height: 2.5rem; border-top: 1px solid var(--line); }
.cs-row.cs-axis { min-height: 0; border-top: 0; }
.cs-label { font-size: var(--t-3); font-weight: 600; line-height: 1.3; color: var(--ink); }
.cs-label:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.cs-pos { text-align: right; white-space: nowrap; font-size: var(--t-2); font-variant-numeric: tabular-nums; color: var(--muted); }
.cs-pos b { margin-right: 0.3rem; font-size: var(--t-3); font-weight: 700; color: var(--ink); }
.cs-ticks { position: relative; height: 1.2rem; margin: 0 8px; }
.cs-ticks i { position: absolute; top: 0; transform: translateX(-50%); font-style: normal; font-size: var(--t-1); font-variant-numeric: tabular-nums; color: var(--muted); }
/* a line down the strip at 0, 25, 50, 75 and 100 */
.cs-strip {
  position: relative; height: 2.5rem; margin: 0 8px;
  background: linear-gradient(to right, var(--ck-grid) 1px, transparent 1px) 0 0 / 25% 100%;
  border-right: 1px solid var(--ck-grid);
}
.cs-dot, .cs-me, .cs-rest { position: absolute; top: 50%; border-radius: 50%; }
.cs-dot { width: 8px; height: 8px; margin: -4px 0 0 -4px; background: var(--ck-grey); opacity: 0.5; cursor: pointer; }
.cs-dot:hover { opacity: 1; background: var(--ck-strong); z-index: 2; }
.cs-mid { position: absolute; top: 5px; bottom: 5px; width: 2px; margin-left: -1px; background: var(--ck-strong); z-index: 1; }
.cs-me { width: 14px; height: 14px; margin: -7px 0 0 -7px; background: var(--ck-c1); box-shadow: 0 0 0 2px var(--ck-surface); z-index: 3; }
.cs-rest { width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2.5px solid var(--ck-strong); background: var(--ck-surface); box-shadow: 0 0 0 2px var(--ck-surface); z-index: 2; }
.cs-bar { position: absolute; top: 50%; height: 4px; margin-top: -2px; background: var(--ck-grey); opacity: 0.55; }
/* a mark is easier to point at than it is to see */
.cs-dot::before, .cs-mid::before, .cs-me::before, .cs-rest::before { content: ''; position: absolute; inset: -5px; }
@media (max-width: 700px) {
  .cs-group { padding: 0.85rem 0.75rem 0.6rem; }
  .cs-row { grid-template-columns: minmax(0, 1fr) auto; gap: 0 0.75rem; padding-top: 0.5rem; }
  .cs-row .cs-strip { grid-column: 1 / -1; grid-row: 2; height: 2rem; }
  .cs-row.cs-axis { padding-top: 0; }
  .cs-row.cs-axis > span { display: none; }
  .cs-row.cs-axis .cs-ticks { grid-column: 1 / -1; }
}

/* ---------- what has moved: one small chart for each measure ---------- */
.cs-minis { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem 1.75rem; }
.cs-mini h4 { font-size: var(--t-3); font-weight: 700; line-height: 1.3; }
.cs-mini h4 a { color: var(--ink); }
.cs-mini h4 a:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.cs-move { margin: 0.15rem 0 0.3rem; font-size: var(--t-2); color: var(--ink-2); }
.cs-mini svg { display: block; width: 100%; height: auto; max-width: 420px; }
@media (max-width: 560px) { .cs-minis { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; } }

/* ---------- every figure ---------- */
.cs-table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.cs-table { width: 100%; min-width: 44rem; border-collapse: collapse; font-size: var(--t-2); }
.cs-table th, .cs-table td { padding: 0.5rem 0.85rem; border-bottom: 1px solid var(--line); }
.cs-table thead th { font-size: var(--t-1); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-align: left; vertical-align: bottom; }
.cs-table thead th.num { text-align: right; }
.cs-table tbody th { text-align: left; font-weight: 600; color: var(--ink); }
.cs-table tbody:last-child tr:last-child > * { border-bottom: 0; }
.cs-table-group th { background: var(--surface-2); font-size: var(--t-1); font-weight: 700; letter-spacing: 0.04em; color: var(--ink-2); }
.cs-method { max-width: 60rem; margin-top: 2rem; padding: 1.1rem 1.4rem; background: var(--surface-2); border-radius: var(--r); }
.cs-method h3 { margin-bottom: 0.4rem; font-size: var(--t-3); font-weight: 800; }
.cs-method p { font-size: var(--t-2); line-height: 1.65; color: var(--ink-2); }

/* ---------- other countries ---------- */
.cs-next { margin-top: 3.25rem; padding-top: 1.1rem; border-top: 2px solid var(--ink); }
.cs-next h2 { margin-bottom: 0.6rem; font-size: var(--t-5); font-weight: 800; letter-spacing: -0.02em; }
.cs-next ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.cs-next li a, .cs-regions li a { display: inline-flex; align-items: center; min-height: var(--tap, 2.75rem); font-size: var(--t-3); font-weight: 600; }
.cs-index { margin-top: 1.5rem; }
.cs-regions { columns: 4 15rem; column-gap: 2.5rem; }
.cs-regions section { break-inside: avoid; margin-bottom: 1.5rem; }
.cs-regions h3 { padding-bottom: 0.35rem; border-bottom: 1px solid var(--ink); font-size: var(--t-1); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); }
.cs-regions ul { list-style: none; }
.cs-regions li a { min-height: 2.25rem; color: var(--ink); text-decoration: none; }
.cs-regions li a:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }

/* With the system's own colours forced on, a background is dropped: the marks keep theirs. */
@media (forced-colors: active) {
  .cs-dot, .cs-mid, .cs-me, .cs-rest, .cs-bar, .cs-key { forced-color-adjust: none; }
  .cs-dot, .cs-key-dot, .cs-bar { background: GrayText; opacity: 1; }
  .cs-me, .cs-key-me { background: Highlight; box-shadow: 0 0 0 2px Canvas; }
  .cs-mid, .cs-key-mid { background: CanvasText; }
  .cs-rest, .cs-key-rest { border-color: CanvasText; background: Canvas; box-shadow: none; }
  .cs-strip { background: none; border: 0; }
}
