/*
Theme Name: TopGiamGia WP
Theme URI: http://topgiamgia.local/
Author: Tung
Version: 3.0 - Final Build
*/

/* === 1. CÀI ĐẶT CƠ BẢN & FONT === */
:root {
    --brand-color: #ff6a00;
    --text-color: #333;
    --background-color: #f5f6f7;
    --white-color: #ffffff;
    --border-color: #e5e7eb;
    --max-width: 1140px;
}
html, body, div, span, h1, h2, h3, h4, h5, h6, p, a, img, ul, li, article, header, footer, nav, section, main { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; box-sizing: border-box; }
body { font-family: 'Be Vietnam Pro', sans-serif; line-height: 1.7; color: var(--text-color); background: var(--background-color); }
a { text-decoration: none; color: var(--brand-color); }
img { max-width: 100%; height: auto; display: block; }
.row { max-width: var(--max-width); margin-left: auto; margin-right: auto; padding: 0 15px; }

/* === 2. HEADER & MENU === */
.header-wrap { background: var(--white-color);  position: sticky; top: 0; z-index: 1001; }
#header-wrappers .header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 70px; }
#header-wrappers .logo-link img { height: 60px; width: auto; }
#site-nav .nav-desktop { display: flex; align-items: center; list-style: none; gap: 30px; color: #333333 }
.nav-toggle { display: none; cursor: pointer; background: none; border: 1px solid var(--border-color); padding: 8px; border-radius: 8px; }
.nav-dropdown { display: block; position: fixed; top: 0; right: 0; width: min(85vw, 360px); height: 100%; background: var(--white-color); box-shadow: -10px 0 30px rgba(0,0,0,0.1); transform: translateX(100%); transition: transform 0.3s ease-in-out; z-index: 1002; }
.nav-dropdown.open { transform: translateX(0); }
.backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1001; }
.backdrop.open { display: block; }
body.menu-open { overflow: hidden; }
.nav-dropdown .menu-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; }
.nav-dropdown .menu-head .brand img { height: 40px; width: auto; border: none !important; }
.nav-dropdown .menu-head .menu-close { background: transparent; border: none; padding: 8px; cursor: pointer; }
.nav-dropdown .menu-sep { height: 1px; background: var(--brand-color); border: 0; margin: 0 0px 0px; }
.nav-dropdown .nav-mobile-list { list-style: none; }
.nav-dropdown .nav-mobile-list a { display: block; padding: 12px 24px; color: var(--text-color); border-bottom: 1px solid #f0f0f0; }
@media (max-width: 1024px) {
    #site-nav .nav-desktop { display: none !important; }
    #site-nav .nav-toggle { display: block !important; }
}


/* === 3. TRANG CHỦ (HOMEPAGE) === */
.home #main-wrapper { padding: 10px 0; }
.banner-slot { margin-bottom: 30px; }
.banner-slider { position: relative; overflow: hidden; }
.banner-slider .slides { display: flex; gap: 16px; }
.banner-slider .item { flex: 0 0 calc(33.333% - 11px); border-radius: 12px; overflow: hidden; }
.banner-slider .item img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 1024px) { .banner-slider .item { flex-basis: calc(50% - 8px); } }
@media (max-width: 767px) { .banner-slider .item { flex-basis: 100%; } }

