﻿:root {
  --primary: #1c4e80;
  --primary-dark: #123a61;
  --accent: #e8871a;
  --danger: #a93226;
  --ok: #1e8449;
  --header-red: #c1121f;
  --bg-light: #e8eff7;
  --text-gray: #5d6d7e;
  --border: #d5dbdb;

  /* Ảnh nền header/footer — đổi đường dẫn ở đây là áp dụng cho toàn site.
     Ảnh phải nằm trong wwwroot (ví dụ wwwroot/images/...) và khai báo bắt đầu bằng "/images/...". */
  --header-bg-image: url('/images/bg-pattern1.png');
  --footer-bg-image: url('/images/bg-pattern1.png');
}

* { box-sizing: border-box; }
body {
  font-family: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
  margin: 0;
  color: #1b2631;
  background: #f7f9fa;
  line-height: 1.55;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
  background: linear-gradient(135deg, var(--header-red), #7a0c13);
  color: #fff;
  padding: 18px 0;
}
.site-header .brand { display: flex; align-items: center; gap: 14px; }
.site-header .brand img { height: 56px; width: 56px; border-radius: 50%; background: #fff; padding: 4px; }
.site-header .brand h1 { font-size: 20px; margin: 0; }
.site-header .brand p { margin: 2px 0 0; font-size: 13px; opacity: .9; }

/* Nav */
.site-nav { background: var(--primary); }
.site-nav .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.site-nav ul { list-style: none; display: flex; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav ul li a { display: block; padding: 12px 16px; color: #fff; font-weight: 500; font-size: 14.5px; }
.site-nav ul li a:hover, .site-nav ul li a.active { background: var(--primary-dark); text-decoration: none; }
.site-nav form { display: flex; padding: 8px 0; }
.site-nav form input[type=text] { border: none; border-radius: 4px 0 0 4px; padding: 7px 10px; width: 180px; }
.site-nav form button { border: none; background: var(--accent); color: #fff; padding: 7px 14px; border-radius: 0 4px 4px 0; cursor: pointer; }

/* Marquee */
.marquee-bar { background: #fdf1e0; padding: 8px 0; font-size: 14px; color: #a85f00; overflow: hidden; white-space: nowrap; }
.marquee-bar marquee { font-weight: 600; }

/* Cards */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(16, 42, 67, .06);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(16, 42, 67, .12);
}
.card img { height: 170px; width: 100%; object-fit: cover; background: #e8ecef; transition: transform .35s ease; }
.card:hover img { transform: scale(1.04); }
.card .body { padding: 14px 16px; }
.card .title { font-weight: 700; font-size: 15px; margin: 0 0 6px; line-height: 1.45; }
.card .title a { color: #1b2631; text-decoration: none; }
.card .title a:hover { color: var(--primary); }
.card .meta { color: var(--text-gray); font-size: 12.5px; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 11.5px; font-weight: 700; }
.badge-featured { background: var(--accent); color: #fff; }
.badge-status-published { background: var(--ok); color: #fff; }
.badge-status-draft { background: #99a3a4; color: #fff; }

.section-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 16px; }
.section-title h2 { font-size: 19px; color: var(--primary-dark); border-left: 5px solid var(--accent); padding-left: 10px; margin: 0; }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } .grid-5 { grid-template-columns: repeat(2, 1fr); } }

/* Danh sách tin dạng hàng: ảnh trái, tiêu đề phải (Tin nổi bật / Tin theo chuyên mục) */
.news-list { display: flex; flex-direction: column; }
.news-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}
.news-row:first-child { padding-top: 0; }
.news-row:last-child { border-bottom: none; }
.news-row-img { flex: none; width: 130px; height: 90px; border-radius: 6px; overflow: hidden; }
.news-row-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.news-row:hover .news-row-img img { transform: scale(1.05); }
.news-row-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.news-row-title {
    color: #1b2631;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.45;
}
.news-row:hover .news-row-title { color: var(--primary); }
.news-row-meta { color: var(--text-gray); font-size: 12.5px; }
.news-row .badge-featured { align-self: flex-start; }

@media (max-width: 600px) {
    .news-row-img { width: 96px; height: 72px; }
    .news-row-title { font-size: 14px; }
}

.layout-2col { display: grid; grid-template-columns: 2.2fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .layout-2col { grid-template-columns: 1fr; } }

.sidebar-box { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 18px; }
.sidebar-box h3 { margin: 0 0 10px; font-size: 15px; color: var(--primary-dark); }
.sidebar-box ul { list-style: none; padding: 0; margin: 0; }
.sidebar-box ul li { padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: center; }
.stat-grid div { background: var(--bg-light); border-radius: 6px; padding: 8px; }
.stat-grid b { display: block; font-size: 18px; color: var(--primary); }

/* Topbar tiện ích (đăng nhập, đổi giao diện) */
footer.site-footer { background: #2c3e50; color: #dfe6e9; text-align: center; padding: 22px 0; margin-top: 40px; font-size: 13.5px; }
.topbar-utility {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0; font-size: 12.5px; opacity: .95;
}
.dark-toggle {
  background: rgba(255,255,255,.15); border: none; color: #fff; width: 30px; height: 30px;
  border-radius: 50%; cursor: pointer; display:flex; align-items:center; justify-content:center;
}
.dark-toggle:hover { background: rgba(255,255,255,.3); }
.topbar-account { display: flex; align-items: center; gap: 8px; color: #fff; }
.topbar-account a { color: #fff; font-weight: 600; }
.topbar-account a:hover { text-decoration: underline; }

/* ===== DARK MODE ===== */
body.dark { background: #12181f; color: #dfe6e9; }
body.dark .card, body.dark .sidebar-box, body.dark table { background: #1c2530; border-color: #2c3e50; color: #dfe6e9; }
body.dark .site-nav { background: #0d2436; }
body.dark .site-nav ul li a:hover, body.dark .site-nav ul li a.active { background: #16344a; }
body.dark footer.site-footer { background: #0b0f14; }
body.dark .card .meta, body.dark .text-gray { color: #95a5a6; }
body.dark a { color: #5dade2; }
body.dark .btn-outline { background: transparent; border-color: #5dade2; color: #5dade2; }

.btn { display: inline-block; padding: 8px 16px; border-radius: 5px; border: none; cursor: pointer; font-weight: 600; font-size: 14px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: #fff; border: 1px solid var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }

.breadcrumb { font-size: 13px; color: var(--text-gray); margin: 14px 0; }
.pagination { display: flex; gap: 6px; justify-content: center; margin: 24px 0; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; }
.pagination .active { background: var(--primary); color: #fff; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #d5f5e3; color: #1e8449; }
.alert-danger { background: #fadbd8; color: #a93226; }

.article-detail h1 { font-size: 26px; color: var(--primary-dark); }
.article-detail .content { font-size: 16px; line-height: 1.8; margin-top: 16px; }
.article-detail .content img { border-radius: 6px; margin: 12px 0; }

form.simple label { display: block; margin: 10px 0 4px; font-weight: 600; font-size: 13.5px; }
form.simple input[type=text], form.simple input[type=email], form.simple input[type=password],
form.simple input[type=date], form.simple select, form.simple textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 5px; font-size: 14px;
}

/* =========================================================
   TRANG CHỦ - GIAO DIỆN MỚI
   ========================================================= */


/* =========================
   SLIDER TRANG CHỦ
   ========================= */

.home-slider {
    width: 100%;
    margin-bottom: 20px;
    overflow: hidden;
    background: #f5f8fa;
}

.home-slider img {
    display: block;
    width: 100%;
    height: auto;
}


/* =========================
   THANH TIN TỨC
   ========================= */

.marquee-bar {
    background: #fff;
    border-top: 1px solid #e4e8ec;
    border-bottom: 1px solid #e4e8ec;
    padding: 7px 0;
    color: #b71c1c;
    font-size: 14px;
    overflow: hidden;
}

.marquee-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.marquee-label {
    flex: 0 0 auto;
    width: 34px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c1121f;
    border-right: 1px solid #ddd;
}

.marquee-inner marquee {
    flex: 1;
    font-weight: 600;
}


/* =========================
   TOP BANNER
   ========================= */

.top-banners {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.top-banners img {
    width: 100%;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
}


/* =========================================================
   TIN MỚI NHẤT
   ========================================================= */

.latest-news {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(320px, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}


/* =========================
   TIN CHÍNH
   ========================= */

.latest-main {
    min-width: 0;
    background: #fff;
    border: 1px solid #e1e5e8;
    border-radius: 10px;
    overflow: hidden;
    transition: all .25s ease;
}

.latest-main:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
}

.latest-main-image {
    display: block;
    width: 100%;
    height: 390px;
    overflow: hidden;
}

.latest-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.latest-main:hover .latest-main-image img {
    transform: scale(1.025);
}

.latest-main-content {
    padding: 14px 17px 17px;
}

.latest-label {
    margin-bottom: 7px;
}

.latest-label span {
    display: inline-block;
    padding-left: 9px;
    border-left: 4px solid #c1121f;
    color: #c1121f;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.latest-main-content h1 {
    font-size: 21px;
    line-height: 1.42;
    margin: 0 0 7px;
    font-weight: 750;
}

.latest-main-content h1 a {
    color: #17202a;
}

.latest-main-content h1 a:hover {
    color: #1c4e80;
    text-decoration: none;
}

.latest-meta {
    color: #7b8794;
    font-size: 12.5px;
    margin-bottom: 6px;
}

.latest-main-content > p {
    margin: 5px 0 0;
    color: #566573;
    font-size: 14px;
    line-height: 1.55;
}


/* =========================
   4 TIN LIỀN KỀ
   ========================= */

.latest-side {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.latest-side-item {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 12px;
    padding: 0 0 13px;
    margin-bottom: 13px;
    border-bottom: 1px solid #e5e8eb;
    min-height: 95px;
}

.latest-side-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.latest-side-image {
    display: block;
    width: 130px;
    height: 92px;
    overflow: hidden;
    border-radius: 7px;
    background: #edf1f3;
}

.latest-side-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.latest-side-image:hover img {
    transform: scale(1.05);
}

.latest-side-content {
    min-width: 0;
}

.latest-side-content h2 {
    font-size: 15px;
    line-height: 1.4;
    margin: 0;
    font-weight: 700;
}

.latest-side-content h2 a {
    color: #1b2631;
}

.latest-side-content h2 a:hover {
    color: #1c4e80;
    text-decoration: none;
}

.latest-side-meta {
    margin-top: 7px;
    font-size: 11.5px;
    color: #8a949e;
}


/* =========================================================
   SECTION
   ========================================================= */

.home-section {
    margin-top: 38px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    border-bottom: 2px solid #1c4e80;
}

.section-heading-title {
    display: flex;
    align-items: center;
    gap: 9px;
}

.section-heading-title > span {
    display: block;
    width: 5px;
    height: 25px;
    background: #c1121f;
    border-radius: 2px;
}

.section-heading h2 {
    margin: 0;
    padding: 0 0 7px;
    font-size: 19px;
    color: #1c4e80;
    font-weight: 750;
}

.section-more {
    font-size: 13px;
    color: #1c4e80;
    font-weight: 600;
    padding-bottom: 7px;
}

.section-more:hover {
    color: #c1121f;
    text-decoration: none;
}


/* =========================================================
   NEWS CARD
   ========================================================= */

.news-card {
    border: 1px solid #e1e5e8;
    transition: all .25s ease;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(0,0,0,.07);
}

.news-card-image {
    display: block;
    height: 180px;
    overflow: hidden;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.news-card:hover .news-card-image img {
    transform: scale(1.03);
}

.news-card .body {
    padding: 12px 14px 14px;
}

.news-card .title {
    line-height: 1.45;
}

.news-card .title a {
    color: #1b2631;
}

.news-card .title a:hover {
    color: #1c4e80;
    text-decoration: none;
}

.gallery-card {
    text-decoration: none;
    color: inherit;
    display: block;
}
.gallery-card .news-card-image {
    position: relative;
}
.gallery-count {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(0,0,0,.62);
    color: #fff;
    font-size: 11.5px;
    padding: 3px 9px;
    border-radius: 20px;
}
.gallery-card .title {
    color: #1b2631;
    font-weight: 700;
}
.gallery-card:hover .title {
    color: #1c4e80;
}

/* =========================================================
   TAB CHUYÊN MỤC (trang chủ)
   ========================================================= */

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 18px;
}

.category-tab {
    background: none;
    border: none;
    cursor: pointer;
    padding: 9px 16px;
    font-size: 14.5px;
    font-weight: 600;
    color: #5d6d7e;
    border-radius: 6px 6px 0 0;
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;
    transition: color .15s ease, background .15s ease;
}

.category-tab:hover {
    color: var(--primary);
    background: var(--bg-light);
}

.category-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--bg-light);
}

.category-tab-panel {
    display: none;
}

.category-tab-panel.active {
    display: block;
    animation: tab-fade-in .2s ease;
}

@keyframes tab-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.category-tab-more {
    text-align: right;
    margin-top: 12px;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.modern-sidebar {
    padding: 0;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 18px;
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 14px;
    border-bottom: 2px solid #c1121f;
}

.sidebar-title i {
    color: #c1121f;
    font-size: 15px;
}

.sidebar-title h3 {
    margin: 0;
    color: #1c4e80;
    font-size: 16px;
    font-weight: 750;
}


/* =========================
   THỐNG KÊ
   ========================= */

.modern-sidebar .stat-grid {
    padding: 12px 14px;
    gap: 8px;
}

.modern-sidebar .stat-grid div {
    background: #f5f8fa;
    border: 1px solid #e5e9ec;
    padding: 9px 5px;
    border-radius: 6px;
}

.stat-icon {
    display: block;
    color: #1c4e80;
    margin-bottom: 3px;
    font-size: 12px;
}

.modern-sidebar .stat-grid b {
    font-size: 17px;
    color: #1c4e80;
}

.modern-sidebar .stat-grid small {
    display: block;
    color: #66727e;
    font-size: 11.5px;
    margin-top: 2px;
}

.stat-grid-5 {
    grid-template-columns: repeat(5, 1fr);
}
@media (max-width: 480px) {
    .stat-grid-5 { grid-template-columns: repeat(2, 1fr); }
    .stat-online { grid-column: span 2; }
}

.stat-online {
    background: #eafaf1 !important;
    border-color: #b7e4c7 !important;
}
.stat-online .stat-icon { color: #1e8449; }
.stat-online b {
    color: #1e8449 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    display: inline-block;
    animation: live-pulse 1.6s infinite;
}
@keyframes live-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(46, 204, 113, .55); }
    70%  { box-shadow: 0 0 0 6px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}


/* =========================
   SIDEBAR LIST
   ========================= */

ul.sidebar-list {
    list-style: none;
    padding: 5px 14px 10px;
    margin: 0;
}

.sidebar-list li {
    padding: 10px 0;
    border-bottom: 1px dashed #dce1e5;
}

.sidebar-list li:last-child {
    border-bottom: none;
}

.sidebar-list a {
    display: block;
    color: #34495e;
    line-height: 1.45;
}

.sidebar-list a:hover {
    color: #1c4e80;
    text-decoration: none;
}

.sidebar-list strong {
    display: block;
    color: #c1121f;
    font-size: 12px;
    margin-bottom: 3px;
}

.sidebar-list span {
    font-size: 12.5px;
}


/* =========================
   QUICK LINKS
   ========================= */

.quick-links {
    padding: 12px 14px;
}

.quick-links a {
    display: block;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 7px;
}

.quick-links a:last-child {
    margin-bottom: 0;
}

.quick-links img {
    width: 100%;
    border-radius: 7px;
    transition: transform .3s ease;
}

.quick-links a:hover img {
    transform: scale(1.02);
}


/* =========================
   SIDEBAR BANNER
   ========================= */

.sidebar-banners {
    padding: 12px 14px;
}

.sidebar-banners img {
    width: 100%;
    border-radius: 7px;
    margin-bottom: 10px;
}

.sidebar-banners img:last-child {
    margin-bottom: 0;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {

    .latest-news {
        grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
    }

    .latest-main-image {
        height: 350px;
    }

    .latest-side-item {
        grid-template-columns: 110px minmax(0, 1fr);
    }

    .latest-side-image {
        width: 110px;
        height: 82px;
    }

}


@media (max-width: 900px) {

    .latest-news {
        grid-template-columns: 1fr;
    }

    .latest-main-image {
        height: 360px;
    }

    .latest-side {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
        margin-top: 4px;
    }

    .latest-side-item {
        margin: 0;
        padding-bottom: 10px;
    }

}


@media (max-width: 600px) {

    .latest-main-image {
        height: 250px;
    }

    .latest-main-content h1 {
        font-size: 18px;
    }

    .latest-side {
        grid-template-columns: 1fr;
    }

    .latest-side-item {
        grid-template-columns: 110px minmax(0, 1fr);
    }

    .latest-side-image {
        width: 110px;
        height: 80px;
    }

    .latest-side-content h2 {
        font-size: 14px;
    }

    .news-card-image {
        height: 200px;
    }

}

/* =========================================================
HEADER MỚI - PHONG CÁCH CỔNG THÔNG TIN ĐIỆN TỬ
========================================================= */

/* Header tổng */
.site-header {
background: #ffffff;
color: #0e2a4a;
padding: 0;
border-top: 4px solid #c1121f;
box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

/* =========================================================
THANH TIỆN ÍCH
========================================================= */

.header-top {
background: #f6f8fa;
border-bottom: 1px solid #e7ebef;
}

.header-top-inner {
min-height: 36px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 15px;
}

.header-welcome {
color: #667788;
font-size: 12px;
font-weight: 500;
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 4px;
}

.header-welcome i {
color: #b21f2d;
margin-right: 5px;
}

.header-clock {
color: #8a1c28;
font-weight: 700;
margin-left: 10px;
padding-left: 10px;
border-left: 1px solid #d8dde3;
white-space: nowrap;
}

@media (max-width: 600px) {
    .header-clock { border-left: none; margin-left: 0; padding-left: 0; width: 100%; }
}

.header-tools {
display: flex;
align-items: center;
gap: 9px;
font-size: 12px;
}

.header-tools a {
color: #526477;
font-weight: 500;
text-decoration: none;
transition: color .2s ease;
}

.header-tools a:hover {
color: #b21f2d;
text-decoration: none;
}

.header-tools i {
margin-right: 3px;
}

.header-user {
color: #526477;
}

.header-user strong {
color: #0e2a4a;
}

.header-separator {
color: #c8cfd6;
}

.dark-toggle {
width: 27px;
height: 27px;
border: 1px solid #d6dde4;
border-radius: 50%;
background: #ffffff;
color: #526477;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all .2s ease;
padding: 0;
}

.dark-toggle:hover {
background: #0e2a4a;
color: #ffffff;
border-color: #0e2a4a;
}

/* =========================================================
LOGO + TÊN ĐƠN VỊ
========================================================= */

.header-brand {
background-color: #ffffff;
background-image: linear-gradient(rgba(255, 255, 255, .90), rgba(255, 255, 255, .90)), var(--header-bg-image);
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}

.brand-inner {
min-height: 112px;
display: flex;
align-items: center;
gap: 20px;
}

.brand-logo {
flex: 0 0 auto;
display: flex;
align-items: center;
justify-content: center;
text-decoration: none;
}

.brand-logo img {
width: 100px;
height: 100px;
object-fit: contain;
display: block;
}

.brand-text {
min-width: 0;
}

.brand-unit {
color: #8a1c28;
font-size: 12px;
font-weight: 700;
letter-spacing: .35px;
margin-bottom: 4px;
text-transform: uppercase;
}

.brand-text h1 {
margin: 0;
padding: 0;
color: #0e2a4a;
font-size: 25px;
line-height: 1.25;
font-weight: 750;
letter-spacing: -.2px;
}

.brand-line {
width: 68px;
height: 3px;
margin-top: 9px;
background: #c1121f;
border-radius: 2px;
}

/* =========================================================
MENU CHÍNH
========================================================= */

.site-nav {
background: var(--header-red);
border-bottom: 3px solid #d8b24c;
box-shadow: 0 2px 5px rgba(0, 0, 0, .08);
}

.nav-inner {
min-height: 50px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 18px;
}

.main-menu {
list-style: none;
padding: 0;
margin: 0;
display: flex;
align-items: stretch;
flex-wrap: wrap;
}

.main-menu li {
margin: 0;
padding: 0;
}

.main-menu li a {
min-height: 50px;
display: flex;
align-items: center;
gap: 7px;
padding: 0 15px;
color: #ffffff;
font-size: 13.5px;
font-weight: 600;
text-decoration: none;
white-space: nowrap;
position: relative;
transition: background .2s ease, color .2s ease;
}

.main-menu li a::after {
content: "";
position: absolute;
left: 15px;
right: 15px;
bottom: 0;
height: 3px;
background: #d8b24c;
transform: scaleX(0);
transition: transform .2s ease;
}

.main-menu li a:hover {
background: rgba(255,255,255,.09);
color: #ffffff;
text-decoration: none;
}

.main-menu li a:hover::after {
transform: scaleX(1);
}

.main-menu li:first-child a {
padding-left: 16px;
}

.main-menu li:first-child a i {
font-size: 13px;
}

.menu-arrow {
font-size: 9px;
opacity: .8;
margin-left: 2px;
}

/* ---------- NÚT HAMBURGER (chỉ hiện trên mobile) ---------- */
.nav-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 13px 16px;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

/* =========================================================
Ô TÌM KIẾM
========================================================= */

.header-search {
flex: 0 0 auto;
display: flex;
align-items: center;
height: 34px;
margin: 0;
}

.header-search input[type="text"] {
width: 175px;
height: 34px;
border: 1px solid rgba(255,255,255,.25);
border-right: none;
border-radius: 5px 0 0 5px;
outline: none;
padding: 0 11px;
background: rgba(255,255,255,.96);
color: #273746;
font-family: inherit;
font-size: 12.5px;
}

.header-search input[type="text"]::placeholder {
color: #8795a3;
}

.header-search input[type="text"]:focus {
border-color: #ffffff;
}

.header-search button {
width: 40px;
height: 34px;
border: none;
border-radius: 0 5px 5px 0;
background: #c1121f;
color: #ffffff;
cursor: pointer;
transition: background .2s ease;
}

.header-search button:hover {
background: #9f101a;
}

/* =========================================================
MAIN
========================================================= */

.site-main {
padding-top: 20px;
min-height: 60vh;
}

/* =========================================================
FOOTER
========================================================= */

.site-footer {
background-color: #0e2a4a;
background-image: linear-gradient(rgba(23, 54, 93, .92), rgba(23, 54, 93, .92)), var(--footer-bg-image);
background-size: cover;
background-position: center;
background-repeat: no-repeat;
color: #dce5ee;
text-align: center;
padding: 28px 0;
margin-top: 40px;
font-size: 13px;
border-top: 4px solid #c1121f;
}

.footer-inner {
line-height: 1.7;
}

.footer-title {
color: #ffffff;
font-size: 16px;
font-weight: 700;
margin-bottom: 2px;
}

.footer-subtitle {
color: #b9c8d7;
font-size: 12.5px;
margin-bottom: 10px;
}

.footer-extra {
color: #c3d0dc;
font-size: 12.5px;
line-height: 1.6;
max-width: 640px;
margin: 0 auto 12px;
padding-top: 10px;
border-top: 1px solid rgba(255,255,255,.12);
}
.footer-extra a { color: #9fd3ff; }

.footer-copy {
color: #aebdcb;
font-size: 12px;
}

/* =========================================================
DARK MODE - HEADER
========================================================= */

body.dark .site-header {
background: #17212b;
border-top-color: #c1121f;
}

body.dark .header-brand {
background-color: #17212b;
background-image: linear-gradient(rgba(23, 33, 43, .90), rgba(23, 33, 43, .90)), var(--header-bg-image);
}

body.dark .header-top {
background: #111a22;
border-bottom-color: #293745;
}

body.dark .header-welcome,
body.dark .header-tools a,
body.dark .header-user {
color: #aebdcb;
}

body.dark .header-user strong {
color: #ffffff;
}

body.dark .header-tools a:hover {
color: #f06a73;
}

body.dark .dark-toggle {
background: #1d2a36;
border-color: #354654;
color: #c5d0da;
}

body.dark .dark-toggle:hover {
background: #29445e;
color: #ffffff;
}

body.dark .brand-unit {
color: #e47b83;
}

body.dark .brand-text h1 {
color: #ffffff;
}

body.dark .site-nav {
background: #10283f;
}

body.dark .header-search input[type="text"] {
background: #f5f7f9;
color: #1b2631;
}

/* =========================================================
DARK MODE - BỔ SUNG (vá các chỗ còn sáng trắng/chữ tối khó đọc)
========================================================= */

/* Nav đỏ sẫm: dùng tông tối hơn 1 chút cho dark mode, đồng bộ với light mode */
body.dark .site-nav {
background: #4d0b12;
}

/* Tiêu đề thẻ tin (Chuyên mục/Tìm kiếm/Thư viện ảnh/Trang chủ) — trước đây bị
   tối màu (#1b2631) nên gần như không đọc được trên nền thẻ tối của dark mode */
body.dark .card .title a {
color: #ecf0f1;
}
body.dark .card .title a:hover {
color: #5dade2;
}

/* Danh sách tin dạng hàng (Tin nổi bật / Tin theo chuyên mục ở Cổ điển) */
body.dark .news-row-title {
color: #ecf0f1;
}
body.dark .news-row-title:hover,
body.dark .news-row:hover .news-row-title {
color: #5dade2;
}
body.dark .news-row-meta {
color: #95a5a6;
}
body.dark .news-row {
border-bottom-color: #2c3e50;
}

/* Đồng hồ ngày giờ trong thanh tiện ích — màu đỏ sẫm cũ khó đọc trên nền tối */
body.dark .header-clock {
color: #f0a8ae;
border-left-color: #354654;
}

/* Tab "Tin theo chuyên mục" — nền sáng (--bg-light) bị lạc quẻ trên nền tối */
body.dark .category-tab {
color: #95a5a6;
}
body.dark .category-tab:hover,
body.dark .category-tab.active {
color: #5dade2;
background: #16344a;
}
body.dark .category-tab.active {
border-bottom-color: #5dade2;
}

/* Khung "Thống kê truy cập" — các ô số liệu nền sáng bị lạc quẻ trên nền tối */
body.dark .modern-sidebar .stat-grid div {
background: #223140;
border-color: #34495e;
}
body.dark .stat-icon {
color: #5dade2;
}
body.dark .modern-sidebar .stat-grid b {
color: #ecf0f1;
}

/* Bảng Văn bản pháp lý và các bảng dữ liệu khác */
body.dark table.card thead tr {
background: #223140 !important;
}
body.dark table.card th {
color: #ecf0f1;
}

/* =========================================================
RESPONSIVE HEADER
========================================================= */

@media (max-width: 1000px) 
{

.brand-inner {
    min-height: 100px;
}

.brand-logo img {
    width: 90px;
    height: 90px;
}

.brand-text h1 {
    font-size: 21px;
}

.main-menu li a {
    padding: 0 10px;
    font-size: 12.5px;
}

.main-menu li a::after {
    left: 10px;
    right: 10px;
}

.header-search input[type="text"] {
    width: 140px;
}


}

@media (max-width: 800px) {


.header-top-inner {
    justify-content: flex-end;
}

.header-welcome {
    display: none;
}

.brand-inner {
    min-height: 92px;
    gap: 13px;
}

.brand-logo img {
    width: 60px;
    height: 60px;
}

.brand-unit {
    font-size: 10px;
}

.brand-text h1 {
    font-size: 18px;
}

.nav-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-bottom: 8px;
}

.main-menu {
    width: 100%;
    justify-content: center;
}

.main-menu li a {
    min-height: 43px;
    padding: 0 9px;
    font-size: 12px;
}

.header-search {
    width: 100%;
    padding: 0 0 2px;
}

.header-search input[type="text"] {
    width: 100%;
}


}

@media (max-width: 600px) {


.header-top-inner {
    min-height: 34px;
}

.header-tools {
    font-size: 11px;
    gap: 6px;
}

.header-user {
    display: none;
}

.header-separator {
    display: none;
}

.brand-inner {
    min-height: 82px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.brand-logo img {
    width: 50px;
    height: 50px;
}

.brand-unit {
    font-size: 8.5px;
    letter-spacing: .1px;
}

.brand-text h1 {
    font-size: 15px;
    line-height: 1.3;
}

.brand-line {
    width: 45px;
    height: 2px;
    margin-top: 6px;
}

.main-menu {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
}

.main-menu li {
    flex: 0 0 auto;
}

.main-menu li a {
    min-height: 42px;
    padding: 0 10px;
    font-size: 11.5px;
}

.main-menu li a::after {
    left: 10px;
    right: 10px;
}

.main-menu li:nth-child(3) {
    display: none;
}

.header-search {
    margin-top: 2px;
}

.site-main {
    padding-top: 14px;
}


}

.brand-unit {
    display: inline-flex;
    align-items: center;
    gap: 9px;

    color: #8f1d2c;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .7px;
    line-height: 1.4;
    text-transform: uppercase;

    margin-bottom: 7px;
    padding-bottom: 5px;

    position: relative;
}

.brand-unit::before {
    content: "";
    width: 4px;
    height: 18px;
    background: #c1121f;
    border-radius: 2px;
    display: inline-block;
}

.brand-unit::after {
    content: "";
    position: absolute;
    left: 13px;
    bottom: 0;
    width: 42px;
    height: 1px;
    background: #d8b24c;
}
.brand-text h1 {
    color: #0e2a4a;
    font-size: 25px;
    font-weight: 750;
}

/* =========================================================
   FIX MOBILE: Tên website 1 hàng, đơn vị chủ quản 1 hàng
   (đặt sau cùng để thắng các rule .brand-unit / .brand-text h1
   trùng lặp phía trên, tránh bị tràn xuống 2 hàng)
   ========================================================= */

.brand-text {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

@media (max-width: 800px) {

    .brand-inner {
        gap: 12px;
    }

    .brand-unit {
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 11.5px;
        padding-bottom: 3px;
    }

    .brand-unit::before,
    .brand-unit::after {
        display: none;
    }

    .brand-text h1 {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: clamp(14px, 4.6vw, 18px);
        line-height: 1.3;
    }
}

@media (max-width: 600px) {

    .brand-unit {
        font-size: 10px;
        letter-spacing: .1px;
    }

    .brand-text h1 {
        font-size: clamp(13px, 4.3vw, 16px);
    }

}

/* =========================================================
   TIN TỨC & SỰ KIỆN - DROPDOWN DANH MỤC
   ========================================================= */

.menu-dropdown {
    position: relative;
}

.menu-dropdown-link {
    cursor: pointer;
}

/* Khung danh sách danh mục */
.category-dropdown {
    position: absolute;
    top: 100%;
    left: 0;

    width: 280px;

    background: #fff;

    border-top: 3px solid #c1121f;
    border-radius: 0 0 5px 5px;

    box-shadow: 0 8px 25px rgba(0, 0, 0, .16);

    padding: 7px 0;

    display: none;

    z-index: 9999;
}

/* Hiện dropdown khi rê chuột */
.menu-dropdown:hover .category-dropdown,
.menu-dropdown:focus-within .category-dropdown {
    display: block;
}

/* Từng danh mục */
.category-dropdown-item {
    display: flex !important;
    align-items: center;

    width: 100%;
    min-height: 42px;

    padding: 0 16px !important;

    color: #0e2a4a !important;

    background: #fff;

    font-size: 13px !important;
    font-weight: 600 !important;

    text-decoration: none !important;

    transition: all .2s ease;
}

/* Không dùng gạch chân của menu chính */
.category-dropdown-item::after {
    display: none !important;
}

/* Icon */
.category-dropdown-item i {
    width: 22px;

    color: #c1121f;

    font-size: 9px;

    transition: transform .2s ease;
}

/* Hover */
.category-dropdown-item:hover {
    background: #f4f7fa !important;

    color: #c1121f !important;

    padding-left: 20px !important;
}

.category-dropdown-item:hover i {
    transform: translateX(3px);
}

/* =========================================================
   ẢNH TRONG NỘI DUNG CHI TIẾT BÀI VIẾT
   ========================================================= */

.article-detail .content img {
    display: block;

    max-width: 100%;
    width: auto;
    height: auto;

    margin: 18px auto;

    border-radius: 6px;

    object-fit: contain;
}

/* Ảnh lớn: không vượt quá chiều rộng bài viết */
.article-detail .content p img,
.article-detail .content div img {
    max-width: 100%;
    height: auto;
}

/* Không để CSS của editor ép chiều cao ảnh */
.article-detail .content img[style] {
    height: auto !important;
    max-width: 100% !important;
}

/* Nội dung bài viết */
.article-detail .content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

/* Các đoạn văn */
.article-detail .content p {
    margin: 0 0 15px;
}

/* Ảnh chú thích nếu có */
.article-detail .content figure {
    margin: 20px auto;
    text-align: center;
    max-width: 100%;
}

.article-detail .content figure img {
    margin: 0 auto 8px;
}

.article-detail .content figcaption {
    font-size: 13px;
    color: #777;
    text-align: center;
    font-style: italic;
}

/* =========================================================
   ARTICLE DETAIL
   ========================================================= */

.article-detail {
    padding: 20px;
}

.article-detail-title {
    margin: 0 0 10px;
    color: #0e2a4a;
    font-size: 30px;
    line-height: 1.35;
    font-weight: 750;
}

.article-detail-meta {
    margin-bottom: 22px;
}

/* Nội dung bài viết */
.article-detail-content {
    width: 100%;
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

/* ĐOẠN VĂN */
.article-detail-content p {
    margin: 0 0 16px;
}

/* =========================================================
   ẢNH TRONG BÀI VIẾT
   ========================================================= */

.article-detail-content img {
    display: block !important;

    width: auto !important;
    max-width: 100% !important;

    height: auto !important;
    max-height: none !important;

    object-fit: contain !important;

    margin: 20px auto !important;

    border-radius: 6px;
}

/*
   Nếu CKEditor lưu inline style kiểu:
   width:100%; height:150px;
   thì height:auto !important sẽ ghi đè.
*/

/* Ảnh nằm trong figure */
.article-detail-content figure {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 22px auto;
    text-align: center;
}

.article-detail-content figure img {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
}

/* Chú thích ảnh */
.article-detail-content figcaption {
    margin-top: 8px;
    color: #777;
    font-size: 13px;
    line-height: 1.5;
    font-style: italic;
    text-align: center;
}

/* Link ảnh */
.article-detail-content a img {
    display: block !important;
}

/* Không cho các CSS cũ ép ảnh */
.article-detail-content img[width],
.article-detail-content img[height],
.article-detail-content img[style] {
    height: auto !important;
    max-width: 100% !important;
}


/* =========================================================
   BẢNG TRONG BÀI VIẾT
   ========================================================= */

.article-detail-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.article-detail-content table th,
.article-detail-content table td {
    padding: 8px 10px;
    border: 1px solid #ddd;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .article-detail {
        padding: 15px;
    }

    .article-detail-title {
        font-size: 23px;
    }

    .article-detail-content {
        font-size: 15px;
        line-height: 1.75;
    }

    .article-detail-content img {
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;
    }

}

/* =========================================================
   VĂN BẢN PHÁP LÝ - SIDEBAR TRANG CHỦ
   ========================================================= */

.legal-sidebar {
    padding: 0;
    overflow: hidden;
}

.legal-sidebar .sidebar-title {
    padding: 12px 16px;
    margin: 0;
}

.legal-sidebar .sidebar-list {
    padding: 8px 16px 12px;
    margin: 0;
}

.legal-sidebar .sidebar-list li {
    padding: 11px 0;
}

.legal-sidebar .sidebar-list a {
    padding: 0 2px;
    display: block;
}

.legal-sidebar .sidebar-list strong {
    margin-bottom: 4px;
}

.legal-sidebar .sidebar-list span {
    display: block;
    line-height: 1.5;
}


/* =========================================================================
   LAYOUT TRANG CHỦ "HIỆN ĐẠI" (Admin → Cấu hình Website → Giao diện trang chủ)
   Tham khảo cấu trúc dantri.com.vn: mỗi chuyên mục là 1 khối riêng gồm 1 tin
   lớn (ảnh to + tóm tắt) bên trái và danh sách tin nhỏ (ảnh nhỏ + tiêu đề)
   bên phải, lặp lại cho từng chuyên mục — dày thông tin, không dùng tab hay
   ảnh chạy. Toàn bộ class đặt tiền tố "hm-" — tách biệt với layout Cổ điển.
   ========================================================================= */

:root {
    --hm-accent: #c1121f;
    --hm-ink: #14213d;
    --hm-sub: #6b7280;
    --hm-line: #e5e7eb;
    --hm-surface: #ffffff;
    --hm-bg: #f7f8fa;
}

.hm-wrap { padding-bottom: 8px; }
.hm-slider-static { margin-bottom: 22px; border-radius: 6px; overflow: hidden; }

/* ---------- 3 TIN NỔI BẬT ĐẦU TRANG ---------- */
.hm-top-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--hm-line);
}
@media (max-width: 900px) { .hm-top-grid { grid-template-columns: 1fr; } }

.hm-top-card { display: block; text-decoration: none; }
.hm-top-img { display: block; border-radius: 6px; overflow: hidden; margin-bottom: 10px; }
.hm-top-img img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}
.hm-top-card:hover .hm-top-img img { transform: scale(1.04); }
.hm-top-title {
    display: block;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.4;
    color: var(--hm-ink);
    margin-bottom: 6px;
}
.hm-top-card:hover .hm-top-title { color: var(--hm-accent); }
.hm-top-meta { font-size: 12px; color: var(--hm-sub); }

/* ---------- TIN NHANH / ĐỌC NHIỀU (dải gọn) ---------- */
.hm-quick-band {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--hm-bg);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 24px;
}
.hm-quick-label {
    flex: none;
    background: var(--hm-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 3px;
    margin-top: 2px;
}
.hm-quick-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
}
.hm-quick-list a {
    font-size: 13px;
    font-weight: 600;
    color: var(--hm-ink);
    text-decoration: none;
    position: relative;
    padding-left: 12px;
}
.hm-quick-list a::before {
    content: "";
    position: absolute;
    left: 0; top: 6px;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--hm-accent);
}
.hm-quick-list a:hover { color: var(--hm-accent); text-decoration: underline; }

/* ---------- KHỐI CHUYÊN MỤC (hero trái + danh sách nhỏ phải) ---------- */
.hm-cat-module { margin-bottom: 30px; }
.hm-cat-module:last-child { margin-bottom: 0; }

/* Khối "Tin nổi bật" (.hm-section) trước đó không có margin gì cả, nên dính sát luôn vào
   khối chuyên mục đầu tiên bên dưới — thêm khoảng cách cho thoáng. */
.hm-section {
    margin-bottom: 30px;
}

.hm-cat-head {
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--hm-ink);
}
.hm-cat-name {
    display: inline-block;
    font-size: 18px;
    font-weight: 800;
    color: var(--hm-ink);
    text-decoration: none;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--hm-accent);
    margin-bottom: -10px;
}
.hm-cat-name:hover { color: var(--hm-accent); }

.hm-cat-body {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 22px;
}
@media (max-width: 900px) { .hm-cat-body { grid-template-columns: 1fr; } }

.hm-cat-hero { display: block; text-decoration: none; }
.hm-cat-hero-img { display: block; border-radius: 6px; overflow: hidden; margin-bottom: 10px; }
.hm-cat-hero-img img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}
.hm-cat-hero:hover .hm-cat-hero-img img { transform: scale(1.04); }
.hm-cat-hero-title {
    display: block;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.4;
    color: var(--hm-ink);
    margin-bottom: 6px;
}
.hm-cat-hero:hover .hm-cat-hero-title { color: var(--hm-accent); }
.hm-cat-hero-summary {
    display: block;
    font-size: 13.5px;
    line-height: 1.6;
    color: #3a3a3a;
    margin-bottom: 6px;
}
.hm-cat-hero-meta { font-size: 12px; color: var(--hm-sub); }

.hm-cat-list { display: flex; flex-direction: column; }
.hm-cat-list-item {
    display: flex;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--hm-line);
    text-decoration: none;
}
.hm-cat-list-item:first-child { padding-top: 0; }
.hm-cat-list-item:last-child { border-bottom: none; }
.hm-cat-list-img { flex: none; width: 90px; height: 64px; border-radius: 5px; overflow: hidden; }
.hm-cat-list-img img { width: 100%; height: 100%; object-fit: cover; }
.hm-cat-list-title {
    color: var(--hm-ink);
    font-weight: 700;
    font-size: 13.5px;
    line-height: 1.42;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    align-self: center;
}
.hm-cat-list-item:hover .hm-cat-list-title { color: var(--hm-accent); }

@media (max-width: 600px) {
    .hm-cat-list-img { width: 74px; height: 54px; }
}

/* ---------- BỐ CỤC 2 CỘT ---------- */
.hm-layout {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 24px;
    align-items: start;
}
@media (max-width: 900px) { .hm-layout { grid-template-columns: 1fr; } }

/* ---------- SIDEBAR ---------- */
.hm-aside { display: flex; flex-direction: column; gap: 16px; }

.hm-widget {
    background: var(--hm-surface);
    border: 1px solid var(--hm-line);
    border-radius: 6px;
    padding: 16px;
}
.hm-widget-head { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--hm-ink); }
.hm-widget-head h3 {
    margin: 0;
    font-size: 14.5px;
    color: var(--hm-ink);
    display: inline-block;
    padding-bottom: 9px;
    border-bottom: 2px solid var(--hm-accent);
    margin-bottom: -11px;
}

.hm-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.hm-stat { background: var(--hm-bg); border-radius: 6px; padding: 10px 6px; text-align: center; }
.hm-stat b { display: block; font-size: 17px; color: var(--hm-ink); }
.hm-stat small { display: block; font-size: 11px; color: var(--hm-sub); margin-top: 2px; }
.hm-stat-online { grid-column: span 2; background: #fdecea; }
.hm-stat-online b { color: var(--hm-accent); display: flex; align-items: center; justify-content: center; gap: 6px; }

.hm-list { list-style: none; margin: 0; padding: 0; }
.hm-list li { border-bottom: 1px solid var(--hm-line); }
.hm-list li:last-child { border-bottom: none; }
.hm-list a { display: block; padding: 10px 2px; text-decoration: none; color: var(--hm-ink); }
.hm-list a:hover strong { color: var(--hm-accent); }
.hm-list strong { display: block; font-size: 13px; margin-bottom: 3px; }
.hm-list span { display: block; font-size: 12px; color: var(--hm-sub); line-height: 1.5; }

.hm-quick-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hm-quick-links a { display: block; }
.hm-quick-links img {
    display: block;
    width: 100%;
    height: 64px;
    box-sizing: border-box;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--hm-line);
    border-radius: 6px;
    padding: 6px;
    transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
.hm-quick-links img:hover {
    border-color: var(--hm-accent);
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    transform: translateY(-2px);
}

/* ---------- CHỮ CHẠY (marquee) 5 tin nổi bật, dưới thanh menu ---------- */
.hm-ticker {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--hm-bg);
    border-bottom: 1px solid var(--hm-line);
    padding: 9px 0;
    margin-bottom: 20px;
}
.hm-ticker-label {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--hm-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 3px;
    white-space: nowrap;
}
.hm-ticker-viewport {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}
.hm-ticker-track {
    display: flex;
    width: max-content;
    animation: hm-ticker-scroll 26s linear infinite;
}
.hm-ticker-track:hover { animation-play-state: paused; }
.hm-ticker-set {
    display: flex;
    gap: 46px;
    padding-right: 46px;
    white-space: nowrap;
}
.hm-ticker-set a {
    color: var(--hm-ink);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
}
.hm-ticker-set a:hover { color: var(--hm-accent); text-decoration: underline; }

@keyframes hm-ticker-scroll {
    from { transform: translateX(0%); }
    to { transform: translateX(-50%); }
}

/* ---------- TIÊU ĐỀ MỤC ĐƠN GIẢN (dùng cho Tin nổi bật) ---------- */
.hm-simple-head {
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--hm-ink);
}
.hm-simple-head h2 {
    font-size: 17px;
    font-weight: 800;
    color: var(--hm-ink);
    margin: 0;
    display: inline-block;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--hm-accent);
    margin-bottom: -10px;
}

/* ---------- TIN NỔI BẬT — 5 tin, ảnh trên/tiêu đề dưới, 1 hàng ---------- */
.hm-featured-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}
.hm-featured-card { display: block; text-decoration: none; }
.hm-featured-img { display: block; border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
.hm-featured-img img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}
.hm-featured-card:hover .hm-featured-img img { transform: scale(1.05); }
.hm-featured-title {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--hm-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hm-featured-card:hover .hm-featured-title { color: var(--hm-accent); }

@media (max-width: 900px) {
    .hm-featured-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .hm-featured-grid { grid-template-columns: repeat(2, 1fr); }
}


/* =========================================================================
   MENU MOBILE — ĐỔ XUỐNG (thay cho cách cuộn ngang cũ ở trên)
   Đặt ở cuối file để chắc chắn thắng các rule .main-menu cũ phía trên.
   ========================================================================= */
@media (max-width: 900px) {
    .nav-inner {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
        padding-bottom: 0 !important;
    }

    .nav-toggle { display: flex !important; }

    .main-menu {
        display: none !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        overflow-x: visible !important;
        width: 100% !important;
        justify-content: flex-start !important;
        border-top: 1px solid rgba(255,255,255,.15);
    }
    .main-menu.open { display: flex !important; }

    .main-menu li { width: 100%; flex: none !important; }
    .main-menu li a {
        width: 100%;
        min-height: auto !important;
        padding: 13px 16px !important;
        white-space: normal;
    }
    .main-menu li a::after { display: none; }

    /* Dropdown chuyên mục: trên mobile bấm mới mở, không hover */
    .menu-dropdown .category-dropdown {
        display: none !important;
        position: static !important;
        width: 100% !important;
        box-shadow: none !important;
        border-radius: 0;
    }
    .menu-dropdown.open .category-dropdown { display: block !important; }
    .menu-dropdown.open .menu-arrow { transform: rotate(180deg); }
    .category-dropdown-item { padding-left: 34px !important; }

    .header-search { width: 100%; margin: 8px 0; padding: 0 12px 10px; box-sizing: border-box; }
    .header-search input[type="text"] { width: 100% !important; }
}


/* =========================================================================
   MENU RIÊNG CHO GIAO DIỆN "HIỆN ĐẠI" (trên máy tính) — khác hẳn Cổ điển:
   nền xanh lá đậm kiểu cổng thông tin nhà nước (ngành Nông nghiệp & Môi
   trường), dính lên đầu khi cuộn (sticky), gạch chân đỏ khi active/hover —
   thay vì thanh nav xanh navy đặc của Cổ điển.
   ========================================================================= */
:root {
    --hm-nav-bg: #c1121f;
    --hm-nav-bg-dark: #8f0e18;
}

body.theme-modern .site-nav {
    background: linear-gradient(180deg, var(--hm-nav-bg) 0%, var(--hm-nav-bg-dark) 100%);
    border-bottom: 3px solid #d8b24c;
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
    position: sticky;
    top: 0;
    z-index: 500;
}

body.theme-modern .main-menu li a {
    color: #ffffff;
    font-weight: 700;
}

body.theme-modern .main-menu li a::after {
    background: var(--hm-accent, #c1121f);
    height: 3px;
}

body.theme-modern .main-menu li a:hover {
    background: rgba(255,255,255,.08);
    color: #ffffff;
}

body.theme-modern .main-menu li:first-child a {
    color: #ffffff;
}

body.theme-modern .category-dropdown {
    border-top: 3px solid var(--hm-accent, #c1121f);
    border-radius: 8px;
    overflow: hidden;
}

body.theme-modern .category-dropdown-item:hover {
    background: var(--hm-bg, #f7f8fa) !important;
    color: var(--hm-accent, #c1121f) !important;
}

body.theme-modern .header-search input[type="text"] {
    border-radius: 20px 0 0 20px;
}

body.theme-modern .header-search button {
    background: var(--hm-accent, #c1121f);
    border-radius: 0 20px 20px 0;
}

@media (max-width: 900px) {
    body.theme-modern .nav-toggle { color: #ffffff; }
    body.theme-modern .main-menu { border-top-color: rgba(255,255,255,.2); }
    body.theme-modern .main-menu li a { color: #ffffff; }
}


/* =========================================================================
   ĐỒNG BỘ GIAO DIỆN "HIỆN ĐẠI" SANG CÁC TRANG KHÁC
   (Chi tiết bài viết, Chuyên mục, Tìm kiếm, Thư viện ảnh, Văn bản, Giới thiệu...)
   Các trang này dùng chung 1 view cho cả 2 theme — không tách file riêng như
   trang chủ, chỉ định kiểu lại đúng những class sẵn có (.card, .breadcrumb,
   .article-detail, .sidebar-box, .pagination, .btn...) khi body có class
   "theme-modern", để đồng bộ tông đỏ-navy-phẳng với trang chủ Hiện đại.
   ========================================================================= */

body.theme-modern h1 {
    color: var(--hm-ink);
    font-size: 24px;
    font-weight: 800;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--hm-line);
    margin-bottom: 18px;
}

body.theme-modern .breadcrumb {
    color: var(--hm-sub);
}
body.theme-modern .breadcrumb a {
    color: var(--hm-accent);
    text-decoration: none;
}
body.theme-modern .breadcrumb a:hover { text-decoration: underline; }

/* Thẻ card dùng ở lưới Chuyên mục/Tìm kiếm/Thư viện ảnh */
body.theme-modern .card {
    border-color: var(--hm-line);
    border-radius: 8px;
}
body.theme-modern .card .title a {
    color: var(--hm-ink);
}
body.theme-modern .card .title a:hover,
body.theme-modern .card:hover .title a {
    color: var(--hm-accent);
}
body.theme-modern .card .meta { color: var(--hm-sub); }

body.theme-modern .pagination a,
body.theme-modern .pagination span {
    border-color: var(--hm-line);
    color: var(--hm-ink);
}
body.theme-modern .pagination a:hover {
    border-color: var(--hm-accent);
    color: var(--hm-accent);
}
body.theme-modern .pagination .active {
    background: var(--hm-accent);
    border-color: var(--hm-accent);
    color: #fff;
}

body.theme-modern .btn-primary {
    background: var(--hm-accent);
}
body.theme-modern .btn-primary:hover {
    background: #9c0e19;
}
body.theme-modern .btn-outline {
    border-color: var(--hm-accent);
    color: var(--hm-accent);
}
body.theme-modern .btn-outline:hover {
    background: var(--hm-accent);
    color: #fff;
}

/* Trang chi tiết bài viết */
body.theme-modern .article-detail-title {
    color: var(--hm-ink);
}
body.theme-modern .article-detail-meta {
    color: var(--hm-sub);
}
body.theme-modern .article-detail-meta i {
    color: var(--hm-accent);
}
body.theme-modern .article-detail-content {
    color: #2c2c2c;
}
body.theme-modern .article-detail-content a {
    color: var(--hm-accent);
}

/* Khung sidebar dùng ở trang chi tiết bài viết */
body.theme-modern .sidebar-box {
    border-color: var(--hm-line);
    border-radius: 8px;
}
body.theme-modern .sidebar-box h3 {
    color: var(--hm-ink);
    padding-bottom: 9px;
    border-bottom: 2px solid var(--hm-line);
    margin-bottom: 10px;
}
body.theme-modern .sidebar-box ul { list-style: none; padding: 0; margin: 0; }
body.theme-modern .sidebar-box ul li {
    border-bottom: 1px solid var(--hm-line);
    padding: 9px 0;
}
body.theme-modern .sidebar-box ul li:last-child { border-bottom: none; }
body.theme-modern .sidebar-box ul li a {
    color: var(--hm-ink);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
}
body.theme-modern .sidebar-box ul li a:hover { color: var(--hm-accent); }

/* Bảng Văn bản pháp lý */
body.theme-modern table.card thead tr {
    background: var(--hm-bg) !important;
}
body.theme-modern table.card th { color: var(--hm-ink); }
body.theme-modern table.card td { color: #2c2c2c; }
body.theme-modern table.card tr { border-top-color: var(--hm-line) !important; }

/* =========================================================================
   CHẾ ĐỘ TỐI (DARK MODE) - VÁ LỖI CHỮ TỐI TRÊN NỀN TỐI
   Áp dụng cho CẢ 2 GIAO DIỆN (Cổ điển và Hiện đại). Trước đây nhiều tiêu đề/
   nội dung (bài viết, sidebar, tin liền kề, tiêu đề chuyên mục...) vẫn giữ
   màu chữ tối (xanh navy/xám đậm) dùng cho nền sáng, nên khi bật dark mode
   nền chuyển tối nhưng chữ không đổi -> gần như không đọc được.
   ========================================================================= */

/* ---------- Giao diện Hiện đại: đổi luôn "bộ màu" (biến CSS) sang tông tối,
   nhờ vậy mọi khối .hm-... (dùng chung biến --hm-ink/--hm-sub/--hm-surface...)
   tự động đổi màu theo, không cần vá từng lớp riêng lẻ. ---------- */
body.dark {
    --hm-ink: #ecf0f1;
    --hm-sub: #aebdcb;
    --hm-line: #34495e;
    --hm-surface: #1c2530;
    --hm-bg: #223140;
    /* --border dùng cho khung phân trang, viền vài khối khác — đổi sang tông tối
       để không còn viền xám sáng lạc quẻ trên nền tối. */
    --border: #34495e;
}

/* 2 chỗ của giao diện Hiện đại lỡ ghi cứng màu chữ tối (không dùng biến) */
body.dark .hm-cat-hero-summary,
body.dark .article-detail-content,
body.dark table.card td {
    color: #dfe6e9;
}

/* ---------- Trang chi tiết bài viết (dùng chung cho cả 2 giao diện) ---------- */
body.dark .article-detail h1,
body.dark .article-detail-title {
    color: #ecf0f1;
}
body.dark .article-detail .content,
body.dark .article-detail .content p {
    color: #dfe6e9;
}
body.dark .article-detail .content figcaption,
body.dark .article-detail-content figcaption {
    color: #95a5a6;
}

/* ---------- Trang chủ Cổ điển: khối "Tin liền kề", tiêu đề chuyên mục ---------- */
body.dark .latest-side-content h2 a {
    color: #ecf0f1;
}
body.dark .latest-side-content h2 a:hover {
    color: #5dade2;
}
body.dark .latest-side-meta {
    color: #95a5a6;
}
body.dark .section-heading h2 {
    color: #ecf0f1;
}
body.dark .section-more {
    color: #5dade2;
}
body.dark .section-more:hover {
    color: #f06a73;
}

/* ---------- Khung sidebar bên phải (Văn bản pháp lý, Liên kết, Tin liên quan...) ---------- */
body.dark .sidebar-box h3,
body.dark .sidebar-title h3 {
    color: #ecf0f1;
}
body.dark .sidebar-list a {
    color: #dfe6e9;
}
body.dark .sidebar-list a:hover {
    color: #5dade2;
}
body.dark .sidebar-list strong {
    color: #f06a73;
}
body.dark .modern-sidebar .stat-grid small {
    color: #aebdcb;
}

/* ---------- Đường dẫn (breadcrumb) ở các trang Chuyên mục/Tìm kiếm/Văn bản... ---------- */
body.dark .breadcrumb {
    color: #95a5a6;
}
body.dark .breadcrumb a {
    color: #5dade2;
}

/* ---------- Thanh menu ở chế độ tối: giảm chói, đổi sang đỏ sẫm hơn ----------
   (đặt cuối file + tăng độ ưu tiên để không bị các quy tắc màu của riêng
   giao diện Hiện đại ghi đè trở lại màu đỏ sáng) */
body.dark .site-nav {
    background: #4d0b12;
    border-bottom-color: #a8863c;
}
body.dark.theme-modern .site-nav {
    background: linear-gradient(180deg, #4d0b12 0%, #33070b 100%);
}

/* =========================================================================
   VÁ LỖI TRÀN NGANG TRÊN ĐIỆN THOẠI: bảng và video nhúng dán vào bài viết
   Nội dung bài viết do BTV dán từ Word/Youtube có thể mang kích thước cố định
   (bảng nhiều cột, khung video 560x315...) khiến cả trang bị đẩy tràn ngang
   trên màn hình hẹp. 2 quy tắc dưới đây không đổi giao diện trên máy tính
   (chỉ phát huy tác dụng khi nội dung thực sự rộng hơn khung chứa).
   ========================================================================= */

/* Bảng nhiều cột: cho phép cuộn ngang RIÊNG bảng đó, không đẩy tràn cả trang */
.article-detail-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Video/khung nhúng (Youtube...) co theo chiều rộng khung bài viết, giữ tỉ lệ 16:9
   thay vì giữ nguyên width/height cố định lúc dán mã nhúng */
.article-detail-content iframe {
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
}

/* ---------- Vá thêm: 2 khối vẫn còn nền trắng khi bật chế độ tối ----------
   (chưa được các quy tắc "body.dark ..." phía trên bao phủ) */

/* Thanh chữ chạy tin nổi bật dưới menu (marquee-bar) */
body.dark .marquee-bar {
    background: #1c2530;
    border-top-color: #2c3e50;
    border-bottom-color: #2c3e50;
    color: #ff8a80;
}
body.dark .marquee-label {
    color: #ff6b6b;
    border-right-color: #34495e;
}

/* Menu thả xuống danh mục khi rê chuột vào menu chính */
body.dark .category-dropdown {
    background: #1c2530;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .45);
}
body.dark .category-dropdown-item {
    color: #dfe6e9 !important;
    background: #1c2530;
}
body.dark .category-dropdown-item:hover {
    background: #16344a !important;
    color: #5dade2 !important;
}


