/* ============================================================
   file: /css/style.css
   Author: Nhiên Vũ Xuân (+84987650901)
   Cập nhật: 2026-10-24
   - Bổ sung .section-subtitle, .post-category cho mục "Tin mới nhất"
   - Đồng bộ toàn bộ class/id dùng trong index.html + js/app.js
   - Updated: 24/10/2026 - 17:45  ← thêm .attackers-list
   ============================================================ */
/* ========== RESET & BIẾN ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bg: #f5f7fa;
    --bg-card: #ffffff;
    --text: #212121;
    --text-muted: #607d8b;
    --primary: #1565c0;
    --primary-light: #e3f2fd;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --radius: 8px;
    --max-width: 1200px;
}

body.dark {
    --bg: #121212;
    --bg-card: #1e1e1e;
    --text: #e0e0e0;
    --text-muted: #90a4ae;
    --primary: #64b5f6;
    --primary-light: #1e3a5f;
    --border: #333333;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.6);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    transition: background 0.3s, color 0.3s;
}

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

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

/* ========== UTILITIES ========== */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.loading,
.empty {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 20px;
    margin: 0;
}

/* ========== CONTAINER ========== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px 16px 40px;
}

/* ========== NÚT NỔI (Theme toggle + Back to top) ========== */
.theme-toggle,
.back-to-top {
    position: fixed;
    right: 20px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 20px;
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: transform 0.2s, background 0.2s, opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle {
    top: 20px;
}

.back-to-top {
    bottom: 20px;
    opacity: 0;
    pointer-events: none;
}

.theme-toggle:hover,
.back-to-top:hover {
    transform: scale(1.08);
    background: #0d47a1;
}

body.dark .theme-toggle,
body.dark .back-to-top {
    background: var(--primary);
    color: #121212;
}

body.dark .theme-toggle:hover,
body.dark .back-to-top:hover {
    background: #42a5f5;
}

/* ========== MENU0 – HÀNG NGANG Ở ĐỈNH ========== */
/* Thanh menu chính (top bar) */
.website-menu-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 20px;
}

/* Tiêu đề "Menu chính:" — cố định, không co */
.website-menu-bar .menumain-title {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--primary);
}

/* Menu chính — link */
.menumain-link {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 14px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.menumain-link:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}
body.dark .menumain-link:hover { color: #121212; }

/* Trạng thái rỗng */
.menu-empty { color: #999; font-style: italic; font-size: 13px; }





/* Vùng chứa các link menu — do menu-loader render vào */
#menumain-content {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    flex: 1;
}

/* Từng link menu */
.notebook-link,
.menumain-link {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 14px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.notebook-link:hover,
.menumain-link:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

body.dark .notebook-link:hover,
body.dark .menumain-link:hover {
    color: #121212;
}

/* Responsive: mobile thì xuống dòng */
@media (max-width: 600px) {
    .website-notebook-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    #notebook-content {
        gap: 4px 10px;
    }

    .notebook-link {
        font-size: 12px;
        padding: 3px 8px;
    }
}


/* ========== TIÊU ĐỀ CHÍNH ========== */
h1 {
    text-align: center;
    font-size: 26px;
    line-height: 1.3;
    margin: 16px 0 24px;
    color: var(--text);
}

/* ========== SLOGAN ========== */
.family-quote-container {
    text-align: center;
    margin: 12px 0; 
}

.family-quote {
    background: #e8f5a3;
    border-radius: var(--radius);
    padding: 12px 16px;       
    box-shadow: var(--shadow);
    max-width: 700px;         
    margin: 0 auto;
}

.slogan-line-1 {
    font-size: 15px;       
    font-weight: 600;
    color: #c62828;
    margin: 0 0 4px;         
}

.slogan-line-2 {
    font-size: 16px;       
    font-style: italic;
    color: #c62828;
    margin: 0;
}

/* ========== DIVIDER ========== */
.divider {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

/* ========== MARQUEE ========== */
.marquee-container {
    overflow: hidden;
    background: #d32f2f;      /* ← nền đỏ */
    border-radius: var(--radius);
    padding: 10px 0;
    box-shadow: var(--shadow);
}

.marquee-track {
    white-space: nowrap;
    display: inline-block;
    padding-left: 100%;
    animation: marquee 30s linear infinite;
    font-weight: 600;
    color: #ffeb3b;           /* ← chữ vàng */
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}


/* ========== SECTION TITLE ========== */
.section-title {
    font-size: 20px;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    color: var(--text);
}

.section-subtitle {
    margin: -6px 0 12px;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

/* ========== VÙNG 1 (Tin mới + Sidebar) ========== */
.section-main1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin: 24px 0;
}

.main1-col1,
.main1-col2 {
    min-width: 0;
}

/* ========== POST CARD (dùng chung) ========== */
.post-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.post-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.35;
    color: var(--text);
}

.post-card .author {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.4;
}

.post-card .excerpt-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.post-card .thumb {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.post-card .excerpt-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.post-card .read-more {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

/* Badge chuyên mục cho mục "Tin mới nhất" */
.post-category {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    margin-bottom: 8px;
    line-height: 1.2;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

#main1-list .post-card h3 {
    margin-top: 0;
    font-size: 16px;
}

/* ========== SIDEBAR COL2 ========== */
.auth-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.auth-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}

.auth-btn:hover {
    background: #0d47a1;
}

body.dark .auth-btn {
    color: #121212;
}

body.dark .auth-btn:hover {
    background: #42a5f5;
}

.search-box {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.search-box input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-card);
    color: var(--text);
}

.search-box input:focus {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
}

.search-box button {
    padding: 10px 18px;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.search-box button:hover {
    background: #0d47a1;
}

body.dark .search-box button {
    color: #121212;
}

.search-extra {
    margin-bottom: 18px;
    font-size: 13px;
}

.sidebar-title {
    font-size: 16px;
    margin: 12px 0 8px;
    color: var(--text);
}

#recent-list {
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 100%);
    padding: 12px 14px;
    border-radius: var(--radius);
    border-left: 4px solid #e91e63;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
}

