/*
Theme Name: Hospital Care Theme
Author: Senior WP Developer
Description: Giao diện y tế hiện đại, tối ưu SEO và Accessibility.
Version: 1.0.0
Text Domain: hospital-care
*/

/* =========================================
   Custom Base Styles & WordPress Overrides
   ========================================= */

body {
    font-family: var(--font-main);
    color: var(--text-dark);
    line-height: 1.6; /* Tăng khoảng cách dòng mặc định cho dễ đọc */
}

/* =========================================
   BOXED LAYOUT (SITE CONTAINER)
   ========================================= */

/* Màu nền xám nhạt cho toàn trang */
body.boxed-mode {
    background-color: var(--bg-body);
}

/* Class bao bọc toàn bộ nội dung */
.site-container {
    background-color: #ffffff;
    width: 100%;
    max-width: 1500px; /* Mở rộng lên 1500px cho màn hình lớn */
    margin: 0 auto;    /* Canh giữa */
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.05); /* Đổ bóng nhẹ tạo khối */
    min-height: 100vh; /* Đảm bảo chiều cao tối thiểu bằng màn hình */
    display: flex;
    flex-direction: column;
}

/* QUAN TRỌNG: Ghi đè giới hạn của Tailwind .container bên trong */
.site-container .container {
    max-width: 100% !important; /* Để nội dung tràn ra khớp với 1500px của khung ngoài */
}

/* Responsive cho Mobile/Tablet */
@media (max-width: 1024px) {
    .site-container {
        width: 95%; /* Thu gọn nhẹ 2 bên lề trên mobile */
        margin-top: 10px; /* Tạo khoảng cách nhỏ phía trên */
        margin-bottom: 10px;
        border-radius: 8px; /* Bo góc nhẹ cho mềm mại */
        overflow: hidden; /* Ẩn các phần tử tràn ra ngoài */
    }
}

/* Hiệu ứng nút Hotline nhấp nháy */
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.hotline-pulse {
    animation: pulse-red 2s infinite;
}

/* Mobile Menu Hidden by default */
.mobile-menu-hidden {
    display: none;
}

/* =========================================
   Single Post Content Styling (.entry-content)
   ========================================= */

/* Container chung cho nội dung bài viết */
.entry-content {
    font-family: var(--font-main);
    font-size: 1.125rem; /* 18px - Chuẩn báo chí hiện đại cho Desktop */
    line-height: 1.8;    /* Khoảng cách dòng thoáng (180%) */
    color: #334155;      /* Slate 700 - Xám đậm dịu mắt, không đen tuyền */
    word-wrap: break-word;
}

/* Đoạn văn */
.entry-content p {
    margin-bottom: 1.5rem; /* ~24px */
    text-align: left; /* Canh trái dễ đọc hơn canh đều (justify) trên web vì tránh lỗi khoảng trắng */
}

/* Các thẻ Heading (Tiêu đề con) */
.entry-content h2,
.entry-content h3,
.entry-content h4 {
    color: #1e293b; /* Slate 800 - Đậm hơn văn bản thường */
    font-weight: 700;
    line-height: 1.35;
    margin-top: 2.5rem;   /* Cách xa đoạn trên để phân tách rõ ràng */
    margin-bottom: 1rem;  /* Gần đoạn dưới hơn */
    position: relative;
}

/* Heading 2 - Điểm nhấn chính */
.entry-content h2 {
    font-size: 1.75rem; /* ~28px */
    color: #15803d;     /* Green 700 - Màu thương hiệu */
    padding-left: 1rem;
    border-left: 4px solid #15803d; /* Đường kẻ xanh bên trái */
}

/* Heading 3 */
.entry-content h3 {
    font-size: 1.5rem; /* ~24px */
}

/* Heading 4 */
.entry-content h4 {
    font-size: 1.25rem; /* ~20px */
    font-weight: 600;
}

/* Danh sách (List) */
.entry-content ul,
.entry-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem; /* Thụt đầu dòng */
    color: #334155;
}

.entry-content ul li,
.entry-content ol li {
    margin-bottom: 0.75rem; /* Khoảng cách giữa các mục li */
    padding-left: 0.5rem;
}

.entry-content ul { list-style-type: disc; }
.entry-content ol { list-style-type: decimal; }

/* Bảng biểu (Table) - Responsive & Striped */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0; /* Slate 200 */
    font-size: 1rem;
    /* Responsive Scroll cho bảng */
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}

.entry-content th,
.entry-content td {
    border: 1px solid #e2e8f0;
    padding: 1rem;
    text-align: left;
}

.entry-content th {
    background-color: #f1f5f9; /* Slate 100 */
    font-weight: 700;
    color: #0f172a;
}

/* Striped Rows (Dòng kẻ sọc) */
.entry-content tr:nth-child(even) {
    background-color: #f8fafc; /* Slate 50 */
}

