/* ==========================================================================
   E-Magazine Data Journalism Stylesheet
   Minimum body/UI text: 16px | Minimum infographic text: 18px
   ========================================================================== */

:root {
  --bg-page: #faf9f5;
  --bg-surface: #ffffff;
  --bg-infographic: #f1f4ee;
  --bg-infographic-alt: #f6f2ea;
  --border-subtle: #dbe2d6;
  --border-strong: #bcc8b6;

  --text-primary: #17211c;
  --text-secondary: #394b42;
  --text-on-dark: #ffffff;
  --text-on-dark-muted: rgba(255, 255, 255, 0.9);

  --accent-green: #145a3a;
  --accent-green-light: #e3efe8;
  --accent-green-mid: #277d54;
  --accent-amber: #a85f0a;
  --accent-amber-light: #f8ecd9;
  --accent-teal: #0e6973;
  --accent-teal-light: #e2f0f2;

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

  --measure: 720px;
  --wide-measure: 1040px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 12px 32px -12px rgba(23, 33, 28, 0.08);
  --ease-out-expo: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::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-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: clamp(17px, 1.15vw, 19px);
  line-height: 1.8;
  font-weight: 400;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

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

/* ==========================================================================
   Hero Section (No navigation header, centered title)
   ========================================================================== */

.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(4rem, 9vh, 7rem) clamp(1.25rem, 4vw, 3rem);
  overflow: hidden;
  background-color: #03663a;
  color: var(--text-on-dark);
}

.hero__media {
  position: absolute;
  inset: -12% 0;
  z-index: 0;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.95) contrast(1.04);
}

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 45%, rgba(97, 161, 133, 0.56) 0%, rgba(8, 66, 42, 0.82) 100%),
    linear-gradient(180deg, rgba(10, 24, 18, 0.48) 0%, rgba(5, 85, 50, 0.78) 100%);
}

.hero__inner {
  position: relative;
  z-index: 2;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.hero__title {
  margin: 0 auto 2rem;
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 4.8vw, 3.85rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-align: center;
  color: var(--text-on-dark);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.hero__sapo {
  max-width: 740px;
  margin: 0 auto;
  display: grid;
  gap: 1.15rem;
}

.hero__sapo p {
  margin: 0;
  font-size: clamp(17.5px, 1.35vw, 20px);
  line-height: 1.72;
  color: var(--text-on-dark-muted);
  font-weight: 400;
}

.hero__scroll-cue {
  margin-top: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  animation: floatCue 2.6s ease-in-out infinite;
}

@keyframes floatCue {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(7px);
  }
}

/* ==========================================================================
   Main Article Flow & 3-Part Editorial Rhythm
   ========================================================================== */

.article-main {
  padding-bottom: clamp(4rem, 8vw, 6.5rem);
}

.story-part {
  position: relative;
  padding-top: clamp(3.5rem, 7vw, 5.5rem);
}

.story-part+.story-part {
  border-top: 1px solid var(--border-subtle);
  margin-top: clamp(3rem, 6vw, 5rem);
}

.container-text {
  width: 100%;
  max-width: calc(var(--measure) + 2.5rem);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-wide {
  width: 100%;
  max-width: calc(var(--wide-measure) + 2.5rem);
  margin: clamp(2.25rem, 5vw, 3.5rem) auto;
  padding: 0 1.25rem;
}

.part-marker {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.part-marker__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
  padding: 0 0.75rem;
  border-radius: 999px;
  background-color: var(--accent-green);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.part-marker__line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-green) 0%, rgba(20, 90, 58, 0.12) 100%);
  transform-origin: left center;
}

