/* 
 * App CSS - Main Stylesheet
 * TASK 11 (18/08/2026): Redesign Giao Diện 2026 "Báo Điện Tử Phong Cách Đức"
 * Phong cách: Süddeutsche Zeitung / Der Spiegel — Mobile First, Serif headings,
 * bảng màu trắng/xám nhạt/đen + đỏ đậm #c00000, hỗ trợ Dark Mode.
 * GIỮ NGUYÊN mọi class hiện có (sidebar, content-bottom, share-box, favorites, search...).
 */

/* ============================================================
   1. DESIGN TOKENS (CSS Variables) — Light & Dark
   ============================================================ */
:root {
    --color-bg: #ffffff;
    --color-bg-alt: #f5f5f5;
    --color-surface: #ffffff;
    --color-text: #1a1a1a;
    --color-text-muted: #6b6b6b;
    --color-text-soft: #999999;
    --color-accent: #c00000;
    --color-accent-dark: #8f0000;
    --color-accent-soft: #fdecec;
    --color-border: #e5e5e5;
    --color-border-strong: #d0d0d0;
    --color-header-bg: #002B58;
    --color-nav-bg: #002B58;
    --color-nav-text: #ffffff;
    --color-nav-hover: #c00000;
    --color-footer-bg: #1a1a1a;
    --color-footer-text: #cccccc;
    --color-footer-heading: #ffffff;
    --color-link: #c00000;
    --color-link-hover: #8f0000;
    --font-serif: 'Merriweather', 'Lora', 'Source Serif Pro', 'Noto Serif', 'DejaVu Serif', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', 'Roboto', 'Source Sans Pro', 'Noto Sans', 'DejaVu Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --container-max: 1200px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,.1);
    --transition: .2s ease;
}

[data-theme="dark"] {
    --color-bg: #121212;
    --color-bg-alt: #1a1a1a;
    --color-surface: #1e1e1e;
    --color-text: #f0f0f0;
    --color-text-muted: #a0a0a0;
    --color-text-soft: #777777;
    --color-accent: #e04040;
    --color-accent-dark: #ff5a5a;
    --color-accent-soft: #3a1a1a;
    --color-border: #333333;
    --color-border-strong: #444444;
    --color-header-bg: #001a3a;
    --color-nav-bg: #001a3a;
    --color-nav-text: #f0f0f0;
    --color-nav-hover: #e04040;
    --color-footer-bg: #0d0d0d;
    --color-footer-text: #aaaaaa;
    --color-footer-heading: #ffffff;
    --color-link: #e04040;
    --color-link-hover: #ff6b6b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,.5);
}

/* ============================================================
   2. RESET & BASE (Mobile First)
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; line-height: 1.6; scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background var(--transition), color var(--transition);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-link); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-link-hover); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-serif); font-weight: 700; line-height: 1.25; color: var(--color-text); }
ul, ol { list-style: none; }
button { font-family: var(--font-sans); cursor: pointer; }
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 16px; }

/* ============================================================
   3. HEADER (Sticky)
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-header-bg);
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    transition: background var(--transition);
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    max-width: var(--container-max);
    margin: 0 auto;
    gap: 12px;
}
.logo { flex-shrink: 0; }
.logo img { height: 44px; width: auto; }
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.header-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 50%;
    color: #ffffff;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.header-action-btn:hover { background: rgba(255,255,255,.12); color: #ffffff; border-color: rgba(255,255,255,.6); }
.header-action-btn svg { width: 20px; height: 20px; }

/* Search Modal */
.search-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}
.search-modal.active { display: flex; }
.search-modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 560px;
    position: relative;
    box-shadow: var(--shadow-md);
}
.search-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: var(--color-bg-alt);
    border: none;
    border-radius: 50%;
    font-size: 22px;
    color: var(--color-text);
    line-height: 1;
}
.search-form { display: flex; gap: 0; margin-top: 8px; }
.search-form input {
    flex: 1;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid var(--color-border);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    outline: none;
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color var(--transition);
}
.search-form input:focus { border-color: var(--color-accent); }
.search-form button {
    padding: 14px 22px;
    font-size: 16px;
    font-weight: 600;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    transition: background var(--transition);
}
.search-form button:hover { background: var(--color-accent-dark); }

/* ============================================================
   4. NAVIGATION (MegaMenu)
   ============================================================ */