/* Trích dẫn (Blockquote) */
.entry-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background-color: #f8fafc; /* Nền xám rất nhạt */
    border-left: 4px solid #15803d; /* Viền xanh */
    font-style: italic;
    color: #475569; /* Slate 600 */
    border-radius: 0 8px 8px 0;
    font-size: 1.2rem;
}

/* Hình ảnh & Video */
.entry-content img,
.entry-content video,
.entry-content iframe {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto; /* Canh giữa và cách đoạn */
    border-radius: 6px; /* Bo góc nhẹ */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); /* Đổ bóng mỏng tinh tế */
}

.entry-content figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: #64748b;
    margin-top: -1.5rem;
    margin-bottom: 2rem;
    font-style: italic;
}

/* Đường dẫn (Links) */
.entry-content a {
    color: #15803d; /* Green 700 */
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
    font-weight: 500;
}

.entry-content a:hover {
    color: #166534; /* Green 800 */
    border-bottom-color: #166534; /* Gạch chân khi hover */
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .entry-content {
        font-size: 1.0625rem; /* 17px cho Mobile */
        line-height: 1.7;
    }
    .entry-content h2 { font-size: 1.5rem; }
    .entry-content h3 { font-size: 1.35rem; }
    .entry-content blockquote { padding: 1rem; font-size: 1.1rem; }
}

/* =========================================
   CUSTOM HEADER MENU STYLES (Dynamic)
   ========================================= */

/* 1. Cấu trúc Menu Cấp 1 (Main Menu) */
.main-navigation ul {
    display: flex;              /* Xếp ngang các mục menu cha */
    flex-wrap: wrap;
    background-color: transparent; /* Nền trong suốt để hòa hợp với header trắng */
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 2px;                   /* Khoảng cách giữa các nút */
}

.main-navigation .menu > li {
    position: relative;         /* Để định vị menu con tuyệt đối theo cha */
}

.main-navigation ul > li > a {
    display: block;
    padding: 14px 18px;         /* Padding thoáng đãng hơn */
    color: #ffffff;             /* Chữ trắng trên nền xanh */
    text-decoration: none;
    font-weight: 600;           /* Semi-bold hiện đại */
    font-size: 15px;            /* Kích thước chữ dễ đọc */
    text-transform: uppercase;
    letter-spacing: 0.5px;      /* Khoảng cách chữ thoáng */
    position: relative;         /* Để chứa đường kẻ */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Easing mượt mà */
    white-space: nowrap;        /* Đảm bảo menu luôn nằm trên 1 dòng */
    border-radius: 8px;         /* Bo góc nhẹ cho trạng thái hover */
}

/* 2. Hiệu ứng Hover Menu Cấp 1 (Nền sáng nhẹ + Gạch chân trượt) */
.main-navigation ul > li > a::before {
    content: '';
    position: absolute;
    bottom: 8px;                /* Cách đáy một chút */
    left: 50%;
    width: 0;
    height: 2px;                /* Đường kẻ thanh mảnh */
    background-color: #ffffff;  /* Màu trắng tinh khiết */
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    opacity: 0.8;
}

.main-navigation ul > li:hover > a,
.main-navigation ul > li.current-menu-item > a {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.15); /* Nền trắng mờ tinh tế */
    text-shadow: 0 0 10px rgba(255,255,255,0.3); /* Hiệu ứng phát sáng nhẹ */
}

/* 3. Mũi tên (Caret Down) cho mục có menu con */
.main-navigation .menu-item-has-children > a {
    padding-right: 28px;        /* Chừa chỗ cho mũi tên */
    position: relative;
}

.main-navigation .menu-item-has-children > a::after {
    content: '';
    border: solid currentColor; /* Mũi tên theo màu chữ */
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg) translateY(-50%);
    position: absolute;
    right: 10px;
    top: 45%;
    transition: transform 0.3s ease;
}

/* 4. Sub-menu (Menu Cấp 2 - Thả xuống) */
.main-navigation .sub-menu {
    position: absolute;
    top: 100%;                  /* Nằm ngay dưới menu cha */
    left: 0;
    min-width: 240px;           /* Rộng hơn chút để chứa tên dài */
    background-color: #ffffff;  /* Nền trắng */
    list-style: none;
    padding: 10px 0;            /* Padding trên dưới */
    margin: 0;
    border: 1px solid #f3f4f6;  /* Viền siêu nhạt */
    border-radius: 12px;        /* Bo góc mềm mại hơn */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); /* Bóng đổ sâu */
    z-index: 999;               /* Đảm bảo nằm trên các thành phần khác */
    
    /* Hiệu ứng Fade & Slide Up (Micro-interaction) */
    visibility: hidden;
    opacity: 0;
    transform: translateY(15px); /* Dịch xuống dưới 15px */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);    
    
    display: block; 
    width: 240px;
    margin-top: 10px; /* Tạo khoảng cách nhỏ với menu cha */
}