.home-sections .home-section { margin-bottom: 15px; }
.home-sections .home-title { font-size: 24px; font-weight: 700; margin-bottom: 20px; }
.home-sections .cards { display: flex; flex-wrap: wrap; gap: 25px; }
.home-sections .card { background: var(--white-color); border-radius: 16px; box-shadow: 0 6px 18px rgba(0,0,0,0.06); overflow: hidden; text-decoration: none; color: inherit; }
.home-sections .card .thumb { position: relative; height: 180px; font-size: 0; }
.home-sections .card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.home-sections .card .badge, .home-sections .card .badge-date { position: absolute; top: 12px; color: #fff; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 999px; }
.home-sections .card .badge-date { left: 12px; background: rgba(17,24,39,.6); }
.home-sections .card .badge { right: 12px; background: #0369A1; }
.home-sections .card .titlebar { background: #0369A1; color: #fff; padding: 12px 14px; }
.home-sections .card .title { font-size: 18px; font-weight: 700; color: #fff !important; }
.home-sections .view-all-row { text-align: center; margin-top: 20px; width: 100%; }
@media (min-width: 1025px) { .home-sections .card { flex-basis: calc(33.333% - 17px); } }
@media (min-width: 768px) and (max-width: 1024px) { .home-sections .card { flex-basis: calc(50% - 13px); } }
@media (max-width: 767px) { .home-sections .card { flex-basis: 100%; } }

/* === 4. TRANG TĨNH & CHUYÊN MỤC === */
#main-wrapper { min-height: 60vh; }
.archive .archive-hero, .page .entry-header { padding: 40px 20px; background: linear-gradient(135deg, #4F94FF 0%, #2A52BE 100%); color: #ffffff; text-align: center; }
.archive .archive-title, .page .entry-title { font-size: 36px; font-weight: 800; color: #fff !important; margin: 0; }
.archive .archive-subtitle { font-size: 18px; color: #fff !important; margin-top: 10px; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; margin-top: 20px; }
.page .entry-content, .single .entry-content { background: #fff; padding: 10px; border-radius: 8px; margin: 10px 0; }
.entry-content ul { list-style-position: inside; }
@media (max-width: 1024px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px) { .post-grid { grid-template-columns: 1fr; } }

/* === 5. FOOTER === */
footer.site-footer { margin-top: 0px; }
.about-box { text-align: center; padding: 25px 15px; background: #3a3a3a; color: #eee; }
.about-box .logo { margin-bottom: 0px; }
.about-box .logo img { max-width: 350px; width: 90%; height: auto; margin-left: auto; margin-right: auto; }
.about-box p, .about-box .credit { max-width: 720px; margin-left: auto; margin-right: auto; color: #eee; line-height: 1.8; }
.about-box p .brand, .about-box .credit a { color: #ff8a8a; font-weight: 700; }
.about-box .credit { margin-top: 25px; font-size: 14px; }
/* ======================================================= */
/* SỬA LỖI Z-INDEX (HEADER BỊ CHE) - BẢN CUỐI CÙNG     */
/* ======================================================= */

/* 1. Nâng z-index của header lên một giá trị rất cao */
.header-wrap {
    z-index: 1000 !important;
}

/* 2. Đảm bảo khu vực nội dung chính có z-index thấp hơn */
#main-wrapper {
    position: relative; /* Bắt buộc phải có để z-index hoạt động */
    z-index: 1;
}


/* Bám sát mép phải, không còn khoảng trống */
.nav-dropdown {
  position: fixed;
  /* inset: top right bottom left  → khóa panel vào mép phải */
  inset: 0 0 0 auto;              /* tương đương: top:0; right:0; bottom:0; left:auto; */
  width: clamp(300px, 85vw, 360px);
  height: 100vh;
  transform: translateX(100%);    /* trạng thái đóng: trượt hẳn ra ngoài */
  transition: transform .3s ease-in-out;
  z-index: 10002;                 /* đảm bảo nổi hơn backdrop */
}

.nav-dropdown.open {
  transform: translateX(0);       /* mở: trượt vào sát mép phải */
}

/* Backdrop bên dưới menu */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: none;
  z-index: 10001;
}
.backdrop.open { display: block; }

/* Xóa mọi khả năng bị “độn” bởi padding/margin toàn trang khi khóa cuộn */
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body.menu-open { overflow: hidden; padding-right: 0 !important; }

/* Phòng trường hợp tablet bị lệch do container có padding bên phải */
@media (min-width: 768px) {
  .nav-dropdown { width: 360px; } /* tablet/full HD giữ kích thước tối đa */
}

/* Đệm an toàn: nếu có ancestor nào áp dụng transform ở mobile */
header, .header-wrap, nav { transform: none !important; }

/* Fallback nếu trình duyệt không hỗ trợ min()/clamp() */
@supports not (width: clamp(300px, 85vw, 360px)) {
  .nav-dropdown { width: 85vw; max-width: 360px; }
}

/* Drawer: ẩn hoàn toàn khi đóng, không bắt sự kiện, không vẽ */
.nav-dropdown {
  position: fixed;
  inset: 0 0 0 auto;        /* top:0; right:0; bottom:0; left:auto */
  width: clamp(300px, 85vw, 360px);
  height: 100vh;
  background: #fff;
  /* ĐẨY RA NGOÀI HƠN 100% để không còn rò viền */
  transform: translateX(calc(100% + 2px));
  visibility: hidden;
  pointer-events: none;
  transition: transform .28s ease, visibility 0s linear .28s;
  z-index: 10002;
  box-shadow: none;          /* tránh shadow “lóe” ở mép phải */
  backface-visibility: hidden;
  contain: paint;
}
.nav-dropdown.open {
  transform: translateX(0);
  visibility: visible;       /* hiển thị lại ngay khi mở */
  pointer-events: auto;
  transition: transform .28s ease;
}

/* Backdrop: đóng thì hoàn toàn không render */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: none;
  opacity: 0;
  pointer-events: none;
  z-index: 10001;
  transition: opacity .2s ease;
}
.backdrop.open {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* Ngăn tràn ngang tạo đường rìa khác màu */
html, body { margin:0; padding:0; overflow-x:hidden; background:#fff; }

/* Nếu wrapper trang có box-shadow, đừng để “hở” nền khác màu */
.page-wrap { background:#fff; }

/* (Tuỳ) Nếu vẫn còn vệt trên vài máy Android cũ, bù thêm 1px: */
@supports (transform: translateX(0)) {
  .nav-dropdown { transform: translateX(calc(100% + 3px)); }
}

/* Giả sử logo có class .logo-bottom bên trong .site-footer */
.about-box .logo img {
  display: block;
  margin: 12px auto 0;                 /* giữ logo canh giữa theo mặc định */
  transform: translateX(var(--logo-shift, 0));
  transition: transform .2s ease;      /* mượt khi bạn chỉnh */
}

/* Điều chỉnh chung (px, %, rem đều được) */
:root { --logo-shift: 0px; }           /* 0 = đúng giữa; âm = lệch trái; dương = lệch phải */

/* Tuỳ chọn: tinh chỉnh theo breakpoint */
@media (max-width: 767px) { :root { --logo-shift: 50px; } }        /* mobile: lệch trái 6px */
@media (min-width: 768px) and (max-width: 1024px) { :root { --logo-shift: 50px; } }  /* tablet: giữa */
@media (min-width: 1025px) { :root { --logo-shift: 50px; } }        /* desktop: lệch phải 8px */

/* Giữ logo & credit ở giữa */
.site-footer .about-box { text-align: center; }

/* Logo: bỏ margin-left cứng và canh giữa đúng chuẩn */
.site-footer .about-box .logo img{
  display:block;
  margin: 0 auto !important;   /* ghi đè rule cũ margin-left:450px */
}

/* Đoạn mô tả: dàn đều 2 lề */
.site-footer .about-box p{
  text-align: justify;
  text-justify: inter-word;     /* fallback */
  hyphens: auto;                /* ngắt từ đẹp hơn khi justify */
  margin-left:auto;
  margin-right:auto;
  max-width: 720px;             /* giữ độ rộng đọc dễ */
}

/* Credit vẫn giữa */
.site-footer .about-box .credit{ text-align:center; }


/* === Mobile: sát 2 mép mà KHÔNG đổi khoảng dọc === */
@media (max-width: 767.98px) {
  /* Giữ nguyên top/bottom, chỉ xoá margin trái/phải mặc định của body */
  body { margin-inline: 0 !important; }

  /* Các container phổ biến: chỉ reset padding/margin TRỤC NGANG */
  .home .container,
  .home .container-fluid,
  .home .site-content,
  .home .content-wrap,
  .page .container,
  .page .container-fluid,
  .page .site-content,
  .page .content-wrap {
    max-width: 100vw !important;
    padding-inline: 0 !important;   /* = padding-left/right */
    margin-inline: 0 !important;    /* = margin-left/right */
    /* KHÔNG đổi padding-block/margin-block (trục dọc) */
  }

  /* Bootstrap grid/cột: chỉ bỏ “gáy” trái/phải, giữ trên/dưới */
  .home .row,
  .page .row { margin-inline: 0 !important; }

  .home [class*="col-"],
  .page [class*="col-"] { padding-inline: 0 !important; }

  /* Các section hay có padding ngang – chỉ bỏ trái/phải */
  .home .section, .home .module, .home .block, .home .entry-content,
  .page .section, .page .module, .page .block, .page .entry-content {
    padding-inline: 0 !important;
  }

  /* Nếu có layout flex/grid: chỉ tắt khoảng NGANG, không đụng khoảng DỌC */
  .home .grid, .home [class*="grid"], .home .flex, .home [class*="flex"],
  .page .grid, .page [class*="grid"], .page .flex, .page [class*="flex"] {
    column-gap: 0 !important;       /* GIỮ nguyên row-gap */
  }

  /* Tôn trọng safe-area (tai thỏ) nhưng không thêm padding dọc */
  .home, .page {
    padding-inline: max(0px, env(safe-area-inset-left))
                    max(0px, env(safe-area-inset-right));
  }
}


/* ======================================================= */
/* === CSS HOÀN CHỈNH CHO TRANG BÀI VIẾT (V3 - ĐẦY ĐỦ) === */
/* ======================================================= */

/* --- 1. Nền trang và Khung bài viết --- */

body {
  background-color: #f5f6f7; /* Nền xám nhạt cho toàn bộ trang */
}

#main-wrapper article.post.single {
  background: #ffffff;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
  position: relative; 
}

/* --- 2. CSS cho Breadcrumbs của plugin NavXT --- */
/* 1. Container chính của Breadcrumbs */
        .breadcrumbs {
            display: flex; 
            align-items: center;
            padding: 15px 0;
            font-size: 0; /* QUAN TRỌNG: Ẩn các text node con (như dấu '»') */
        }

        /* 2. Đặt lại font-size cho các mục và ẩn mục bài viết hiện tại */
        .breadcrumbs > span {
            font-size: 14px; /* Đặt lại font-size cho các mục breadcrumb */
        }

        .breadcrumbs .current-item {
            display: none !important;
        }

        /* 3. Style cho các mục có link (Trang chủ, Chuyên mục...) */
        .breadcrumbs a {
            display: flex;
            align-items: center;
            position: relative;
            height: 40px;
            background-color: #1a7f37;
            color: #ffffff !important;
            text-decoration: none;
            font-weight: 500;
            padding: 0 15px;
            margin-right: 20px; 
            transition: background-color 0.3s ease;
        }

        /* 4. Tạo hình ĐẦU mũi tên (bên phải) */
        .breadcrumbs a::after {
            content: '';
            position: absolute;
            top: 0;
            right: -20px; 
            width: 0;
            height: 0;
            border-top: 20px solid transparent;
            border-bottom: 20px solid transparent;
            border-left: 20px solid #1a7f37;
            transition: border-left-color 0.3s ease;
        }

        /* 5. TẠO HÌNH ĐUÔI MŨI TÊN (bên trái) */
        /* Áp dụng cho tất cả các mục trừ mục đầu tiên */
        .breadcrumbs > span:not(:first-child):not(.current-item) > a::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 0;
            height: 0;
            border-top: 20px solid transparent;
            border-bottom: 20px solid transparent;
            border-left: 20px solid #f4f7f6; 
        }

        /* Tăng padding trái cho các mục có đuôi để chữ không bị che */
        .breadcrumbs > span:not(:first-child):not(.current-item) > a {
            padding-left: 35px;
        }


        /* 6. Hiệu ứng khi rê chuột */
        .breadcrumbs a:hover {
            background-color: #115a27;
        }
        .breadcrumbs a:hover::after {
            border-left-color: #115a27;
        }

/* Đưa ngày tháng lên góc trên bên phải */
#main-wrapper .single .post-meta {
  display: block !important;
  position: absolute;
  top: 5px;
  right: 35px;
  font-size: 14px;
  color: #6c757d;
  font-style: italic;
}

/* Thêm biểu tượng lịch */
#main-wrapper .single .post-meta time::before {
  content: '🗓️';
  margin-right: 6px;
  vertical-align: ;
}

/* Ẩn tên chuyên mục và dấu chấm */
#main-wrapper .single .post-meta .cats,
#main-wrapper .single .post-meta .dot {
  display: none;
}

/* Canh giữa và định dạng lại Tiêu đề (H1) */
#main-wrapper .single .entry-header {
  all: unset;
  display: block;
}

#main-wrapper .single .entry-title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  color: #111827;
  padding-top: 0px;
  margin-bottom: 0px;
}

/* --- 4. CSS cho nội dung còn lại --- */

#main-wrapper .single .entry-content p,
#main-wrapper .single .entry-content li {
  font-size: 18px;
  line-height: 1.2;
}

/* --- 5. Responsive cho Mobile --- */
@media (max-width: 767px) {
  #main-wrapper article.post.single {
    padding: 5px;
  }
  #main-wrapper .single .post-meta {
    position: relative;
    top: 0;
    right: 0;
    text-align: center;
    margin-bottom: 5px;
    font-size: 13px;
  }
  #main-wrapper .single .entry-title {
    padding-top: 0;
    margin-bottom: 5px;
  }
}

@media (max-width: 1024px) {
          
          /* Áp dụng cho TẤT CẢ các phần tử cần kéo dãn trong trang post và page */
          body.single .dw-breadcrumbs,
          body.page .dw-breadcrumbs,
          body.single #main-wrapper article.post.single,
          body.page #main-wrapper .entry-header,
          body.page #main-wrapper .entry-content {
            /* Dùng margin âm để kéo dãn các khối ra ngoài */
            margin-left: -15px;
            margin-right: -15px;
            border-radius: 0;
          }

          /* Thêm lại padding cho breadcrumbs để item không bị dính sát vào mép */
          body.single .dw-breadcrumbs,
          body.page .dw-breadcrumbs {
              box-sizing: border-box; 
              padding-left: 15px;
              padding-right: 15px;
              width: calc(100% + 30px);
          }

          /* SỬA LỖI: Thêm lại padding cho nội dung của trang tĩnh (page) và dùng !important */
          body.page #main-wrapper .entry-content {
              padding-left: 15px !important;
              padding-right: 15px !important;
              box-sizing: border-box;
          }
        }

