/* ==========================================================================
   EMAGAZINE DATA JOURNALISM STYLESHEET
   - Minimum body/global font size: 16px (18px+ across all infographics)
   - High-contrast warm paper + deep forest editorial palette
   - Responsive across Desktop, Tablet, and Mobile
   - No header/menu/TOC/progress bar
   ========================================================================== */

:root {
  --bg-paper: #fbf9f4;
  --bg-tinted: #f2f5f0;
  --bg-card: #ffffff;
  --ink-primary: #13221a;
  --ink-secondary: #2d4237;
  --ink-muted: #465b50;
  --accent-green: #15803d;
  --accent-green-dark: #0f5129;
  --accent-green-soft: #e7f3eb;
  --accent-gold: #b45309;
  --accent-gold-soft: #fef3c7;
  --accent-plum: #7e22ce;
  --accent-plum-soft: #f3e8ff;
  --border-subtle: #d6dfd8;

  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Be Vietnam Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --shadow-card: 0 18px 45px -20px rgba(15, 41, 27, 0.14), 0 2px 8px rgba(15, 41, 27, 0.04);
  --radius-lg: 20px;
  --radius-md: 14px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg-paper);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 1.125rem; /* 18px */
  line-height: 1.8;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font-family: inherit;
}

/* Containers */
.container {
  width: min(100% - 2rem, 740px);
  margin-inline: auto;
}

.container-wide {
  width: min(100% - 2rem, 1020px);
  margin-inline: auto;
}

/* ==========================================================================
   HERO SECTION (Centered Title, Parallax Background)
   ========================================================================== */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(4.5rem, 8vw, 7rem) 1.25rem;
  overflow: hidden;
  background-color: #0e2418;
  color: #ffffff;
  text-align: center;
}

.hero-media {
  position: absolute;
  inset: -12% 0;
  z-index: 0;
  will-change: transform;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.05);
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(10, 26, 18, 0.45) 0%, rgba(10, 26, 18, 0.78) 100%),
    linear-gradient(180deg, rgba(10, 26, 18, 0.52) 0%, rgba(10, 26, 18, 0.82) 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(100%, 920px);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-ornament {
  color: #facc15;
  margin-bottom: 1.5rem;
}

.hero-title {
  margin: 0 0 1.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.15rem, 4.7vw, 3.85rem);
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: #ffffff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.hero-lead {
  margin: 0;
  max-width: 780px;
  font-size: clamp(1.125rem, 1.8vw, 1.375rem); /* 18px to 22px */
  line-height: 1.75;
  color: #f3f7f4;
  font-weight: 400;
}

.hero-scroll-cue {
  margin-top: 2.5rem;
  color: #fde047;
  animation: gentleBounce 2.2s ease-in-out infinite;
}

@keyframes gentleBounce {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.75;
  }
  50% {
    transform: translateY(7px);
    opacity: 1;
  }
}

/* ==========================================================================
   STORY PARTS & EDITORIAL TYPOGRAPHY
   ========================================================================== */
.story-part {
  padding: clamp(3.5rem, 6vw, 5.5rem) 0;
}

.story-part-tinted {
  background-color: var(--bg-tinted);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section-intro {
  text-align: center;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.part-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  background-color: var(--accent-green);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.375rem; /* 22px */
  margin-bottom: 1rem;
  box-shadow: 0 8px 20px -8px rgba(21, 128, 61, 0.55);
}

.part-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.2vw, 2.65rem);
  line-height: 1.25;
  color: var(--ink-primary);
}

.editorial-figure {
  margin-top: 0;
  margin-bottom: clamp(2.25rem, 4vw, 3.25rem);
}

.figure-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #d7e4db 0%, #bfd3c6 100%);
  box-shadow: var(--shadow-card);
}

.figure-img {
  width: 100%;
  height: 112%;
  object-fit: cover;
  margin-top: -6%;
  will-change: transform;
}

.prose-col p {
  margin: 0 0 1.45rem;
  font-size: clamp(1.0625rem, 1.35vw, 1.1875rem); /* 17px–19px */
  line-height: 1.82;
  color: var(--ink-primary);
}

.prose-col p:last-child {
  margin-bottom: 0;
}

.lead-dropcap::first-letter {
  float: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3.6rem;
  line-height: 0.85;
  padding-top: 0.25rem;
  padding-right: 0.65rem;
  color: var(--accent-green-dark);
}

.quote-para {
  padding-left: 1.35rem;
  border-left: 4px solid var(--accent-green);
  color: var(--ink-secondary);
}