.part-heading {
  margin: 0 0 1.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.24;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.story-paragraph {
  margin: 0 0 1.45rem;
  font-size: clamp(17px, 1.15vw, 19px);
  line-height: 1.82;
  color: var(--text-primary);
}

.story-paragraph:last-child {
  margin-bottom: 0;
}

.story-paragraph--lead::first-letter {
  float: left;
  font-family: var(--font-display);
  font-size: 3.65rem;
  line-height: 0.86;
  font-weight: 700;
  color: var(--accent-green);
  padding: 0.25rem 0.65rem 0 0;
}

/* ==========================================================================
   Editorial Photo Figures (Clean, no overlaid text)
   ========================================================================== */

.editorial-figure {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: #e6ebe3;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
}

.editorial-figure__frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.editorial-figure__img {
  width: 100%;
  height: 108%;
  object-fit: cover;
  transform: translate3d(0, var(--img-parallax, 0px), 0) scale(1.03);
  transition: transform 0.25s linear;
  will-change: transform;
}

/* ==========================================================================
   Infographic Blocks (Data-only, SVG, icons, charts, >= 18px text, balanced grids)
   ========================================================================== */

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

.infographic--warm {
  background-color: var(--bg-infographic-alt);
}

.infographic--teal {
  background-color: #eef4f3;
}

/* Force >= 18px across every text element inside infographics */
.infographic,
.infographic * {
  font-size: max(18px, 1rem);
}

.infographic__header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-strong);
}

.infographic__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background-color: var(--accent-green);
  color: #ffffff;
  flex-shrink: 0;
}

.infographic--warm .infographic__badge {
  background-color: var(--accent-amber);
}

.infographic--teal .infographic__badge {
  background-color: var(--accent-teal);
}

.infographic__title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
}

/* Balanced 2x2 Grid (Never 3 top + 1 bottom) */
.info-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

/* Balanced 2-Column Top + 4-Tile Bottom Grid (desktop 4 cols, tablet 2x2, mobile 1 col) */
.info-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.info-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.info-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: clamp(1.15rem, 2.2vw, 1.6rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

.info-panel__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.info-panel__label {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-secondary);
}

.info-panel__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-green-light);
  color: var(--accent-green);
  flex-shrink: 0;
}

.info-panel__icon--amber {
  background-color: var(--accent-amber-light);
  color: var(--accent-amber);
}

.info-panel__icon--teal {
  background-color: var(--accent-teal-light);
  color: var(--accent-teal);
}

.big-stat {
  font-size: clamp(30px, 3.2vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--accent-green);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.big-stat--amber {
  color: var(--accent-amber);
}

.big-stat--teal {
  color: var(--accent-teal);
}

.stat-caption {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-primary);
}

/* ==========================================================================
   Chart Components inside Infographics (Animated Bars, Rings, Circular Flow)
   ========================================================================== */

.bar-chart {
  display: grid;
  gap: 0.9rem;
}

.bar-row {
  display: grid;
  gap: 0.4rem;
}

.bar-row__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.bar-row__val {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-green);
  white-space: nowrap;
}

.bar-row__val--amber {
  color: var(--accent-amber);
}

.bar-track {
  width: 100%;
  height: 18px;
  border-radius: 999px;
  background-color: #e4eae0;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-green) 0%, var(--accent-green-mid) 100%);
  transition: width 1.15s var(--ease-out-expo);
}

.bar-fill--muted {
  background: #8a9b91;
}