/* ===================================================================
         THÊM KHOẢNG CÁCH DƯỚI BÀI VIẾT VỚI FOOTER
        =================================================================== 
        */
        /* Chỉ áp dụng cho trang bài viết (post) */
        body.single #main-wrapper article.post.single {
            margin-bottom: 25px; /* Tạo khoảng trống 25px giữa bài viết và footer */
        }


/* ===================================================================
   CSS HOÀN CHỈNH - V19 (FIX VÙNG CLICK "XEM THÊM")
=================================================================== */

/* === PHẦN DÙNG CHUNG === */
body.home .card .thumb,
body.archive .card-thumbnail {
    position: relative;
}

body.home .card .badge,
body.archive .card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    background-color: #0369A1;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    text-transform: uppercase;
}

body.home .badge-date,
body.archive .badge-date {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: rgba(17, 24, 39, 0.6);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 999px;
}


/* ===================================================================
   CSS SỬA LỖI HIỂN THỊ CHO TRANG SEARCH VÀ ARCHIVE (FIXED)
=================================================================== */

/* === PHẦN DÙNG CHUNG CHO CÁC THẺ BÀI VIẾT === */
body.home .card .thumb,
body.archive .card-thumbnail, 
body.search .card-thumbnail { /* << THÊM MỚI */
    position: relative;
}