#recent-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#recent-list li {
    color: #880e4f;
    font-weight: 500;
    padding: 8px 6px;
    border-bottom: 1px dashed rgba(233, 30, 99, 0.25);
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    transition: background 0.2s, color 0.2s;
    border-radius: 4px;
}

#recent-list li:hover {
    background: #f06292;
    color: #ffffff;
    border-bottom-color: transparent;
}

#recent-list li:last-child {
    border-bottom: none;
}

#recent-list li span {
    color: #ad1457 !important;
    font-size: 11px !important;
    opacity: 0.8;
}

#recent-list li:hover span {
    color: #ffffff !important;
}

#recent-list .empty,
#recent-list .loading {
    color: #ad1457;
    font-style: italic;
    text-align: center;
    padding: 12px;
}

.view-all-btn {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}

.view-all-btn:hover {
    background: var(--primary);
    color: #fff;
}

body.dark .view-all-btn:hover {
    color: #121212;
}

/* Panel "Tất cả bài đăng" */
.all-posts-panel {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 12px;
    box-shadow: var(--shadow);
    max-height: 500px;
    overflow-y: auto;
}

.all-posts-panel h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.all-posts-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.all-posts-list li {
    padding: 10px 8px;
    border-bottom: 1px dashed var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.all-posts-list li:hover {
    background: var(--primary-light);
}

.all-posts-list .post-meta {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.close-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    border-radius: var(--radius);
    background: #e57373;
    color: #fff;
    font-weight: 600;
}

.close-btn:hover {
    background: #c62828;
}

/* ========== POST VIEWER ========== */
.post-viewer {
    background: var(--bg-card);
    border: 2px solid #f9a825;          /* viền vàng đậm */
    border-left: 6px solid #f57c00;      /* viền trái dày hơn, đậm hơn */
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 4px 16px rgba(249, 168, 37, 0.15);  /* shadow vàng nhạt */
    margin: 24px 0;
    transition: box-shadow 0.3s;
}

.post-viewer:hover {
    box-shadow: 0 6px 24px rgba(249, 168, 37, 0.25);  /* shadow đậm hơn khi hover */
}

.post-content h1 {
    text-align: left;
    margin-top: 0;
    color: var(--primary);
    font-size: 24px;
}

.post-content .meta-author {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.post-content .body-content {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
}

.post-content .body-content img {
    margin: 12px auto;
    border-radius: var(--radius);
}

.back-btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: var(--radius);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 16px;
    transition: background 0.2s;
}

.back-btn:hover {
    background: var(--primary);
    color: #fff;
}

body.dark .back-btn:hover {
    color: #121212;
}

.back-btn-bottom {
    margin-top: 24px;
    margin-bottom: 0;
}

/* ========== VÙNG 2 ========== */
.section-main2 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 32px 0;
    background: #ede7f6;      /* nền violet nhạt (Material Deep Purple 50) */
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.main2-col {
    min-width: 0;
}

.main2-col .section-title {
    font-size: 16px;
}

.post-list-main2 .post-card {
    padding: 12px;
}

.post-list-main2 .post-card h3 {
    font-size: 15px;
}

.post-list-main2 .post-card .thumb {
    width: 70px;
    height: 70px;
}

/* ========== VÙNG 3 ========== */
.section-main3 {
    margin: 32px 0;
}

.post-list-main3 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);   /* 2 cột cố định */
    gap: 16px;
    align-items: stretch;
}