.main-navigation {
    background: var(--color-nav-bg);
    position: relative;
    z-index: 90;
    transition: background var(--transition);
}
.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 16px;
}
.nav-menu {
    display: flex;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav-menu::-webkit-scrollbar { display: none; }
.nav-item { position: relative; flex-shrink: 0; }
.nav-item > a {
    display: block;
    padding: 14px 16px;
    color: var(--color-nav-text);
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
}
.nav-item > a:hover, .nav-item > a.nav-active { background: var(--color-nav-hover); color: #fff; }
.megamenu-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-accent);
    box-shadow: var(--shadow-md);
    min-width: 260px;
    padding: 16px;
    display: none;
    z-index: 50;
}
.nav-item:hover .megamenu-content { display: block; }
.megamenu-content a {
    display: block;
    padding: 8px 10px;
    color: var(--color-text);
    font-size: 14px;
    border-radius: 4px;
    transition: background var(--transition), color var(--transition);
}
.megamenu-content a:hover { background: var(--color-accent-soft); color: var(--color-accent); }

/* Mobile menu toggle (hidden on desktop) */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-nav-text);
    cursor: pointer;
    padding: 10px;
}
.mobile-menu-toggle svg { width: 24px; height: 24px; }

/* Mobile menu drawer */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: var(--color-surface);
    z-index: 300;
    transition: right .3s ease;
    box-shadow: -4px 0 20px rgba(0,0,0,.2);
    overflow-y: auto;
}
.mobile-menu.active { right: 0; }
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
    font-weight: 700;
    font-family: var(--font-serif);
}
.mobile-menu-close {
    width: 40px;
    height: 40px;
    background: var(--color-bg-alt);
    border: none;
    border-radius: 50%;
    font-size: 22px;
    color: var(--color-text);
}
.mobile-nav-menu { padding: 8px 0; }
.mobile-nav-menu li a {
    display: block;
    padding: 14px 20px;
    color: var(--color-text);
    font-size: 16px;
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition), color var(--transition);
}
.mobile-nav-menu li a:hover { background: var(--color-accent-soft); color: var(--color-accent); }
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 250;
    display: none;
}
.mobile-menu-overlay.active { display: block; }

/* ===== Submenu indicator (desktop megamenu) ===== */
.nav-item.has-submenu > a::after {
    content: ' \25BE';
    font-size: 0.65em;
    margin-left: 6px;
    opacity: 0.6;
    display: inline-block;
    transition: transform var(--transition);
}
.nav-item.has-submenu:hover > a::after {
    transform: translateY(1px);
}

/* ===== Mobile submenu accordion ===== */
.mobile-nav-item.has-submenu {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}
.mobile-nav-item.has-submenu > a { flex: 1; padding-right: 0; }
.mobile-nav-item.has-submenu > .submenu-toggle {
    width: 44px;
    flex-shrink: 0;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text);
}
.mobile-nav-item.has-submenu > .submenu-toggle:hover { color: var(--color-accent); }
.mobile-nav-item.has-submenu > .submenu-toggle .chevron {
    transition: transform .25s ease;
}
.mobile-nav-item.has-submenu > .submenu-toggle[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}
.mobile-submenu {
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0,0,0,.03);
}
.mobile-nav-item.has-submenu.expanded > .mobile-submenu {
    max-height: 600px;
}
[data-theme="dark"] .mobile-submenu {
    background: rgba(255,255,255,.05);
}
.mobile-submenu li a {
    padding: 12px 20px 12px 32px;
    font-size: 14px;
    border-bottom: 1px solid rgba(0,0,0,.06);
}
[data-theme="dark"] .mobile-submenu li a {
    border-bottom-color: rgba(255,255,255,.06);
}
.mobile-submenu li:last-child a { border-bottom: 0; }

/* ===== Mobile utility/login divider + section header ===== */
.mobile-nav-divider {
    height: 1px;
    background: var(--color-border);
    margin: 12px 16px;
    list-style: none;
}
.mobile-nav-section {
    padding: 14px 20px 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-accent);
    letter-spacing: 0.5px;
    list-style: none;
}
.mobile-nav-utility a {
    padding: 10px 20px 10px 32px !important;
    font-size: 14px;
    color: var(--color-text-secondary);
}
.mobile-nav-login a {
    color: var(--color-accent);
    font-weight: 600;
}

