/* =========================================
   N4C.VN — ARTICLE LAYOUT SYSTEM
   Dùng chung cho toàn bộ bài viết blog
   Import: <link rel="stylesheet" href="../css/article.css">
   ========================================= */

/* === READING PROGRESS BAR === */
.reading-progress { position: fixed; top: 0; left: 0; width: 0%; height: 3px; background: linear-gradient(90deg, var(--neon-cyan), var(--tiktok-pink)); z-index: 99999; transition: width 0.1s; }

/* === ARTICLE HERO === */
.article-hero { padding: 120px 4% 30px; }
.article-hero-inner { max-width: 1100px; margin: 0 auto; }

/* === COVER IMAGE - NO CROP === */
.article-cover { width: 100%; border-radius: 16px; margin-top: 25px; border: 1px solid var(--border-subtle); display: block; }

/* === 2-COLUMN LAYOUT === */
.article-layout { max-width: 1440px; margin: 0 auto; padding: 0 4% 80px; display: grid; grid-template-columns: 1fr 340px; gap: 50px; align-items: start; }

/* === ARTICLE BODY === */
.article-body h2 { font-size: 1.5rem; margin: 40px 0 15px; color: var(--neon-cyan); scroll-margin-top: 90px; }
.article-body h3 { font-size: 1.2rem; margin: 25px 0 10px; color: #fff; }
.article-body p { color: var(--text-light); font-size: 1.05rem; line-height: 1.9; margin-bottom: 18px; }
.article-body a { color: var(--neon-cyan); text-decoration: underline; }
.article-body ul, .article-body ol { color: var(--text-light); font-size: 1.05rem; line-height: 2; margin: 10px 0 20px 25px; }
.article-body li { margin-bottom: 8px; }
.article-body img { border-radius: 12px; margin: 15px 0; }
.article-body table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 0.95rem; }
.article-body table th { background: rgba(0,228,255,0.1); color: var(--neon-cyan); padding: 12px 16px; text-align: left; border: 1px solid rgba(255,255,255,0.08); }
.article-body table td { padding: 10px 16px; border: 1px solid rgba(255,255,255,0.06); color: var(--text-light); }
.article-body table tr:hover td { background: rgba(0,228,255,0.03); }

/* === ARTICLE META === */
.article-meta { display: flex; align-items: center; gap: 15px; margin-top: 20px; }
.article-meta img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }
.article-info-row { display: flex; align-items: center; gap: 20px; margin-top: 12px; flex-wrap: wrap; }
.article-info-row span { font-size: 0.85rem; color: var(--text-gray); display: flex; align-items: center; gap: 5px; }

/* === BREADCRUMB === */
.breadcrumb { font-size: 0.85rem; color: var(--text-gray); margin-bottom: 15px; }
.breadcrumb a { color: var(--text-gray); text-decoration: none; }
.breadcrumb a:hover { color: var(--neon-cyan); }