/* Hiển thị Sub-menu khi hover vào cha */
.main-navigation li:hover > .sub-menu,
.main-navigation li:focus-within > .sub-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    top: 100%; /* Trượt lên vị trí chuẩn */    
}

/* Ẩn gạch chân của menu cha đối với menu con */
.main-navigation .sub-menu li a::before { display: none; }

.main-navigation .sub-menu li:last-child a {
    border-bottom: none;
}

.main-navigation .sub-menu li a:hover {
    color: #15803d;             /* Chữ xanh đậm */
    background-color: #f0fdf4;  /* Nền xanh rất nhạt (Green 50) */
    transform: translateX(5px); /* Dịch chuyển sang phải 5px */
}

/* Style cho các mục trong Sub-menu */
.main-navigation .sub-menu li {
    display: block; /* Quan trọng: Ép xuống dòng */
    width: 100%;    /* Chiếm hết chiều rộng cha */
    margin: 0;      /* Reset margin */
}

.main-navigation .sub-menu li a {
    display: block;
    padding: 12px 20px;
    color: #374155;             /* Màu xám đậm (Slate 700) */
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    text-transform: none;       /* Chữ thường cho menu con */
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: transparent; /* Mặc định trong suốt */
}

/* =========================================
   PAGINATION STYLES (Phân trang)
   ========================================= */
.page-numbers {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    justify-content: center;
    align-items: center;
}

.page-numbers li a,
.page-numbers li span {
    display: block;
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem; /* rounded-md */
    text-decoration: none;
    color: #334155; /* slate-700 */
    font-weight: 500;
    transition: all 0.2s;
}

.page-numbers li a:hover,
.page-numbers li span.current {
    background-color: #15803d; /* Green 700 */
    color: white;
    border-color: #15803d;
}

/* =========================================
   VIDEO GALLERY STYLES
   ========================================= */

/* Custom Scrollbar cho Playlist Video */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #1e293b; /* Slate 800 */
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #475569; /* Slate 600 */
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #64748b; /* Slate 500 */
}

/* =========================================
   SINGLE POST ENHANCEMENTS
   ========================================= */

.author-box .author-description p {
    margin-bottom: 0.5rem; /* Giảm khoảng cách giữa các đoạn trong mô tả tác giả */
    font-size: 0.875rem; /* 14px */
    line-height: 1.6;
}

/* =========================================
   WIDGET: TRENDING NEWS (LEADERBOARD)
   ========================================= */

.trending-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* Khoảng cách giữa các bài */
    padding-top: 0.5rem;
}

.trending-item {
    position: relative; /* Để làm mốc cho số tuyệt đối */
    padding-left: 3.5rem; /* Đẩy nội dung sang phải để nhường chỗ cho số */
    min-height: 3rem;
    display: flex;
    align-items: center;
}

/* Số thứ tự to bản */
.trending-number {
    position: absolute;
    left: -5px;
    top: -12px; /* Đẩy lên trên một chút */
    font-size: 3.5rem; /* Số cực to */
    font-weight: 800;
    color: #f3f4f6; /* Màu xám rất nhạt (Slate 100) */
    line-height: 1;
    z-index: 0; /* Nằm dưới tiêu đề */
    font-family: var(--font-main);
    -webkit-text-stroke: 1px #e2e8f0; /* Viền nhẹ để số sắc nét hơn trên nền trắng */
    transition: all 0.3s ease;
}

/* Hiệu ứng khi hover vào bài viết: Số đổi màu xanh */
.trending-item:hover .trending-number {
    color: #dcfce7; /* Green 100 */
    -webkit-text-stroke: 1px #86efac; /* Green 300 */
}

.trending-content {
    position: relative;
    z-index: 1; /* Đè lên trên số */
}

.trending-title {
    margin: 0 0 0.25rem 0 !important; /* Reset margin mặc định của widget title */
    font-size: 1rem !important;
    line-height: 1.4 !important;
}

.trending-meta {
    font-size: 0.75rem;
    color: #94a3b8; /* Slate 400 */
}

/* =========================================
   MOBILE MENU STYLES (OVERHAUL - UI/UX)
   ========================================= */

