/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT.CSS — Report layout system
   All class names match the sim exactly.
   rpt-* aliases provided for template compatibility.
   ═══════════════════════════════════════════════════════════════════════════ */


/* ── GRID PRIMITIVES ── */

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; }
.two-col-r { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.two-col-wide-narrow { display: grid; grid-template-columns: 3fr 2fr; gap: 28px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.intel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.char-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.geo-three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }


/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT 1 — SECTION LEAD CHART
   sim: .section-lead-chart   alias: .rpt-lead-chart
   ═══════════════════════════════════════════════════════════════════════════ */

.section-lead-chart,
.rpt-lead-chart {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section-lead-chart .slc-lead,
.rpt-lead-chart .rpt-standfirst { margin-bottom: 0; }

.slc-stats-analysis,
.rpt-lead-chart.stats-analysis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.slc-stats-analysis .stat-cards,
.rpt-lead-chart .rpt-stat-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.slc-intro-row,
.rpt-lead-chart.intro-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.slc-intro-row .slc-lead { margin: 0; }

.slc-analysis-col { display: flex; flex-direction: column; }

.section-lead-chart .slc-chart.two-col,
.section-lead-chart .slc-analysis.two-col,
.rpt-lead-chart .rpt-chart-row.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  align-items: start;
}


/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT 2 — KEY FINDINGS + SIDEBAR
   sim: .s2-layout / .s2-main / .s2-sidebar   alias: .rpt-main-sidebar etc.
   ═══════════════════════════════════════════════════════════════════════════ */

.s2-layout,
.rpt-main-sidebar { position: relative; }

.s2-main,
.rpt-main-col { min-width: 0; }

.s2-sidebar,
.rpt-sidebar-col {
  position: absolute;
  top: -30px;
  right: -120px;
  width: 250px;
}

.sidebar-rule,
.rpt-sidebar-rule {
  border-top: 0.75px solid var(--gray-dark);
  margin-bottom: 20px;
}

.sidebar-heading,
.rpt-sidebar-heading {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--report-ink);
  margin-bottom: 10px;
}

.sidebar-toggle,
.rpt-sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 10px 0 0 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  color: var(--pink);
  font-family: var(--font-family);
}

.sidebar-arrow,
.rpt-sidebar-arrow {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.sidebar-arrow.open,
.rpt-sidebar-arrow.open { transform: rotate(180deg); }

.sidebar-toc,
.rpt-sidebar-toc {
  display: none;
  flex-direction: column;
  gap: 0;
  margin-top: 12px;
  background: var(--report-white);
  border: 0.75px solid var(--report-border);
  border-radius: 6px;
  padding: 4px 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  position: relative;
  z-index: 10;
}

.sidebar-toc.open,
.rpt-sidebar-toc.open { display: flex; }

.sidebar-toc-item,
.rpt-sidebar-toc-item {
  font-size: var(--t-small);
  color: var(--report-ink);
  text-decoration: none;
  padding: 7px 14px;
  line-height: 1.4;
  transition: color 0.12s, background 0.12s;
}

.sidebar-toc-item:last-child,
.rpt-sidebar-toc-item:last-child { border-bottom: none; }

.sidebar-toc-item:hover,
.rpt-sidebar-toc-item:hover { color: var(--report-ink); background: var(--report-bg-page); }


/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT 3 — PARA CHART
   sim: .para-chart   alias: .rpt-para-chart
   ═══════════════════════════════════════════════════════════════════════════ */

.para-chart,
.rpt-para-chart {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.para-chart-body,
.rpt-para-body {
  font-size: var(--t-body);
  font-weight: var(--t-body-wt);
  line-height: var(--t-body-lh);
  color: var(--report-ink);
}

.para-chart-figure,
.rpt-para-figure {
  width: 100%;
  border-top: 0.75px solid var(--report-border);
  border-bottom: 0.75px solid var(--report-border);
  padding: 30px 0;
}

.para-chart-title,
.rpt-para-figure-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--report-ink);
  margin-bottom: 0;
  line-height: 1.3;
}

