/* ==========================================================================
   DESIGN SYSTEM - E-MAGAZINE GIA LAI COOPERATIVES BRANDING
   Style: National Geographic x The Economist x Nikkei Asia
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Encode+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette */
    --primary-green: #143d2b;      /* Xanh lá đậm Tây Nguyên */
    --primary-green-light: #255a43;
    --accent-bazan: #b24c1e;       /* Đất đỏ Bazan */
    --accent-coffee: #553422;      /* Nâu cà phê chín */
    --bg-paper: #faf9f6;           /* Trắng sáng hiện đại dạng giấy báo cao cấp */
    --bg-dark: #0b130f;            /* Nền tối sâu */
    --text-dark: #121815;          /* Chữ chính */
    --text-light: #f3f5f4;         /* Chữ sáng trên nền tối */
    --text-muted: #526059;         /* Chữ phụ, mô tả */
    --text-muted-light: #a3b0a9;
    --border-color: #e2e6e4;
    
    /* Typography */
    --font-serif: 'Encode Sans', system-ui, -apple-system, sans-serif;
    --font-sans: 'Encode Sans', system-ui, -apple-system, sans-serif;
    
    /* Transitions & Shadow */
    --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.3s ease;
    --card-shadow: 0 20px 40px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 30px 60px rgba(20, 61, 43, 0.08);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    overflow-x: hidden;
    line-height: 1.8;
}

/* Typography Helpers */
h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.25;
}

p {
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    text-align: justify;
}

a {
    color: var(--accent-bazan);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-green);
}

/* Layout Elements */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.content-narrow {
    max-width: 760px;
    margin: 0 auto;
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   1. HERO COVER (Full screen Parallax)
   ========================================================================== */
.hero-cover {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
    background-color: var(--bg-paper);
}

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

.hero-scroll-btn {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(11, 19, 15, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    cursor: pointer;
    z-index: 10;
    transition: var(--transition-fast);
    opacity: 0;
    animation: bounce 2s infinite, fadeIn 1.5s ease forwards 1.2s;
}

.hero-scroll-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--text-light);
}

.hero-scroll-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--text-light);
    stroke-width: 2;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* ==========================================================================
   2. SAPO SECTION (Hộp nổi giữa màn hình)
   ========================================================================== */
.sapo-section {
    padding: 8rem 0;
    background: linear-gradient(to bottom, var(--bg-dark), var(--bg-paper) 50%);
    position: relative;
    z-index: 10;
}

.sapo-box {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.08);
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

@media(min-width: 992px) {
    .sapo-box {
        grid-template-columns: 1fr 1.2fr;
    }
}

.sapo-illustration {
    background: var(--primary-green);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.sapo-illustration::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37,90,67,0.3) 0%, rgba(20,61,43,0) 70%);
    top: -50%;
    left: -50%;
}

.sapo-illustration svg {
    max-width: 100%;
    height: auto;
    z-index: 2;
}

.sapo-content {
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sapo-lead-text {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    line-height: 1.8;
    color: var(--primary-green);
    font-weight: 500;
}

.sapo-lead-text::first-letter {
    font-size: 4rem;
    font-family: var(--font-serif);
    font-weight: 700;
    float: left;
    margin-right: 0.75rem;
    line-height: 0.85;
    color: var(--accent-bazan);
    margin-top: 0.15rem;
}

/* ==========================================================================
   3. SECTION CHAPTERS (Tít xen)
   ========================================================================== */
.chapter-section {
    position: relative;
    padding: 0;
}

.chapter-header {
    height: 60vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    overflow: hidden;
}

.chapter-header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    z-index: 1;
}

/* Chapter Overlays */
.ch1-bg {
    background-image: linear-gradient(to bottom, rgba(20, 61, 43, 0.4), rgba(20, 61, 43, 0.85)), url('images/hero_background.png');
}
.ch2-bg {
    background-image: linear-gradient(to bottom, rgba(85, 52, 34, 0.4), rgba(85, 52, 34, 0.85)), url('images/glar_coffee_harvest.png');
}
.ch3-bg {
    background-image: linear-gradient(to bottom, rgba(20, 61, 43, 0.5), rgba(11, 19, 15, 0.9)), url('images/conclusion_flycam.png');
}

.chapter-header-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    padding: 0 1.5rem;
}

.chapter-num {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--accent-bazan);
    margin-bottom: 1rem;
}

.chapter-title {
    font-size: 2.5rem;
    font-family: var(--font-serif);
    margin-bottom: 1.5rem;
}

.chapter-quote {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-style: italic;
    line-height: 1.7;
    opacity: 0.9;
    position: relative;
    padding: 0 2rem;
}

.chapter-quote::before,
.chapter-quote::after {
    font-size: 4rem;
    position: absolute;
    opacity: 0.2;
    line-height: 1;
}
.chapter-quote::before {
    content: '“';
    left: -0.5rem;
    top: -1.5rem;
}
.chapter-quote::after {
    content: '”';
    right: -0.5rem;
    bottom: -3rem;
}

/* Chapter Body */
.chapter-body {
    padding: 6rem 0;
}

/* ==========================================================================
   4. ARTICLE TEXT & STORY BLOCKS
   ========================================================================== */
