/* Data visualization styles — "case file" design */
.wrapper--charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr));
  gap: 1.5rem;
  margin: 2rem 0 1rem;
}
.chart-card {
  background: var(--paper-raised);
  border-top: 0.1875rem solid var(--ink);
  padding: 1rem 1.25rem 1.25rem;
}
.chart-card h3 {
  margin: 0 0 0.75rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}
.chart-canvas-wrap { position: relative; height: 15rem; width: 100%; }
.chart-caption { margin: 0.75rem 0 0; color: var(--ink-soft); font-size: 0.875rem; line-height: 1.55; }
.p--chart-intro { margin-bottom: 0; }

/* "Show the data" table fallback under each chart */
.chart-data { margin-top: 0.75rem; font-size: 0.875rem; }
.chart-data summary { cursor: pointer; color: var(--archive); padding: 0.25rem 0; }
.chart-data summary:focus-visible { outline: 0.125rem solid var(--stamp); outline-offset: 0.125rem; }
.chart-data table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.chart-data th, .chart-data td {
  text-align: left; padding: 0.3125rem 0.5rem 0.3125rem 0;
  border-bottom: 0.0625rem solid var(--rule-soft); font-weight: 400;
}
.chart-data th[scope="col"] { font-weight: 700; }
.chart-data .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ===== Interactive data stories (2026-11-07) ===== */
.chart-card--wide { grid-column: 1 / -1; }
.chart-canvas-wrap--tall { height: 22rem; }
.chart-source { margin: 0.5rem 0 0; color: var(--ink-soft); font-size: 0.8125rem; }

/* Scrollytelling: sticky chart beside scrolling step cards */
.scrolly { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2rem; margin: 2.5rem 0 3rem; align-items: start; }
.scrolly__graphic { position: sticky; top: 4.5rem; background: var(--paper-raised); border-top: 0.1875rem solid var(--ink); padding: 1rem 1.25rem 1.25rem; }
.scrolly__label { margin: 0 0 0.5rem; font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; color: var(--stamp); min-height: 1.5em; }
.scrolly__canvas { position: relative; height: 24rem; }
.scrolly__steps { list-style: none; margin: 0; padding: 0; }
.scrolly__step { margin: 0 0 45vh; padding: 1rem 1.25rem; background: var(--paper-raised); border-left: 0.25rem solid var(--rule-soft); transition: border-color 0.25s, box-shadow 0.25s; cursor: pointer; }
.scrolly__step:last-child { margin-bottom: 10vh; }
.scrolly__step.is-active { border-left-color: var(--stamp); box-shadow: 0 0.25rem 1rem rgba(27, 36, 48, 0.08); }
.scrolly__step:focus-visible { outline: 0.125rem solid var(--stamp); outline-offset: 0.125rem; }
.scrolly__step h3 { margin: 0 0 0.375rem; font-size: 1.125rem; }
.scrolly__step p { margin: 0 0 0.5rem; font-size: 0.9375rem; line-height: 1.55; }
.scrolly__step p:last-child { margin-bottom: 0; }
.scrolly__stat { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--stamp); }
@media screen and (max-width: 767px) {
  .scrolly { grid-template-columns: 1fr; gap: 1rem; }
  .scrolly__graphic { top: 3.5rem; z-index: 2; padding: 0.75rem; }
  .scrolly__canvas { height: 13rem; }
  .scrolly__step { margin-bottom: 55vh; position: relative; z-index: 1; }
}

/* World map */
.dp-map { position: relative; background: var(--paper-raised); border-top: 0.1875rem solid var(--ink); padding: 1rem 1.25rem 1.25rem; margin: 2rem 0; }
.dp-map h3 { margin: 0 0 0.5rem; font-family: var(--font-body); font-size: 1rem; font-weight: 700; letter-spacing: 0; }
.dp-map__controls { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.75rem; }
.dp-map__controls button { font: inherit; font-size: 0.875rem; padding: 0.375rem 0.75rem; border: 0.0625rem solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer; border-radius: 0.125rem; }
.dp-map__controls button[aria-pressed="true"] { background: var(--ink); color: var(--paper-raised); border-color: var(--ink); }
.dp-map__controls button:focus-visible { outline: 0.125rem solid var(--stamp); outline-offset: 0.125rem; }
.dp-map__svg svg { display: block; width: 100%; height: auto; }
.dp-map__svg path.has-profile { cursor: pointer; }
.dp-map__tip { position: absolute; pointer-events: none; z-index: 5; max-width: 13rem; background: var(--ink); color: var(--paper-raised); font-size: 0.8125rem; line-height: 1.45; padding: 0.5rem 0.625rem; border-radius: 0.125rem; }
.dp-map__legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-top: 0.75rem; font-size: 0.8125rem; color: var(--ink-soft); align-items: center; }
.dp-map__legend i { display: inline-block; width: 0.875rem; height: 0.875rem; margin-right: 0.375rem; vertical-align: -0.125rem; }
.dp-map__ramp { display: block; width: min(20rem, 100%); height: 0.625rem; }
.dp-map__ramp-labels { display: flex; justify-content: space-between; width: min(20rem, 100%); font-weight: 400; }
.dp-map__ramp-labels b { font-weight: 400; }
.dp-map__fallback { display: none; color: var(--ink-soft); font-size: 0.9375rem; }
.dp-map--unavailable .dp-map__fallback { display: block; }
.dp-map--unavailable .dp-map__controls { display: none; }