.para-chart-caption {
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--report-ink);
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.para-chart-analysis { display: flex; flex-direction: column; gap: 0; width: 100%; }

.para-chart-source,
.rpt-para-figure-source {
  font-size: var(--t-small);
  color: var(--report-ink);
  line-height: 1.3;
  margin-top: 0;
  padding-top: 10px;
}

.rpt-para-figure-sub {
  font-size: var(--t-body);
  font-weight: 300;
  color: var(--report-ink);
  margin-bottom: 20px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT 4 — ABOUT FLOAT (expandable methodology card)
   sim: .about-float-wrap / .about-bar / .about-body
   alias: .rpt-about-float / .rpt-about-bar etc.
   ═══════════════════════════════════════════════════════════════════════════ */

.about-wrap-grid,
.rpt-about-float { display: block; }

.about-float-wrap,
.rpt-about-float-wrap {
  float: left;
  width: 280px;
  margin: 0 32px 16px 0;
}

.about-wrap-grid.open .about-float-wrap,
.about-wrap-grid.open .rpt-about-float-wrap,
.rpt-about-float.open .rpt-about-float-wrap {
  width: 100%;
  float: none;
  margin-right: 0;
}

.about-wrap-grid > .body { margin-top: 14px; }
.about-wrap-grid.open .about-intro-text,
.rpt-about-float.open .rpt-drop-cap-para { margin-top: 24px; clear: both; }

/* clearfix */
.about-wrap-grid::after,
.rpt-about-float::after { content: ''; display: table; clear: both; }

.about-bar,
.rpt-about-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--report-bg-page);
  padding: 14px 20px;
  border-radius: 6px;
  cursor: pointer;
  width: 280px;
  height: 120px;
  transition: width 0.25s ease, border-radius 0.25s ease;
}

.about-bar.open,
.rpt-about-bar.open {
  width: 100%;
  max-width: 100%;
  border-radius: 6px 6px 0 0;
}

.about-bar-label,
.rpt-about-bar-label {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 0;
}

.about-bar-label-top,
.rpt-about-bar-label-top {
  font-size: var(--t-small);
  font-weight: 300;
  color: var(--report-ink);
}

.about-bar-label-bottom,
.rpt-about-bar-label-bottom {
  font-size: 20px;
  font-weight: 400;
  color: var(--report-ink);
}

.about-bar.open .about-bar-label-bottom,
.rpt-about-bar.open .rpt-about-bar-label-bottom {
  font-size: 22px;
  font-weight: 600;
}

.about-bar-toggle,
.rpt-about-bar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--report-ink);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.about-bar-toggle:hover,
.rpt-about-bar-toggle:hover { background: var(--pink); }

