/* Root variables are defined globally in style.css */


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

body {
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

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

ul {
    list-style: none;
}

/* ========================================
   PAGE LAYOUT
======================================== */


.content-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}

/* ========================================
   ARTICLE MAIN
======================================== */
.article-main {
    min-width: 0;
}

/* Category badge */
.article-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: var(--gold-glow);
    border: 1px solid var(--gold-border);
    border-radius: 2px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.article-category-badge a {
    display: inline-flex;
    align-items: center;
    gap: 5px
}

/* Title */
.article-title {
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 900;
    line-height: 1.28;
    color: var(--white);
    margin-bottom: 10px;
}

/* Meta row */
.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    /* padding: 10px 0; */
    /* border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border); */
    margin-bottom: 15px;
}

.meta-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-light);
}

.meta-item i {
    color: var(--gold);
    font-size: 0.8rem;
}

/* Short description */
.article-excerpt {
    background: linear-gradient(135deg, rgba(224, 162, 66, 0.06), rgba(224, 162, 66, 0.02));
    border-left: 3px solid var(--gold);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 0 22px;
    margin-bottom: 32px;
    font-size: 14px;
    line-height: 1.8;
    font-style: italic;
}

/* Featured Image */
.article-thumb {
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 36px;
    position: relative;
}

.article-thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/8;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.article-thumb:hover img {
    transform: scale(1.02);
}

.article-thumb-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.7) 0%, transparent 100%);
    pointer-events: none;
}

/* ========================================
   ARTICLE CONTENT — ISOLATED SCOPE
   Two-level parent to beat global CSS
======================================== */
.article-body-wrap {
    /* Level 1 wrapper — scope boundary */
    margin-bottom: 40px;
}

.article-body-wrap .article-body-scope {
    /* Level 2 — all CKEditor raw HTML lives here */
    all: revert;
    /* reset inherited props */
}

/* Now re-style everything INSIDE .article-body-scope */
.article-body-wrap .article-body-scope {
    /* font-family: 'Be Vietnam Pro', sans-serif; */
    font-size: 16px;
    line-height: 1.6;
    /* color: #d8d4cf; */
    /* word-break: break-word; */
    /* overflow-wrap: break-word; */
}

.article-body-wrap .article-body-scope * {
    max-width: 100%;
}

.article-body-wrap .article-body-scope h1,
.article-body-wrap .article-body-scope h2,
.article-body-wrap .article-body-scope h3,
.article-body-wrap .article-body-scope h4,
.article-body-wrap .article-body-scope h5,
.article-body-wrap .article-body-scope h6 {
    color: #f0ede8;
    line-height: 1.3;
    margin: 15px 0;
    font-weight: 700;
}

.article-body-wrap .article-body-scope h2 {
    font-size: 22px;
    /* border-bottom: 1px solid rgba(224, 162, 66, 0.2); */
    /* padding-bottom: 10px; */
    color: #ffffff;
}

.article-body-wrap .article-body-scope h3 {
    font-size: 18px;
    color: #FFF;
}

.article-body-wrap .article-body-scope h4 {
    font-size: 16px;
}

.article-body-wrap .article-body-scope p {
    margin: 0 0 10px;
    font-size: 16px;
}

.article-body-wrap .article-body-scope a {
    color: #e0a242;
    text-decoration: underline;
    text-decoration-color: rgba(224, 162, 66, 0.4);
    text-underline-offset: 3px;
    transition: all 0.2s;
}

.article-body-wrap .article-body-scope a:hover {
    text-decoration-color: #e0a242;
    color: #f0b855;
}

.article-body-wrap .article-body-scope strong,
.article-body-wrap .article-body-scope b {
    color: #f0ede8;
    font-weight: 700;
}

.article-body-wrap .article-body-scope em,
.article-body-wrap .article-body-scope i {
    font-style: italic;
}

.article-body-wrap .article-body-scope ul,
.article-body-wrap .article-body-scope ol {
    margin: 0 0 15px 0;
    padding-left: 1.6em;
}

.article-body-wrap .article-body-scope ul {
    list-style: none;
    padding-left: 0;
}