/* ===== Utility dropdown (desktop) ===== */
.utility-dropdown {
    position: absolute;
    top: 100%;
    right: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-accent);
    box-shadow: var(--shadow-md);
    min-width: 280px;
    z-index: 100;
    display: none;
}
.utility-dropdown.active { display: block; }
.ttvd-menu-module {
    padding: 12px 16px;
}
.ttvd-menu-module h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}
.ttvd-menu-module ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ttvd-menu-module li {
    border-bottom: 1px solid rgba(0,0,0,.06);
}
[data-theme="dark"] .ttvd-menu-module li {
    border-bottom-color: rgba(255,255,255,.06);
}
.ttvd-menu-module li:last-child { border-bottom: 0; }
.ttvd-menu-module li a {
    display: block;
    padding: 10px 8px;
    color: var(--color-text);
    font-size: 14px;
    border-radius: 4px;
    transition: background var(--transition), color var(--transition);
}
.ttvd-menu-module li a:hover {
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

/* ============================================================
   5. MAIN LAYOUT
   ============================================================ */
.main-wrapper { background: var(--color-bg); min-height: 60vh; }
.main-content { max-width: var(--container-max); margin: 0 auto; padding: 24px 16px; }

/* ============================================================
   6. HERO / FEATURED NEWS (Home)
   ============================================================ */
.hero-banner {
    background: var(--color-bg-alt);
    border-bottom: 3px solid var(--color-accent);
    padding: 28px 16px;
    text-align: center;
}
.hero-banner h1 {
    font-size: 28px;
    color: var(--color-text);
    margin-bottom: 8px;
}
.hero-banner .tagline {
    color: var(--color-text-muted);
    font-size: 16px;
    max-width: 640px;
    margin: 0 auto;
}

.featured-news { max-width: var(--container-max); margin: 0 auto; padding: 32px 16px 8px; }
.featured-news h2, .category-news h2, .latest-articles h2 {
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--color-accent);
    display: inline-block;
}
.news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
.featured-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.featured-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.featured-card a { display: block; color: var(--color-text); }
.featured-image { aspect-ratio: 16/9; overflow: hidden; background: var(--color-bg-alt); }
.featured-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.featured-card:hover .featured-image img { transform: scale(1.03); }
.featured-card h3 {
    font-size: 18px;
    padding: 14px 16px 4px;
    line-height: 1.35;
}
.featured-card h3:hover { color: var(--color-accent); }
.featured-card time {
    display: block;
    padding: 0 16px 14px;
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ============================================================
   7. CATEGORY NEWS (Home)
   ============================================================ */
.category-news { max-width: var(--container-max); margin: 0 auto; padding: 24px 16px; }
.category-section { margin-bottom: 28px; }
.category-section h3 {
    font-size: 18px;
    margin-bottom: 14px;
    padding-left: 12px;
    border-left: 4px solid var(--color-accent);
}
.category-section h3 a { color: var(--color-text); }
.category-section h3 a:hover { color: var(--color-accent); }
.category-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.category-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.category-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.category-item a { display: block; color: var(--color-text); }
.category-item img { aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.category-item span {
    display: block;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}
.category-item a:hover span { color: var(--color-accent); }

/* ============================================================
   8. LATEST ARTICLES (Home)
   ============================================================ */
.latest-articles { max-width: var(--container-max); margin: 0 auto; padding: 24px 16px 40px; }
.articles-list { display: flex; flex-direction: column; }
.article-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border);
}
.article-item:last-child { border-bottom: none; }
.article-item a { color: var(--color-text); }
.article-item h3 {
    font-size: 17px;
    line-height: 1.4;
    margin-bottom: 6px;
}
.article-item h3:hover { color: var(--color-accent); }
.article-item .meta {
    display: flex;
    gap: 14px;
    font-size: 13px;
    color: var(--color-text-muted);
}
.article-item .meta .category { color: var(--color-accent); font-weight: 500; }

/* ============================================================
   9. ARTICLE PAGE
   ============================================================ */
.article-container { max-width: var(--container-max); margin: 0 auto; padding: 24px 16px; }
.breadcrumbs {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs a:hover { color: var(--color-accent); }
.breadcrumbs span { color: var(--color-text); }

.article-content { max-width: 800px; }
.article-content h1 {
    font-size: 30px;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--color-text);
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--color-text-muted);
    font-size: 14px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}
.article-meta .author { color: var(--color-accent); font-weight: 500; }
.article-featured-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
}
.article-featured-image img { width: 100%; }
.article-intro {
    font-size: 18px;
    line-height: 1.7;
    color: var(--color-text);
    font-family: var(--font-serif);
    margin-bottom: 20px;
    padding-left: 16px;
    border-left: 4px solid var(--color-accent);
}
.article-content p {
    font-size: 17px;
    line-height: 1.8;
    margin-bottom: 18px;
    color: var(--color-text);
}
.article-content h2, .article-content h3, .article-content h4 {
    margin: 24px 0 12px;
}
.article-content img { border-radius: var(--radius); margin: 16px 0; }
.article-content a { text-decoration: underline; text-underline-offset: 2px; }

