/* ==========================================================================
   eMagazine Style Sheet (Breakout Layout Edition)
   Inspired by Bloomberg Businessweek, Financial Times, Nikkei Asia
   Color Palette:
   - Primary (Ocean Blue): #0077B6
   - Secondary (Green Tech): #3FA34D
   - Accent (Orange): #F4A300
   - Backgrounds: White (#FFFFFF) & Soft Gray (#F8F9FA, #E9ECEF)
   ========================================================================== */

:root {
    --primary-color: #0077B6;
    --secondary-color: #3FA34D;
    --accent-color: #F4A300;
    --text-dark: #1A2530;
    --text-muted: #495057;
    --bg-light: #F8F9FA;
    --bg-gray: #E9ECEF;
    --border-color: #DEE2E6;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Inter', sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset and Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    color: var(--text-dark);
    background-color: #ffffff;
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Scroll Progress Bar */
#progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 1000;
}

#progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.1s ease;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   Hero Header (Tối giản, chỉ để title trên ảnh - Không có chìa khóa)
   ========================================================================== */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-align: center;
    padding: 0 20px;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 53, 84, 0.85) 0%, rgba(0, 119, 182, 0.7) 100%);
    z-index: 1;
}

.hero-container {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeInDown 1.5s ease;
}

.hero-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

/* 3D Gold Typography for "Chìa khóa" (Không có chìa khóa xoay bên cạnh) */
.title-3d {
    font-family: var(--font-serif);
    font-size: 5.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    background: linear-gradient(135deg, #FFE259 0%, #FFA751 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(2px 2px 0px rgba(0, 0, 0, 0.8))
            drop-shadow(4px 4px 5px rgba(244, 163, 0, 0.5));
    display: inline-flex;
    align-items: center;
}

.title-main {
    font-family: var(--font-sans);
    font-size: 2.5rem;
    font-weight: 400; /* Nhẹ nhàng hơn để tăng tính sang trọng */
    line-height: 1.45;
    max-width: 880px;
    letter-spacing: -0.5px;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Dòng highlight trong tiêu đề */
.title-main .highlight-green {
    color: #4AD66D; /* Xanh lá tươi tắn, hiện đại */
    font-weight: 800;
}

.title-main .highlight-gold {
    color: var(--accent-color); /* Cam vàng nổi bật */
    font-weight: 800;
}

.title-decor-line {
    width: 150px;
    height: 3px;
    background-color: var(--accent-color);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Sapo Section & Article Metadata
   ========================================================================== */
.sapo-section {
    padding: 80px 0 50px 0;
    background-color: #ffffff;
}

.sapo-glass-card {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    padding: 50px 60px;
    border: 1px solid rgba(0, 119, 182, 0.15);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 950px;
    margin: 0 auto;
}

.quote-mark {
    font-family: var(--font-serif);
    font-size: 6rem;
    font-weight: bold;
    color: rgba(244, 163, 0, 0.25);
    position: absolute;
    line-height: 1;
}

.quote-mark.open {
    top: 10px;
    left: 20px;
}

.quote-mark.close {
    bottom: -40px;
    right: 20px;
}

.sapo-text {
    font-family: var(--font-serif);
    font-size: 1.45rem;
    font-style: italic;
    color: var(--text-dark);
    text-align: justify;
    line-height: 1.8;
    position: relative;
    z-index: 2;
}

.sapo-icons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 40px;
    border-top: 1px solid rgba(0, 119, 182, 0.1);
    padding-top: 30px;
}

.sapo-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}

.sapo-icon-item .icon-wrapper {
    width: 60px;
    height: 60px;
    background: rgba(0, 119, 182, 0.08);
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 22px;
    transition: var(--transition-smooth);
}

.sapo-icon-item:hover .icon-wrapper {
    background: var(--primary-color);
    color: #ffffff;
    transform: translateY(-5px);
}

.sapo-icon-item span {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* Article Meta Bar (After Sapo) */
.article-meta-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.95rem;
    font-family: var(--font-sans);
}

.meta-divider {
    color: var(--border-color);
}

/* ==========================================================================
   Part Title Header
   ========================================================================== */
.part-title-wrapper {
    position: relative;
    width: 100%;
    height: 400px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    overflow: hidden;
    margin-bottom: 40px;
}

.part-title-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(26, 37, 48, 0.9) 0%, rgba(0, 119, 182, 0.5) 100%);
    z-index: 1;
}

.part-title-container {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    padding: 0 20px;
}

.part-number {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 5px;
    color: var(--accent-color);
    margin-bottom: 15px;
    text-transform: uppercase;
}