@media (max-width: 991px) {
    /* 1. Overlay (Lớp phủ nền tối) */
    #mobile-menu-overlay {
        position: fixed;
        inset: 0; /* top:0, right:0, bottom:0, left:0 */
        background-color: rgba(0, 0, 0, 0.5); /* Đen mờ 50% */
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
        backdrop-filter: blur(2px); /* Làm mờ nhẹ background phía sau */
    }

    #mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* 2. Panel Menu (Trượt từ phải) */
    #mobile-menu-container {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 80%;
        max-width: 320px;
        background-color: #ffffff; /* Trắng muốt */
        z-index: 9999;
        transform: translateX(100%); /* Ẩn sang phải */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Easing mượt mà */
        box-shadow: -5px 0 25px rgba(0,0,0,0.15);
        display: flex;
        flex-direction: column;
        height: 100vh;
    }

    #mobile-menu-container.open {
        transform: translateX(0); /* Trượt vào */
    }

    /* 3. Header Menu (Tiêu đề & Nút đóng) */
    .mobile-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20px;
        border-bottom: 1px solid #e2e8f0;
        background-color: #f8fafc;
    }

    .mobile-menu-title {
        font-size: 18px;
        font-weight: 800;
        color: #1e293b;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    #mobile-menu-close {
        background: none;
        border: none;
        cursor: pointer;
        padding: 5px;
        color: #64748b;
        transition: color 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #mobile-menu-close:hover {
        color: #ef4444; /* Đỏ khi hover */
    }

    #mobile-menu-close svg {
        width: 28px; /* Icon to rõ */
        height: 28px;
    }

    /* 4. Danh sách Menu (List) */
    .mobile-menu-body {
        flex: 1;
        overflow-y: auto; /* Cuộn dọc nếu menu dài */
        padding: 0;
    }

    #mobile-primary-menu {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    /* FIX: Đảm bảo mọi cấp li đều là điểm neo cho nút mũi tên absolute */
    #mobile-primary-menu li {
        position: relative;
    }

    #mobile-primary-menu > li {
        border-bottom: 1px solid #e5e7eb; /* Đường kẻ mỏng */
    }

    #mobile-primary-menu > li > a {
        display: block;
        padding: 16px 20px; /* Padding thoáng */
        font-size: 16px;    /* Chữ to dễ đọc */
        font-weight: 600;
        color: #334155;
        text-decoration: none;
        line-height: 1.5;
        transition: color 0.2s;
    }

    #mobile-primary-menu > li > a:hover {
        color: #15803d;
    }

    /* 5. Accordion Sub-menu (Menu con) */
    /* Nút mũi tên (Chevron) */
    .mobile-submenu-toggle {
        position: absolute;
        top: 0;
        right: 0;
        width: 50px; /* Vùng bấm rộng */
        height: 100%; /* Luôn bằng chiều cao của thẻ li cha, áp dụng cho mọi cấp */
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #94a3b8;
        transition: transform 0.3s ease, color 0.2s;
        z-index: 10;
    }

    .mobile-submenu-toggle:hover {
        color: #15803d;
    }

    /* Xoay mũi tên khi mở */
    #mobile-primary-menu .menu-item-has-children.submenu-active > .mobile-submenu-toggle {
        transform: rotate(180deg);
        color: #15803d;
    }

    /* Menu con ẩn mặc định */
    #mobile-primary-menu .sub-menu {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out; /* Hiệu ứng trượt */
        background-color: #f8fafc; /* Nền xám rất nhạt */
        list-style: none;
        padding: 0;
        margin: 0;
    }

    /* Menu con khi mở */
    #mobile-primary-menu .menu-item-has-children.submenu-active > .sub-menu {
        max-height: 1000px; /* Đủ lớn để hiện hết nội dung */
        border-top: 1px solid #f1f5f9;
    }

    /* Item trong menu con */
    #mobile-primary-menu .sub-menu li a {
        padding: 12px 20px 12px 35px; /* Thụt lề trái */
        font-size: 15px;
        color: #475569;
        border-bottom: 1px dashed #e2e8f0;
        display: block;
    }
    
    #mobile-primary-menu .sub-menu li:last-child a {
        border-bottom: none;
    }

    #mobile-primary-menu .sub-menu li a:hover {
        color: #15803d;
        background-color: #f1f5f9;
    }
}

/* =========================================
   FIX: ẨN MOBILE MENU TRÊN DESKTOP (Desktop Hide)
   ========================================= */
@media (min-width: 992px) {
    #mobile-menu-container,
    #mobile-menu-overlay {
        display: none !important;
    }
}

/* =========================================
   MAGAZINE BLOCK STYLES (FRONT PAGE)
   ========================================= */

/* Đảm bảo ảnh thumbnail luôn giữ tỷ lệ và không bị méo */
.magazine-category-block img,
.video-item img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* Tạo khoảng nghỉ mắt (Breathing room) giữa các khối chuyên mục */
.magazine-category-block {
    margin-bottom: 3rem; /* ~48px */
}

/* Hiệu ứng hover nhẹ cho nút Play video */
.video-item:hover .bg-white\/90 {
    background-color: #15803d; /* Green 700 */
    color: #ffffff;
}

/* =========================================
   NEWS FEED LAYOUT (FRONT PAGE)
   ========================================= */

