/* openabundance.au — Light Editorial / Civic Print Stylesheet
   Shared palette with web/style.css (Our World in Data / ABC Data aesthetic) */

:root {
  --bg: #faf9f5;
  --surface: #ffffff;
  --panel: #f2f0ea;
  --border: #d6d3cb;
  --border-strong: #b8b3a8;
  --ink: #181a1b;
  --muted: #555c65;
  --accent: #0f5c52;
  --accent-hover: #0b473f;
  --accent-tint: #eef5f3;
  --ochre: #b45309;
  --ochre-tint: #fbf5ee;
  --brick: #b91c1c;
  --stone: #cbd5e1;
  --font-serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --max-w: 940px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--accent-hover);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 1000;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--accent);
  padding: 8px 14px;
  border-radius: 3px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 16px;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* Masthead Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
}

.brand-link {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: stretch;
  gap: 24px;
  height: 58px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding: 0 2px;
  margin-bottom: -1px;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--ink);
  text-decoration: none;
}

.nav-link.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.nav-link.nav-map {
  color: var(--accent);
}

.nav-link.nav-map:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

/* Essay Header (Hero) */
.essay-header {
  padding: 56px 0 40px;
}

.kicker {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.essay-header h1 {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.2vw, 2.85rem);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 760px;
}

.standfirst {
  margin: 0 0 28px;
  font-size: 1.125rem;
  line-height: 1.62;
  color: var(--muted);
  max-width: 680px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
  border-radius: 3px;
  font-size: 0.93rem;
  font-weight: 600;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
  text-decoration: none;
}

.text-action {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-action:hover {
  color: var(--accent);
}

/* Editorial Pull-Quote Callout (Public KPIs Analogy) */
.kpi-callout {
  margin: 30px 0 0;
  max-width: 740px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 3px;
  padding: 20px 24px;
}

.kpi-callout-label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
}

.kpi-callout blockquote {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.56;
  color: var(--ink);
}

.kpi-callout-metrics {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--panel);
  font-size: 0.86rem;
  color: var(--muted);
}

.kpi-callout-metrics strong {
  color: var(--ink);
}

/* Contents Strip */
.toc-bar {
  margin-top: 38px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  font-size: 0.86rem;
}

.toc-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.74rem;
  color: var(--muted);
}

.toc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.toc-links a {
  color: var(--muted);
  text-decoration: none;
}

.toc-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Editorial Margin-Rule Sections */
.essay-section {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 76px;
}

.essay-section:last-of-type {
  border-bottom: none;
}

.section-grid {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  gap: 16px 40px;
  align-items: start;
}

.section-margin {
  padding-top: 6px;
}

.section-num {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.section-tag {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  line-height: 1.4;
}

.section-body h2 {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 2.5vw, 1.8rem);
  font-weight: 700;
  line-height: 1.24;
  color: var(--ink);
}

.section-body > p {
  margin: 0 0 16px;
  color: var(--ink);
  max-width: 660px;
}

.section-body > p.lead-note {
  color: var(--muted);
}

/* Ruled Example List (Section 01) */
.ruled-list {
  margin: 26px 0 28px;
  border-top: 1px solid var(--border);
}

.ruled-row {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 8px 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.ruled-row h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.45;
}

.ruled-row p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Figures & Inline SVG Diagrams */
.figure-box {
  margin: 28px 0 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 20px 22px 18px;
}

.figure-title {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
}

.figure-subtitle {
  margin: 0 0 16px;
  font-size: 0.84rem;
  color: var(--muted);
}

.figure-svg {
  width: 100%;
  height: auto;
  display: block;
}

.figure-note {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--panel);
  font-size: 0.8rem;
  color: var(--muted);
}

/* Structured Reference Table for Five Essentials (Section 02) */
.essentials-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 0.94rem;
}

.essentials-table th {
  text-align: left;
  padding: 11px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.essentials-table td {
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.essentials-table tr:last-child td {
  border-bottom: none;
}

.essential-name {
  width: 28%;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.35;
}

.essential-sub {
  display: block;
  margin-top: 5px;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.48;
}

.essential-points {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
}

.essential-points li {
  margin-bottom: 6px;
  line-height: 1.55;
}

.essential-points li:last-child {
  margin-bottom: 0;
}

/* Bottlenecks 2x2 Hairline Grid (Section 03) */
.bottleneck-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
}

.bottleneck-cell {
  padding: 20px 22px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.bottleneck-cell:nth-child(2n) {
  border-right: none;
}

.bottleneck-cell:nth-last-child(-n + 2) {
  border-bottom: none;
}

.bottleneck-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ochre);
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
}

.bottleneck-cell h3 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 1.03rem;
  color: var(--ink);
}

.bottleneck-cell p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.58;
}

/* Clocks & Time Horizons (Section 04) */
.clocks-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 0.93rem;
}

.clocks-table th {
  text-align: left;
  padding: 10px 15px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.clocks-table td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.clocks-table tr:last-child td {
  border-bottom: none;
}

.clock-span {
  white-space: nowrap;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ochre);
}

.clocks-table tr.long-horizon {
  background: var(--accent-tint);
}

.clocks-table tr.long-horizon .clock-span {
  color: var(--accent);
}

