:root {
    --xanh-dam: #0b2e5c;
    --xanh-vua: #0d3d7a;
    --do-nhan: #d32f2f;
    --vang: #f2a900;
    --nen-xam: #f4f6f9;
}

body {
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--nen-xam);
    color: #222;
}

a { text-decoration: none; }

/* ===== Thanh trên cùng ===== */
.top-bar {
    background: var(--xanh-dam);
    color: #fff;
    font-size: .85rem;
    padding: 6px 0;
}
.top-bar a { color: #fff; }
.top-bar a:hover { color: var(--vang); }
.top-search input {
    width: 150px; height: 26px; font-size: .8rem;
    border-radius: 4px 0 0 4px; border: none;
}
.top-search button { padding: 2px 8px; }

/* ===== Tìm kiếm & phân trang trong danh sách tin tức ===== */
.search-box .form-control { height: 44px; }
.pagination .page-link { color: var(--xanh-dam); }
.pagination .page-item.active .page-link { background: var(--xanh-dam); border-color: var(--xanh-dam); }

/* ===== Header ===== */
.site-header {
    background: #fff;
    border-bottom: 3px solid var(--do-nhan);
}
/* Trên di động, menu chính (main-nav) ẩn đi và nút mở menu nằm trong header,
   nên cho header luôn nổi trên cùng để người dùng luôn bấm được nút menu. */
@media (max-width: 991px) {
    .site-header {
        position: sticky;
        top: 0;
        z-index: 1031;
    }

}
.site-logo { width: 64px; height: 64px; object-fit: contain; }
.site-title {
    color: var(--xanh-dam);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: .5px;
}
.site-subtitle {
    color: var(--do-nhan);
    font-weight: 800;
    font-size: 1.35rem;
}
.site-slogan { color: #555; font-size: .9rem; font-style: italic; }

/* ===== Menu chính ===== */
.main-nav {
    background: var(--xanh-vua);
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.main-nav .nav-link {
    color: #fff;
    font-weight: 600;
    padding: 14px 18px;
    font-size: .95rem;
}
.main-nav .nav-link:hover,
.main-nav .nav-link.active {
    background: var(--do-nhan);
}
.main-nav .dropdown-menu {
    border-radius: 0; border: none; padding: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,.15);
}
.main-nav .dropdown-item { padding: 10px 18px; font-size: .9rem; }
.main-nav .dropdown-item:hover { background: var(--nen-xam); color: var(--do-nhan); }
.mobile-link {
    display: block;
    padding: 12px 4px;
    border-bottom: 1px solid #eee;
    color: #222;
    font-weight: 600;
}

/* ===== Hero slider ===== */
.hero-slider { position: relative; }
.hero-slide {
    background-size: cover;
    background-position: center;
    min-height: 420px;
    display: flex;
    align-items: center;
    position: relative;
}
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(11,46,92,.85) 0%, rgba(11,46,92,.35) 60%, rgba(11,46,92,.05) 100%);
}
.hero-content {
    position: relative;
    z-index: 2;
    color: #fff;
    max-width: 650px;
}
.hero-content h2 { font-size: 2rem; font-weight: 800; }
.hero-content h3 { font-size: 1.4rem; font-weight: 700; color: var(--vang); margin-bottom: 1rem; }
.hero-content .btn-primary { background: var(--do-nhan); border: none; font-weight: 700; padding: .6rem 1.4rem; }

@media (max-width: 767px) {
    .hero-slide { min-height: 280px; }
    .hero-content h2 { font-size: 1.3rem; }
    .hero-content h3 { font-size: 1rem; }
    .hero-content p { font-size: .85rem; }
}

