/* Theme quypctt (thanhhoafdfund.gov.vn): CSS gom từ các khối <style> trong theme Quypctt của websitetonghop. */

/* ===== Bố cục chung (Shared/_Layout) ===== */
/* css.css (chứa rule an menu con ".mlmenu.horizontal li ul{display:none}") duoc nap o cuoi trang,
           gan phan dong script cuoi cung, de khong dung thu tu asset goc. Nhung vi vay, khi mang cham,
           trinh duyet ve menu ngay khi phan dau trang tai xong, truoc khi css.css (o cuoi) kip tai ->
           toan bo menu con (ul long trong li cua .mlmenu) hien ra xo het, xep doc, "vo" giao dien.
           Lap lai dung rule do ngay trong phan head nay, de co hieu luc tu lan ve dau tien. */
        .mlmenu.horizontal li ul { display: none; }

        .footer-trust-topright { margin-bottom: 10px; }
        .footer-trust-topright img { width: 130px; height: auto; display: inline-block; border-radius: 4px; }
        .header-search-box { display: flex; align-items: center; }
        .header-search-input { width: 220px; height: 34px; padding: 0 12px; border: 1px solid #ddd; border-radius: 3px 0 0 3px; font-size: 13px; outline: none; }
        .header-search-btn { height: 34px; width: 40px; border: 1px solid #ddd; border-left: none; background: #fff; border-radius: 0 3px 3px 0; color: #1877c7; cursor: pointer; }
        .header-search-btn:hover { background: #f2f2f2; }

        /* Chống tràn ngang trên mobile: ảnh banner/carousel trang chủ không có max-width mặc định trong
           CSS gốc (chỉ có class "width100" riêng lẻ ở 1 số nơi), khiến ảnh giữ kích thước gốc lớn hơn màn
           hình -> trang bị kéo rộng, cuộn ngang. Đặt max-width:100% chung cho toàn theme để an toàn. */
        body { overflow-x: hidden; }
        img { max-width: 100%; }

        /* Trang thư viện ảnh (/thu-vien-anh, Views/Gallery/Album.cshtml) dùng class .gallery-grid/.gallery-item,
           nhưng CSS định nghĩa kích thước cho 2 class này chỉ có trong home-sections.css của theme Default,
           không được nạp ở layout Quypctt -> ảnh hiển thị theo kích thước gốc rất to, xếp dọc. Thêm CSS lưới
           thumbnail riêng cho theme này. */
        .gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
        .gallery-grid .gallery-item { display: block; overflow: hidden; border-radius: 4px; }
        .gallery-grid .gallery-item img { width: 100%; height: 190px; object-fit: cover; display: block; }

        @media (max-width: 800px) {
            .gallery-grid { grid-template-columns: repeat(2, 1fr); }
            .gallery-grid .gallery-item img { height: 160px; }
        }
        @media (max-width: 500px) {
            .gallery-grid { grid-template-columns: 1fr; }
            .gallery-grid .gallery-item img { height: 220px; }
        }

        /* Trang danh sách album thư viện ảnh (/thu-vien-anh, Views/Gallery/Index.cshtml) dùng class
           .promotion-grid/.promotion-card/.photo, nhưng CSS định nghĩa kích thước cho các class này chỉ có
           trong site.css, không được nạp ở layout Quypctt -> ảnh cover album hiển thị theo kích thước gốc
           rất to. Thêm CSS lưới thumbnail riêng cho theme này, cùng kiểu với .gallery-grid ở trên. */
        .promotion-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
        .promotion-card { display: block; border-radius: 4px; overflow: hidden; text-decoration: none; }
        .promotion-card .photo, .promotion-card .photo-fallback { position: relative; display: block; height: 190px; overflow: hidden; background: #f2f2f2; }
        .promotion-card .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
        .promotion-card-body { padding: 10px 2px; }

        @media (max-width: 800px) {
            .promotion-grid { grid-template-columns: repeat(2, 1fr); }
            .promotion-card .photo, .promotion-card .photo-fallback { height: 160px; }
        }
        @media (max-width: 500px) {
            .promotion-grid { grid-template-columns: 1fr; }
            .promotion-card .photo, .promotion-card .photo-fallback { height: 220px; }
        }

        @media (max-width: 767px) {
            /* Nút mở menu mobile (#top_option) đặt bottom:19px theo chiều cao 40px của #menu_top_home nên
               dễ bị menu12_home (menu desktop, đã display:none ở breakpoint này) hoặc phần logo đè lên, khiến
               vùng bấm không trùng với vùng hiển thị icon trên 1 số màn hình hẹp -> chạm không trúng nút.
               Tăng z-index, nới vùng bấm bằng padding, và đảm bảo panel menu trượt ra nổi trên mọi khối khác. */
            #top_menu_home, #menu_top_home { overflow: visible; }
            #top_option { z-index: 2147483000; }
            .top_option { width: 44px; height: 32px; }
            /* #menu_right (panel trượt) vốn có top:12px (responhitech.css) - tính từ .top_option, vùng chứa
               icon 36x22px - nên khi mở ra, panel đè ngay lên icon (cùng z-index, panel đứng sau trong DOM
               nên nổi trên icon), khiến icon "biến mất"/không bấm lại được để đóng menu. Đẩy panel xuống dưới
               hẳn icon (dùng chiều cao .top_option 32px ở breakpoint này) để icon luôn lộ ra, bấm đóng được. */
            #menu_right { top: 32px !important; z-index: 2147483000; background: #fff; box-shadow: 0 4px 10px rgba(0,0,0,.15); max-height: 80vh; overflow-y: auto; }
            .cat_title_right, .cat_title_right a { touch-action: manipulation; }

            /* Menu cấp 2/3 trong panel mobile (_SubMenuMobile.cshtml) - thụt lề + nền đậm dần theo cấp để
               phân biệt với mục cha, vì panel này không có hover/flyout như bản desktop (.mlmenu).
               Ẩn mặc định, chỉ xổ ra khi bấm mũi tên (.submenu-toggle) - tránh hiện hết 1 lần làm panel quá dài. */
            .cat_title_right_sub { width: 100%; display: none; }
            .cat_title_right_sub .cat_title_right { padding-left: 12%; background: #efefef; }
            .cat_title_right_sub .cat_title_right_sub .cat_title_right { padding-left: 18%; background: #e6e6e6; }
            .cat_title_right { position: relative; }
            .cat_title_right .submenu-toggle { position: absolute; right: 0; top: 0; width: 40px; height: 100%; display: flex; align-items: center; justify-content: center; cursor: pointer; }
            .cat_title_right .submenu-toggle::after { content: "\f107"; font-family: FontAwesome, "Font Awesome 5 Free"; font-weight: 900; transition: transform .2s; }
            .cat_title_right .submenu-toggle.open::after { transform: rotate(180deg); }

            .top_logo img { max-width: 100% !important; width: 100%; height: auto; }
        }


/* ===== Trang chủ (Home/Index) ===== */
.hot-article-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px; }
    .hot-article-photo { flex: 0 0 auto; display: block; }
    .hot-article-photo img { display: block; width: 115px; height: auto; }
    .hot-article-body { flex: 1 1 auto; min-width: 0; }
    .hot-article-body a { display: block; word-break: break-word; }
    /* Khối "Tin tức nổi bật": ảnh to hơn, tiêu đề + mô tả căn theo chiều cao ảnh;
       mô tả ngắn hơn chiều cao ảnh thì giữ nguyên, dài hơn thì cắt thành "..." */
    .hot-article-item--featured { align-items: stretch; }
    .hot-article-item--featured .hot-article-photo { order: 2; }
    .hot-article-item--featured .hot-article-body { order: 1; }
    .hot-article-item--featured .hot-article-photo img { width: 160px; height: 130px; object-fit: cover; }
    .hot-article-item--featured .hot-article-body { display: flex; flex-direction: column; height: 130px; overflow: hidden; }
    .hot-article-item--featured .hot-article-title { flex: 0 0 auto; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: normal; overflow-wrap: normal; }
    .hot-article-item--featured .hot-article-desc { flex: 1 1 auto; min-height: 0; margin: 4px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: normal; overflow-wrap: normal; }
    .hot-article-item--featured .hot-article-title a,
    .hot-article-item--featured .hot-article-desc { word-break: normal; }
    .link-view-more i { font-size: 11px; margin-left: 0; }
    .link-view-more i:first-of-type { margin-left: 3px; }
    .cat_home_art_title a.link-view-more { color: #bbb; }
    .cat_home_art_title a.link-view-more:hover { color: #c00; text-decoration: none; }
    .partner-logo-list { display: flex; flex-direction: column; gap: 10px; }
    .partner-logo-item { padding: 5px; }
    .partner-logo-strip { padding: 10px 0; text-align: center; }
    .partner-logo-strip img { width: 100%; max-width: 100%; height: 90px; object-fit: contain; background: #fff; }
    .visit-stats-home .visit-stats { color: inherit; }
    .visit-stats-home .visit-stats .fa-circle { color: #2ecc71; }
    .visit-stats-home .visit-stats-item { display: block; margin: 0 0 6px 0; }


/* ===== Danh sách tin (Articles/Category) ===== */
.page-banner { overflow: hidden; }
    .page-banner h1 { margin: 0; word-wrap: break-word; overflow-wrap: break-word; }
    .news-list { list-style: none; margin: 0; padding: 0; }
    .news-list-item { display: flex; gap: 20px; align-items: flex-start; padding: 18px 0; border-bottom: 1px solid #eee; }
    .news-list-item:first-child { padding-top: 0; }
    .news-list-photo { flex: 0 0 160px; width: 160px; height: 110px; overflow: hidden; border-radius: 6px; background: #f2f2f2; display: block; }
    .news-list-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .news-list-photo .photo-fallback { display: flex; align-items: center; justify-content: center; height: 100%; padding: 8px; font-size: 12px; color: #888; text-align: center; }
    .news-list-body { flex: 1 1 auto; min-width: 0; max-width: 100%; }
    .news-list-body h2 { margin: 0 0 12px; font-size: 16px; line-height: 1.4; font-weight: 600; overflow-wrap: break-word; word-break: break-word; }
    .news-list-body h2 a { color: #222; text-decoration: none; display: block; }
    .news-list-body h2 a:hover { color: #c00; }
    .news-list-body .btn-detail { display: inline-block; background: #4caf50; color: #fff; font-size: 13px; padding: 6px 16px; border-radius: 4px; text-decoration: none; }
    .news-list-body .btn-detail:hover { background: #3d9140; }
    @media (max-width: 576px) {
        .news-list-item { gap: 12px; }
        .news-list-photo { flex-basis: 110px; width: 110px; height: 80px; }
    }
    @media (max-width: 991px) {
        .qp-side-layout { display: flex; flex-wrap: wrap; }
        .qp-side-layout > .col-md-9 { order: 2; }
        .qp-side-layout > .col-md-3 { order: 1; margin-bottom: 20px; }
    }
    .link-view-more i { font-size: 11px; margin-left: 0; }
    .link-view-more i:first-of-type { margin-left: 3px; }
    .cat_home_art_title a.link-view-more { color: #bbb; }
    .cat_home_art_title a.link-view-more:hover { color: #c00; text-decoration: none; }
    .partner-logo-list { display: flex; flex-direction: column; gap: 10px; }
    .partner-logo-item { padding: 5px; }
    .partner-logo-item img { width: 100%; max-width: 100%; }
    .visit-stats-home .visit-stats { color: inherit; }
    .visit-stats-home .visit-stats .fa-circle { color: #2ecc71; }
    .visit-stats-home .visit-stats-item { display: block; margin: 0 0 6px 0; }


/* ===== Chi tiết tin (Articles/Detail) ===== */
.page-banner { overflow: hidden; }
    .page-banner h1 { margin: 0; word-wrap: break-word; overflow-wrap: break-word; }
    .link-view-more i { font-size: 11px; margin-left: 0; }
    .link-view-more i:first-of-type { margin-left: 3px; }
    .cat_home_art_title a.link-view-more { color: #bbb; }
    .cat_home_art_title a.link-view-more:hover { color: #c00; text-decoration: none; }
    .jcarousel-box { overflow: hidden; }
    .jcarousel-box .items { width: 100%; }
    .col-md-3 .jcarousel-box .items img { width: 100%; height: 150px; object-fit: cover; display: block; border-radius: 6px; }
    .jcarousel-box:not(.owl-loaded) .items:not(:first-child) { display: none; }
    .partner-logo-list { display: flex; flex-direction: column; gap: 10px; }
    .partner-logo-item { padding: 5px; }
    .partner-logo-item img { width: 100%; max-width: 100%; }
    .visit-stats-home .visit-stats { color: inherit; }
    .visit-stats-home .visit-stats .fa-circle { color: #2ecc71; }
    .visit-stats-home .visit-stats-item { display: block; margin: 0 0 6px 0; }


/* ===== Tra cứu văn bản (VanBan/Index) ===== */
.vb-page{font-family:inherit}
    .vb-tabs{display:flex;gap:32px;border-bottom:1px solid #e3e3e3;margin-bottom:24px}
    .vb-tabs a{padding:0 0 12px;font-weight:700;letter-spacing:.3px;text-transform:uppercase;color:#8a8a8a;text-decoration:none;border-bottom:3px solid transparent;font-size:15px}
    .vb-tabs a.active{color:#1a73c7;border-bottom-color:#1a73c7}
    .vb-filter-row{display:flex;flex-wrap:wrap;gap:16px;margin-bottom:14px}
    .vb-filter-row > div{flex:1;min-width:220px}
    .vb-field-full{margin-bottom:14px}
    .vb-page label{display:block;margin-bottom:6px;color:#333;font-size:14px}
    .vb-page input[type=text],.vb-page input[type=date]{width:100%;box-sizing:border-box;border:1px solid #d8d8d8;border-radius:6px;padding:10px 12px;font-size:14px;color:#333}
    .vb-actions{display:flex;justify-content:flex-end;gap:10px;margin-bottom:28px}
    .vb-btn{border-radius:6px;padding:10px 24px;font-size:14px;font-weight:600;border:1px solid #d8d8d8;background:#fff;color:#333;cursor:pointer;text-decoration:none;display:inline-block}
    .vb-btn-primary{background:#1a73c7;border-color:#1a73c7;color:#fff}
    .van-ban-list{background:#f5f5f5;border-radius:8px;padding:8px 16px}
    .vb-list-item{display:flex;align-items:flex-start;gap:16px;padding:18px 0;border-bottom:1px solid #ececec}
    .vb-list-item:last-child{border-bottom:none}
    .vb-icon{width:34px;height:34px;flex:0 0 auto;margin-top:2px}
    .vb-soky{font-weight:700;color:#222;display:block;margin-bottom:4px}
    .vb-trichyeu{margin:0;color:#444;line-height:1.5}
    .vb-date{white-space:nowrap;color:#444;align-self:center;font-size:14px}
    .vb-download{white-space:nowrap;align-self:center}


/* ===== Liên hệ (Information/Contact) ===== */
.contact-info-block { padding: 10px 0; font-size: 18px; letter-spacing: 0.6px; }
    .contact-info-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px dashed #ddd; }
    .contact-info-item i { color: #1e88e5; font-size: 22px; margin-top: 3px; }
    .contact-info-item strong { letter-spacing: 0.6px; }
    .contact-info-item p { margin: 4px 0; color: #555; letter-spacing: 0.6px; }
    .btn-view-more { display: inline-block; font-size: 14px; color: #c00; background:#fff; border: 1px solid #c00; border-radius: 3px; padding: 8px 20px; transition: all .2s; }
    .btn-view-more:hover { background: #c00; color: #fff; text-decoration: none; }

/* ===== Bổ sung cho webbase (phân trang, thư viện ảnh/video, tìm kiếm) ===== */
.qp-pager { margin: 20px 0; }
.qp-pager .pagination > li > span.ellipsis { border: none; background: none; }
.qp-page-title { margin: 10px 0 20px; font-size: 22px; font-weight: 600; text-transform: uppercase; color: #1877c7; }
.qp-back { margin-bottom: 15px; display: inline-block; }
.qp-empty { padding: 30px 0; color: #777; }
.promotion-card-body h2 { font-size: 15px; font-weight: 600; margin: 0 0 6px; color: #222; line-height: 1.4; }
.promotion-card-body p { margin: 0; color: #777; font-size: 13px; }
.promotion-card-body .eyebrow { color: #999; font-size: 12px; margin-bottom: 4px; }
.promotion-card .photo-fallback { display: flex; align-items: center; justify-content: center; padding: 8px; color: #888; font-size: 12px; text-align: center; }
.promotion-card .photo .play-icon { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 22px; display: flex; align-items: center; justify-content: center; }
.qp-video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; margin-bottom: 15px; }
.qp-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.qp-gallery-caption { font-size: 12px; color: #666; margin-top: 4px; }
.visit-stats { color: #ccc; font-size: 13px; padding: 8px 0; }
.visit-stats-item { margin-right: 15px; display: inline-block; }
.visit-stats .visit-stats-highlight { color: #e60000; font-weight: bold; }
.jcarousel-box { overflow: hidden; }
.jcarousel-box .items { width: 100%; }
#jcarousel-sidebarLibrary .items img { width: 100%; height: 150px; object-fit: cover; display: block; border-radius: 6px; }
.jcarousel-box:not(.owl-loaded) .items:not(:first-child) { display: none; }
