/*
Theme Name: Sắc Màu Bootstrap Theme
Theme URI: https://dulichsacmaubinhduong.com
Author: Tống Nhật Trường
Author URI: https://dulichsacmaubinhduong.com
Description: Một theme WordPress tùy chỉnh được xây dựng với Bootstrap 5.
Version: 1.7.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: bootstrap, responsive-layout, two-columns, right-sidebar, custom-menu, featured-images, translation-ready
Text Domain: mybootstraptheme

Đây là nơi bạn sẽ thêm các CSS tùy chỉnh của mình sau này.
*/

/* === HEADER STYLES - CODE CỨNG === */
.site-header .header-area.header-top_bar {
    background-color: #0d6efd;
    color: #ffffff;
}

.site-header .header-area.header-top_bar a {
    color: #ffffff;
}

.site-header .header-area.header-top_bar a:hover {
    color: #e0e0e0;
}

.site-header .header-area.header-main {
    background-color: #0d6efd;
    color: #ffffff;
}

.site-header .header-area.header-main a {
    color: #ffffff;
}

.site-header .header-area.header-main a:hover {
    color: #e0e0e0;
}

.site-header .header-area.header-bottom {
    background-color: #0d6efd;
    color: #ffffff;
}

.site-header .header-area.header-bottom a {
    color: #ffffff;
}

.site-header .header-area.header-bottom a:hover {
    color: #e0e0e0;
}

.image-grid-item {
    position: relative;
    display: block;
    overflow: hidden;
}

.img-zoom-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.image-grid-item:hover .img-zoom-overlay {
    opacity: 1;
}

/* Bo góc cho overlay khớp với ảnh */
.image-grid-item img.rounded-start+.img-zoom-overlay {
    border-top-left-radius: var(--bs-border-radius);
    border-bottom-left-radius: var(--bs-border-radius);
}

.image-grid-item img.rounded-top-right+.img-zoom-overlay {
    border-top-right-radius: var(--bs-border-radius);
}

.image-grid-item img.rounded-bottom-right+.img-zoom-overlay {
    border-bottom-right-radius: var(--bs-border-radius);
}

.breadcrumb {
    gap: 0.6rem;
    margin: 0
}

.breadcrumb-item a {
    color: #727171 !important
}

.breadcrumb-item.active {
    color: #2196F3 !important;
    font-weight: 500
}

.contact-card {
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: 0.4s ease;
    position: relative;
}

.title.style {
    background-image: linear-gradient(to right, #2196f300, rgb(33 150 243 / 26%));
    background-size: 200% 100%;
    animation: titleFlash 3s linear infinite;
}

@keyframes titleFlash {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: -100% 50%;
    }
}

.contact-card {
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: 0.4s ease;
    position: relative;
}

.entry-content h3 {
    position: relative;
    padding: 18px 25px;
    margin-bottom: 10px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.03);
    line-height: 1.3;
    overflow: hidden;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.entry-content h3:not(.has-text-color) {
    color: #212529;
}

.entry-content h3:not(.has-background-color) {
    background-color: #ffffff;
}

.entry-content .title-h3::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 12px;
    height: 100%;
    background: linear-gradient(180deg, #007bff 0%, #00c6ff 100%);
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.entry-content h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, rgba(0, 123, 255, 0.7) 0%, rgba(0, 198, 255, 0) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease-out;
}

.entry-content h3:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.entry-content h3:hover::after {
    transform: scaleX(1);
}

.contact-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0.2) 100%);
    transform: skewX(-25deg);
    transition: 0.75s;
}

.contact-card:hover::before {
    left: 130%;
}

.contact-card img {
    border-radius: 50%;
    background: white;
    padding: 8px;
}

.footer-widget-title {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem !important;
    position: relative;
    display: inline-block;
}

.footer-widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 50px;
    height: 3px;
    background-color: #00aeff;
}

.footer-main-area {
    min-height: 410px;
    background-color: #212529;
    color: #ffffff;
    position: relative;
    padding-top: 75px;
    /* Thêm padding để nội dung không bị che */
}


/*Mục lục*/

#toc-box {
    background-color: #d9eafc;
    border: 1px solid #1b71c7;
    border-radius: 5px;
}

#toc-box span {
    font-weight: bold;
    /* Make the heading bold */
    font-size: 1.1em;
    /* Slightly larger font size */
    color: #343a40;
    /* Darker text color */
    display: block;
    /* Make it a block to take full width */
    margin-bottom: 10px;
    /* Space below the heading */
}

#toc-list {
    list-style: none;
    /* Remove bullet points */
    padding: 0;
    /* Remove default padding */
    margin: 0;
    /* Remove default margin */
}

#toc-list li {
    margin-bottom: 8px;
    /* Space between list items */
}

#toc-list li:last-child {
    margin-bottom: 0;
    /* No bottom margin for the last item */
}

/*Sidebar*/
/* ==========================================================================
   Sidebar Widget Styling
   ========================================================================== */

/* Style chung cho các widget trong sidebar */
.widget-area .widget {
    /* Các class bg-light, rounded-3, shadow-sm từ Bootstrap đã xử lý nền và bóng đổ */
    transition: all 0.3s ease-in-out;
}

/* Tiêu đề widget */
.widget-area .widget-title {
    color: #343a40;
    /* Màu chữ đậm hơn cho tiêu đề */
    position: relative;
    padding-bottom: 0.75rem;
    /* Tăng padding dưới cho đường kẻ */
}