/* ==========================================================================
   INFOGRAPHICS (ALL TEXT >= 18px, BALANCED GRIDS, NO ORPHANS)
   ========================================================================== */
.infographic-wrap {
  margin-block: clamp(2.5rem, 4.5vw, 3.5rem);
}

.infographic-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  box-shadow: var(--shadow-card);
  font-size: 1.125rem; /* 18px base inside infographics */
}

.infographic-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.infographic-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1 1 320px;
}

.infographic-icon {
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-green-soft);
  color: var(--accent-green-dark);
}

.infographic-icon.icon-plum {
  background-color: var(--accent-plum-soft);
  color: var(--accent-plum);
}

.infographic-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  line-height: 1.3;
  color: var(--ink-primary);
}

/* Interactive Toggle Buttons */
.toggle-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  background-color: #eef3ef;
  padding: 0.35rem;
  border-radius: 12px;
}

.toggle-btn {
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  font-weight: 600;
  font-size: 1.125rem; /* 18px */
  padding: 0.55rem 1.05rem;
  border-radius: 9px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.toggle-btn:hover {
  color: var(--ink-primary);
}

.toggle-btn.is-active {
  background-color: var(--accent-green);
  color: #ffffff;
  box-shadow: 0 4px 12px -4px rgba(21, 128, 61, 0.55);
}

/* INFOGRAPHIC 1: Balanced 2-Column Coop Cards */
.ig1-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.coop-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.15rem;
  background-color: #f8fbf9;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  cursor: pointer;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.coop-panel:hover,
.coop-panel:focus-visible,
.coop-panel.is-selected {
  border-color: var(--accent-green);
  background-color: #ffffff;
  box-shadow: 0 12px 26px -16px rgba(21, 128, 61, 0.35);
  outline: none;
}

.coop-top {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.coop-name {
  margin: 0;
  font-size: 1.25rem; /* 20px */
  font-weight: 700;
  color: var(--ink-primary);
  line-height: 1.35;
}

.coop-place {
  font-size: 1.125rem; /* 18px */
  color: var(--ink-muted);
  font-weight: 500;
}

.coop-stats-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.coop-stats-row .stat-pill-single {
  grid-column: 1 / -1;
}

.stat-pill {
  background-color: var(--accent-green-soft);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-number {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.75rem, 2.8vw, 2.25rem); /* 28px–36px */
  line-height: 1.15;
  color: var(--accent-green-dark);
}

.stat-unit {
  font-size: 1.125rem; /* 18px */
  font-weight: 500;
  color: var(--ink-secondary);
}

.coop-tags {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.tag-chip {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  line-height: 1.35;
}

.tag-green {
  background-color: var(--accent-green-soft);
  color: var(--accent-green-dark);
}

.tag-gold {
  background-color: var(--accent-gold-soft);
  color: #92400e;
}

.coop-checklist {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: var(--ink-primary);
}

.coop-checklist li {
  font-size: 1.125rem; /* 18px */
  line-height: 1.5;
}

/* Shared SVG Bar Tracks */
.ig1-bar-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

.bar-row {
  display: grid;
  grid-template-columns: 185px 1fr 90px;
  align-items: center;
  gap: 1rem;
}

.bar-label {
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  color: var(--ink-primary);
}

.bar-track {
  width: 100%;
  height: 18px;
}

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

.svg-bar-fill {
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-value {
  text-align: right;
  font-size: 1.25rem; /* 20px */
  font-weight: 700;
  color: var(--ink-primary);
}

/* INFOGRAPHIC 2: 2x2 KPI Grid + 4-Step Value Chain */
.badge-market {
  background-color: var(--accent-plum-soft);
  color: #581c87;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1.125rem; /* 18px */
}

.kpi-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
  margin-bottom: 1.75rem;
}

.kpi-box {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background-color: #faf7fe;
  border: 1px solid #e9d5ff;
}

.kpi-icon {
  flex: 0 0 auto;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 12px;
  background-color: var(--accent-plum-soft);
  color: var(--accent-plum);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kpi-content {
  min-width: 0;
}

.kpi-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1.2;
  color: #581c87;
  margin-bottom: 0.25rem;
}

.kpi-value .stat-number {
  color: #581c87;
  font-size: inherit;
}

.kpi-unit {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.125rem; /* 18px */
}

.kpi-label {
  font-size: 1.125rem; /* 18px */
  color: var(--ink-secondary);
  font-weight: 500;
  line-height: 1.4;
}

.chain-panel {
  background-color: #f8f5fc;
  border: 1px solid #e9d5ff;
  border-radius: var(--radius-md);
  padding: 1.35rem;
}

.chain-header-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

.chain-heading {
  font-size: 1.125rem; /* 18px */
  font-weight: 700;
  color: var(--ink-primary);
}

.chain-progress-svg-wrap {
  width: 100%;
  height: 12px;
}

.chain-line-svg {
  width: 100%;
  height: 12px;
  display: block;
}

#chain-line-active {
  transition: all 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.chain-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.chain-step {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 2px solid #e9d5ff;
  background-color: #ffffff;
  color: var(--ink-primary);
  font-weight: 600;
  font-size: 1.125rem; /* 18px */
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.chain-step:hover {
  border-color: var(--accent-plum);
  transform: translateY(-2px);
}

.chain-step.is-active {
  background-color: var(--accent-plum);
  border-color: var(--accent-plum);
  color: #ffffff;
}

.chain-num {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-plum-soft);
  color: #581c87;
  font-weight: 700;
  font-size: 1.125rem; /* 18px */
}

.chain-step.is-active .chain-num {
  background-color: #ffffff;
  color: var(--accent-plum);
}

.chain-name {
  line-height: 1.3;
  font-size: 1.125rem; /* 18px */
}

.chain-detail-box {
  background-color: #ffffff;
  border-left: 4px solid var(--accent-plum);
  border-radius: 8px;
  padding: 1rem 1.15rem;
  font-size: 1.125rem; /* 18px */
  line-height: 1.6;
  color: var(--ink-primary);
}

/* INFOGRAPHIC 3: 3-HTX Comparison + Balanced 2-Col Transformation */
.ig3-chart {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: 1.75rem;
}

.ig3-bar-row {
  display: grid;
  grid-template-columns: 270px 1fr 96px;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background-color: #f9fbf9;
  border: 1px solid var(--border-subtle);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.ig3-bar-row.is-dimmed {
  opacity: 0.3;
}

.ig3-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ig3-coop {
  font-size: 1.125rem; /* 18px */
  font-weight: 700;
  color: var(--ink-primary);
}

.ig3-sub {
  font-size: 1.125rem; /* 18px */
  color: var(--ink-muted);
}

.ig3-val {
  text-align: right;
  font-size: 1.25rem; /* 20px */
  font-weight: 800;
  color: var(--ink-primary);
}

.shift-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.shift-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
}

.shift-before {
  background-color: #f5f5f4;
  border: 1px solid #d6d3d1;
}

.shift-after {
  background-color: #eef7f1;
  border: 1px solid #bbf7d0;
}

.shift-col-title {
  font-size: 1.1875rem; /* 19px */
  font-weight: 700;
  color: var(--ink-primary);
  padding-bottom: 0.35rem;
}

.shift-item {
  width: 100%;
  text-align: left;
  background-color: #ffffff;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-size: 1.125rem; /* 18px */
  line-height: 1.45;
  color: var(--ink-primary);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.shift-before .shift-item.is-highlighted {
  border-color: #78716c;
}

.shift-after .shift-item.is-highlighted {
  border-color: var(--accent-green);
  box-shadow: 0 6px 16px -10px rgba(21, 128, 61, 0.45);
}

/* ==========================================================================
   AUTHOR SIGNOFF
   ========================================================================== */
.author-signoff {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

.signoff-rule {
  width: 72px;
  height: 3px;
  background-color: var(--accent-green);
  border-radius: 2px;
}

.author-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.375rem; /* 22px */
  color: var(--ink-primary);
}

/* ==========================================================================
   SCROLL-TRIGGER REVEAL ANIMATIONS
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-scroll-cue {
    animation: none;
  }
  .svg-bar-fill,
  #chain-line-active {
    transition: none;
  }
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (TABLET & MOBILE)
   ========================================================================== */
@media (max-width: 900px) {
  .chain-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ig3-bar-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .ig3-val {
    text-align: left;
  }
}

@media (max-width: 720px) {
  .ig1-grid,
  .kpi-grid-2x2,
  .shift-matrix {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .bar-value {
    text-align: left;
  }
}

@media (max-width: 540px) {
  .hero {
    min-height: 82vh;
    padding: 3.5rem 1rem;
  }

  .coop-stats-row,
  .chain-steps {
    grid-template-columns: 1fr;
  }

  .infographic-card {
    padding: 1.25rem;
  }

  .toggle-group {
    width: 100%;
  }

  .toggle-btn {
    flex: 1 1 auto;
    text-align: center;
  }
}
