/* ==========================================================================
   EMAGAZINE DATA JOURNALISM STYLESHEET
   Design System: Modern Editorial & High-Precision Data Journalism
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..900;1,9..144,300..900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Dark Editorial Palette (Default) */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(24, 33, 53, 0.9);
  --bg-glass: rgba(15, 23, 42, 0.65);
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-accent: #38bdf8;
  
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-cyan: #06b6d4;
  --accent-rose: #f43f5e;
  --accent-gold: #fbbf24;
  --accent-tea: #34d399;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(56, 189, 248, 0.3);
  
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 35px rgba(56, 189, 248, 0.15);
  
  --container-narrow: 760px;
  --container-standard: 920px;
  --container-wide: 1180px;
}

[data-theme="light"] {
  --bg-primary: #fcfbf7;
  --bg-secondary: #f4f1ea;
  --bg-card: #ffffff;
  --bg-card-hover: #faf9f5;
  --bg-glass: rgba(255, 255, 255, 0.85);
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-accent: #0284c7;
  
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-cyan: #0891b2;
  --accent-rose: #e11d48;
  --accent-gold: #d97706;
  --accent-tea: #059669;
  
  --border-color: rgba(0, 0, 0, 0.09);
  --border-highlight: rgba(2, 132, 199, 0.3);
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 16px 30px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 30px rgba(2, 132, 199, 0.08);
}

/* ==========================================================================
   RESET & BASE TYPOGRAPHY
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  font-size: 19px;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

::selection {
  background: rgba(56, 189, 248, 0.25);
  color: var(--text-primary);
}

/* Reading Progress Bar */
#reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #06b6d4, #f59e0b);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* Minimalist Top Utility Bar */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  pointer-events: none;
}

.top-nav > * {
  pointer-events: auto;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.brand-badge .indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.theme-toggle-btn:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
  color: var(--text-accent);
}

/* ==========================================================================
   HERO / COVER SECTION
   ========================================================================== */

.hero-cover {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 120px 24px 80px;
  overflow: hidden;
}

.hero-background-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 115%;
  z-index: 1;
  pointer-events: none;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  transform: scale(1.05);
  transition: transform 0.6s ease-out;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 14, 23, 0.4) 0%,
    rgba(10, 14, 23, 0.7) 45%,
    var(--bg-primary) 98%
  );
  z-index: 2;
}

[data-theme="light"] .hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(252, 251, 247, 0.2) 0%,
    rgba(252, 251, 247, 0.8) 50%,
    var(--bg-primary) 98%
  );
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: var(--container-wide);
  margin: 0 auto;
  width: 100%;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-tea);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 8px 18px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(34px, 5.2vw, 68px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 32px;
  max-width: 1050px;
  text-wrap: balance;
}

.hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  font-size: 16px;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-item strong {
  color: var(--text-primary);
}

/* ==========================================================================
   ARTICLE LAYOUT & TYPOGRAPHY
   ========================================================================== */

.article-container {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 40px 24px 100px;
}

.narrative-flow {
  max-width: var(--container-narrow);
  margin: 0 auto;
}

.sapo-lead-box {
  max-width: var(--container-standard);
  margin: 0 auto 60px;
  padding: 36px 42px;
  background: var(--bg-card);
  border-left: 4px solid var(--accent-tea);
  border-radius: 0 16px 16px 0;
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.sapo-lead-box p {
  font-family: var(--font-serif);
  font-size: clamp(20px, 1.45vw, 24px);
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 20px;
  font-weight: 400;
}

.sapo-lead-box p:last-child {
  margin-bottom: 0;
}

/* Editorial Body Paragraphs */
.editorial-p {
  font-size: clamp(18px, 1.2vw, 20px);
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 28px;
  text-align: justify;
  hyphens: auto;
}

.editorial-p:first-of-type::first-letter {
  font-family: var(--font-serif);
  font-size: 4.8rem;
  line-height: 0.85;
  float: left;
  margin-top: 6px;
  margin-right: 14px;
  margin-bottom: 0;
  color: var(--accent-tea);
  font-weight: 700;
}

/* Section Header Styling */
.section-wrapper {
  margin-top: 90px;
  padding-top: 60px;
  border-top: 1px solid var(--border-color);
  position: relative;
}

.section-badge-num {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-amber);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: inline-block;
}