/* Compare tool */
.dp-compare__pickers { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0; }
.dp-compare__pickers label { display: flex; flex-direction: column; font-size: 0.8125rem; color: var(--ink-soft); gap: 0.25rem; }
.dp-compare__pickers select { font: inherit; font-size: 0.9375rem; padding: 0.375rem 0.5rem; border: 0.0625rem solid var(--rule); background: var(--paper-raised); color: var(--ink); min-width: 12rem; }
.dp-compare table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.9375rem; }
.dp-compare th, .dp-compare td { text-align: left; padding: 0.4rem 0.5rem 0.4rem 0; border-bottom: 0.0625rem solid var(--rule-soft); font-weight: 400; }
.dp-compare th[scope="col"] { font-weight: 700; }
.dp-compare .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Timelines */
.dp-timeline { list-style: none; margin: 1.25rem 0 2rem; padding: 0 0 0 1.25rem; border-left: 0.125rem solid var(--rule); max-width: var(--measure); }
.dp-timeline li { position: relative; margin: 0 0 1.25rem; padding-left: 0.5rem; }
.dp-timeline li::before { content: ""; position: absolute; left: -1.75rem; top: 0.375rem; width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--paper); border: 0.1875rem solid var(--stamp); }
.dp-timeline time { display: block; font-weight: 700; font-size: 0.875rem; color: var(--stamp); letter-spacing: 0.01em; }
.dp-timeline p { margin: 0.125rem 0 0; }
.dp-timeline .dp-timeline__src { font-size: 0.8125rem; color: var(--ink-soft); }
.dp-timeline__country { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--archive); margin-left: 0.375rem; }
.dp-tl-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.dp-tl-filter button { font: inherit; font-size: 0.8125rem; padding: 0.3rem 0.65rem; border: 0.0625rem solid var(--rule); background: var(--paper-raised); color: var(--ink); cursor: pointer; }
.dp-tl-filter button[aria-pressed="true"] { background: var(--ink); color: var(--paper-raised); }
.dp-tl-year { font-family: var(--font-display); font-size: 1.5rem; margin: 2rem 0 0.5rem; }

/* Wiki infobox chart */
.wiki-chart { margin: 1.5rem 0 2rem; background: var(--paper-raised); border-top: 0.1875rem solid var(--ink); padding: 1rem 1.25rem 1.25rem; max-width: 48rem; }
.wiki-chart h3 { margin: 0 0 0.5rem; font-family: var(--font-body); font-size: 1rem; font-weight: 700; }
.wiki-chart .chart-canvas-wrap { height: 16rem; }
.dp-timeline .dp-tl-yearrow { padding: 0; margin: 0; }
.dp-timeline .dp-tl-yearrow::before { display: none; }
.dp-timeline .dp-tl-yearrow h2 { border-top: 0; padding-top: 0; margin: 1.5rem 0 0.75rem -1.25rem; font-size: 1.5rem; }
.dp-timeline li[hidden] { display: none; }
.wiki-article a.cite { font-size: 0.75rem; color: var(--ink-soft); white-space: normal; }
/* Timelines sit directly inside .p--main, whose ol/li rules (the Pillars list styling in dictator-playbook.css) would otherwise win. */
.p--main > ol.dp-timeline { list-style: none; margin: 1.25rem 0 2rem; padding: 0 0 0 1.5rem; border-left: 0.125rem solid var(--rule); max-width: var(--measure); }
.p--main > ol.dp-timeline > li { position: relative; margin: 0 0 1.25rem; padding: 0 0 0 0.5rem; border: 0; max-width: none; }
.p--main > ol.dp-timeline > li:last-child { border-bottom: 0; margin-bottom: 0; }
.p--main > ol.dp-timeline > li::before { left: -2.05rem; }
.p--main > ol.dp-timeline > li.dp-tl-yearrow { padding: 0; margin: 0; }
.p--main > ol.dp-timeline > li.dp-tl-yearrow h2 { margin: 1.75rem 0 0.75rem -1.5rem; padding: 0 0 0 1.5rem; border-top: 0; background: var(--paper); position: relative; }
.p--main > ol.dp-timeline > li.dp-tl-yearrow:first-child h2 { margin-top: 0; }
.p--main > ol.dp-timeline > li[hidden] { display: none; }
@media screen and (max-width: 767px) { .p--main > ol.dp-timeline > li { padding-left: 0.5rem; } }