.part-heading {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 1px;
    line-height: 1.4;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.part-icon {
    font-size: 2rem;
    color: var(--accent-color);
}

.link-chain-simulation, .trademark-simulation, .lighthouse-animation {
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    margin: 20px auto 0 auto;
}

/* ==========================================================================
   Breakout Layout (Nội dung chính)
   ========================================================================== */
.story-part {
    margin-bottom: 80px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 80px;
}

/* Centered Text column (Dễ đọc, nhiều khoảng trắng) */
.story-text-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.text-block {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.text-block.active {
    opacity: 1;
    transform: translateY(0);
}

.paragraph {
    font-size: 1.2rem;
    color: var(--text-dark);
    text-align: justify;
    line-height: 1.95;
}

/* First Letter Dropcap Vibe */
.paragraph.first-letter::first-letter {
    font-family: var(--font-serif);
    font-size: 3.8rem;
    float: left;
    line-height: 0.9;
    padding-right: 12px;
    font-weight: 700;
    color: var(--primary-color);
}

.paragraph.highlight-paragraph {
    font-family: var(--font-serif);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--primary-color);
    border-left: 5px solid var(--accent-color);
    padding-left: 20px;
    margin: 20px 0;
    line-height: 1.7;
}

/* Middle Inline Images */
.mid-image-container {
    width: 100%;
    margin: 40px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.mid-image-container.active {
    opacity: 1;
    transform: translateY(0);
}

.mid-image-container img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.image-caption {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-style: italic;
    border-left: 2px solid var(--primary-color);
    padding-left: 10px;
}

/* Large Quote Block */
.large-quote-block {
    background-color: var(--bg-light);
    border-left: 5px solid var(--primary-color);
    padding: 30px 40px;
    margin: 40px 0;
    position: relative;
    border-radius: 0 8px 8px 0;
}

.large-quote-block .quote-icon {
    font-size: 2rem;
    color: rgba(0, 119, 182, 0.15);
    position: absolute;
    top: 15px;
    left: 20px;
}

.large-quote-block blockquote {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-style: italic;
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.large-quote-block cite {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 700;
    font-style: normal;
    color: var(--text-muted);
    display: block;
    text-align: right;
}

/* ==========================================================================
   Breakout Graphic Container (Infographic tràn 2 bên, cực rộng)
   ========================================================================== */
.breakout-graphic-container {
    width: 100%;
    max-width: 1300px;
    margin: 60px auto;
    padding: 0 24px;
}

.infographic-box {
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 40px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 15px 40px rgba(0,0,0,0.06);
    border: 1px solid var(--border-color);
    gap: 25px;
}

.info-title {
    font-family: var(--font-sans);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 15px;
    line-height: 1.4;
}

.svg-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.infographic-svg {
    width: 100%;
    height: auto;
}

/* SVG Font Awesome Support inside Text Elements */
.svg-icon-font {
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900 !important;
}

/* Interactive SVG animations */
.node:hover {
    cursor: pointer;
}
.node circle, .node rect {
    transition: var(--transition-smooth);
}
.node:hover circle {
    fill: var(--accent-color);
    r: 45px;
}
.node:hover rect {
    fill: var(--accent-color);
    filter: drop-shadow(0px 8px 12px rgba(244, 163, 0, 0.4));
}

.animated-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawPath 6s linear infinite;
}

@keyframes drawPath {
    to {
        stroke-dashoffset: 0;
    }
}

.quote-box-inline {
    background-color: var(--bg-light);
    border-left: 4px solid var(--accent-color);
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
}

.quote-text-inline {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-style: italic;
    color: var(--text-dark);
    line-height: 1.6;
}

/* ==========================================================================
   Footer Section
   ========================================================================== */
.footer-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 24px;
    color: #ffffff;
}

.footer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(26, 37, 48, 0.9) 0%, rgba(0, 53, 84, 0.95) 100%);
    z-index: 1;
}

.footer-container {
    position: relative;
    z-index: 2;
    max-width: 950px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.footer-network-graphics {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.footer-icon {
    font-size: 2.2rem;
    color: rgba(255, 255, 255, 0.3);
    transition: var(--transition-smooth);
}

.footer-icon:hover {
    color: var(--accent-color);
    transform: scale(1.2);
}

.footer-quote-wrapper {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 40px 0;
}

.footer-quote-text {
    font-family: var(--font-serif);
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.65;
    color: #ffffff;
    max-width: 850px;
    margin: 0 auto;
}

.footer-author-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
}

.author-label {
    font-size: 11px;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.author-name {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--accent-color);
    letter-spacing: 1px;
}

/* Simple pulse effect */
.anim-pulse {
    animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; color: var(--accent-color); }
}

/* ==========================================================================
   Responsive Web Design (Media Queries)
   ========================================================================== */

/* Medium Devices (Tablets, 1024px and below) */
@media screen and (max-width: 1024px) {
    html {
        font-size: 15px;
    }

    .hero-title .title-3d {
        font-size: 4.5rem;
    }

    .hero-title .title-main {
        font-size: 2rem;
    }

    .breakout-graphic-container {
        max-width: 100%;
        padding: 0 16px;
    }

    .infographic-box {
        padding: 25px;
    }

    .footer-quote-text {
        font-size: 1.8rem;
    }
}

/* Mobile Devices (Phones, 768px and below) */
@media screen and (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .hero-title .title-3d {
        font-size: 3.2rem;
    }

    .hero-title .title-main {
        font-size: 1.6rem;
    }

    .story-text-container {
        padding: 20px 16px;
        gap: 24px;
    }

    .paragraph {
        font-size: 1.15rem;
    }

    .breakout-graphic-container {
        margin: 40px auto;
        padding: 0 8px;
    }

    .infographic-box {
        padding: 20px 12px;
        gap: 15px;
    }

    .info-title {
        font-size: 1.15rem;
    }

    .svg-container {
        min-height: 480px; /* Bắt buộc chiều cao tối thiểu cho SVG để không bị nén quá nhỏ trên mobile */
    }

    .sapo-glass-card {
        padding: 30px 20px;
    }

    .sapo-text {
        font-size: 1.25rem;
    }

    .sapo-icons {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .article-meta-bar {
        flex-direction: column;
        gap: 10px;
        font-size: 0.9rem;
    }

    .article-meta-bar .meta-divider {
        display: none;
    }

    .part-title-wrapper {
        height: 320px;
        background-attachment: scroll; /* parallax issues on mobile */
    }

    .part-heading {
        font-size: 1.5rem;
    }

    .large-quote-block {
        padding: 20px 24px;
        margin: 30px 0;
    }

    .large-quote-block blockquote {
        font-size: 1.2rem;
    }

    .footer-section {
        background-attachment: scroll;
        padding: 60px 16px;
    }

    .footer-quote-text {
        font-size: 1.45rem;
    }

    .footer-icon {
        font-size: 1.8rem;
    }
}