.article-body-wrap .article-body-scope ul li {
    padding-left: 1.4em;
    position: relative;
    margin-bottom: 0.5em;
}

.article-body-wrap .article-body-scope ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.75em;
    width: 6px;
    height: 6px;
    background: #e0a242;
    border-radius: 50%;
    transform: translateY(-50%);
}

.article-body-wrap .article-body-scope ol {
    list-style: decimal;
}

.article-body-wrap .article-body-scope ol li {
    margin-bottom: 0.5em;
}



.article-body-wrap .article-body-scope pre {
    margin: 1.5em 0;
    padding: 20px 22px;
    background: #0e0e0e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow-x: auto;
    /* font-family: 'Fira Code', 'Courier New', monospace; */
    font-size: 0.88rem;
    line-height: 1.7;
    color: #a8e6a3;
}

.article-body-wrap .article-body-scope code {
    /* font-family: 'Fira Code', 'Courier New', monospace; */
    font-size: 0.88em;
    padding: 2px 7px;
    background: rgba(224, 162, 66, 0.1);
    border: 1px solid rgba(224, 162, 66, 0.2);
    border-radius: 3px;
    color: #e0a242;
}

.article-body-wrap .article-body-scope pre code {
    padding: 0;
    background: none;
    border: none;
    color: inherit;
}

.article-body-wrap .article-body-scope img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5em auto;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.article-body-wrap .article-body-scope figure {
    margin: 1.8em 0;
    text-align: center;
}

.article-body-wrap .article-body-scope .image-caption {
    margin-top: 8px;
    font-size: 14px;
    /* color: var(--text-light); */
    font-style: italic;
}

.article-body-wrap .article-body-scope table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.9rem;
}

.article-body-wrap .article-body-scope th {
    background: rgba(224, 162, 66, 0.12);
    color: #e0a242;
    font-weight: 600;
    padding: 12px 14px;
    text-align: left;
    border: 1px solid rgba(224, 162, 66, 0.2);
}

.article-body-wrap .article-body-scope td {
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: #c0bcb7;
}

.article-body-wrap .article-body-scope tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

.article-body-wrap .article-body-scope hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 2em 0;
}

/* ========================================
   TAGS
======================================== */
.article-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.tags-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tag {
    padding: 5px 13px;
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 0.76rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.tag:hover {
    border-color: var(--gold-border);
    color: var(--gold);
    background: var(--gold-glow);
}

/* ========================================
   SHARE BUTTONS
======================================== */
.share-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 18px;
    margin-bottom: 30px;
}

.share-title {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    /* color: var(--text-muted); */
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    letter-spacing: 0.02em;
}

.share-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.share-fb {
    background: #1877f2;
    color: #fff;
}

.share-tw {
    background: #000;
    color: #fff;
    border: 1px solid #333;
}

.share-zalo {
    background: #0068ff;
    color: #fff;
}

.share-zalo img {
    width: 20px;
    height: 20px;
}

.share-tele {
    background: #0088cc;
    color: #fff;
}

.share-copy {
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.share-copy:hover {
    color: var(--gold);
    border-color: var(--gold-border);
}

/* Copy toast */
.copy-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--gold);
    color: #000;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 10px 22px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
    z-index: 9999;
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========================================
   AUTHOR BOX
======================================== */
.author-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.author-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-dark));
}

.author-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid var(--gold-border);
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-info h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 4px;
}

.author-box .author-description {
    margin-bottom: 10px;
}

.author-info .author-role {
    font-size: 0.76rem;
    color: var(--gold);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.author-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 14px;
}

.author-socials ul {
    display: flex;
    gap: 10px;
}

.author-socials ul li {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 50%;
}

.author-socials ul li:hover {
    background-color: var(--gold);
    transition: all 0.3s ease;
}

.author-socials ul li:hover img {
    /* filter: invert(1); */
    transition: all 0.3s ease;
}

.author-socials ul li img {
    width: 20px !important;
    height: 20px !important;
}