/* 1. Featured Card (Overlay Style) */
.featured-card-img-wrapper {
    aspect-ratio: 16 / 9;
}

/* 2. Standard Card (Classic Blog Style) */
.standard-card-img-wrapper {
    aspect-ratio: 16 / 9;
}

/* Helper class để giới hạn số dòng của text */
.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* =========================================
   MODERN PAGINATION STYLES
   ========================================= */

/* Ghi đè và tinh chỉnh style phân trang đã có */
.pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem; /* 8px */
}

.page-numbers {
    display: inline-flex; /* Thay đổi từ flex để tương thích với wrapper */
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 1px solid #e2e8f0; /* slate-200 */
    border-radius: 0.5rem; /* 8px */
    min-width: 2.5rem; /* 40px */
    height: 2.5rem; /* 40px */
    padding: 0.25rem 0.75rem;
    font-weight: 600;
    color: #334155; /* slate-700 */
    transition: all 0.2s ease-in-out;
}

.page-numbers:hover {
    background-color: #f1f5f9; /* slate-100 */
    border-color: #cbd5e1; /* slate-300 */
    color: #1e293b; /* slate-800 */
}

.page-numbers.current {
    background-color: #15803d; /* Green-700 */
    color: #ffffff;
    border-color: #15803d;
    cursor: default;
}

.page-numbers.dots {
    border: none;
    background: none;
}

/* =========================================
   FIX: SINGLE POST LAYOUT & ALIGNMENT (HARD RESET)
   ========================================= */

/* 1. Reset Khu vực Nội dung (.entry-content) */
.entry-content {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    text-align: left !important;
    display: block !important; /* Ngăn chặn hành vi flex item co giãn sai */
    flex: 1 1 auto !important; /* Ép bung hết khổ trong flex container */
}

/* 2. Xử lý Container bọc ngoài (Flex Wrapper) */
/* Đảm bảo container không căn giữa nội dung theo trục dọc/ngang */
.single .flex.flex-col.xl\:flex-row {
    align-items: flex-start !important;
    justify-content: flex-start !important;
}

/* 3. Fix Hộp Tác giả (Author Box) */
.author-box,
.author-box-wrapper {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
    display: flex !important; /* Giữ layout flex bên trong hộp tác giả */
}

/* 4. Fix Hình ảnh, Iframe, PDF Embedder */
.entry-content img,
.entry-content iframe,
.entry-content video,
.entry-content object,
.entry-content embed,
.pdfemb-viewer {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 20px 0 !important; /* Căn lề trên dưới chuẩn */
}

/* 5. (QUAN TRỌNG) Ẩn cột Mục lục rỗng bên trái nếu nó gây ra khoảng trắng */
/* Class này tương ứng với div w-64 trong single.php */
.single .hidden.xl\:block.w-64.flex-shrink-0 {
    display: none !important;
}

/* =========================================
   AUTO TABLE OF CONTENTS (TOC) STYLES
   ========================================= */

/* Highlight mục đang xem */
.toc-link.active {
    color: #15803d; /* Green 700 */
    font-weight: 700;
    position: relative;
}

/* Text dọc cho nút nổi */
.writing-mode-vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* Smooth Scroll cho toàn trang */
html {
    scroll-behavior: smooth;
}

/* =========================================
   RELATED POSTS STYLING (In-Content & Bottom)
   ========================================= */

/* ... existing code ... */

/* Các khối CSS cũ cho mobile menu đã được xóa và thay thế bằng khối @media (max-width: 991px) ở trên. */

/* =========================================
   FIX FOOTER BRANDING & LAYOUT (Cột 1)
   ========================================= */

/* 1. Container Branding (Logo + Tên) */
.footer-branding {
    display: flex !important;
    align-items: center !important; /* Canh giữa theo chiều dọc */
    gap: 15px !important;           /* Khoảng cách giữa Logo và Tên */
    margin-bottom: 20px !important; /* Đẩy phần liên hệ xuống dưới */
    position: relative;
}