body.home .card .badge,
body.archive .card-badge,
body.search .card-badge { /* << THÊM MỚI */
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    background-color: #0369A1;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    text-transform: uppercase;
}

body.home .badge-date,
body.archive .badge-date,
body.search .badge-date { /* << THÊM MỚI */
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: rgba(17, 24, 39, 0.6);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 999px;
}


/* === CSS DÀNH RIÊNG CHO TRANG CHUYÊN MỤC, THẺ VÀ TÌM KIẾM === */
body.archive #main-wrapper,
body.search #main-wrapper { /* << THÊM MỚI */
    padding-bottom: 30px;
}

body.archive .post-card,
body.search .post-card { /* << THÊM MỚI */
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden; 
}

body.archive .card-content,
body.search .card-content { /* << THÊM MỚI */
    padding: 12px 20px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

body.archive h2.card-title a,
body.search h2.card-title a { /* << THÊM MỚI */
    color: #0369A1;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
}
body.archive h2.card-title a:hover,
body.search h2.card-title a:hover { /* << THÊM MỚI */
    color: #024a70;
}
body.archive h2.card-title,
body.search h2.card-title { /* << THÊM MỚI */
    margin: 0 0 8px 0;
}

body.archive .card-excerpt,
body.search .card-excerpt { /* << THÊM MỚI */
    font-size: 0.95rem;
    color: #333333;
    line-height: 1.6;
    margin-bottom: 15px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

body.archive a.read-more,
body.search a.read-more { /* << THÊM MỚI */
    display: inline-block;
    align-self: flex-end;
    margin-top: auto;
    padding-top: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #0369A1;
    text-decoration: none;
}

/* === THAY ĐỔI TẠI ĐÂY === */
body.archive a.read-more {
    display: inline-block; /* THAY ĐỔI 1: Để vùng click co lại vừa bằng nội dung */
    align-self: flex-end;  /* THAY ĐỔI 2: Căn chỉnh mục flex này sang phải */
    margin-top: auto;
    padding-top: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #0369A1;
    text-decoration: none;
    /* THAY ĐỔI 3: Xóa text-align vì đã có align-self */
}

/* === CSS SỬA LỖI DÀNH RIÊNG CHO TRANG CHỦ (INDEX.PHP) === */
body.home .card {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    overflow: hidden;
}

body.home .card .titlebar {
    background: #0369A1;
    padding: 12px 14px;
}

body.home .card .title a {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff !important;
    text-decoration: none;
}
/* ===================================================================
   CSS V25 - GIẢI PHÁP CUỐI CÙNG CHO HEADER TRANG CHUYÊN MỤC
=================================================================== */

/* 1. Giảm chiều cao của nền xanh bao quanh tiêu đề */
body.archive .archive-hero {
    padding-top: 10px;
    padding-bottom: 25px;
}

/* 2. Bó hẹp chiều rộng của KHỐI NỘI DUNG */
body.archive .archive-hero-content {
    max-width: 700px; /* Bó hẹp toàn bộ khối chứa tiêu đề và mô tả */
    margin-left: auto;
    margin-right: auto;
}

/* 3. Giới hạn mô tả trong 2 dòng (giờ sẽ hoạt động) */
body.archive .archive-subtitle {
    margin-top: 0px;
	
    
    /* Các thuộc tính để giới hạn 2 dòng */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ===================================================================
   CSS ĐỔI MÀU CHỮ MENU DESKTOP
=================================================================== */

/* Đặt màu chữ mặc định cho các mục menu là màu đen/xám đậm */
#site-nav .nav-desktop li a {
    color: var(--text-color);
}

/* Tùy chọn: Đổi thành màu cam thương hiệu khi rê chuột qua */
#site-nav .nav-desktop li a:hover {
    color: var(--brand-color);
}
/* --- TĂNG CỠ CHỮ CHỈ CHO MENU CHA (DESKTOP) --- */
#site-nav .nav-desktop > li > a {
    font-size: 18px; /* << Thay đổi số 16 thành kích thước bạn muốn */
}



