/* ==========================================================================
   Header Styles (Restored)
   ========================================================================== */
.hf-header {
    text-align: center;
    margin-bottom: 70px;
}
.hf-subtitle {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #1a3636;
    position: relative;
    padding-top: 20px;
}
.hf-subtitle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background-color: var(--color-primary, #c0392b);
}
.hf-title {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 48px;
    font-weight: 700;
    color: #1a3636;
    margin: 20px 0 15px;
}
.hf-desc {
    font-size: 16px;
    color: #555;
    font-weight: 400;
    line-height: 1.7;
}
@media (max-width: 767px) {
    .hf-title {
        font-size: 36px;
    }
}
/* ==========================================================================
   Gallery Grid (Isotope layout)
   ========================================================================== */
.gallery-grid {
    display: block;
    margin: 0 -5px;
}
.gallery-grid:after {
    content: '';
    display: block;
    clear: both;
}

.gallery-item {
    width: 33.333%;
    padding: 5px;
    float: left;
}

/* Ẩn các class hidden dự phòng */
.gallery-item.hidden {
    display: none;
}

.gallery-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    overflow: hidden;
    
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.gallery-image-wrapper:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.gallery-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-image-wrapper:hover img {
    transform: scale(1.05);
}

/* ==========================================================================
   Filter Buttons
   ========================================================================== */
.gallery-filter-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    margin-bottom: 50px;
}

.gallery-filters {
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 0;
}

.filter-nav-btn {
    display: none; /* Hidden on desktop */
}

.filter-btn {
    background: transparent;
    border: none;
    font-family: var(--font-primary, 'Jost', sans-serif);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #666;
    padding: 10px 24px;
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    color: var(--color-accent, #F26522);
}

.filter-btn.active {
    background-color: var(--color-accent, #F26522);
    color: #fff;
}

/* ==========================================================================
   Lightbox Styles
   ========================================================================== */
.gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gallery-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-lightbox.active .lightbox-content img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: var(--color-accent, #c99339);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 50px;
    cursor: pointer;
    user-select: none;
    z-index: 10000;
    padding: 20px;
    transition: color 0.3s ease, transform 0.3s ease;
}

.lightbox-nav:hover {
    color: var(--color-accent, #c99339);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 991px) {
    .gallery-item { width: 50%; }
}

@media (max-width: 575px) {
    .gallery-item { width: 100%; }
    .lightbox-nav { font-size: 30px; padding: 10px; }
    .lightbox-prev { left: 5px; }
    .lightbox-next { right: 5px; }
}




/* ==========================================================================
   Gallery Page Banner Custom
   ========================================================================== */
.main-body .body-banner.gallery-banner-custom {
    height: 400px; /* Made taller */
    position: relative;
    overflow: hidden;
}

.banner-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 3;
    transform: rotate(180deg);
    
    /* Inherit the exact background image and properties from the body */
    background-image: url("../images/smenu-bg.png");
    background-attachment: fixed !important;
    background-color: var(--color-bg);

    /* Use the SVG wave as a mask so only the wave shape shows the background */
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1200 120" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z" opacity=".25" fill="%23000" /><path d="M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35-6.69,119.13-24.28s75.16-39,116.92-43.05c59.73-5.85,113.28,22.88,168.9,38.84,30.2,8.66,59,6.17,87.09-7.5,22.43-10.89,48-26.93,60.65-49.24V0Z" opacity=".5" fill="%23000" /><path d="M0,0V5.63C149.93,59,314.09,71.32,475.83,42.57c43-7.64,84.23-20.12,127.61-26.46,59-8.63,112.48,12.24,165.56,35.4C827.93,77.22,886,95.24,951.2,90c86.53-7,172.46-45.71,248.8-84.81V0Z" fill="%23000" /></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1200 120" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z" opacity=".25" fill="%23000" /><path d="M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35-6.69,119.13-24.28s75.16-39,116.92-43.05c59.73-5.85,113.28,22.88,168.9,38.84,30.2,8.66,59,6.17,87.09-7.5,22.43-10.89,48-26.93,60.65-49.24V0Z" opacity=".5" fill="%23000" /><path d="M0,0V5.63C149.93,59,314.09,71.32,475.83,42.57c43-7.64,84.23-20.12,127.61-26.46,59-8.63,112.48,12.24,165.56,35.4C827.93,77.22,886,95.24,951.2,90c86.53-7,172.46-45.71,248.8-84.81V0Z" fill="%23000" /></svg>');
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

@media (max-width: 991px) {
    .main-body .body-banner.gallery-banner-custom {
        height: 300px;
    }
    .banner-wave {
        height: 40px;
    }
}


/* ==========================================================================
   Mobile Gallery Optimizations
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. Description: Don't break into 2 lines */
    .hf-desc br,
    .desktop-br {
        display: none !important;
    }
    .hf-desc {
        max-width: 95%;
        margin: 0 auto;
        color: #444;
        font-weight: 500;
        font-size: 15px;
        line-height: 1.65;
    }

    /* 2. Filter Navigation for Mobile */
    .gallery-filter-wrapper {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        position: relative;
        max-width: 100%;
        margin-bottom: 30px;
        padding: 0 4px;
    }

    .gallery-filters {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        justify-content: flex-start;
        padding: 6px 2px;
        gap: 8px;
        flex: 1;
    }

    .gallery-filters::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 8px 18px;
        font-size: 12px;
        margin: 0;
    }

    .filter-nav-btn {
        display: none; /* Shown dynamically via JS if categories overflow */
        width: 34px;
        height: 34px;
        border-radius: 50%;
        border: 1px solid rgba(1, 79, 134, 0.2);
        background: #fff;
        color: var(--color-primary, #014F86);
        align-items: center;
        justify-content: center;
        cursor: pointer;
        flex-shrink: 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        transition: all 0.2s ease;
        padding: 0;
        z-index: 5;
    }

    .filter-nav-btn:active {
        background: var(--color-primary, #014F86);
        color: #fff;
        transform: scale(0.92);
    }

    .filter-nav-btn.is-disabled {
        opacity: 0.25;
        pointer-events: none;
    }
}
.gallery-content {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.gallery-image-wrapper {
    cursor: pointer;
}

.gallery-loadmore-wrap {
    text-align: center;
    margin-top: 40px;
}

#gallery-view-more {
    display: none;
    border: none;
    cursor: pointer;
}