/* ===== Tiêu đề khối ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #dde3ec;
    margin-bottom: 1rem;
    padding-bottom: 8px;
}
.section-header h4 {
    color: var(--xanh-dam);
    font-weight: 800;
    font-size: 1.1rem;
    margin: 0;
}
.section-header .bar {
    display: inline-block;
    width: 5px; height: 20px;
    background: var(--do-nhan);
    margin-right: 8px;
    vertical-align: middle;
}
.section-header .see-all { color: var(--do-nhan); font-weight: 600; font-size: .9rem; }
.small-header h5 { font-size: .95rem; font-weight: 800; margin: 0; color: var(--xanh-dam); }

/* ===== Thẻ tin nổi bật ===== */
.feature-card { position: relative; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.08); }
.feature-card img { width: 100%; height: 220px; object-fit: cover; }
.feature-card .date-badge {
    position: absolute; top: 10px; left: 10px;
    background: var(--do-nhan); color: #fff; padding: 4px 10px; font-size: .8rem; border-radius: 4px;
}
.feature-caption { padding: 12px; }
    .feature-caption a {
        color: var(--xanh-dam);
        font-weight: 700;
        font-size: 1.1rem;
    }
.placeholder-card { height: 220px; display:flex; align-items:center; justify-content:center; color:#999; background:#eee; }
.ranked-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 6px;
}

    .ranked-list::-webkit-scrollbar {
        width: 6px;
    }

    .ranked-list::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }

    .ranked-list::-webkit-scrollbar-thumb {
        background: #cbd3dc;
        border-radius: 3px;
    }

        .ranked-list::-webkit-scrollbar-thumb:hover {
            background: #9aa5b1;
        }
.ranked-list li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eee; }
.ranked-list .rank { font-weight: 800; color: var(--do-nhan); font-size: 1.1rem; width: 26px; }
.ranked-list img { width: 70px; height: 55px; object-fit: cover; border-radius: 4px; }
    .ranked-list a {
        color: #222;
        font-weight: 600;
        font-size: .92rem;
    }

.nhan-dang-doc {
    display: none;
    color: var(--do-nhan);
    font-weight: 700;
    font-size: .72rem;
    margin-left: 6px;
}

.ranked-list li.tin-noi-bat-dang-doc {
    background: #fff6e0;
    border-radius: 6px;
    padding-left: 6px;
}

    .ranked-list li.tin-noi-bat-dang-doc .nhan-dang-doc {
        display: inline-block;
    }

.announce-box { background: #fff; border-radius: 8px; padding: 14px; box-shadow: 0 1px 6px rgba(0,0,0,.08); }
.announce-box ul li { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px dashed #eee; font-size: .88rem; }

/* ===== Thông tin gia đình ===== */
.info-card {
    background: #fff; border-radius: 8px; padding: 18px; text-align: center;
    box-shadow: 0 1px 6px rgba(0,0,0,.08); height: 100%;
}
.info-icon {
    width: 52px; height: 52px; border-radius: 50%; color: #fff;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; font-size: 1.3rem;
}
.bg-purple { background: #7b1fa2; }

/* ===== Tin nhỏ / hoạt động ===== */
.news-mini-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,.08); height: 100%; }
.news-mini-card img { width: 100%; height: 120px; object-fit: cover; }
    .news-mini-card a {
        display: block;
        padding: 8px 10px 0;
        color: #222;
        font-weight: 600;
        font-size: .9rem;
    }
.news-mini-card p { padding: 4px 10px 10px; }
.excerpt-2-dong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-thumb { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; }

/* ===== Thống kê truy cập ===== */
.stats-bar {
    background: var(--xanh-dam); color: #fff; border-radius: 8px; padding: 20px;
}
.stats-bar i { font-size: 1.5rem; color: var(--vang); }
.stat-num { font-size: 1.4rem; font-weight: 800; }
.stat-label { font-size: .8rem; opacity: .85; }

/* ===== Nút liên hệ nhanh nổi ===== */
.quick-contact-wrapper {
    position: fixed;
    right: 14px;
    top: 45%;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.quick-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-fab-toggle {
    display: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--do-nhan);
    color: #fff;
    font-size: 1.3rem;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.3);
    transition: transform .2s ease;
}

    .quick-fab-toggle.dang-mo {
        transform: rotate(90deg);
    }