/* 2. Xử lý Logo */
.footer-logo-wrap {
    flex-shrink: 0; /* Không cho logo bị co lại */
    background: transparent !important; /* Xóa nền trắng cũ nếu có */
    padding: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.footer-logo-wrap img {
    max-width: 65px !important;     /* Giới hạn chiều rộng */
    height: auto !important;        /* Chiều cao tự động */
    object-fit: contain !important; /* Giữ tỷ lệ ảnh */
    display: block;
}

/* 3. Xử lý Tên Bệnh Viện */
.footer-agency-name {
    background: transparent !important; /* Tuyệt đối xóa nền */
    color: #fde047 !important;          /* Màu vàng nhạt nổi bật (Yellow-300) */
    font-size: 13px !important;         /* Kích thước chữ chuẩn */
    font-weight: 700 !important;        /* In đậm */
    text-transform: uppercase !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    padding: 0 !important;
    letter-spacing: 0.5px;
}

/* 4. Xử lý Thông tin liên hệ */
.footer-contact-info {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Khoảng cách giữa các dòng liên hệ */
}

.footer-contact-info .contact-item {
    display: flex !important;
    align-items: flex-start !important; /* Canh icon theo dòng đầu tiên của text */
    gap: 12px !important;
    color: #ffffff !important;
    font-size: 14px !important;
    line-height: 1.8 !important; /* Giãn dòng thoáng */
    margin: 0 !important;
}

.footer-contact-info .contact-item svg {
    margin-top: 5px; /* Chỉnh icon xuống một chút cho cân với dòng text */
    flex-shrink: 0;
    color: #fde047; /* Icon màu vàng */
}

/* =========================================
   SIDEBAR SMART LINK CARDS (UI/UX)
   ========================================= */

/* Container chung */
.sidebar-smart-links {
    display: flex;
    flex-direction: column;
    gap: 12px; /* Khoảng cách giữa các thẻ */
}

/* =========================================
   SMART SIDEBAR CARD (UI/UX REDESIGN)
   ========================================= */

/* 1. Thẻ Card Liên kết (Container chính) */
.smart-sidebar-card {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid #e2e8f0; /* Slate 200 - Viền xám nhạt */
    border-radius: 8px;        /* Bo góc mềm mại */
    padding: 12px;             /* Padding thoáng hơn */
    text-decoration: none !important; /* Bỏ gạch chân mặc định */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Chuyển động mượt */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); /* Đổ bóng tĩnh */
    position: relative;
    overflow: hidden;
    gap: 12px; /* Khoảng cách giữa các phần tử con */
}

/* Hiệu ứng Hover (Tương tác) */
.smart-sidebar-card:hover {
    transform: translateY(-2px); /* Nhô lên nhẹ */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* Bóng đổ sâu hơn */
    border-color: #16a34a; /* Green 600 - Viền xanh đậm khi hover */
    background-color: #ffffff; /* Giữ nền trắng cho sạch */
}

/* 2. Khung chứa Logo/Icon (.card-icon) */
.card-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0; /* Không bị co lại */
    border-radius: 6px;
    background-color: #f0fdf4; /* Green 50 - Nền xanh siêu nhạt */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #15803d; /* Green 700 - Màu icon mặc định */
    transition: all 0.3s ease;
}

/* Khi hover vào card, icon đậm màu hơn */
.smart-sidebar-card:hover .card-icon {
    background-color: #dcfce7; /* Green 100 */
    color: #166534; /* Green 800 */
}

/* 3. Tiêu đề liên kết (.card-text) */
.card-text {
    flex-grow: 1;
    font-family: var(--font-main);
    font-size: 15px; /* Chữ to hơn xíu cho dễ đọc */
    font-weight: 600;
    color: #334155; /* Slate 700 */
    line-height: 1.3;
}

.smart-sidebar-card:hover .card-text {
    color: #16a34a; /* Green 600 - Đổi màu chữ khi hover */
}

/* 4. Mũi tên điều hướng (.card-arrow) */
.card-arrow {
    font-size: 18px;
    font-weight: 400;
    color: #cbd5e1; /* Slate 300 - Xám nhạt */
    transition: transform 0.3s ease, color 0.2s;
    line-height: 1;
}

.smart-sidebar-card:hover .card-arrow {
    color: #16a34a; /* Đổi màu xanh */
    transform: translateX(3px); /* Trượt nhẹ sang phải */
}

/* =========================================
   FIX CHO DYNAMIC MENU (UL/LI RESET)
   ========================================= */
/* Reset style mặc định của thẻ UL/LI trong Sidebar Smart Links */
.sidebar-smart-links ul.smart-menu-ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 12px; /* Khoảng cách giữa các thẻ */
}

.sidebar-smart-links ul.smart-menu-ul li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Đảm bảo thẻ A chiếm hết chiều rộng của thẻ LI */
.sidebar-smart-links ul.smart-menu-ul li a.smart-sidebar-card {
    width: 100%;
}

/* =========================================
   13. INTERACTIVE BODY MAP (Tranh Đồng Nhân)
   ========================================= */
   
/* --- TCM Body Map Styles --- */
.body-map-wrapper {
    position: relative;
    width: 100%;
    max-width: 200px; /* Thu nhỏ còn 2/3 (200px) */
    margin: 0 auto;
    font-family: 'Be Vietnam Pro', sans-serif;
    user-select: none;
}

/* SVG Styles */
.tcm-body-svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.05));
}