/* ===================================================================
   HOMEPAGE HERO SECTION REDESIGN V1.0
=================================================================== */

/* 1. Khung chính của Hero */
.home-hero {
    background-color: #f0f4f8; /* Một màu nền sáng và sạch */
    padding: 20px 0;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.home-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

/* 2. Tiêu đề và Mô tả */
.home-hero-title {
    font-size: 40px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 10px;
}

.home-hero-subtitle {
    font-size: 18px;
    color: #4b5563;
    margin-bottom: 30px;
}

/* 3. Tinh chỉnh lại thanh tìm kiếm (FIXED) */
.home-hero .search-form-wrapper {
    max-width: 700px;
    margin: 0 auto 35px;
}

.home-hero .search-form {
    width: 100%;
    display: flex; /* Quan trọng: Dàn layout cho ô input và nút bấm */
    align-items: center; /* Căn giữa các mục theo chiều dọc */
    background-color: #ffffff; /* Thêm lại nền trắng */
    border-radius: 999px;
    border: 1px solid #d1d5db;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    overflow: hidden; /* Ngăn các góc của nút bấm bị lòi ra ngoài */
}

.home-hero .search-form:focus-within {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.2), 0 4px 20px rgba(0, 0, 0, 0.07);
}

.home-hero .search-field {
    flex-grow: 1; /* Quan trọng: Cho ô input lấp đầy không gian còn trống */
    width: 100%; /* Đảm bảo input chiếm đủ chiều rộng */
    border: none;
    background: transparent;
    outline: none;
    padding: 16px 24px;
    font-size: 16px;
    color: #333;
}