/* === CTA & BOXES === */
.article-cta { background: var(--bg-card); border: 1px solid var(--border-glow); border-radius: 16px; padding: 35px; margin: 50px 0; text-align: center; }
.prompt-box { background: rgba(0,0,0,0.4); border: 1px dashed rgba(0,228,255,0.3); border-radius: 12px; padding: 20px 24px; margin: 20px 0; font-family: 'Courier New', monospace; font-size: 0.95rem; color: #00E4FF; line-height: 1.8; white-space: pre-wrap; }
.highlight-box { background: rgba(0,228,255,0.05); border-left: 4px solid var(--neon-cyan); padding: 20px 25px; border-radius: 0 12px 12px 0; margin: 25px 0; }
.highlight-box p { margin-bottom: 0; }
.warning-box { background: rgba(255,0,80,0.05); border-left: 4px solid var(--tiktok-pink); padding: 20px 25px; border-radius: 0 12px 12px 0; margin: 25px 0; }
.warning-box p { margin-bottom: 0; }
.step-number { display: inline-block; width: 36px; height: 36px; background: linear-gradient(135deg, #00E4FF, #FF0050); border-radius: 50%; text-align: center; line-height: 36px; font-weight: 800; color: #fff; margin-right: 10px; font-size: 0.95rem; }

/* === SHARE BUTTONS === */
.share-bar { display: flex; gap: 10px; margin: 30px 0; flex-wrap: wrap; }
.share-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 0.85rem; font-weight: 600; color: #fff; text-decoration: none; transition: 0.3s; border: none; cursor: pointer; font-family: 'Inter', sans-serif; }
.share-btn:hover { transform: translateY(-2px); color: #fff; }
.share-fb { background: #1877F2; }
.share-tw { background: #1DA1F2; }
.share-tele { background: #0088cc; }
.share-copy { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.1); }
.share-copy:hover { background: rgba(0,228,255,0.2); }

/* === SIDEBAR === */
.article-sidebar { position: sticky; top: 90px; }
.sidebar-box { background: var(--bg-card); border: 1px solid rgba(255,255,255,0.06); border-radius: 14px; padding: 22px; margin-bottom: 24px; }
.sidebar-box h4 { font-size: 1rem; color: #fff; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; gap: 8px; }

/* TOC */
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list li { margin-bottom: 6px; }
.toc-list a { display: block; padding: 8px 12px; color: var(--text-gray); font-size: 0.88rem; border-radius: 8px; text-decoration: none; line-height: 1.5; transition: all 0.3s; border-left: 2px solid transparent; }
.toc-list a:hover, .toc-list a.active { color: var(--neon-cyan); background: rgba(0,228,255,0.05); border-left-color: var(--neon-cyan); }

/* Author card */
.author-card { display: flex; align-items: center; gap: 14px; }
.author-card img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.author-card .author-name { font-weight: 700; color: #fff; font-size: 0.95rem; }
.author-card .author-role { font-size: 0.82rem; color: var(--text-gray); margin-top: 2px; }

/* Related articles */
.related-item { display: flex; gap: 12px; margin-bottom: 14px; text-decoration: none; padding: 8px; border-radius: 10px; transition: 0.3s; }
.related-item:hover { background: rgba(0,228,255,0.05); }
.related-item img { width: 72px; height: 50px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.related-item .related-title { font-size: 0.85rem; color: var(--text-light); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-item .related-date { font-size: 0.75rem; color: var(--text-gray); margin-top: 4px; }

/* Tags */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-item { padding: 5px 14px; border-radius: 20px; font-size: 0.8rem; color: var(--text-gray); background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); text-decoration: none; transition: 0.3s; }
.tag-item:hover { color: var(--neon-cyan); border-color: rgba(0,228,255,0.3); background: rgba(0,228,255,0.05); }

/* === ARTICLE RESPONSIVE === */
@media (max-width: 1024px) {
    .article-layout { grid-template-columns: 1fr; gap: 30px; }
    .article-sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
    /* Ẩn sidebar TOC trên mobile/tablet vì đã có mobile-toc */
    .article-sidebar .sidebar-box:first-child { display: none; }
}
@media (max-width: 768px) {
    .article-hero { padding: 100px 4% 20px; }
    .article-hero h1 { font-size: 1.8rem !important; }
    .article-layout { padding: 0 4% 60px; }
    .article-sidebar { grid-template-columns: 1fr; }
    .share-bar { margin: 20px 0; }
    .article-info-row { gap: 10px; }
}
@media (max-width: 480px) {
    .article-hero h1 { font-size: 1.5rem !important; }
    .article-body h2 { font-size: 1.3rem; }
    .article-body p { font-size: 0.98rem; }
    .prompt-box { font-size: 0.85rem; padding: 15px; }
}

/* === MOBILE TOC (Mục Lục cho Di Động / Tablet) === */
.mobile-toc {
    display: none; /* Mặc định ẩn trên Desktop */
    margin: 0 0 30px;
    border-radius: 14px;
    border: 1px solid rgba(0, 228, 255, 0.15);
    background: rgba(10, 20, 40, 0.85);
    backdrop-filter: blur(10px);
    overflow: hidden;
}
.mobile-toc-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.3s;
}
.mobile-toc-toggle:hover {
    background: rgba(0, 228, 255, 0.05);
}
.mobile-toc-toggle .toc-icon {
    font-size: 1.1rem;
    transition: transform 0.3s;
}
.mobile-toc.open .toc-icon {
    transform: rotate(180deg);
}
.mobile-toc-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.mobile-toc.open .mobile-toc-content {
    max-height: 800px;
}
.mobile-toc-content .toc-list {
    padding: 0 16px 16px;
}
.mobile-toc-content .toc-list a {
    padding: 10px 14px;
    font-size: 0.92rem;
}

@media (max-width: 1024px) {
    .mobile-toc {
        display: block;
    }
}