.article-text {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    color: #2b3530;
    line-height: 1.9;
    margin-bottom: 4rem;
}

.article-text p {
    margin-bottom: 2rem;
}

/* Story Block 2 Cột */
.story-block {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin: 5rem 0;
    align-items: center;
}

@media(min-width: 768px) {
    .story-block {
        grid-template-columns: 1fr 1fr;
    }
}

.story-media {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    position: relative;
}

.story-media img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition-smooth);
}

.story-media:hover img {
    transform: scale(1.05);
}

.story-media-caption {
    background: rgba(11,19,15,0.8);
    color: #ffffff !important;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    backdrop-filter: blur(5px);
}

.story-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.story-tag {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-bazan);
    margin-bottom: 0.75rem;
}

.story-title {
    font-size: 2rem;
    color: var(--primary-green);
    margin-bottom: 1.5rem;
}

.story-quote-block {
    border-left: 4px solid var(--accent-bazan);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--accent-coffee);
    font-family: var(--font-serif);
    font-size: 1.25rem;
}

/* ==========================================================================
   5. INFOGRAPHICS & DATA VISUALS
   ========================================================================== */
.infographic-wrapper {
    background: var(--white);
    border-radius: 16px;
    padding: 3rem 2rem;
    margin: 4rem 0;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

.infographic-wrapper:hover {
    box-shadow: var(--card-shadow-hover);
}

.info-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--primary-green);
    text-align: center;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.info-subtitle {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2.5rem;
}

/* SVG Styling & Interaction */
.svg-interactive {
    width: 100%;
    height: auto;
    display: block;
}

.svg-interactive text {
    font-family: var(--font-sans);
}

.svg-interactive .highlight {
    transition: var(--transition-fast);
    cursor: pointer;
}

.svg-interactive .highlight:hover {
    fill: var(--accent-bazan) !important;
    opacity: 0.95;
}

/* Animation cho đường mũi tên */
.animated-flow-line {
    stroke-dasharray: 8;
    animation: dash 30s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -1000;
    }
}

/* Data Card Nổi bật */
.data-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 4rem 0;
}

@media(min-width: 768px) {
    .data-card-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.data-card {
    background: var(--white);
    border-radius: 16px;
    padding: 3rem 2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.data-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary-green-light);
}

.data-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--accent-bazan);
}

.data-card.card-green::before {
    background: var(--primary-green);
}

.data-card-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 2rem;
}

.data-card-num {
    font-family: var(--font-serif);
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--accent-bazan);
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.data-card.card-green .data-card-num {
    color: var(--primary-green);
}

.data-card-label {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.data-card-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ==========================================================================
   6. KẾT LUẬN & FOOTER
   ========================================================================== */
.conclusion-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    overflow: hidden;
}

.conclusion-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(to top, rgba(11, 19, 15, 0.95), rgba(20, 61, 43, 0.6)), url('images/conclusion_flycam.png');
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    z-index: 1;
}

.conclusion-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 0 2rem;
    text-align: center;
}

.conclusion-quote {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-style: italic;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.footer {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 6rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footer-author {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.footer-role {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--accent-bazan);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 3rem;
}

.footer-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    max-width: 700px;
    margin-bottom: 4rem;
}

.tag-badge {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted-light);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-fast);
}

.tag-badge:hover {
    background: var(--primary-green-light);
    color: var(--white);
    border-color: var(--primary-green-light);
}

.footer-copyright {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    padding-top: 2rem;
}

/* ==========================================================================
   7. INTERACTIVE & POPUP OR TOOLTIPS FOR MAP/ROADMAP
   ========================================================================== */
.tooltip {
    position: absolute;
    background: var(--white);
    color: var(--text-dark);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.2s ease;
    border: 1px solid var(--border-color);
}

.tooltip.visible {
    opacity: 1;
}

.roadmap-step {
    transition: var(--transition-fast);
    cursor: pointer;
}

.roadmap-step:hover rect,
.roadmap-step:hover circle {
    fill: var(--accent-bazan) !important;
}

.roadmap-step:hover text {
    fill: var(--white) !important;
}

/* Responsive fixes */
@media(max-width: 767px) {
    p {
        font-size: 1.05rem;
    }
    .hero-title {
        font-size: 2.25rem;
    }
    .hero-subhead {
        font-size: 1.05rem;
        margin-bottom: 2rem;
    }
    .chapter-header {
        height: 50vh;
    }
    .chapter-title {
        font-size: 1.8rem;
    }
    .chapter-quote {
        font-size: 1.15rem;
    }
    .story-title {
        font-size: 1.5rem;
    }
    .sapo-content {
        padding: 2.5rem 1.5rem;
    }
    .sapo-illustration {
        padding: 2rem 1.5rem;
    }
}

/* Tools Grid 4 trên 2 dưới */
.tools-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

@media(min-width: 576px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(min-width: 992px) {
    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .tools-grid .tool-card:nth-child(5) {
        grid-column: 2;
    }
    .tools-grid .tool-card:nth-child(6) {
        grid-column: 3;
    }
}

.tool-card {
    background: var(--bg-paper);
    padding: 2rem 1.5rem;
    text-align: center;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.tool-card:hover {
    border-color: var(--accent-bazan);
    transform: translateY(-5px);
    box-shadow: var(--card-shadow);
}
