/* ==========================================================================
   EMAGAZINE DATA JOURNALISM STYLING
   HTX mở hướng sinh kế, giữ lao động ở lại nông thôn - Lào Cai
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;0,800;1,600&display=swap');

:root {
  /* Editorial Color Palette */
  --bg-page: #fbfaf7;
  --bg-card: #ffffff;
  --bg-dark-section: #0c1524;
  --bg-dark-card: #152238;
  --bg-dark-card-hover: #1c2e4c;
  
  --text-main: #1e293b;
  --text-muted: #526075;
  --text-light: #e2e8f0;
  --text-light-muted: #94a3b8;
  
  --accent-emerald: #0d7a57;
  --accent-emerald-light: #10b981;
  --accent-emerald-soft: #ecfdf5;
  --accent-amber: #c25e00;
  --accent-amber-light: #f59e0b;
  --accent-amber-soft: #fffbeb;
  --accent-indigo: #2563eb;
  --accent-indigo-light: #38bdf8;
  --accent-indigo-soft: #eff6ff;
  --accent-coral: #dc2626;

  --border-subtle: #e2e8f0;
  --border-dark: rgba(255, 255, 255, 0.12);
  --border-emerald: rgba(16, 185, 129, 0.3);

  /* Typography */
  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  /* Sizing Constraints */
  --max-content-width: 820px;
  --max-infographic-width: 1140px;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 40px -15px rgba(15, 23, 42, 0.16);
  --shadow-glow: 0 0 30px rgba(16, 185, 129, 0.2);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.85;
  overflow-x: hidden;
}

/* ==========================================================================
   EMAGAZINE HEADER (CENTERED, TYPOGRAPHIC FOCUS - NO HERO IMAGE)
   ========================================================================== */
.emagazine-header {
  padding: 5rem 1.5rem 3.5rem;
  max-width: 1040px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}

.eyebrow-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-emerald);
  background: var(--accent-emerald-soft);
  padding: 0.4rem 1.1rem;
  border-radius: 9999px;
  margin-bottom: 2rem;
  border: 1px solid rgba(13, 122, 87, 0.2);
}

.eyebrow-tag svg {
  width: 16px;
  height: 16px;
}

.main-title {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.25;
  color: #0f172a;
  margin-bottom: 2.2rem;
  letter-spacing: -0.02em;
}

.title-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0 auto 2.5rem;
  width: 180px;
}

.title-separator .line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-emerald), transparent);
}

.title-separator .diamond {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  transform: rotate(45deg);
}

.lead-sapo {
  font-family: var(--font-sans);
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
  font-weight: 500;
  line-height: 1.75;
  color: #334155;
  max-width: 860px;
  margin: 0 auto;
  background: #ffffff;
  padding: 2.2rem 2.8rem;
  border-radius: 16px;
  border-left: 5px solid var(--accent-emerald);
  box-shadow: var(--shadow-md);
  text-align: justify;
}

.lead-sapo p + p {
  margin-top: 1.2rem;
}

/* ==========================================================================
   CONTENT LAYOUT & EDITORIAL TEXT
   ========================================================================== */
.article-container {
  width: 100%;
}

.article-section {
  padding: 3.5rem 1.5rem;
  position: relative;
}

.text-wrapper {
  max-width: var(--max-content-width);
  margin: 0 auto;
}

.section-headline-group {
  margin-bottom: 2.5rem;
  text-align: center;
}

.section-badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-emerald);
  margin-bottom: 0.6rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.6vw, 2.6rem);
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent-emerald);
  margin: 0.9rem auto 0;
  border-radius: 2px;
}

.prose-text {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  color: #27303f;
  margin-bottom: 1.8rem;
  text-align: justify;
  letter-spacing: 0.005em;
}

.prose-text.lead-paragraph::first-letter {
  font-family: var(--font-display);
  float: left;
  font-size: 4.2rem;
  line-height: 0.85;
  padding-right: 0.85rem;
  padding-top: 0.25rem;
  color: var(--accent-emerald);
  font-weight: 700;
}

/* Pullquote highlight for policy */
.editorial-quote {
  max-width: 740px;
  margin: 2.8rem auto;
  padding: 1.8rem 2.2rem;
  background: linear-gradient(135deg, rgba(13, 122, 87, 0.06), rgba(37, 99, 235, 0.04));
  border-left: 4px solid var(--accent-emerald);
  border-radius: 0 16px 16px 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.7;
  color: #0f172a;
}

/* ==========================================================================
   PHOTO EDITORIAL CONTAINERS
   ========================================================================== */
.photo-container {
  max-width: 980px;
  margin: 3.2rem auto;
  padding: 0 1rem;
}

.photo-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #0f172a;
}

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

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

.photo-caption {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  margin-top: 0.75rem;
  text-align: center;
  padding: 0 1rem;
}

/* ==========================================================================
   INFOGRAPHIC WRAPPERS - DATA JOURNALISM ENGINE
   ========================================================================== */