.body-part {
    fill: #f1f5f9; /* Slate-100 */
    stroke: #94a3b8; /* Slate-400 */
    stroke-width: 1.5;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Hover Effect */
.body-part:hover,
.body-part.active {
    fill: #bbf7d0; /* Green-200 */
    stroke: #15803d; /* Green-700 */
    filter: drop-shadow(0 0 8px rgba(21, 128, 61, 0.4));
}

/* Tooltip Styles */
.tcm-tooltip {
    position: fixed; /* Fixed để đi theo chuột mượt hơn */
    background-color: #0f172a; /* Slate-900 */
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none; /* Không chặn chuột */
    opacity: 0;
    transform: translate(-50%, -150%); /* Căn giữa phía trên chuột */
    transition: opacity 0.2s;
    z-index: 1000;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.tcm-tooltip.visible {
    opacity: 1;
}

/* Popup Card Styles */
.tcm-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    z-index: 1001;
    padding: 20px;
    animation: popupFadeIn 0.3s ease-out;
}

.tcm-popup.hidden {
    display: none;
}

@keyframes popupFadeIn {
    from { opacity: 0; transform: translate(-50%, -40%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

/* Close Button */
.tcm-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.tcm-popup-close:hover {
    color: #ef4444; /* Red-500 */
}

/* Popup Content Typography */
.tcm-popup-title {
    font-size: 18px;
    font-weight: 700;
    color: #15803d; /* Green-700 */
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0fdf4;
}

.tcm-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-top: 12px;
    margin-bottom: 6px;
}
.tcm-text {
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 8px;
}

/* Links List */
.tcm-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.tcm-link-list li {
    margin-bottom: 6px;
}
.tcm-link-list a {
    color: #2563eb; /* Blue-600 */
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tcm-link-list a:hover {
    text-decoration: underline;
}

/* Disclaimer Box (Scenario A) */
.tcm-disclaimer {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #cbd5e1;
    font-size: 11px;
    color: #64748b;
    font-style: italic;
}

/* Medical Advice Box (Scenario B - Yellow) */
.tcm-advice-box {
    background-color: #fefce8; /* Yellow-50 */
    border-left: 4px solid #eab308; /* Yellow-500 */
    padding: 12px;
    margin-top: 15px;
    border-radius: 4px;
}
.tcm-advice-text {
    font-size: 13px;
    color: #854d0e; /* Yellow-900 */
    line-height: 1.4;
    font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .tcm-popup {
        width: 90%;
        position: fixed; /* Fixed trên mobile để không bị trôi */
    }
}

/* =========================================
   HOSPITAL SLIDER STYLES (CUSTOM)
   ========================================= */

/* Nút điều hướng Slider */
.slider-btn {
    font-size: 3rem;
    line-height: 1;
    cursor: pointer;
    border: none;
    padding-bottom: 8px; /* Căn chỉnh mũi tên */
}

/* Dấu chấm phân trang */
.slider-dots .dot.active {
    background-color: #ffffff;
    transform: scale(1.25);
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}

/* =========================================
   MODERN FOOTER STYLES (3-COLUMN GRID)
   ========================================= */

/* 1. Grid Layout Setup */
.footer-grid-layout {
    display: grid;
    grid-template-columns: 1fr; /* Mobile: 1 cột */
    gap: 40px;
}

@media (min-width: 1024px) {
    .footer-grid-layout {
        grid-template-columns: 1.2fr 0.8fr 1fr; /* Desktop: 3 cột (Cột 1 rộng hơn chút) */
        align-items: start;
    }
}

/* 2. Column 1: Branding & Contact */
.footer-agency-name {
    text-shadow: 0 1px 2px rgba(0,0,0,0.3); /* Bóng chữ nhẹ để nổi trên nền xanh */
}

.footer-contact-list .contact-item {
    line-height: 1.8; /* Giãn dòng dễ đọc */
    transition: transform 0.2s ease;
}

.footer-contact-list .contact-item:hover {
    transform: translateX(5px); /* Hiệu ứng trượt nhẹ khi hover vào dòng liên hệ */
}

/* 3. Column 2: Social Buttons (Micro-interactions) */
.social-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%; /* Hình tròn hoàn hảo */
    background-color: rgba(255, 255, 255, 0.1); /* Trắng mờ */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Hiệu ứng nảy (bouncy) */
    border: 1px solid rgba(255,255,255,0.1);
}

/* Tăng kích thước icon bên trong cho cân đối */
.social-btn svg {
    width: 30px;
    height: 30px;
}

/* Tăng kích thước chữ Zalo */
.social-btn span {
    font-size: 14px;
}

/* Hover Effects */
.social-btn:hover {
    transform: translateY(-5px) scale(1.1); /* Bay lên và phóng to nhẹ */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3); /* Đổ bóng dưới */
    border-color: transparent;
}

/* Brand Colors on Hover */
.social-btn.fb-btn:hover {
    background-color: #1877F2; /* Facebook Blue */
}

.social-btn.yt-btn:hover {
    background-color: #FF0000; /* YouTube Red */
}

.social-btn.zalo-btn:hover {
    background-color: #0068FF; /* Zalo Blue */
}

/* 4. Column 3: Map Card */
.map-card-wrapper {
    border-radius: 12px; /* Bo góc hiện đại */
    overflow: hidden;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3); /* Đổ bóng nổi khối (Floating) */
    border: 2px solid rgba(255, 255, 255, 0.1); /* Viền mờ sang trọng */
    transition: transform 0.3s ease;
    background-color: #e5e7eb; /* Nền xám giữ chỗ khi map chưa load */
}

.map-card-wrapper:hover {
    transform: translateY(-3px); /* Hiệu ứng nổi lên khi hover vào bản đồ */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

/* =========================================
   WIDGET: DOCUMENT LIST (MINIMALIST)
   ========================================= */

/* YÊU CẦU 2: Container giới hạn chiều cao */
.ticker-wrapper {
    height: 250px; /* Đủ hiển thị khoảng 5 bài */
    overflow: hidden;
    position: relative;
}

.hospital-doc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hospital-doc-list li {
    border-bottom: 1px dashed #e5e7eb; /* Đường kẻ mỏng nét đứt */
    padding: 12px 0;
}

.hospital-doc-list li:last-child {
    border-bottom: none;
}

.hospital-doc-list a {
    display: flex;
    align-items: flex-start; /* Căn trên cùng để xử lý tiêu đề dài */
    gap: 12px;
    text-decoration: none;
    
}

/* YÊU CẦU 1: Ô vuông Số thứ tự (Màu đỏ) */
.doc-number-box {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background-color: #fee2e2; /* Red-100 */
    color: #dc2626;            /* Red-600 */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #fecaca; /* Red-200 */
    transition: all 0.3s ease;
}

.doc-num {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-main);
}

/* Tiêu đề bài viết */
.doc-title {
    flex-grow: 1;
    font-size: 14px;
    color: #374151; /* Slate-700 */
    line-height: 1.5;
    font-weight: 500;
    transition: all 0.2s ease;
    /* Cắt chữ nếu quá 2 dòng */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Hover Effect */
.hospital-doc-list a:hover .doc-title {
    color: #15803d; /* Green-700 */
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.hospital-doc-list a:hover .doc-number-box {
    background-color: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
}

/* YÊU CẦU 3: Hiệu ứng Trượt dọc (Vertical Ticker) */
.vertical-scroll-animation {
    /* Thời gian chạy hết 1 vòng lặp (10 bài) là 20s */
    animation: verticalScroll 20s linear infinite;
}

.vertical-scroll-animation:hover {
    animation-play-state: paused; /* Dừng khi hover */
}

@keyframes verticalScroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); } /* Dịch chuyển 50% vì đã nhân đôi danh sách */
}