.home-hero .search-submit {
    flex-shrink: 0; /* Ngăn nút bấm bị co lại */
    background-color: var(--brand-color); /* Thêm lại màu nền cho nút */
    color: white;
    border: none;
    outline: none;
    padding: 0 24px;
    cursor: pointer;
    align-self: stretch; /* Cho nút bấm cao bằng khung chứa */
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}
.home-hero .search-submit:hover {
    background-color: #e65c00;
}

/* 4. Khối thẻ Logo thương hiệu (FIXED - Hoàn Chỉnh) */
.home-hero .quick-access-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Quan trọng: Chia lại layout thành 3 cột */
    gap: 25px;
}

.home-hero .brand-card {
    aspect-ratio: 2 / 1;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.home-hero .brand-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.home-hero .brand-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 5. Responsive cho Mobile */
@media (max-width: 767px) {
    .home-hero {
        padding: 30px 0;
    }
    .home-hero-title {
        font-size: 21px;
    }
    .home-hero-subtitle {
        font-size: 15px;
    }
    .home-hero .quick-access-cards {
        gap: 15px;
    }
}
/* ===================================================================
   MOBILE HERO - Phóng to logo trong khung
=================================================================== */
@media (max-width: 767px) {
    .home-hero .brand-card {
        padding: 2px; /* Giảm khoảng đệm từ 10px xuống còn 5px trên di động */
    }
}

/* === CÀI ĐẶT SỐ CỘT CHO TỪNG THIẾT BỊ === */

/* 1. Mobile (Mặc định): 1 cột */
.quick-access-cards {
    grid-template-columns: repeat(3, 1fr);
}

/* 2. Tablet (Từ 768px trở lên): 2 cột */
@media (min-width: 768px) {
    .quick-access-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 3. Desktop nhỏ (Từ 1024px trở lên): 3 cột */
@media (min-width: 1024px) {
    .quick-access-cards {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Responsive */
@media (max-width: 767px) {
    .top-search-section {
        padding: 20px 15px;
    }
    .quick-access-cards {
        gap: 15px;
        margin-top: 20px;
    }
}


/* =========================================================
   TOÀN BỘ CSS CUỐI CÙNG CHO MENU (FIX ALL BUGS)
========================================================= */

/* --- 1. ICON EMOJI (FIXED) --- */
/* --- CSS CUỐI CÙNG CHO ICON (SỬ DỤNG SELECTOR CHÍNH XÁC) --- */
#menu-item-245 > a > span::before {
    content: '🔖️️️';
    margin-right: 5px;
    font-size: 1.2em; /* Có thể điều chỉnh nếu cần */
    vertical-align: -2px; /* Căn chỉnh cho thẳng hàng */
}

/* --- 2. NỀN TẢNG MENU DESKTOP --- */
#site-nav .nav-desktop > li.menu-item {
    height: 70px;
    display: flex;
    align-items: center;
}
#site-nav .nav-desktop .menu-item-has-children {
    position: relative;
}
#site-nav .nav-desktop .menu-item-has-children > a::after {
    content: '▼';
    font-size: 10px;
    color: #999;
    margin-left: 5px;
}