.infographic-wrapper {
  max-width: var(--max-infographic-width);
  margin: 3.5rem auto;
  padding: 3rem 2.5rem;
  background: var(--bg-dark-section);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  color: var(--text-light);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.infographic-wrapper::before {
  content: '';
  position: absolute;
  top: -150px;
  right: -150px;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.infographic-header {
  text-align: center;
  margin-bottom: 2.8rem;
  position: relative;
  z-index: 2;
}

.infographic-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 18px; /* Tối thiểu 18px */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-emerald-light);
  margin-bottom: 0.6rem;
}

.infographic-title {
  font-family: var(--font-sans);
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  font-weight: 800;
  line-height: 1.35;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.infographic-subtitle {
  font-family: var(--font-sans);
  font-size: 18px; /* Tối thiểu 18px */
  color: var(--text-light-muted);
  margin-top: 0.6rem;
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   INFOGRAPHIC 1: BẢN ĐỒ DỮ LIỆU CHUYỂN DỊCH SINH KẾ (PHẦN 1)
   Grid 4 khối cân bằng hoàn hảo (2x2)
   ========================================================================== */
.data-grid-balanced-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.8rem;
  position: relative;
  z-index: 2;
}

.data-box {
  background: var(--bg-dark-card);
  border: 1px solid var(--border-dark);
  border-radius: 20px;
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
}

.data-box:hover {
  background: var(--bg-dark-card-hover);
  border-color: var(--border-emerald);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.data-box-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.2rem;
}

.box-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-emerald-light);
}

.box-icon svg {
  width: 28px;
  height: 28px;
}

.box-icon.amber {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber-light);
}

.box-icon.indigo {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-indigo-light);
}

.box-stat-number {
  font-family: var(--font-sans);
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  font-weight: 800;
  line-height: 1.1;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.stat-unit {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent-emerald-light);
  margin-left: 0.2rem;
}

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

.stat-unit.indigo {
  color: var(--accent-indigo-light);
}

.box-stat-label {
  font-family: var(--font-sans);
  font-size: 19px; /* Tối thiểu 18px */
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

.box-stat-desc {
  font-family: var(--font-sans);
  font-size: 18px; /* Tối thiểu 18px */
  font-weight: 400;
  color: var(--text-light-muted);
  line-height: 1.55;
}

/* SVG Chart Elements within Box */
.box-chart-inline {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.donut-svg-wrapper {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  position: relative;
}

.donut-svg-wrapper svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.donut-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 7;
}

.donut-fill {
  fill: none;
  stroke: var(--accent-emerald-light);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  transition: stroke-dashoffset 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.donut-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-sans);
  font-size: 18px; /* Tối thiểu 18px */
  font-weight: 700;
  color: #ffffff;
}

.chart-inline-info {
  font-family: var(--font-sans);
  font-size: 18px; /* Tối thiểu 18px */
  color: var(--text-light-muted);
  line-height: 1.45;
}

.chart-inline-info strong {
  color: #ffffff;
}

/* ==========================================================================
   INFOGRAPHIC 2: HỆ SINH THÁI CHUỖI GIÁ TRỊ MƯỜNG LÒ (PHẦN 2)
   Cân bằng đối xứng: Trục trung tâm + 4 vệ tinh 2x2
   ========================================================================== */
.ecosystem-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
  z-index: 2;
}

.hub-center-card {
  background: linear-gradient(135deg, #1e3a5f, #0f243a);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 20px;
  padding: 2.2rem 2.5rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  position: relative;
}

.hub-center-badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 18px; /* Tối thiểu 18px */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-indigo-light);
  margin-bottom: 0.5rem;
}

.hub-center-title {
  font-family: var(--font-sans);
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.8rem;
}

.hub-center-desc {
  font-family: var(--font-sans);
  font-size: 19px; /* Tối thiểu 18px */
  color: #cbd5e1;
  max-width: 820px;
  margin: 0 auto;
  line-height: 1.6;
}

/* 4 Vệ tinh đối xứng (2x2) */
.satellite-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.6rem;
}

.satellite-card {
  background: var(--bg-dark-card);
  border: 1px solid var(--border-dark);
  border-radius: 18px;
  padding: 2rem;
  transition: all 0.35s ease;
  display: flex;
  gap: 1.4rem;
  align-items: flex-start;
}

.satellite-card:hover {
  background: var(--bg-dark-card-hover);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.satellite-icon {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-indigo-light);
  flex-shrink: 0;
}

.satellite-icon svg {
  width: 32px;
  height: 32px;
}

.satellite-body {
  flex: 1;
}