/* =========================================
   WIDGET: SIDEBAR BANNER LINKS (IMAGE LIST)
   ========================================= */

.sidebar-banner-links {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Xóa khoảng cách để các banner liền nhau (hoặc để 10px nếu muốn tách rời) */
    padding: 0 !important; /* QUAN TRỌNG: Xóa padding để ảnh tràn viền widget */
}

.sidebar-banner-links a {
    display: block;
    text-decoration: none;
    transition: all 0.3s ease;
    width: 100%; /* Đảm bảo thẻ a chiếm hết chiều rộng */
}

.sidebar-banner-links a img {}
.sidebar-banner-links img { /* Áp dụng cho cả trường hợp không có thẻ a */
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0; /* Bỏ bo góc để ảnh vuông vức với khung widget */
    transition: all 0.3s ease;
}

/* Hiệu ứng Hover (Micro-interaction) */
.sidebar-banner-links a:hover {
    opacity: 0.9; /* Làm mờ nhẹ khi hover thay vì đẩy lên */
}

.sidebar-banner-links a:hover img {
    filter: brightness(1.05);
}

/* Trang trí Tiêu đề Widget (Vuông xanh chuẩn nhà nước) */
.widget-title {
    display: flex;
    align-items: center;
}

.widget-title::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: #2563eb; /* Blue-600 */
    margin-right: 10px;
    border-radius: 2px; /* Bo nhẹ */
    flex-shrink: 0;
}

/* =========================================
   HEADER REDESIGN (SLOGAN & SEARCH)
   ========================================= */

/* 2. Header Main Search Input Placeholder */
.header-main-search-form input::placeholder {
    font-weight: 400;
    opacity: 0.7;
}

/* Hiệu ứng focus cho ô tìm kiếm chính */
.header-main-search-form:focus-within {
    transform: translateY(-1px); /* Nhô nhẹ lên khi gõ */
}