.quick-btn {
    width: 56px; height: 56px; border-radius: 50%; color: #fff; display: flex; flex-direction: column;
    align-items: center; justify-content: center; font-size: 1.1rem; box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.quick-btn span { font-size: .55rem; }

/* ===== Footer ===== */
.site-footer { background: #0a2547; color: #d7e0ee; padding: 40px 0 20px; margin-top: 40px; }
.footer-title { color: #fff; font-weight: 700; font-size: .95rem; margin-bottom: 12px; }
.site-footer a { color: #d7e0ee; }
.site-footer a:hover { color: var(--vang); }
.social-icon { width: 36px; height: 36px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; }
.map-placeholder { background: #123058; border-radius: 6px; height: 120px; display: flex; align-items: center; justify-content: center; color: #9fb2cc; font-size: .85rem; }

/* ===== Nội dung chi tiết bài viết ===== */
.sidebar-sticky {
    position: sticky;
    top: 70px;
    align-self: flex-start;
}
.post-content {
    line-height: 1.7;
    font-size: 1rem;
}

    .post-content img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        margin: 10px 0;
        display: block;
    }

    .post-content p {
        margin-bottom: 1rem;
    }
    .post-content .ql-font-serif {
        font-family: Georgia, "Times New Roman", serif;
    }

    .post-content .ql-font-monospace {
        font-family: "Courier New", monospace;
    }

    .post-content .ql-size-small {
        font-size: 0.75em;
    }

    .post-content .ql-size-large {
        font-size: 1.5em;
    }

    .post-content .ql-size-huge {
        font-size: 2.5em;
    }

    .post-content .ql-align-center {
        text-align: center;
    }

    .post-content .ql-align-right {
        text-align: right;
    }

    .post-content .ql-align-justify {
        text-align: justify;
    }

    .post-content .ql-indent-1 {
        padding-left: 3em;
    }

    .post-content .ql-indent-2 {
        padding-left: 6em;
    }

.anh-dai-dien-chi-tiet {
    width: 100%;
    height: 380px;
    object-fit: cover;
    border-radius: 8px;
}

@media (max-width: 575px) {
    .anh-dai-dien-chi-tiet {
        height: 220px;
    }
    .author-box {
        background: #f4f6f9;
        border-left: 3px solid var(--do-nhan);
        border-radius: 4px;
        padding: 10px 14px;
        font-size: .92rem;
    }

        .author-box i {
            color: var(--xanh-dam);
            margin-right: 6px;
        }
}

/* ===== Trang đăng nhập / đăng ký ===== */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 80vh; }
.auth-card {
    background: #fff; border-radius: 10px; box-shadow: 0 2px 16px rgba(0,0,0,.1);
    padding: 32px; width: 100%; max-width: 420px;
}

/* ===== Thẻ từng câu hỏi trong form đăng ký (kiểu Google Form) ===== */
.form-card {
    background: #fff; border-radius: 10px; box-shadow: 0 1px 6px rgba(0,0,0,.08);
    padding: 18px 20px;
}

/* ===== Responsive tổng thể ===== */
@media (max-width: 991px) {
    .site-title, .site-subtitle { font-size: 1.05rem; }
    .quick-contact { display: none !important; }
}
@media (max-width: 991px) {
    .site-title, .site-subtitle {
        font-size: 1.05rem;
    }

    .quick-contact-wrapper {
        top: auto;
        bottom: 16px;
        right: 8px;
    }

    .quick-fab-toggle {
        display: flex;
    }

    .quick-contact {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        pointer-events: none;
        transition: max-height .25s ease, opacity .2s ease;
    }

        .quick-contact.dang-mo {
            max-height: 220px;
            opacity: 1;
            pointer-events: auto;
        }

    .quick-btn {
        width: 46px;
        height: 46px;
        font-size: 1rem;
    }

        .quick-btn span {
            display: none;
        }
}
}