.about-bar-icon,
.rpt-about-bar-icon { width: 16px; height: 16px; color: #fff; }

.about-body,
.rpt-about-body {
  display: none;
  background: var(--report-bg-page);
  border-radius: 0 0 6px 6px;
  padding: 24px 44px;
  margin-top: -4px;
  width: 100%;
  max-width: 100%;
}

.about-body.open,
.rpt-about-body.open { display: block; }

.about-intro,
.rpt-about-para {
  font-size: var(--t-body);
  font-weight: var(--t-body-wt);
  line-height: var(--t-body-lh);
  color: var(--report-ink);
  margin-bottom: 12px;
}

.about-intro:last-child,
.rpt-about-para:last-child { margin-bottom: 0; }

.about-section-rule { width: 100%; max-width: 700px; height: 1px; background: var(--report-border); margin: 0 0 50px; }
.about-sections { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.about-section-item { padding-left: 12px; border-left: 0.75px solid var(--gray-dark); }
.about-section-title { font-size: var(--t-body); font-weight: 600; color: var(--report-ink); margin-bottom: 2px; }
.about-section-body { font-size: var(--t-small); color: var(--report-ink); line-height: 1.6; }
.about-divider { border-top: 0.75px solid var(--report-border); margin: 20px 0; }
.about-confidence { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.about-confidence-title { font-size: var(--t-small); font-weight: 600; color: var(--report-ink); letter-spacing: 0.8px; margin-bottom: 4px; }
.about-confidence-item { display: flex; align-items: flex-start; gap: 10px; font-size: var(--t-small); line-height: 1.6; color: var(--report-ink); }
.about-confidence-item .conf-dot { margin-top: 5px; flex-shrink: 0; }
.about-data p { font-size: var(--t-small); line-height: 1.8; color: var(--report-ink); margin-top: 8px; }


/* ── DROP CAP ── */

/* Applied to .body.drop-cap or .rpt-drop-cap-para */
.drop-cap::first-letter,
.rpt-drop-cap-para::first-letter {
  float: left;
  font-size: 57px;
  line-height: 1;
  font-weight: 400;
  color: var(--report-ink);
  margin-right: 8px;
  margin-top: 2px;
}

.drop-lead,
.rpt-drop-lead { font-weight: 500; }

/* rpt-drop-cap-para wraps text in a span — target the span's first letter */
.rpt-drop-cap-para {
  font-size: var(--t-body);
  font-weight: var(--t-body-wt);
  line-height: var(--t-body-lh);
  color: var(--report-ink);
  margin-top: 12px;
}

.rpt-drop-cap-para > .rpt-drop-lead::first-letter {
  float: left;
  font-size: 57px;
  line-height: 1;
  font-weight: 400;
  color: var(--report-ink);
  margin-right: 8px;
  margin-top: 2px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT 5 — CHART + INSIGHT
   sim: .section-chart-insight   alias: .rpt-chart-insight
   ═══════════════════════════════════════════════════════════════════════════ */

.section-chart-insight,
.rpt-chart-insight { display: grid; grid-template-columns: 3fr 2fr; gap: 32px; align-items: start; }

.section-chart-insight.equal,
.rpt-chart-insight.equal { grid-template-columns: 1fr 1fr; }

.section-chart-insight.chart-wide,
.rpt-chart-insight.chart-wide { grid-template-columns: 2fr 1fr; }

.rpt-chart-insight.reverse { grid-template-columns: 2fr 3fr; }

.section-chart-insight .sci-insight,
.rpt-ci-insight { display: flex; flex-direction: column; gap: 16px; }


/* ═══════════════════════════════════════════════════════════════════════════
   ACTION BAR
   sim: .action-bar   alias: .rpt-action-bar
   ═══════════════════════════════════════════════════════════════════════════ */

.action-bar,
.rpt-action-bar {
  padding: 25px 0 0;
  background: var(--report-white);
  position: relative;
  overflow: visible;
}

.action-bar-inner,
.rpt-action-bar-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.action-btn,
.rpt-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--report-ink);
  cursor: pointer;
  border-radius: 6px;
  text-decoration: none;
  font-family: var(--font-family);
  transition: background 0.15s, color 0.15s;
}

.action-btn:first-child,
.rpt-action-btn:first-child { padding-left: 0; }

.action-btn:hover,
.rpt-action-btn:hover { background: var(--report-bg-page); color: var(--report-ink); }

.action-btn svg,
.rpt-action-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

.action-btn span,
.rpt-action-btn span { font-size: var(--t-small); font-weight: 500; }

.action-btn.active,
.rpt-action-btn.active { background: var(--report-bg-page); color: var(--report-ink); }

.rpt-share-wrap { position: relative; }

.rpt-share-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  background: var(--report-white);
  border: 1px solid var(--gray-light);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  z-index: 100;
  flex-direction: column;
}
.rpt-share-menu.open { display: flex; }

.rpt-share-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--report-ink);
  font-family: var(--font-family);
  font-size: var(--t-small);
  font-weight: 450;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s;
  width: 100%;
  text-align: left;
}
.rpt-share-item:hover { background: var(--report-bg-page); }
.rpt-share-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.rpt-share-divider {
  height: 1px;
  background: var(--gray-light);
  margin: 4px 8px;
}