.section-heading {
  font-family: var(--font-serif);
  font-size: clamp(30px, 3.8vw, 46px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 36px;
}

/* Photographic Interludes */
.editorial-photo-card {
  margin: 48px auto;
  max-width: var(--container-standard);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.editorial-photo-card img {
  width: 100%;
  height: auto;
  max-height: 540px;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.editorial-photo-card:hover img {
  transform: scale(1.02);
}

.photo-caption {
  padding: 16px 24px;
  font-size: 16px;
  color: var(--text-muted);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}

.photo-caption svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* Quote Callout */
.editorial-pullquote {
  margin: 40px auto;
  padding: 30px 36px;
  border-left: 3px solid var(--accent-amber);
  background: var(--bg-card);
  border-radius: 0 14px 14px 0;
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.pullquote-content {
  font-family: var(--font-serif);
  font-size: clamp(19px, 1.35vw, 23px);
  line-height: 1.65;
  color: var(--text-primary);
  font-style: italic;
}

.pullquote-author {
  margin-top: 14px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-amber);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   DATA INFOGRAPHICS - STRICT MINIMUM FONT SIZE: 18px
   ========================================================================== */

.infographic-container {
  margin: 56px auto;
  max-width: var(--container-wide);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 42px 38px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.infographic-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-emerald), var(--accent-cyan), var(--accent-amber));
}

.infographic-header {
  margin-bottom: 36px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 24px;
}

.info-title-group .info-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.info-title-group h3 {
  font-family: var(--font-serif);
  font-size: clamp(24px, 2.2vw, 32px);
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.3;
}

.info-source-note {
  font-size: 18px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Infographic 1: Raw Materials Grid */
.info-grid-two {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.info-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.info-stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-highlight);
}

.card-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-tag {
  font-size: 18px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.badge-tag.amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.badge-tag.cyan {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
}

/* Comparison Visual (2018 vs Now) */
.growth-comparison-track {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.track-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.track-labels {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
}

.track-bar-bg {
  width: 100%;
  height: 18px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

[data-theme="light"] .track-bar-bg {
  background: rgba(0, 0, 0, 0.07);
}

.track-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald));
  width: 0%;
  transition: width 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.track-bar-fill.accent-two {
  background: linear-gradient(90deg, var(--accent-amber), var(--accent-gold));
}

.metric-highlights-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

.metric-mini-item {
  display: flex;
  flex-direction: column;
}

.metric-mini-num {
  font-family: var(--font-serif);
  font-size: clamp(28px, 2.5vw, 38px);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.metric-mini-label {
  font-size: 18px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.35;
}

/* Infographic 2: Processing Technology Dashboard */
.tech-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.tech-kpi-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.kpi-main-number {
  font-family: var(--font-serif);
  font-size: clamp(34px, 3.2vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  color: var(--accent-amber);
  margin-bottom: 8px;
}

.kpi-unit {
  font-size: 20px;
  font-weight: 600;
  margin-left: 2px;
  color: var(--text-secondary);
}

.kpi-description {
  font-size: 18px;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.35;
}

/* Parameters Comparison (Temp & Moisture) */
.specs-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.spec-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 26px;
}

.spec-box h4 {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.temp-indicator-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.temp-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 18px;
}

.temp-item strong {
  font-size: 22px;
  font-family: var(--font-mono);
  color: var(--accent-amber);
}

/* Infographic 3: Socio-Economic Impact & OCOP */
.impact-showcase-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 28px;
}

.wage-breakdown-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 30px;
}

.wage-breakdown-panel h4 {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.wage-bars-vertical {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.wage-bar-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wage-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 18px;
  font-weight: 600;
}

.wage-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-emerald);
}

.ocop-recognition-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ocop-recognition-panel h4 {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.ocop-badge-display {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ocop-item-box {
  padding: 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
}

.ocop-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.ocop-stars {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

.ocop-desc {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ==========================================================================
   FOOTER & AUTHOR BYLINE
   ========================================================================== */

.article-footer {
  margin-top: 100px;
  padding-top: 50px;
  border-top: 2px solid var(--border-color);
  max-width: var(--container-narrow);
  margin-left: auto;
  margin-right: auto;
}

.author-signature-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 24px 30px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.author-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.author-avatar-initials {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-emerald), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.author-text h4 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.author-text p {
  font-size: 16px;
  color: var(--text-muted);
}

.site-back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-accent);
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  transition: all 0.3s ease;
  cursor: pointer;
}

.site-back-to-top:hover {
  background: rgba(56, 189, 248, 0.2);
  transform: translateY(-2px);
}

/* ==========================================================================
   SCROLL REVEAL ANIMATIONS
   ========================================================================== */

.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   RESPONSIVE DESIGN (DESKTOP, TABLET, MOBILE)
   ========================================================================== */

@media (max-width: 1024px) {
  .tech-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .impact-showcase-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  body {
    font-size: 18px;
    line-height: 1.78;
  }

  .hero-cover {
    padding: 100px 18px 60px;
    min-height: 90vh;
  }

  .sapo-lead-box {
    padding: 26px 22px;
    border-radius: 0 12px 12px 0;
  }

  .article-container {
    padding: 24px 16px 60px;
  }

  .editorial-p {
    text-align: left;
    margin-bottom: 22px;
  }

  .infographic-container {
    padding: 28px 20px;
    border-radius: 18px;
  }

  .info-grid-two,
  .specs-detail-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .tech-kpi-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .info-stat-card,
  .spec-box,
  .wage-breakdown-panel,
  .ocop-recognition-panel {
    padding: 22px 18px;
  }

  .metric-highlights-row {
    grid-template-columns: 1fr 1fr;
  }
  
  .author-signature-box {
    flex-direction: column;
    align-items: flex-start;
  }
}