/* ============================================================
   10. SHARE BOX (Lan tỏa bài viết này)
   ============================================================ */
.share-box {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 22px 24px;
    margin: 32px 0 24px;
    box-shadow: var(--shadow-sm);
    max-width: 800px;
}
.share-box-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 16px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.02em;
    font-family: var(--font-sans);
}
.share-box-title svg { color: var(--color-accent); flex-shrink: 0; }
.share-buttons-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all .2s ease;
    letter-spacing: 0.01em;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
    min-height: 44px;
}
.share-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.18); color: #fff; }
.share-btn span { white-space: nowrap; }
.share-zalo { background: #007bff; }
.share-zalo:hover { background: #0056b3; }
.share-telegram { background: #2aabee; }
.share-telegram:hover { background: #1a8cb5; }
.share-facebook { background: #1a1a2e; }
.share-facebook:hover { background: #2a2a4e; }
.share-save { background: #dc2626; }
.share-save:hover { background: #b91c1c; }
.share-save.is-saved { background: #064e3b; border-color: #064e3b; }
.share-save.is-saved:hover { background: #047857; }

/* ============================================================
   11. SIDEBAR
   ============================================================ */
.sidebar {
    position: sticky;
    top: 80px;
    height: calc(100vh - 140px);
    overflow-y: auto;
    padding: 20px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-lg);
}
.sidebar-widget {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.sidebar-widget h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-accent);
    font-family: var(--font-sans);
}
.sidebar-widget h3 .subtitle { font-size: 12px; font-weight: 400; color: var(--color-text-muted); }

.recent-list li, .community-list li {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
}
.recent-list li:last-child, .community-list li:last-child { border-bottom: none; }
.recent-list a, .community-list a {
    font-size: 14px;
    color: var(--color-text);
    font-weight: 500;
    display: block;
    line-height: 1.4;
}
.recent-list a:hover, .community-list a:hover { color: var(--color-accent); }
.recent-list .date, .community-list .date { font-size: 12px; color: var(--color-text-muted); }

.hot-news-list { display: flex; flex-direction: column; gap: 12px; }
.hot-news-item { display: flex; flex-direction: column; gap: 6px; }
.hot-news-image { border-radius: var(--radius); overflow: hidden; }
.hot-news-image img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.hot-news-image .ttvd-placeholder { width: 100%; aspect-ratio: 16/9; display: block; }
.hot-news-item h4 { font-size: 14px; margin: 0; font-family: var(--font-sans); }
.hot-news-item h4 a { color: var(--color-text); }
.hot-news-item h4 a:hover { color: var(--color-accent); }
.hot-news-category { font-size: 12px; color: var(--color-accent); font-weight: 500; }

.tags-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-link {
    display: inline-block;
    background: var(--color-accent-soft);
    color: var(--color-accent);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}
.tag-link:hover { background: var(--color-accent); color: #fff; }
.tag-count { font-size: 10px; color: var(--color-text-soft); }
.tuvi-tags .tag-link { background: #fef3c7; color: #92400e; }
.tuvi-tags .tag-link:hover { background: #92400e; color: #fff; }

.banner-widget { text-align: center; padding: 0; background: transparent; box-shadow: none; margin: 12px 0; }
.banner-widget img { max-width: 100%; height: auto; display: block; border-radius: var(--radius); }

/* Article page sidebar integration */
.article-page .sidebar { position: static; height: auto; overflow: visible; background: transparent; }
.article-page .sidebar-widget { margin-bottom: 16px; }

/* ============================================================
   12. FAVORITES (Bài viết đã lưu của tôi)
   ============================================================ */
.mod-my-favorites { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm); }
.mod-my-favorites__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.mod-my-favorites__title { font-size: 15px; font-weight: 700; color: var(--color-text); margin: 0; display: flex; align-items: center; gap: 6px; font-family: var(--font-sans); }
.mod-my-favorites__count { background: var(--color-accent); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; min-width: 18px; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
.mod-my-favorites__list { list-style: none; padding: 0; margin: 0; }
.mod-my-favorites__item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--color-border); animation: mf-fade-in .3s ease; }
.mod-my-favorites__item:last-child { border-bottom: none; }
.mod-my-favorites__item.is-removing { animation: mf-slide-out .3s ease forwards; }
@keyframes mf-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes mf-slide-out { from { opacity: 1; max-height: 60px; } to { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; } }
.mod-my-favorites__thumb { width: 48px; height: 48px; flex-shrink: 0; border-radius: 6px; overflow: hidden; background: var(--color-bg-alt); }
.mod-my-favorites__thumb img { width: 100%; height: 100%; object-fit: cover; }
.mod-my-favorites__thumb-placeholder { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: var(--color-bg-alt); border-radius: 6px; font-size: 18px; }
.mod-my-favorites__content { flex: 1; min-width: 0; }
.mod-my-favorites__link { font-size: 13px; font-weight: 600; color: var(--color-text); line-height: 1.35; display: block; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-my-favorites__link:hover { color: var(--color-accent); }
.mod-my-favorites__remove { background: none; border: none; color: var(--color-text-soft); cursor: pointer; padding: 2px; flex-shrink: 0; opacity: .6; transition: opacity .15s; }
.mod-my-favorites__remove:hover { color: #dc2626; opacity: 1; }
.mod-my-favorites__empty { text-align: center; padding: 16px 0; color: var(--color-text-muted); font-size: 13px; }
.mod-my-favorites__empty-icon { font-size: 28px; margin-bottom: 6px; }
.mod-my-favorites__clear-all { background: var(--color-bg-alt); border: 1px solid var(--color-border); color: var(--color-text-muted); padding: 6px 12px; border-radius: 8px; font-size: 12px; cursor: pointer; width: 100%; transition: all .15s; }
.mod-my-favorites__clear-all:hover { background: #fee2e2; color: #dc2626; border-color: #fecaca; }

/* ============================================================
   13. CONTENT BOTTOM MODULES
   ============================================================ */
.content-bottom {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 40px 0;
    margin-top: 40px;
    border-top: 1px solid var(--color-border);
}
.content-bottom-module {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease;
}
.content-bottom-module:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.module-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.module-header h3 { font-size: 16px; font-weight: 700; color: var(--color-text); margin: 0; font-family: var(--font-sans); }
.module-header a { font-size: 13px; color: var(--color-text-muted); }
.module-header a:hover { color: var(--color-accent); }
.module-content { display: flex; flex-direction: column; gap: 12px; }
.module-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.module-item:last-child { border-bottom: none; }
.module-image { flex-shrink: 0; width: 60px; height: 60px; border-radius: 6px; overflow: hidden; }
.module-image img { width: 100%; height: 100%; object-fit: cover; }
.module-info { flex: 1; min-width: 0; }
.module-info h4 { font-size: 14px; font-weight: 600; margin: 0 0 4px; line-height: 1.4; font-family: var(--font-sans); }
.module-info h4 a { color: var(--color-text); }
.module-info h4 a:hover { color: var(--color-accent); }
.module-hits { font-size: 12px; color: var(--color-text-muted); }
.utility-links li { padding: 8px 0; border-bottom: 1px solid var(--color-border); }
.utility-links li:last-child { border-bottom: none; }
.utility-links a { display: block; font-size: 14px; color: var(--color-text); font-weight: 500; }
.utility-links a:hover { color: var(--color-accent); }

/* ============================================================
   14. ARTICLE BOTTOM MODULES (Bài liên quan)
   ============================================================ */
.article-modules {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid var(--color-border);
}
.article-module { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 16px; }
.module-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid var(--color-accent);
    padding-bottom: 8px;
    font-family: var(--font-sans);
}
.module-subtitle { font-size: 12px; font-weight: 400; color: var(--color-text-muted); margin-left: auto; }
.module-list { list-style: none; margin: 0; padding: 0; }
.module-thumb { flex-shrink: 0; width: 100px; height: 60px; border-radius: 6px; overflow: hidden; }
.module-thumb img { width: 100%; height: 100%; object-fit: cover; }
.module-item-title { font-size: 14px; font-weight: 600; line-height: 1.4; margin: 0 0 4px; font-family: var(--font-sans); }
.module-item-title a { color: var(--color-text); }
.module-item-title a:hover { color: var(--color-accent); }
.module-date, .module-meta { font-size: 12px; color: var(--color-text-muted); }
.module-hits { font-size: 12px; color: var(--color-accent); font-weight: 500; }

/* ============================================================
   15. CATEGORY PAGE
   ============================================================ */
.category-container { max-width: var(--container-max); margin: 0 auto; padding: 24px 16px; }
.category-header { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 3px solid var(--color-accent); }
.category-title { font-size: 30px; margin-bottom: 8px; }
.category-description { color: var(--color-text-muted); font-size: 16px; margin-bottom: 12px; }
.category-meta { display: flex; gap: 20px; font-size: 13px; color: var(--color-text-muted); }
.category-meta .articles-count { color: var(--color-accent); font-weight: 500; }

/* View toggle (grid/list) */
.view-toggle {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--color-bg-alt);
    border-radius: 8px;
    padding: 4px;
}
.view-toggle button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
}
.view-toggle button.active { background: var(--color-accent); color: #fff; }
.view-toggle button svg { width: 16px; height: 16px; }

.category-articles { display: grid; grid-template-columns: 1fr; gap: 20px; }
.category-articles.view-list { grid-template-columns: 1fr; }
.article-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.article-card a { display: block; color: var(--color-text); }
.article-image { aspect-ratio: 16/9; overflow: hidden; background: var(--color-bg-alt); }
.article-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.article-card:hover .article-image img { transform: scale(1.03); }
.article-card .article-content { padding: 16px; }
.article-title { font-size: 18px; line-height: 1.35; margin-bottom: 8px; }
.article-title:hover { color: var(--color-accent); }
.article-excerpt { font-size: 14px; color: var(--color-text-muted); line-height: 1.6; margin-bottom: 10px; }
.article-meta-cat { display: flex; gap: 12px; font-size: 13px; color: var(--color-text-muted); }
.article-date { color: var(--color-accent); font-weight: 500; }

/* List view variant */
.category-articles.view-list .article-card a { display: flex; gap: 16px; }
.category-articles.view-list .article-image { aspect-ratio: auto; width: 220px; min-width: 220px; height: 140px; }
.category-articles.view-list .article-content { flex: 1; padding: 16px; }

.no-articles { text-align: center; padding: 40px; color: var(--color-text-muted); }

/* Pagination */
.category-pagination { margin-top: 32px; }
.pagination-list { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pagination-item.active .pagination-link { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 14px;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.pagination-link:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ============================================================
   16. SEARCH PAGE
   ============================================================ */
.search-container { max-width: 800px; margin: 0 auto; padding: 30px 16px; }
.search-hero { text-align: center; margin-bottom: 30px; }
.search-hero h1 { font-size: 28px; color: var(--color-text); margin-bottom: 8px; }
.search-subtitle { color: var(--color-text-muted); font-size: 15px; margin-bottom: 20px; }
.search-form-large { display: flex; max-width: 600px; margin: 0 auto; gap: 0; }
.search-form-large input {
    flex: 1;
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid var(--color-border);
    border-right: none;
    border-radius: 8px 0 0 8px;
    outline: none;
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color .2s;
}
.search-form-large input:focus { border-color: var(--color-accent); }
.search-form-large button {
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: background .2s;
}
.search-form-large button:hover { background: var(--color-accent-dark); }
.search-loading { text-align: center; color: var(--color-text-soft); padding: 40px 0; font-size: 15px; }
.search-empty { text-align: center; color: var(--color-text-muted); padding: 40px 0; font-size: 16px; }
.search-empty-hint { color: var(--color-text-soft); font-size: 14px; margin-top: 8px; }
.search-result-count { font-size: 14px; color: var(--color-text-muted); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--color-border); }
.search-result-item { padding: 16px 0; border-bottom: 1px solid var(--color-border); }
.search-result-item:last-child { border-bottom: none; }
.search-result-link { display: block; text-decoration: none; }
.search-result-title { font-size: 17px; font-weight: 600; color: var(--color-text); line-height: 1.4; margin-bottom: 6px; transition: color .2s; font-family: var(--font-serif); }
.search-result-link:hover .search-result-title { color: var(--color-accent); }
.search-result-title mark { background: var(--color-accent-soft); color: var(--color-accent); padding: 0 2px; border-radius: 2px; }
.search-result-meta { display: flex; gap: 12px; font-size: 13px; color: var(--color-text-soft); }
.search-result-category { color: var(--color-accent); font-weight: 500; }

/* ============================================================
   17. FOOTER
   ============================================================ */
.site-footer {
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
    padding: 40px 0 0;
    margin-top: 50px;
    transition: background var(--transition);
}
.footer-container { max-width: var(--container-max); margin: 0 auto; padding: 0 16px; }
.footer-top { display: grid; grid-template-columns: 1fr; gap: 30px; }
.footer-logo img { height: 40px; margin-bottom: 12px; }
.footer-tagline { font-size: 14px; color: var(--color-footer-text); line-height: 1.6; }
.footer-columns { display: grid; grid-template-columns: 1fr; gap: 24px; }
.footer-column h4 { font-size: 16px; margin-bottom: 15px; color: var(--color-footer-heading); font-family: var(--font-sans); }
.footer-column a { color: var(--color-footer-text); font-size: 14px; line-height: 2; }
.footer-column a:hover { color: var(--color-accent); }
.footer-bottom { padding: 20px 0; border-top: 1px solid rgba(255,255,255,.1); margin-top: 30px; }
.internal-links-section h5 { font-size: 14px; color: var(--color-footer-heading); margin-bottom: 12px; font-family: var(--font-sans); }
.internal-links-grid { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.internal-links-grid a { color: var(--color-footer-text); font-size: 13px; }
.internal-links-grid a:hover { color: var(--color-accent); }
.footer-copyright { padding: 16px 0 24px; text-align: center; font-size: 13px; color: var(--color-footer-text); border-top: 1px solid rgba(255,255,255,.08); margin-top: 20px; }

/* ============================================================
   18. BACK TO TOP
   ============================================================ */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all .3s ease;
    z-index: 150;
}
.back-to-top.active { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--color-accent-dark); }

/* ============================================================
   19. RESPONSIVE — Tablet (≥ 640px)
   ============================================================ */
@media (min-width: 640px) {
    .news-grid { grid-template-columns: repeat(2, 1fr); }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .content-bottom { grid-template-columns: repeat(2, 1fr); }
    .article-modules { grid-template-columns: repeat(2, 1fr); }
    .category-articles { grid-template-columns: repeat(2, 1fr); }
    .footer-top { grid-template-columns: 1fr 2fr; }
    .footer-columns { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   20. RESPONSIVE — Desktop (≥ 992px)
   ============================================================ */
@media (min-width: 992px) {
    .news-grid { grid-template-columns: repeat(3, 1fr); }
    .news-grid .featured-card:first-child { grid-column: span 2; grid-row: span 2; }
    .news-grid .featured-card:first-child h3 { font-size: 24px; }
    .category-grid { grid-template-columns: repeat(4, 1fr); }
    .content-bottom { grid-template-columns: repeat(4, 1fr); }
    .article-modules { grid-template-columns: repeat(3, 1fr); }
    .category-articles { grid-template-columns: repeat(3, 1fr); }
    .footer-columns { grid-template-columns: repeat(4, 1fr); }
    .mobile-menu-toggle { display: none; }
    .article-content h1 { font-size: 36px; }
    .category-title { font-size: 34px; }
}

/* ============================================================
   21. RESPONSIVE — Mobile (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
    .mobile-menu-toggle { display: block; }
    .nav-menu { display: none; }
    .site-footer { padding: 30px 0 0; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .sidebar { padding: 10px; position: static; height: auto; overflow: visible; }
    .sidebar-widget { padding: 12px; }
    .recent-list li, .community-list li { font-size: 13px; }
    .tag-link { font-size: 11px; padding: 5px 10px; }
    .content-bottom { grid-template-columns: 1fr; padding: 24px 0; gap: 16px; }
    .content-bottom-module { padding: 16px; }
    .module-header h3 { font-size: 14px; }
    .module-item { gap: 10px; padding: 8px 0; }
    .module-image { width: 50px; height: 50px; }
    .category-articles.view-list .article-card a { flex-direction: column; }
    .category-articles.view-list .article-image { width: 100%; min-width: 0; height: auto; aspect-ratio: 16/9; }
}

/* ============================================================
   22. RESPONSIVE — Small Mobile (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
    .share-box { padding: 16px 14px; }
    .share-buttons-row { gap: 8px; }
    .share-btn { padding: 10px 14px; font-size: 13px; }
    .article-content h1 { font-size: 24px; }
    .article-content p { font-size: 16px; }
    .search-hero h1 { font-size: 22px; }
    .search-form-large input { padding: 12px 14px; font-size: 15px; }
    .search-form-large button { padding: 12px 18px; }
    .search-result-title { font-size: 15px; }
    .hero-banner h1 { font-size: 22px; }
    .featured-card h3 { font-size: 16px; }
    .logo img { height: 36px; }
}

/* ====================================================================
   SECTION 23: TTVD TEASER MODULES (Modern Cards with Thumbnails)
   TASK 11 Redesign 2026 — phong cách Báo Đức
   Class prefix: .ttvd-teaser* — dùng cho tất cả card teaser cần thumb
   ==================================================================== */

.ttvd-teaser {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition);
}
.ttvd-teaser:last-child { border-bottom: none; }
.ttvd-teaser:hover { background: var(--color-bg-alt); }

.ttvd-teaser-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 56px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-bg-alt);
    position: relative;
}
.ttvd-teaser-thumb--sm { width: 80px; height: 56px; }
.ttvd-teaser-thumb--md { width: 96px; height: 64px; }
.ttvd-teaser-thumb--lg { width: 120px; height: 80px; }

.ttvd-teaser-thumb img,
.ttvd-teaser-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.ttvd-teaser:hover .ttvd-teaser-thumb img { transform: scale(1.05); }

.ttvd-teaser-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ttvd-teaser-title {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: var(--font-sans);
}
.ttvd-teaser-title a { color: var(--color-text); text-decoration: none; }
.ttvd-teaser-title a:hover { color: var(--color-accent); }

.ttvd-teaser-meta {
    font-size: 11px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1.3;
}
.ttvd-teaser-meta .ttvd-teaser-cat {
    color: var(--color-accent);
    font-weight: 500;
    text-transform: none;
}
.ttvd-teaser-meta .ttvd-teaser-hits {
    color: var(--color-text-soft);
    font-style: italic;
}
.ttvd-teaser-meta .ttvd-teaser-sep { color: var(--color-border-strong); }

/* SVG placeholder (khi intro_image rỗng hoặc ảnh lỗi) */
.ttvd-placeholder {
    background-color: var(--color-bg-alt);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: block;
}

/* Content Bottom: thumb MD (96x64) */
.ttvd-teaser--content-bottom {
    padding: 12px 0;
    gap: 14px;
}
.ttvd-teaser--content-bottom .ttvd-teaser-title {
    font-size: 14px;
    font-weight: 600;
    -webkit-line-clamp: 2;
}
.ttvd-teaser--content-bottom .ttvd-teaser-meta { font-size: 12px; }

/* Sidebar: thumb SM (80x56) */
.ttvd-teaser--sidebar {
    padding: 8px 0;
    gap: 10px;
}
.ttvd-teaser--sidebar .ttvd-teaser-title {
    font-size: 13px;
    font-weight: 500;
    -webkit-line-clamp: 2;
}
.ttvd-teaser--sidebar .ttvd-teaser-meta { font-size: 11px; }

/* Home latest: thumb LG (120x80) + category badge */
.ttvd-teaser--home-latest {
    padding: 14px 0;
    gap: 14px;
}
.ttvd-teaser--home-latest .ttvd-teaser-title {
    font-size: 15px;
    font-weight: 600;
    -webkit-line-clamp: 2;
}
.ttvd-teaser--home-latest .ttvd-teaser-meta {
    font-size: 12px;
    gap: 8px;
}

/* When <a> wraps entire teaser (home latest) — ensure layout matches */
.ttvd-teaser-link { display: flex !important; gap: 14px; align-items: flex-start; text-decoration: none; color: inherit; }
.ttvd-teaser-link:hover .ttvd-teaser-title a,
.ttvd-teaser-link:hover .ttvd-teaser-title { color: var(--color-accent); }
.ttvd-teaser-link:hover .ttvd-teaser-thumb img { transform: scale(1.05); }

/* Mobile: chuyển sang ảnh trên, text dưới */
@media (max-width: 768px) {
    .ttvd-teaser {
        flex-direction: column;
        gap: 10px;
        padding: 14px 0;
    }
    .ttvd-teaser-thumb,
    .ttvd-teaser-thumb--sm,
    .ttvd-teaser-thumb--md,
    .ttvd-teaser-thumb--lg {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .ttvd-teaser-thumb img,
    .ttvd-teaser-img {
        aspect-ratio: 16 / 9;
    }
    .ttvd-teaser--content-bottom,
    .ttvd-teaser--home-latest {
        gap: 10px;
    }
    .ttvd-teaser--sidebar .ttvd-teaser-title { font-size: 14px; }
    .ttvd-teaser--content-bottom .ttvd-teaser-title { font-size: 15px; }
    .ttvd-teaser--home-latest .ttvd-teaser-title { font-size: 16px; }
}

@media (max-width: 480px) {
    .ttvd-teaser { padding: 12px 0; gap: 8px; }
    .ttvd-teaser-title { font-size: 13px; }
    .ttvd-teaser--home-latest .ttvd-teaser-title { font-size: 15px; }
    .ttvd-teaser-meta { font-size: 11px; }
}

/* Dark mode tự kế thừa qua CSS variables (TTVD design system TASK 11) */
[data-theme="dark"] .ttvd-teaser:hover { background: var(--color-bg-alt); }