.rpt-download-tooltip {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--report-ink);
  color: var(--report-white);
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
}
.rpt-download-tooltip.show { opacity: 1; }
.rpt-download-wrap { position: relative; }


/* ═══════════════════════════════════════════════════════════════════════════
   TOC DRAWER
   sim: .toc-drawer   alias: .rpt-toc-drawer
   ═══════════════════════════════════════════════════════════════════════════ */

.toc-drawer,
.rpt-toc-drawer {
  background: var(--report-white);
  border-bottom: 0.75px solid var(--report-border);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.25s ease;
  padding: 0 var(--report-pad);
}

.toc-drawer.open,
.rpt-toc-drawer.open {
  max-height: 700px;
  padding: 20px var(--report-pad) 24px;
}

.toc-nav,
.rpt-toc-nav {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.toc-item,
.rpt-toc-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 5px;
  text-decoration: none;
  color: var(--report-ink);
  font-size: var(--t-body);
  transition: background 0.12s, color 0.12s;
}

.toc-item:hover,
.rpt-toc-item:hover { background: var(--report-bg-page); color: var(--report-ink); }

.toc-num,
.rpt-toc-num {
  font-size: var(--t-small);
  font-weight: 700;
  color: var(--report-ink);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  width: 18px;
}

.toc-label,
.rpt-toc-label { font-weight: 500; }

.meta-icons { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.meta-icon-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; border: none; background: transparent; color: var(--report-ink); cursor: pointer; text-decoration: none; transition: background 0.15s, color 0.15s; }
.meta-icon-btn:hover, .meta-icon-btn.active { background: var(--report-bg-page); color: var(--report-ink); }
.meta-icon-btn svg { width: 15px; height: 15px; flex-shrink: 0; }


/* ═══════════════════════════════════════════════════════════════════════════
   SPLIT-SCREEN CONTEXT OVERRIDES
   ═══════════════════════════════════════════════════════════════════════════ */

.report-container .action-bar { max-width: 800px; margin: 0 auto; }

.report-container .toc-drawer { max-width: 100%; }

.report-container .s2-sidebar { display: none; }

.report-container .about-float-wrap { margin-left: 0; }


/* ═══════════════════════════════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════════════════════════════ */

@media print {
  .toc-drawer, .rpt-toc-drawer {
    max-height: none !important;
    padding: 20px var(--report-pad) 24px !important;
    display: block !important;
  }

  .action-btn, .rpt-action-btn { display: none; }

  .s2-sidebar, .rpt-sidebar-col { display: none; }

  .about-float-wrap, .rpt-about-float-wrap {
    float: none;
    width: 100%;
    margin: 0 0 16px 0;
  }

  .about-body, .rpt-about-body { display: block !important; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 800px) {
  .slc-stats-analysis, .rpt-lead-chart.stats-analysis,
  .slc-intro-row, .rpt-lead-chart.intro-row {
    grid-template-columns: 1fr;
  }

  .section-chart-insight, .rpt-chart-insight,
  .section-chart-insight.equal, .rpt-chart-insight.equal,
  .rpt-chart-insight.reverse, .rpt-chart-insight.chart-wide {
    grid-template-columns: 1fr;
  }

  .s2-sidebar, .rpt-sidebar-col { display: none; }

  .about-float-wrap, .rpt-about-float-wrap {
    float: none !important;
    width: 100% !important;
    margin: 0 0 16px 0 !important;
  }

  .about-bar, .rpt-about-bar { width: 100% !important; height: auto !important; }
  .about-body, .rpt-about-body { max-width: 100% !important; }

  .two-col, .intel-grid, .three-col { grid-template-columns: 1fr; }
  .reg-row { grid-template-columns: 1fr; }
}