.satellite-counter {
  font-family: var(--font-sans);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.satellite-counter-unit {
  font-size: 18px; /* Tối thiểu 18px */
  font-weight: 600;
  color: var(--accent-indigo-light);
}

.satellite-title {
  font-family: var(--font-sans);
  font-size: 20px; /* Tối thiểu 18px */
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.satellite-desc {
  font-family: var(--font-sans);
  font-size: 18px; /* Tối thiểu 18px */
  color: var(--text-light-muted);
  line-height: 1.55;
}

/* ==========================================================================
   INFOGRAPHIC 3: MA TRẬN ĐỐI XỨNG ĐIỂM NGHẼN & MỤC TIÊU (PHẦN 3)
   Cân bằng tuyệt đối 2 Cột (2 Thách thức vs 2 Mục tiêu)
   ========================================================================== */
.matrix-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  position: relative;
  z-index: 2;
}

.matrix-column {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.matrix-col-header {
  padding: 1.2rem 1.6rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-sans);
  font-size: 19px; /* Tối thiểu 18px */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.matrix-col-header.challenge {
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.matrix-col-header.goal {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.matrix-col-header svg {
  width: 24px;
  height: 24px;
}

.matrix-card {
  background: var(--bg-dark-card);
  border: 1px solid var(--border-dark);
  border-radius: 18px;
  padding: 2rem;
  transition: all 0.35s ease;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.matrix-card:hover {
  background: var(--bg-dark-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.matrix-card.challenge:hover {
  border-color: rgba(239, 68, 68, 0.4);
}

.matrix-card.goal:hover {
  border-color: rgba(16, 185, 129, 0.4);
}

.matrix-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

.matrix-number {
  font-family: var(--font-sans);
  font-size: clamp(2.4rem, 3.8vw, 3.2rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.matrix-number.red {
  color: #f87171;
}

.matrix-number.emerald {
  color: var(--accent-emerald-light);
}

.gauge-svg-wrapper {
  width: 72px;
  height: 72px;
  position: relative;
}

.gauge-svg-wrapper svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 6;
}

.gauge-fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  transition: stroke-dashoffset 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.gauge-fill.red {
  stroke: #ef4444;
}

.gauge-fill.emerald {
  stroke: var(--accent-emerald-light);
}

.matrix-title {
  font-family: var(--font-sans);
  font-size: 20px; /* Tối thiểu 18px */
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

.matrix-desc {
  font-family: var(--font-sans);
  font-size: 18px; /* Tối thiểu 18px */
  color: var(--text-light-muted);
  line-height: 1.6;
}

/* ==========================================================================
   ARTICLE FOOTER & AUTHOR BYLINE (MINH KHUÊ)
   ========================================================================== */
.article-footer {
  max-width: var(--max-content-width);
  margin: 4rem auto 6rem;
  padding: 3rem 1.5rem 0;
  border-top: 2px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.author-block {
  text-align: right;
}

.author-title {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.author-name {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  font-style: italic;
  color: #0f172a;
}

/* ==========================================================================
   SCROLL-TRIGGER & PARALLAX ANIMATION CLASSES
   ========================================================================== */
.fade-in-section {
  opacity: 0;
  transform: translateY(28px);
  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-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.parallax-img {
  will-change: transform;
}

/* ==========================================================================
   RESPONSIVE DESIGN (DESKTOP, TABLET, MOBILE)
   ========================================================================== */
@media (max-width: 1024px) {
  .infographic-wrapper {
    padding: 2.5rem 1.8rem;
  }
  
  .data-grid-balanced-4,
  .satellite-grid,
  .matrix-container {
    gap: 1.4rem;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 18px;
    line-height: 1.8;
  }

  .emagazine-header {
    padding: 3.5rem 1rem 2.5rem;
  }

  .lead-sapo {
    padding: 1.8rem 1.5rem;
    font-size: 1.15rem;
  }

  .article-section {
    padding: 2.5rem 1rem;
  }

  .infographic-wrapper {
    padding: 2rem 1.2rem;
    border-radius: 18px;
    margin: 2.5rem -0.5rem;
  }

  /* Chuyển grid thành 1 cột trên mobile nhưng vẫn cực kỳ cân đối */
  .data-grid-balanced-4,
  .satellite-grid,
  .matrix-container {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .satellite-card {
    flex-direction: column;
    gap: 1rem;
  }

  .hub-center-card {
    padding: 1.8rem 1.4rem;
  }

  .data-box,
  .matrix-card {
    padding: 1.6rem 1.4rem;
  }

  .prose-text {
    text-align: left;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 17px;
  }

  .lead-sapo {
    padding: 1.4rem 1.2rem;
    border-left-width: 4px;
  }

  .box-stat-number,
  .matrix-number {
    font-size: 2.2rem;
  }

  /* Đảm bảo cỡ chữ infographic luôn tối thiểu 18px ngay cả trên màn hình nhỏ */
  .box-stat-label,
  .satellite-title,
  .matrix-title {
    font-size: 19px;
  }

  .box-stat-desc,
  .satellite-desc,
  .matrix-desc,
  .chart-inline-info,
  .infographic-tag,
  .infographic-subtitle {
    font-size: 18px;
  }
}
