/* Original Page Title & Breadcrumb styling - PREMIUM COMPACT VERSION */

/* Sticky Header Compensation */
body.sticky-header #sp-header {
    margin-bottom: 0px !important;
}

body.sticky-header #sp-main-body {
    padding-top: 0px !important;
    /* Clears the header if no title row */
}

.home-menu.sticky-header #sp-main-body {
    padding-top: 60px !important;
    /* Slightly smaller compensation for home if user wanted it */
}

/* Base compensation applied only to the wrapper sections */
body.sticky-header .sp-title-wrapper {
    padding-top: 80px !important;
    /* Clears the header inside the grey background */
}

@media (max-width: 991px) {

    body.sticky-header .sp-title-wrapper,
    body.sticky-header #sp-main-body {
        padding-top: 60px !important;
        /* Smaller header on mobile */
    }
}

/* 1. Unified Background - Full Width */
.sp-title-wrapper {
    background: #838383 !important;
    /* Premium Dark Grey background */
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    display: none !important;
    /* Shown via inline style in title.php */
}

/* 2. Compact inner block */
.sp-page-title {
    background: transparent !important;
    padding: 20px 0 !important;
    /* Compact padding */
    margin: 0 !important;
    text-align: left;
}

/* 3. Hide on home page / specific itemids */
.home-menu .sp-title-wrapper,
.itemid-101 .sp-title-wrapper,
.itemid-227 .sp-title-wrapper,
.itemid-274 .sp-title-wrapper {
    display: none !important;
}

/* Because title.php injects 0px padding, we must RESTORE the padding here 
   since we just hid the title wrapper! */
.home-menu.sticky-header #sp-main-body,
.itemid-101.sticky-header #sp-main-body,
.itemid-227.sticky-header #sp-main-body,
.itemid-274.sticky-header #sp-main-body {
    padding-top: 0px !important;
}

/* Hide if empty to avoid gaps */
.sp-title-wrapper:empty {
    display: none !important;
}

/* 4. Text and Breadcrumb styling */
.sp-page-title-heading {
    color: #ffffff !important;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 5px 0 !important;
    line-height: 1.2;
}

/* Breadcrumbs inside Page Title */
.sp-page-title .mod-breadcrumbs {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

.sp-page-title .mod-breadcrumbs li {
    color: #cccccc !important;
    font-size: 13px;
    display: inline-block;
}

.sp-page-title .mod-breadcrumbs li a {
    color: #dddddd !important;
    text-decoration: none;
}

.sp-page-title .mod-breadcrumbs li a:hover {
    color: #ffffff !important;
    text-decoration: underline;
}

.sp-page-title .mod-breadcrumbs li.active {
    color: #ffffff !important;
}

/* Fix generic row/column padding that might create gaps */
#sp-title-row .sp-column {
    padding: 0 !important;
    margin: 0 !important;
}

/* Floating article image left */
.article-details .article-full-image {
    width: 320px;
    float: left;
    margin: 0 20px 15px 0 !important;
}

.article-details .article-full-image img {
    width: 100%;
    height: auto;
}

@media (max-width: 576px) {
    .article-details .article-full-image {
        width: 100%;
        float: none;
        margin: 0 0 15px 0 !important;
    }
}

/* Z-Index for modals/lightboxes above sticky header */
.mfp-wrap,
.mfp-bg,
.sigProContainer,
.sigProModal,
.sp-modal-container,
.sp-lightbox,
.modal,
.modal-backdrop,
.sppBLightboxParent {
    z-index: 999999 !important;
}

#sppb-addon-1656662050768 #sp-slider-141.nivoSlider img {
    opacity: 1 !important;
}

/* Make sure the text in columns takes full width and isn't squished */
.article-list .article-body,
.blog-items .article-body {
    width: 100% !important;
    float: none !important;
    clear: both;
}

/* Fix leaking floats in blog list */
.article-list .article,
.blog-items .article {
    display: flow-root;
    clear: both;
}

@media (max-width: 768px) {

    #sp-user1 .mod-languages {
        width: auto !important;
    }

    .mod-languages .lang-block {
        display: flex;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .mod-languages .lang-block li {
        white-space: nowrap;
    }

    .menu-sticky {
        top: 50px !important;
    }

}

/* Fix Carousel Height on Mobile - Dynamic version */
@media (max-width: 767px) {

    #sppb-addon-1656662050768 .sppb-carousel-inner,
    #sppb-addon-1656662050768 .sppb-item {
        height: auto !important;
        min-height: 1px !important;
        overflow: visible !important;
        position: relative !important;
    }

    /* Ép ảnh nền chạy theo chiều cao nội dung chữ */
    #sppb-addon-1656662050768 .sppb-item>img {
        position: absolute !important;
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
        z-index: 0;
    }

    /* Để nội dung tự quyết định chiều cao của slide */
    #sppb-addon-1656662050768 .sppb-item.sppb-item-has-bg .sppb-carousel-item-inner {
        position: relative !important;
        z-index: 1;
        height: auto !important;
        padding: 40px 15px !important;
        top: 0;
        background: rgba(0, 0, 0, 0.3);
        /* Lớp phủ mờ để dễ đọc chữ */
    }

    #sppb-addon-1656662050768 .sppb-carousel-item-inner>div,
    #sppb-addon-1656662050768 .sppb-carousel-item-inner>div>div {
        display: block !important;
        height: auto !important;
    }
    .home-slider .nivo-caption {
    display: none !important;
}
}