.author-social-link {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.author-social-link:hover {
    border-color: var(--gold-border);
    color: var(--gold);
    background: var(--gold-glow);
}

/* ========================================
/* ========================================
   SIDEBAR (Moved to style.css)
======================================== */


/* Progress bar */
.read-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    z-index: 9999;
    transition: width 0.1s linear;
    width: 0%;
}

/* Back to top */
/* .back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 44px;
    height: 44px;
    background: var(--gold);
    color: #000;
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 50;
    box-shadow: 0 4px 20px rgba(224, 162, 66, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--gold-light);
    transform: translateY(-3px);
} */

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr 280px;
        gap: 28px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }
}

@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .main-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .header-cta {
        display: none;
    }

    .page-wrapper {
        padding: 28px 0px;
    }

    .article-title {
        font-size: 1.5rem;
    }

    .article-meta {
        gap: 12px;
    }

    .meta-divider {
        display: none;
    }

    .author-box {
        flex-direction: column;
        gap: 16px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .share-buttons {
        gap: 8px;
    }

    .share-btn {
        padding: 8px 13px;
        font-size: 0.75rem;
    }

    .back-to-top {
        bottom: 20px;
        right: 16px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .header-inner {
        padding: 0 16px;
    }

    .article-meta {
        /* flex-direction: column; */
        align-items: flex-start;
        gap: 8px;
    }

    .article-body-wrap .article-body-scope {
        font-size: 0.95rem;
    }

    .article-body-wrap .article-body-scope h2 {
        font-size: 1.25rem;
    }
}

/* Mobile nav overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 90;
    backdrop-filter: blur(4px);
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: #111;
    z-index: 95;
    padding: 80px 24px 40px;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid var(--border);
    overflow-y: auto;
}

.mobile-nav.open {
    right: 0;
}

.mobile-nav-overlay.open {
    display: block;
}

.mobile-nav a {
    display: block;
    padding: 13px 0;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.mobile-nav a:hover {
    color: var(--gold);
}

.mobile-nav-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.article-main>* {
    animation: fadeInUp 0.5s ease forwards;
}

.article-category-badge {
    animation-delay: 0.05s;
}

.article-title {
    animation-delay: 0.1s;
}

.article-meta {
    animation-delay: 0.15s;
}

.article-excerpt {
    animation-delay: 0.2s;
}

.article-thumb {
    animation-delay: 0.25s;
}


/* ========================================
   ARTICLE TOC
======================================== */

.article-toc {
    background: linear-gradient(135deg, rgba(224, 162, 66, 0.04), rgba(224, 162, 66, 0.01));
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-gold);
}

.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(224, 162, 66, 0.15);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.toc-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--white);
    flex-grow: 1;
    margin-left: 10px;
    letter-spacing: 0.02em;
}

.toc-toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.toc-toggle-btn:hover {
    color: var(--gold);
}

.toc-body {
    transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out;
    /* max-height: 1000px; */
    opacity: 1;
    /* overflow: hidden; */
}

.toc-body.collapsed {
    max-height: 0;
    opacity: 0;
    padding-bottom: 0;
    margin-bottom: 0;
}

.toc-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    counter-reset: h2-counter;
}

.toc-item {
    margin-bottom: 10px;
    line-height: 1.5;
}

.toc-item:last-child {
    margin-bottom: 0;
}

.toc-item a {
    /* color: var(--text-secondary); */
    font-size: 0.92rem;
    transition: var(--transition);
    /* display: inline-block; */
    position: relative;
}

.toc-item a:hover {
    color: var(--gold);
    transform: translateX(4px);
}

.toc-level-h2 {
    padding-left: 0;
    font-weight: 600;
    counter-increment: h2-counter;
    counter-reset: h3-counter;
}

.toc-level-h2::before {
    content: counter(h2-counter) ". ";
    color: var(--gold);
    margin-right: 8px;
    font-size: 1.1rem;
    vertical-align: middle;
}

.toc-level-h3 {
    padding-left: 20px;
    font-size: 0.88rem;
    counter-increment: h3-counter;
}

.toc-level-h3::before {
    content: counter(h2-counter) "." counter(h3-counter) " ";
    color: var(--text-muted);
    margin-right: 8px;
    vertical-align: middle;
}