.post-list-main3 .post-card {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-list-main3 .post-card .excerpt-row {
    flex: 1;
}

/* Responsive: 1 cột trên mobile */
@media (max-width: 700px) {
    .post-list-main3 {
        grid-template-columns: 1fr;
    }
}

/* ========== VÙNG 4 – GALLERY ========== */
.section-gallery {
    margin: 32px 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--bg-card);
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.gallery-item:hover {
    transform: scale(1.03);
}

.gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.gallery-item .cap {
    padding: 8px 10px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== LIGHTBOX ========== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-close {
    top: 20px;
    right: 20px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-cap {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    max-width: 80vw;
    text-align: center;
}

/* ========== FOOTER ========== */
.site-footer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    background: #e3f2fd;   /* xanh nhạt (Material Light Blue 50) */
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 40px;
    box-shadow: var(--shadow);
}

.footer-column h3 {
    font-size: 15px;
    margin: 0 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
}

.footer-column p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column li {
    margin-bottom: 6px;
    font-size: 14px;
}

.footer-column li a {
    color: var(--text);
}

.footer-column li a:hover {
    color: var(--primary);
}

.access-info .stat-number {
    font-weight: 700;
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

.footer-bottom p {
    margin: 4px 0;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .section-main1 {
        grid-template-columns: 1fr;
    }

    .section-main2 {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 22px;
    }

    .slogan-line-1 {
        font-size: 15px;
    }

    .slogan-line-2 {
        font-size: 13px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 12px 10px 30px;
    }

    h1 {
        font-size: 19px;
        margin: 12px 0 16px;
    }

    .post-category {
        font-size: 11px;
        padding: 2px 8px;
    }

    #main1-list .post-card h3 {
        font-size: 15px;
    }

    .post-card .thumb {
        width: 70px;
        height: 70px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .gallery-item img {
        height: 140px;
    }

    .site-footer {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .theme-toggle,
    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 17px;
        right: 12px;
    }

    .theme-toggle {
        top: 12px;
    }

    .back-to-top {
        bottom: 12px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* ========== PRINT ========== */
@media print {
    .theme-toggle,
    .back-to-top,
    .auth-buttons,
    .search-box,
    .search-extra,
    .view-all-btn,
    .all-posts-panel,
    .lightbox,
    .marquee-container {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .post-card,
    .site-footer {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ========== FONT SIZE CONTROLS ========== */
.post-viewer-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.post-viewer-controls .back-btn {
    margin-bottom: 0;
}

.font-controls {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 4px;
    box-shadow: var(--shadow);
}

.font-btn {
    padding: 6px 12px;
    border-radius: 6px;
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    border: none;
}

.font-btn:hover {
    background: var(--primary-light);
}

.font-btn.active {
    background: var(--primary);
    color: #fff;
}

body.dark .font-btn.active {
    color: #121212;
}

/* 5 cấp độ cỡ chữ cho body content */
.post-content .body-content { font-size: 16px; }
.post-content.size-1 .body-content { font-size: 14px; }
.post-content.size-2 .body-content { font-size: 16px; }
.post-content.size-3 .body-content { font-size: 18px; }
.post-content.size-4 .body-content { font-size: 20px; }
.post-content.size-5 .body-content { font-size: 24px; }

/* Mobile: tự xuống dòng */
@media (max-width: 600px) {
    .post-viewer-controls {
        flex-direction: column;
        align-items: flex-start;
    }
}
/* Ẩn tiêu đề thừa phía trên menu chính */
.menumain-title {
    display: none;
}

/* ========== FOOTER: BỐ CỤC 3 CỘT ========== */
.footer-top {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
}

/* Màn hình nhỏ: chuyển thành một cột */
@media (max-width: 700px) {
    .footer-top {
        grid-template-columns: 1fr;
    }
}

/* Font chữ cho menu chính */
.website-menu-bar .menumain-link {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 500;
    font-style: normal;
    letter-spacing: 0px;
}


/* ========== ========== */