.note-box {
  margin-top: 22px;
  padding: 16px 20px;
  background: var(--panel);
  border-left: 3px solid var(--accent);
  border-radius: 0 3px 3px 0;
  font-size: 0.94rem;
  color: var(--ink);
}

.note-box strong {
  color: var(--ink);
}

/* Global Benchmarks Reference Table (Section 05) */
.benchmarks-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 0.92rem;
}

.benchmarks-table th {
  text-align: left;
  padding: 11px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.benchmarks-table td {
  padding: 15px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.56;
}

.benchmarks-table tr:last-child td {
  border-bottom: none;
}

.bench-place {
  width: 21%;
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--ink);
}

.bench-focus {
  display: block;
  margin-top: 4px;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.bench-outcome {
  width: 50%;
  color: var(--ink);
}

.bench-caveat {
  width: 29%;
  color: var(--muted);
  font-size: 0.87rem;
}

.vitals-panel {
  margin-top: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  padding: 20px 22px;
}

.vitals-panel h3 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 1.06rem;
  color: var(--ink);
}

.vitals-panel > p {
  margin: 0 0 14px;
  font-size: 0.93rem;
  color: var(--muted);
}

.vitals-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 22px;
  font-size: 0.9rem;
  color: var(--ink);
}

.vitals-list li {
  padding-top: 8px;
  border-top: 1px solid var(--panel);
  line-height: 1.52;
}

.vitals-list li:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.vitals-list strong {
  color: var(--ink);
}

/* Two Halves Comparison (Section 06) */
.halves-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 22px;
}

.half-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.half-panel.map-panel {
  border-top: 3px solid var(--accent);
}

.half-panel.guide-panel {
  border-top: 3px solid var(--border-strong);
}

.half-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.map-panel .half-kicker {
  color: var(--accent);
}

.half-panel h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--ink);
}

.half-panel p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--muted);
  line-height: 1.58;
}

.half-panel ul {
  margin: 4px 0 6px;
  padding-left: 18px;
  font-size: 0.9rem;
  color: var(--ink);
}

.half-panel li {
  margin-bottom: 5px;
}

.half-action {
  margin-top: auto;
  padding-top: 6px;
}

/* Numbered Practical Steps (Section 06) */
.steps-list {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.steps-list li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.step-num {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.step-body h3 {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 1.02rem;
  color: var(--ink);
}

.step-body p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--muted);
  line-height: 1.6;
}

/* FAQ Section (Section 07) */
.faq-list {
  margin-top: 22px;
  border-top: 1px solid var(--border);
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--accent);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-answer {
  padding: 0 0 20px;
  max-width: 650px;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.66;
}

.faq-answer p {
  margin: 0 0 12px;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* Closing Callout */
.closing-box {
  margin-top: 32px;
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.closing-box h3 {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--ink);
}

.closing-box p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--muted);
  max-width: 520px;
}

/* Footer */
.site-footer {
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 30px 0;
  font-size: 0.87rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 28px;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.footer-meta {
  margin: 5px 0 0;
  max-width: 520px;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-weight: 600;
}

.footer-links a {
  color: var(--ink);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 820px) {
  .section-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .section-margin {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding-top: 0;
  }

  .section-num {
    margin-bottom: 0;
  }

  .halves-grid,
  .bottleneck-grid {
    grid-template-columns: 1fr;
  }

  .bottleneck-cell {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .bottleneck-cell:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .bottleneck-cell:last-child {
    border-bottom: none;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 18px;
  }

  .nav-inner {
    flex-wrap: wrap;
    min-height: 54px;
    padding: 10px 0 0;
  }

  .site-nav {
    width: 100%;
    height: auto;
    gap: 18px;
    padding-top: 6px;
    border-top: 1px solid var(--panel);
  }

  .nav-link {
    padding: 8px 0;
  }

  .essay-header {
    padding: 36px 0 28px;
  }

  .essay-section {
    padding: 34px 0;
    scroll-margin-top: 108px;
  }

  .ruled-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .essentials-table,
  .essentials-table thead,
  .essentials-table tbody,
  .essentials-table th,
  .essentials-table td,
  .essentials-table tr {
    display: block;
  }

  .essentials-table thead {
    display: none;
  }

  .essentials-table tr {
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
  }

  .essentials-table tr:last-child {
    border-bottom: none;
  }

  .essentials-table td {
    padding: 0;
    border-bottom: none;
  }

  .essential-name {
    width: auto;
    margin-bottom: 10px;
  }

  .benchmarks-table,
  .benchmarks-table thead,
  .benchmarks-table tbody,
  .benchmarks-table th,
  .benchmarks-table td,
  .benchmarks-table tr {
    display: block;
  }

  .benchmarks-table thead {
    display: none;
  }

  .benchmarks-table tr {
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
  }

  .benchmarks-table tr:last-child {
    border-bottom: none;
  }

  .benchmarks-table td {
    padding: 0;
    border-bottom: none;
    width: auto;
  }

  .bench-place {
    margin-bottom: 6px;
  }

  .bench-caveat {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--panel);
  }

  .vitals-list {
    grid-template-columns: 1fr;
  }

  .clocks-table th:first-child,
  .clocks-table td:first-child {
    white-space: normal;
  }
}