/* Tạo đường gạch chân trang trí cho tiêu đề */
.widget-area .widget-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    /* Nằm ngay trên đường border-bottom */
    left: 0;
    width: 50px;
    /* Độ dài của đường gạch */
    height: 3px;
    background-color: var(--bs-primary);
    /* Dùng màu primary của Bootstrap */
}

/* Danh sách trong widget (bài viết mới, chuyên mục) */
.widget-area .widget ul {
    margin-bottom: 0;
}

/* Item trong danh sách bài viết mới */
.widget_recent_entries ul li {
    border-bottom: 1px dashed #dee2e6;
    /* Đường phân cách nét đứt */
}

.widget_recent_entries ul li:last-child {
    border-bottom: none;
    /* Bỏ đường kẻ ở item cuối */
    padding-bottom: 0;
}

.widget_recent_entries ul li a:hover .widget-post-title {
    color: var(--bs-primary);
    /* Đổi màu tiêu đề khi hover */
}

.widget_recent_entries .widget-post-title {
    font-weight: 500;
    transition: color 0.2s ease;
}

/* Danh sách chuyên mục */
.widget_categories .category-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #dee2e6;
}

.widget_categories .category-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.widget_categories .category-list li a {
    text-decoration: none;
    color: #495057;
    font-weight: 500;
}

.widget_categories .category-list li a:hover {
    color: var(--bs-primary);
}

/* Số lượng bài viết trong chuyên mục */
.widget_categories .category-list li .count {
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10rem;
}

/* Form tìm kiếm trong widget */
.widget_search .search-form {
    display: flex;
}

.widget_search .search-form .search-submit {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.widget_search .search-form .search-field {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 0;
}

.widget_search .search-form .search-field:focus {
    z-index: 2;
    /* Đảm bảo viền focus không bị nút che mất */
}

/*End sidebar*/
/* ==========================================================================
   MEGA MENU STYLES - DESKTOP (>= 992px)
   ========================================================================== */
@media (min-width: 992px) {

    /* --- 1. Style cho Dropdown THÔNG THƯỜNG --- */
    .navbar-nav>.menu-item:not(.mega-menu)>.dropdown-menu {
        position: absolute;
        display: block;
        top: 100%;
        left: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.25s ease-out;
        min-width: 220px;
        border-radius: var(--bs-border-radius);
        border: 1px solid var(--bs-border-color-translucent);
        box-shadow: var(--bs-box-shadow-sm);
        padding: 0.5rem 0;
    }

    .navbar-nav>.menu-item.dropdown:not(.mega-menu):hover>.dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* --- 2. Style cho MEGA MENU --- */
    .navbar-nav>.menu-item.mega-menu>.mega-menu-content.dropdown-menu {
        position: absolute;
        display: block;
        top: 100%;
        left: 50%;
        width: 60vw;
        max-width: 1000px;
        padding: 1rem;
        border-radius: var(--bs-border-radius);
        border: 1px solid var(--bs-border-color-translucent);
        box-shadow: var(--bs-box-shadow);
        opacity: 0;
        visibility: hidden;
        transform: translateX(-50%) translateY(10px);
        transition: all 0.25s ease-out;
    }

    .navbar-nav>.menu-item.mega-menu:hover>.mega-menu-content.dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    /* ẨN submenu ul thường nếu là mega menu */
    .navbar-nav>.menu-item.mega-menu>ul.dropdown-menu {
        display: none !important;
    }
}

.mega-menu-content a:not(.wp-block-button__link) {
    color: inherit;
    transition: color 0.2s ease;
}

.mega-menu-content a:not(.wp-block-button__link):hover {
    color: var(--bs-primary);
}

/* Fix Admin Bar trên mobile - thanh đè lên header, không đẩy xuống */
@media screen and (max-width: 782px) {
    html {
        margin-top: 0 !important;
    }

    #wpadminbar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 99999 !important;
    }
}

/* --- Fix Gutenberg Cover Block (Banner) --- */
.wp-block-cover, .wp-block-cover-image {
    position: relative;
    background-color: #000;
    min-height: 400px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wp-block-cover__image-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.wp-block-cover__background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    opacity: 0.5;
}

.wp-block-cover__inner-container {
    position: relative;
    z-index: 2;
    color: #fff !important;
    width: 100%;
}

.wp-block-cover h1, .wp-block-cover h2, .wp-block-cover p {
    color: #fff !important;
}

/* === PAGE TRANSITION STYLES === */
.page-transition-overlay {
    position: absolute; /* Thay vì fixed để chỉ nằm trong #content */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100; 
    opacity: 0;
    pointer-events: none;
    border-radius: inherit;
}

body.is-transitioning .page-transition-overlay {
    pointer-events: auto;
}

/* Đảm bảo Header và Footer luôn tách biệt hoàn toàn */
#masthead, .site-header, #colophon, .site-footer {
    position: relative;
    z-index: 1000 !important;
    background: #fff;
}

/* Container chứa nội dung chính */
#content {
    position: relative; /* Bắt buộc để overlay absolute hoạt động đúng */
    min-height: 200px;
    transform-style: preserve-3d; /* Hỗ trợ hiệu ứng 3D */
    backface-visibility: hidden;
}

#page {
    perspective: 1500px; /* Độ sâu cho hiệu ứng lật trang */
}

/* Spinner Animation */
.sacmau-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(13, 110, 253, 0.2);
    border-top: 3px solid #0d6efd;
    border-radius: 50%;
    animation: sacmau-spin 0.8s linear infinite;
}

@keyframes sacmau-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hạn chế chớp trang khi dùng AJAX */
#content {
    transition: filter 0.3s ease;
}
