/* ===== Article layout ===== */
.article-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 60px;
  align-items: start;
}

/* ===== Colored hero band + centered header card ===== */
.article-top {
  background: linear-gradient(to bottom, var(--accent-tint) 0, var(--accent-tint) 360px, #fff 360px);
  padding: 40px 24px 8px;
  margin: 0 !important;
  display: block;
}
body { background: #fff !important; }
html { background: #fff !important; }

/* Breadcrumb */
.breadcrumb {
  display: none;
}
.breadcrumb a {
  color: var(--navy, #002147);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.breadcrumb a:hover { color: #000; }
.breadcrumb span { margin: 0 9px; color: rgba(0,33,71,.45); }

/* ===== Article header card ===== */
.article-header {
  background: #fff;
  max-width: 860px;
  margin: 26px auto 0;
  padding: 48px 64px 34px;
  text-align: center;
}
.article-title {
  font-family: 'Playfair Display', serif;
  font-size: 46px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--navy, #002147);
  margin: 0 auto 20px;
  max-width: 640px;
}
.article-standfirst {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 21px;
  line-height: 1.5;
  color: #5a7184;
  font-weight: 400;
  max-width: 600px;
  margin: 0 auto 32px;
}

/* Byline: two columns with a divider and a top rule */
.article-byline {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding-top: 26px;
  border-top: 1px solid #e8ecf1;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 15px;
  color: #44505f;
}
.byline-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}
.byline-left { align-items: center; text-align: center; }
.byline-right { align-items: flex-start; text-align: left; }
.article-byline a {
  color: var(--navy, #002147);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-byline a:hover { color: var(--blue, #0066cc); }
.byline-date { color: #6b7685; }
.byline-divider { width: 1px; background: #e8ecf1; align-self: stretch; }
.byline-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--navy, #002147);
}
.byline-link svg { width: 17px; height: 17px; flex: 0 0 auto; }

/* ===== Table of contents (sticky) ===== */
.toc {
  position: sticky;
  top: 96px;
  font-size: 13.5px;
}
.toc-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #9aa3ad;
  margin-bottom: 14px;
}
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin-bottom: 4px; }
.toc a {
  display: block;
  padding: 6px 12px;
  color: #5a6573;
  text-decoration: none;
  border-left: 2px solid #e8ecf1;
  line-height: 1.4;
  transition: color .2s, border-color .2s;
}
.toc a:hover { color: var(--navy, #002147); }
.toc a.active {
  color: var(--navy, #002147);
  font-weight: 600;
  border-left-color: var(--accent);
}

/* ===== Article body (reading column) ===== */
.article-body {
  max-width: 720px;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 19px;
  line-height: 1.7;
  color: #2d3641;
}
.article-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  line-height: 1.25;
  color: var(--navy, #002147);
  font-weight: 700;
  margin: 52px 0 18px;
  scroll-margin-top: 96px;
}
.article-body h3 {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 21px;
  color: var(--navy, #002147);
  font-weight: 600;
  margin: 36px 0 14px;
  scroll-margin-top: 96px;
}
.article-body p { margin-bottom: 22px; }
.article-body a { color: var(--blue, #0066cc); }
.article-body strong { font-weight: 600; color: #1c2530; }

/* Inline citation reference */
sup.ref, .article-body sup:has(a[data-footnote-ref]) {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 12px;
  line-height: 0;
  font-weight: 600;
}
sup.ref a, .article-body a[data-footnote-ref] {
  color: var(--blue, #0066cc);
  text-decoration: none;
  padding: 0 1px;
}
sup.ref a:hover { text-decoration: underline; }

/* Figure / chart card */
figure.chart {
  margin: 40px 0;
  background: #fff;
  border: 1px solid #e8ecf1;
  border-radius: 12px;
  padding: 26px 26px 18px;
  box-shadow: 0 8px 30px rgba(0,33,71,.05);
}
figure.chart .chart-head { margin-bottom: 14px; }
figure.chart .chart-h {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16.5px;
  font-weight: 600;
  color: var(--navy, #002147);
  line-height: 1.35;
}
figure.chart .chart-sub {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 13px;
  color: #8a94a3;
  margin-top: 3px;
}
figure.chart svg { width: 100%; height: auto; display: block; }
figure.chart figcaption {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 12.5px;
  color: #9aa3ad;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f2f5;
}
.chart-legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 13px;
  color: #5a6573;
  margin-top: 10px;
}
.chart-legend-row .lg { display: flex; align-items: center; gap: 7px; }
.chart-legend-row .dot { width: 11px; height: 11px; border-radius: 3px; }

/* Key insight callout */
.key-insight, .article-body blockquote {
  background: color-mix(in srgb, var(--accent) 7%, #fff);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 24px 28px;
  margin: 36px 0;
  font-family: 'Source Sans 3', sans-serif;
}
.key-insight .ki-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 8px;
}
.key-insight .ki-text {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 18px;
  line-height: 1.55;
  color: #2d3641;
}
.key-insight .ki-stat {
  font-family: 'Playfair Display', serif;
  font-size: 38px;
  font-weight: 700;
  color: var(--navy, #002147);
  line-height: 1;
  margin-bottom: 6px;
}

/* ===== Cite / Reuse / Endnotes blocks ===== */
.article-end {
  max-width: 720px;
  margin: 0;
}
.end-block, .article-body .footnotes {
  border-top: 1px solid #e8ecf1;
  padding: 34px 0;
}
.end-block h2, .article-body .footnotes h2 {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 22px;
  color: var(--navy, #002147);
  font-weight: 600;
  margin-bottom: 14px;
  scroll-margin-top: 96px;
}
.end-block p {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: #5a6573;
  margin-bottom: 14px;
}
.end-block a { color: var(--blue, #0066cc); }

/* Citation box with copy */
.cite-box {
  background: #fafbfc;
  border: 1px solid #e8ecf1;
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}
.cite-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #f3f6fa;
  border-bottom: 1px solid #e8ecf1;
}
.cite-box-head .lbl {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #6b7685;
}
.copy-btn {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue, #0066cc);
  background: #fff;
  border: 1px solid #d4dde7;
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.copy-btn:hover { background: var(--navy, #002147); color: #fff; border-color: var(--navy, #002147); }
.copy-btn.copied { background: #1f9e7a; color: #fff; border-color: #1f9e7a; }
.cite-box pre {
  margin: 0;
  padding: 16px;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #2d3641;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Licence pill */
.licence-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fafbfc;
  border: 1px solid #e8ecf1;
  border-radius: 10px;
  padding: 16px 20px;
  margin-top: 8px;
}
.licence-badge {
  flex: 0 0 auto;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background: var(--navy, #002147);
  padding: 7px 12px;
  border-radius: 6px;
  letter-spacing: .5px;
}
.licence-row p { margin: 0; }

/* Reuse section: centered, OWID-style */
.reuse-section-centered {
  text-align: center;
  padding: 64px 32px;
  background: #fff;
  margin: 60px 0 0 0;
  border-top: 1px solid #e8ecf1;
}
.reuse-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  margin-bottom: 36px;
}
.reuse-logo-badge img {
  height: 50px;
  width: auto;
  object-fit: contain;
}
.reuse-section-centered h2 {
  font-family: 'Playfair Display', serif;
  font-size: 34px;
  font-weight: 700;
  color: var(--blue, #0066cc);
  margin: 0 0 26px;
}
.reuse-section-centered p {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #44505f;
  max-width: 780px;
  margin: 0 auto 18px;
}
.reuse-section-centered a { color: var(--blue, #0066cc); }

/* Endnotes */
ol.endnotes, .footnotes ol {
  list-style: none;
  counter-reset: note;
  padding: 0;
  margin: 0;
}
ol.endnotes li, .footnotes li {
  counter-increment: note;
  position: relative;
  padding-left: 34px;
  margin-bottom: 16px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 13.5px;
  line-height: 1.6;
  color: #5a6573;
  scroll-margin-top: 96px;
}
ol.endnotes li::before, .footnotes li::before {
  content: counter(note);
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  background: #eef2f6;
  color: var(--navy, #002147);
  border-radius: 50%;
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
ol.endnotes li a, .footnotes li a { color: var(--blue, #0066cc); word-break: break-word; }

@media (max-width: 940px) {
  .article-wrap { grid-template-columns: 1fr; gap: 0; }
  .toc { display: none; }
  .article-title { font-size: 34px; }
  .article-standfirst { font-size: 18px; }
  .article-body { font-size: 17px; max-width: 100%; }
}

@media (max-width: 720px) {
  .article-top {
    background: linear-gradient(to bottom, var(--yellow, #FDB913) 0, var(--yellow, #FDB913) 170px, #fff 170px);
    padding: 0 14px 8px;
  }
  .article-header { padding: 32px 24px 28px; margin-top: 20px; }
  .article-byline {
    flex-direction: column;
    gap: 18px;
    align-items: center;
  }
  .byline-divider { width: 60%; height: 1px; align-self: center; }
  .byline-right { align-items: center; text-align: center; }
}

/* ===== CMS content: accent, Markdown key-insight blockquote, footnotes ===== */
:root { --accent: #0066cc; --accent-tint: color-mix(in srgb, var(--accent) 18%, #fff); }
.article-body blockquote::before {
  content: "Key insight";
  display: block;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--accent); margin-bottom: 8px;
}
.article-body blockquote p {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 18px; line-height: 1.55; color: #2d3641; margin: 0;
}
.article-body blockquote p:first-of-type > strong:only-child {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 38px; font-weight: 700; color: var(--navy, #002147); line-height: 1;
  margin-bottom: 6px;
}
.footnotes p { display: inline; margin: 0; }