.bar-fill--amber {
  background: linear-gradient(90deg, #9a5407 0%, #cf7b18 100%);
}

.bar-fill--teal {
  background: linear-gradient(90deg, #0b5760 0%, #158490 100%);
}

.is-visible .bar-fill {
  width: var(--target-w, 100%);
}

/* Donut Rings */
.donut-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.donut-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.65rem;
}

.donut-wrap {
  position: relative;
  width: 132px;
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-svg {
  width: 132px;
  height: 132px;
  transform: rotate(-90deg);
}

.donut-track {
  fill: none;
  stroke: #e4eae0;
  stroke-width: 12;
}

.donut-progress {
  fill: none;
  stroke: var(--accent-amber);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 1.3s var(--ease-out-expo);
}

.donut-progress--green {
  stroke: var(--accent-green);
}

.is-visible .donut-progress {
  stroke-dashoffset: var(--dash-offset, 100);
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.donut-label {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-secondary);
}

/* Multiplier Step Columns (Infographic 2 Left) */
.multiplier-bars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
  padding-top: 0.5rem;
}

.mult-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.mult-stage {
  width: 100%;
  height: 130px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background-color: #f4f6f1;
  border-radius: 12px;
  padding: 12px;
}

.mult-bar {
  width: 64px;
  height: 0;
  border-radius: 10px 10px 4px 4px;
  background: #8a9b91;
  transition: height 1.15s var(--ease-out-expo);
}

.mult-bar--boost {
  background: linear-gradient(180deg, #cf7b18 0%, var(--accent-amber) 100%);
}

.is-visible .mult-bar {
  height: var(--target-h, 24px);
}

.mult-value {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.mult-value--amber {
  color: var(--accent-amber);
}

.mult-label {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}

/* Compact stat tile (4-up bottom row) */
.stat-tile {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.stat-tile__num {
  font-size: clamp(26px, 2.5vw, 34px);
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--accent-amber);
}

.stat-tile__num--teal {
  color: var(--accent-teal);
}

.stat-tile__label {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.38;
  color: var(--text-primary);
}

/* ==========================================================================
   Circular Economy Diagram (Infographic 3)
   ========================================================================== */

.circular-stage {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.25rem;
  align-items: stretch;
}

.cycle-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: clamp(1.15rem, 2.4vw, 1.75rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cycle-diagram {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  padding: 0.75rem 0;
}

.cycle-node {
  position: relative;
  z-index: 2;
  background-color: #f4f8f7;
  border: 2px solid #bdd3cf;
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.cycle-node__step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-teal);
}

.cycle-node__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
}

.cycle-svg-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.cycle-loop-path {
  fill: none;
  stroke: var(--accent-teal);
  stroke-width: 3;
  stroke-dasharray: 8 7;
  stroke-dashoffset: 320;
  opacity: 0.65;
  transition: stroke-dashoffset 1.6s var(--ease-out-expo);
}

.is-visible .cycle-loop-path {
  stroke-dashoffset: 0;
}

.dual-pillars {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.pillar-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pillar-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background-color: var(--accent-teal-light);
  color: var(--accent-teal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pillar-card__title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
}

/* ==========================================================================
   Byline Footer
   ========================================================================== */

.article-byline {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 2px solid var(--border-strong);
  display: flex;
  justify-content: flex-end;
}

.article-byline__author {
  font-family: var(--font-display);
  font-size: clamp(20px, 1.8vw, 24px);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

/* ==========================================================================
   Scroll-Trigger Reveal Animations
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition:
    opacity 0.72s var(--ease-out-expo),
    transform 0.72s var(--ease-out-expo);
}

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

.reveal-line {
  transform: scaleX(0);
  transition: transform 0.9s var(--ease-out-expo);
}

.reveal-line.is-visible {
  transform: scaleX(1);
}

/* ==========================================================================
   Responsive Breakpoints (Desktop, Tablet, Mobile)
   ========================================================================== */

@media (max-width: 960px) {
  .info-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .circular-stage {
    grid-template-columns: 1fr;
  }

  .dual-pillars {
    grid-template-rows: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .hero {
    min-height: 82vh;
  }

  .info-grid-2x2,
  .info-grid-2,
  .dual-pillars {
    grid-template-columns: 1fr;
  }

  .donut-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cycle-diagram {
    grid-template-columns: 1fr;
  }

  .cycle-node--step1 {
    order: 1;
  }

  .cycle-node--step2 {
    order: 2;
  }

  .cycle-node--step3 {
    order: 3;
  }

  .cycle-node--step4 {
    order: 4;
  }

  .cycle-svg-overlay {
    display: none;
  }
}

@media (max-width: 480px) {
  .info-grid-4 {
    grid-template-columns: 1fr;
  }

  .donut-pair {
    grid-template-columns: 1fr;
  }

  .story-paragraph--lead::first-letter {
    font-size: 3.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .reveal-line,
  .bar-fill,
  .donut-progress,
  .mult-bar,
  .cycle-loop-path {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero__scroll-cue {
    animation: none;
  }

  .hero__media,
  .editorial-figure__img {
    transform: none !important;
  }
}