/* --- 3. MENU CON TRÊN DESKTOP (FIXED) --- */
#site-nav .nav-desktop .sub-menu {
    display: none;
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #f5f5f5;
    border: 0px solid var(--border-color);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border-radius: 0 0 8px 8px;
    padding: 8px 0; /* Giảm padding tổng thể một chút */
    z-index: 100;
    min-width: 220px;

    /* FIX: Xóa dấu chấm tròn của danh sách */
    list-style: none !important;
}

/* Khi rê chuột vào mục cha, hiện menu con ra */
#site-nav .nav-desktop .menu-item-has-children:hover > .sub-menu {
    display: block;
}

/* FIX: Thêm khoảng cách dọc cho các mục trong menu con */
#site-nav .nav-desktop .sub-menu li a {
    display: block;
    padding: 10px 20px; /* << Thuộc tính này sẽ tạo khoảng cách dọc */
    color: var(--text-color);
    white-space: nowrap;
}

/* Style hover cho các mục bên trong menu con */
#site-nav .nav-desktop .sub-menu li a:hover {
    background-color: #e9e9e9;
    color: var(--brand-color);
}

/* =========================================================
   CSS HOÀN CHỈNH CHO MENU MOBILE (ICON GẦN CHỮ)
========================================================= */

/* Nền tảng (Giữ nguyên) */
.nav-dropdown .nav-mobile-list .menu-item-has-children { position: center; }
.nav-dropdown .nav-mobile-list .sub-menu { list-style: none; padding-left: 0; max-height: 0; overflow: hidden; transition: max-height 0.4s ease-in-out; background-color: #f0f0f0; margin: 0; border-radius: 0; border-bottom: 1px solid #e5e5e5; }
.nav-dropdown .nav-mobile-list .sub-menu.open { max-height: 500px !important; }
.nav-dropdown .nav-mobile-list .sub-menu li a { padding-left: 40px !important; }
.nav-dropdown .nav-mobile-list .sub-menu li { border-bottom: 1px solid #e5e5e5; }
.nav-dropdown .nav-mobile-list .sub-menu li:last-child { border-bottom: none; }

/* 1. Thiết lập cho thẻ link <a> */
.nav-dropdown .nav-mobile-list .menu-item-has-children > a {
    display: flex;
    align-items: center; /* Căn icon và chữ thẳng hàng */
    justify-content: flex-start; 
    width: 100%;
}

/* 2. Tạo icon xoay › nằm ngay sau chữ */
.nav-dropdown .nav-mobile-list .menu-item-has-children > a::after {
    content: '▶';
    font-size: 14px;
    font-weight: bold;
    color: #aaa;
    margin-left: 10px; /* Khoảng cách giữa chữ và icon */
    transition: transform 0.3s ease;
    transform: rotate(0deg);
	position: relative;
    top: 0px;
}

/* 3. Khi menu được mở, xoay icon 90 độ */
.nav-dropdown .nav-mobile-list .menu-item-has-children.open > a::after {
    transform: rotate(90deg);
}

/* FIX 2: Cho nền menu con rộng ra hết cỡ */
.nav-dropdown .nav-mobile-list .sub-menu {
    list-style: none;
    padding-left: 0; /* Xóa padding mặc định của ul */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
    background-color: #f0f0f0; /* Làm màu xám đậm hơn một chút cho dễ phân biệt */
    
    /* Thay đổi quan trọng: Xóa margin ngang */
    margin: 0;
    border-radius: 0;
    border-bottom: 1px solid #e5e5e5;
}

/* Thụt lề cho các mục con bên trong để chúng không bị sát mép */
.nav-dropdown .nav-mobile-list .sub-menu li a {
    padding-left: 40px !important; /* Tăng độ thụt lề so với mục cha */
}
/* Thêm gạch ngang vào dưới mỗi mục */
.nav-dropdown .nav-mobile-list .sub-menu li {
    border-bottom: 1px solid #e5e5e5; /* Tạo gạch ngang mỏng, màu xám nhạt */
}

/* Xóa gạch ngang ở mục cuối cùng cho đẹp hơn */
.nav-dropdown .nav-mobile-list .sub-menu li:last-child {
    border-bottom: none;
}



/* ===== Nội dung: giãn dòng TRONG MỘT ĐOẠN (wrap) mạnh hơn ===== */
.entry-content p,
.entry-content .wp-block-paragraph,
.entry-content li {
  font-size: 1.125rem;          /* ~18px */
  line-height: 1.7 !important; /* giãn khoảng cách giữa 2 dòng trong cùng 1 đoạn */
  margin: 0 0 0.5em;
}

/* Nếu phần nội dung khác không phải p/li vẫn dùng size này */
.entry-content,
.wp-block-post-content { 
  font-size: 1.125rem;
}

/* ===== Tiêu đề bài viết (trên cùng) – to hơn nữa ===== */
.entry-title,
.entry-title a,
.wp-block-post-title,
.wp-block-post-title a {
  color: #c62828 !important;
  font-weight: 800;
  font-size: clamp(2.6rem, 3.6vw + 1rem, 3.8rem); /* ~41–60px tùy màn hình */
  line-height: 1.15;
  margin: 0 0 1.5em !important;
}

/* ===== Heading trong nội dung ===== */
.entry-content h1 {
  color: #c62828 !important;    /* đỏ đậm */
  font-size: 2.6rem;          /* ~42px */
  line-height: 1.2;
  font-weight: 800;
  margin: 0.6em 0 .6em;
}

.entry-content h2 {
  color: #ef5350 !important;    /* đỏ nhạt hơn */
  font-size: 1.8rem;            /* ~34px */
  line-height: 1.25;
  font-weight: 500;
  margin: 0.6em 0 .55em;
}

.entry-content h3 {
  color: #333;
  font-size: 1.5rem;            /* ~25–26px */
  line-height: 1.3;
  font-weight: 500;
  margin: 0.5em 0 .5em;
}

/* ===== Mobile tuning ===== */
@media (max-width: 767px) {
  .entry-content p,
  .entry-content .wp-block-paragraph,
  .entry-content li { line-height: 2.1 !important; }
  .entry-title, .wp-block-post-title { font-size: clamp(2rem, 4.5vw + 1rem, 2.6rem); }
  .entry-content h1 { font-size: 2.2rem; }
  .entry-content h2 { font-size: 1.8rem; }
  .entry-content h3 { font-size: 1.3rem; }
}


/* Áp dụng cho nội dung bài viết */
.entry-content ul,
.entry-content ol {
  list-style-position: outside;     /* bullet/number nằm ngoài khối, chữ thụt vào */
  padding-inline-start: 1.75rem;    /* khoảng thụt vào cho cả danh sách */
  margin: 0 0 1em;                  /* khoảng cách với khối phía dưới */
}

/* Khoảng cách giữa các mục */
.entry-content li {
  margin: 0.25em 0;
  line-height: 1.9;                 /* tuỳ bạn, có thể bớt/tăng */
}

/* Danh sách lồng nhau thụt sâu hơn một chút */
.entry-content li > ul,
.entry-content li > ol {
  margin-top: 0.35em;
  padding-inline-start: 1.25rem;
}

/* (Tuỳ chọn) Nếu theme đã reset padding về 0, ép lại cho chắc */
.entry-content .wp-block-list,
.entry-content .wp-block-list ul,
.entry-content .wp-block-list ol {
  padding-inline-start: 2.5rem !important;
}




/* Card trên trang chủ: toàn bộ nền màu xanh */
.home-sections .card{
  display: flex;
  flex-direction: column;
  background: #075985 !important;   /* xanh chủ đạo */
  border-radius: 24px;
  overflow: hidden;                  /* bo góc gọn, không hở nền khác */
  padding: 0 !important;             /* tránh tạo khe trắng */
}

/* Ảnh phía trên: sát mép, không có nền/đệm trắng */
.home-sections .card .thumb{
  display:block;
  margin: 0;
  background: transparent !important;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* Thanh tiêu đề: để nền trong suốt vì card đã xanh, hoặc giữ xanh đều cũng được */
.home-sections .card .titlebar{
  background: transparent !important;  /* hoặc #075985 để cùng màu */
  padding: 12px 16px;
  margin: 0;
  height: auto;
  min-height: 0;
}

/* Tiêu đề hiển thị full nhiều dòng */
.home-sections .card .title{
  margin: 0;
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.home-sections .card .title a{ color: #fff; display:inline; }

/* Nếu có phần tử nào nằm sau titlebar (meta/readmore…), cho cùng nền xanh */
.home-sections .card .meta,
.home-sections .card .readmore,
.home-sections .card .content,
.home-sections .card .footer{
  background: transparent !important;
  color: #fff;
  margin: 0;
  padding: 0;
}

/* Phần tử cuối card không có khoảng trắng dư */
.home-sections .card > *:last-child{
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}








/* Font hệ thống hỗ trợ tiếng Việt, không cần host hay Google */
html, body,
input, textarea, button, select {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* (tuỳ chọn) đồng bộ heading & menu nếu theme đặt font riêng */
h1, h2, h3, h4, h5, h6,
nav, .menu, .btn, .widget, .entry-content {
  font-family: inherit;
}

