/* Data reports (/report/<year>/). Builds on style.css tokens; charts are inline SVG from
   scripts/report/build-report.mjs. Layout follows research-report conventions: one reading column,
   numbered exhibits with a takeaway headline, a source line and a table view under every chart. */

.rp {
  --rp-col: 760px;
  --rp-accent: #9E4560;
  max-width: calc(var(--rp-col) + 2.5rem);
  margin-inline: auto;
  padding: 3.5rem 1.25rem 2rem;
}

/* ---------- Masthead ---------- */
.rp-mast {
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--ink);
}
.rp-mast__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.015em;
  margin-bottom: 0.45em;
}
.rp-mast__dek {
  font-size: clamp(1.1rem, 2.6vw, 1.3rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 40em;
}
.rp-mast__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Key findings ---------- */
.kf {
  padding: 1.5rem 0 2rem;
  border-bottom: 1px solid var(--hairline);
}
.kf__heading {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.kf__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem 1.75rem;
}
.kf__item {
  border-top: 2px solid var(--ink);
  padding-top: 0.7rem;
}
.kf__item:first-child {
  border-top-color: var(--rp-accent);
}
.kf__value {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(1.75rem, 4.2vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}
.kf__text {
  display: block;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ---------- Contents ---------- */
.rp-toc ol {
  list-style: none;
  padding: 1rem 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--hairline);
}
.rp-toc a {
  color: var(--ink-soft);
  text-decoration: none;
}
.rp-toc a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gold);
}

/* ---------- Chapters ---------- */
.rp-chapter {
  padding-top: 3rem;
  scroll-margin-top: 72px;
}
.rp-chapter > h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 2.6rem);
  margin-bottom: 0.6em;
  padding-top: 0.6rem;
  border-top: 1px solid var(--ink);
}
.rp-chapter > h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  margin: 1.6em 0 0.4em;
}
.rp-chapter > p,
.rp-list li {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 40em;
  margin-bottom: 1em;
}
.rp-list {
  list-style: none;
  padding-left: 0;
}
.rp-list li {
  font-size: 1rem;
  margin-bottom: 0.6em;
}
.rp-list strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Exhibits ---------- */
.ex {
  margin: 2.25rem 0 2.5rem;
  scroll-margin-top: 72px;
}
.ex__title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.35;
  letter-spacing: -0.005em;
  margin-bottom: 0.25rem;
}
.ex__sub {
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
  margin-bottom: 1.1rem;
}
.ex-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.ex-svg--m {
  display: none;
}
.ex__source {
  margin-top: 0.9rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}
.ex__source span {
  color: var(--ink);
  font-weight: 600;
}
.ex__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.25rem 1.5rem;
  margin-top: 0.4rem;
  font-size: 0.82rem;
}
.ex__data {
  flex: 1 1 100%;
  order: 2;
}
.ex__data summary,
.ex__dl {
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
}
.ex__data summary {
  display: list-item;
  list-style-position: inside;
  width: max-content;
}
.ex__data[open] summary {
  margin-bottom: 0.5rem;
}

/* SVG text classes (also embedded in the downloadable SVGs) */
.t-axis { font: 400 12px var(--font-body); fill: var(--muted); font-variant-numeric: tabular-nums; }
.t-tiny { font-size: 10px; }
.t-label { font: 400 12.5px var(--font-body); fill: var(--ink-soft); }
.t-value { font: 500 12px var(--font-body); fill: var(--ink); font-variant-numeric: tabular-nums; }
.t-strong { font-weight: 600; fill: var(--ink); }
.t-inbar, .t-incell { font: 600 12px var(--font-body); }
.ex-svg [data-tip] { cursor: default; }
.ex-svg [data-tip]:hover { opacity: 0.82; }

/* ---------- Tables ---------- */
.rp-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.rp-table-wrap--inline {
  margin: 1.5rem 0 2rem;
}
.rp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.rp-table caption {
  text-align: left;
  font-weight: 600;
  font-size: 0.95rem;
  padding-bottom: 0.5rem;
}
.rp-table th,
.rp-table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--hairline);
  text-align: right;
  white-space: nowrap;
}
.rp-table th:first-child {
  text-align: left;
  padding-left: 0;
}
.rp-table thead th {
  font-weight: 500;
  color: var(--muted);
  border-bottom-color: var(--ink);
  font-size: 0.78rem;
}
.rp-table tbody th {
  font-weight: 500;
  color: var(--ink);
}
.rp-table td {
  color: var(--ink-soft);
}

/* ---------- Reuse, citation, app ---------- */
.rp-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}
.rp-downloads a,
.rp-reuse a {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
}
.rp-cite {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9rem !important;
  background: var(--wash);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
}
.rp-app {
  margin-top: 3.5rem;
  padding: 1.75rem;
  background: var(--wash-rose);
  border-radius: var(--radius);
}
.rp-app h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.8rem;
  margin-bottom: 0.3em;
}
.rp-app p {
  color: var(--ink-soft);
  margin-bottom: 1rem;
}
.rp-app__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.rp-app .app-store-btn {
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  gap: 0.5rem;
}

.rp-footer {
  border-top: 1px solid var(--hairline);
  margin-top: 3rem;
  padding: 1.5rem 1.25rem 2.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.rp-footer__inner {
  max-width: var(--rp-col, 760px);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}
.rp-footer ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  padding: 0;
  margin: 0;
}
.rp-footer a {
  color: var(--muted);
}
/* Language links to every translation of the report (markup and base styles shared with the landing page) */
.rp-footer__langs {
  max-width: var(--rp-col, 760px);
  margin: 1.25rem auto 0;
}
.rp-footer .lang-switcher__list {
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

/* ---------- Tooltip ---------- */
.rp-tip {
  position: fixed;
  z-index: 200;
  max-width: 280px;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: var(--ink);
  color: var(--ivory);
  font-size: 0.8rem;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(45, 41, 38, 0.18);
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .rp { padding-top: 2.25rem; }
  .kf__list { grid-template-columns: 1fr 1fr; gap: 1.25rem 1rem; }
  .ex-svg--d { display: none; }
  .ex-svg--m { display: block; }
  .rp-table .wide-only { display: none; }
  .rp-table { font-size: 0.8rem; }
  .rp-table th, .rp-table td { padding-inline: 0.3rem; }
  .rp-table tbody th { white-space: normal; min-width: 6.5em; }
}
@media (max-width: 380px) {
  .kf__list { grid-template-columns: 1fr; }
}

/* ---------- Print: "Save as PDF" gives the press copy ---------- */
@media print {
  @page { size: A4; margin: 16mm 14mm; }
  .nav, .rp-footer, .rp-app, .rp-toc, .ex__tools, .rp-tip { display: none !important; }
  .rp { padding: 0; max-width: none; }
  .ex-svg--d { display: block !important; }
  .ex-svg--m { display: none !important; }
  .rp-chapter { break-before: page; padding-top: 0; }
  .ex, .rp-table-wrap--inline, .kf__item { break-inside: avoid; }
  .ex__title { break-after: avoid; }
  body { background: #fff; }
}
