/* =============================================================
   GALLERY PAGE
============================================================= */


/* -------------------------------------------------------------
   GALLERY HERO
------------------------------------------------------------- */

.gallery-hero {
    min-height: 52vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.gallery-hero .hero-content {
    padding: 9rem 0 3rem;
    max-width: 800px;
}

.gallery-hero__description {
    max-width: 700px;
}


/* -------------------------------------------------------------
   GALLERY SECTION
------------------------------------------------------------- */

.gallery-section {
    background: var(--bsp-white);
}


/* -------------------------------------------------------------
   GALLERY LAYOUT
   LEFT  = FILTER
   RIGHT = GALLERY
------------------------------------------------------------- */

.gallery-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}


/* -------------------------------------------------------------
   STICKY FILTER SIDEBAR (desktop)
------------------------------------------------------------- */

.gallery-sidebar {
    position: sticky;
     top: calc(var(--header-height, 92px) + 12px);
    z-index: 40;
    align-self: start;
}

.gallery-sidebar__box {
    background: var(--bsp-white);
    border: 1px solid var(--bsp-border-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-soft);
}

.gallery-sidebar__title {
    margin: 0 0 1.1rem;
    color: var(--bsp-text-dark);
    font-size: .9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}


/* -------------------------------------------------------------
   CHECKBOXES
------------------------------------------------------------- */

.gallery-checkboxes {
    display: flex;
    flex-direction: column;
    gap: .8rem;
}

.gallery-checkbox {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin: 0;
    color: var(--bsp-text-muted);
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.35;
    cursor: pointer;
    user-select: none;
}

.gallery-checkbox input {
    width: 17px;
    height: 17px;
    margin: 0;
    flex: 0 0 auto;
    accent-color: var(--bsp-gold);
    cursor: pointer;
}

.gallery-checkbox span {
    transition: color .2s ease;
}

.gallery-checkbox:hover span {
    color: var(--bsp-amber);
}


/* -------------------------------------------------------------
   GALLERY GRID
------------------------------------------------------------- */

.gallery-grid {
    columns: 2;
    column-gap: 1.25rem;
}

.gallery-item {
    position: relative;
    break-inside: avoid;
    margin-bottom: 1.25rem;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--bsp-black);
    cursor: pointer;
    transition:
        transform .3s ease,
        box-shadow .3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-soft);
}

.gallery-item.is-hidden {
    display: none;
}


/* -------------------------------------------------------------
   GALLERY MEDIA
------------------------------------------------------------- */

.gallery-item__media {
    position: relative;
    overflow: hidden;
}

.gallery-item__media img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform .6s ease;
}

.gallery-item:hover .gallery-item__media img {
    transform: scale(1.06);
}


/* -------------------------------------------------------------
   GALLERY OVERLAY
------------------------------------------------------------- */

.gallery-item__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.3rem;
    background:
        linear-gradient(180deg,
            rgba(0, 0, 0, 0) 30%,
            rgba(0, 0, 0, .82) 100%);
    opacity: 0;
    transition: opacity .3s ease;
}

.gallery-item:hover .gallery-item__overlay {
    opacity: 1;
}

.gallery-item__category,
.video-label {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin-bottom: .25rem;
    color: var(--bsp-gold-light);
    font-size: .65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.gallery-item__title {
    margin: 0;
    color: var(--bsp-white);
    font-size: 1rem;
}


/* -------------------------------------------------------------
   FULLSCREEN ICON
------------------------------------------------------------- */

.gallery-item__icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .72);
    color: var(--bsp-gold-light);
    font-size: 1rem;
    z-index: 2;
}


/* -------------------------------------------------------------
   VIDEO ITEMS
------------------------------------------------------------- */

.gallery-item--video {
    cursor: pointer;
}

.gallery-item--video .gallery-item__media {
    aspect-ratio: 16 / 10;
}

.gallery-item--video .gallery-item__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bsp-gold);
    color: var(--bsp-black);
    font-size: 1.35rem;
    padding-left: .15rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .3);
    transition:
        transform .3s ease,
        background-color .3s ease;
    z-index: 3;
}

.gallery-item--video:hover .gallery-play {
    transform: translate(-50%, -50%) scale(1.1);
    background: var(--bsp-gold-light);
}


/* -------------------------------------------------------------
   EMPTY STATE
------------------------------------------------------------- */

.gallery-empty {
    display: none;
    text-align: center;
    padding: 4rem 1rem;
}

.gallery-empty.is-visible {
    display: block;
}

.gallery-empty__icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bsp-cream);
    color: var(--bsp-gold);
    font-size: 1.6rem;
}

.gallery-empty h3 {
    color: var(--bsp-text-dark);
    font-size: 1.2rem;
}

.gallery-empty p {
    color: var(--bsp-text-muted);
    font-size: .9rem;
}


/* -------------------------------------------------------------
   LIGHTBOX
------------------------------------------------------------- */

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(0, 0, 0, .94);
}

.gallery-lightbox.is-open {
    display: flex;
}

.gallery-lightbox__content {
    position: relative;
    width: min(1100px, 82vw);
    max-width: 1100px;
    max-height: 90vh;
    text-align: center;
}


/* -------------------------------------------------------------
   LIGHTBOX IMAGE
------------------------------------------------------------- */

.gallery-lightbox__image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 78vh;
    height: auto;
    margin: 0 auto;
    border-radius: var(--radius-md);
    object-fit: contain;
    box-shadow: 0 20px 70px rgba(0, 0, 0, .5);
}


/* -------------------------------------------------------------
   LIGHTBOX VIDEO
------------------------------------------------------------- */

.gallery-lightbox__video {
    display: none;
    width: min(1100px, 82vw);
    max-width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: var(--radius-md);
    background: #000;
    box-shadow: 0 20px 70px rgba(0, 0, 0, .6);
}


/* -------------------------------------------------------------
   LIGHTBOX CAPTION
------------------------------------------------------------- */

.gallery-lightbox__caption {
    margin-top: 1rem;
    color: var(--bsp-white);
    font-size: .9rem;
}

.gallery-lightbox__counter {
    margin-top: .5rem;
    color: rgba(255, 255, 255, .7);
    font-size: .75rem;
}


/* -------------------------------------------------------------
   LIGHTBOX CLOSE
------------------------------------------------------------- */

.gallery-lightbox__close {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10001;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: var(--bsp-white);
    font-size: 1.2rem;
    cursor: pointer;
    transition:
        background-color .25s ease,
        color .25s ease;
}

.gallery-lightbox__close:hover {
    background: var(--bsp-gold);
    color: var(--bsp-black);
}


/* -------------------------------------------------------------
   LIGHTBOX PREVIOUS / NEXT
------------------------------------------------------------- */

.gallery-lightbox__nav {
    position: fixed;
    top: 50%;
    z-index: 10001;
    width: 50px;
    height: 50px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: var(--bsp-white);
    font-size: 1.25rem;
    cursor: pointer;
    transition:
        background-color .25s ease,
        color .25s ease,
        transform .25s ease;
}

.gallery-lightbox__nav:hover {
    background: var(--bsp-gold);
    color: var(--bsp-black);
}

.gallery-lightbox__nav--prev {
    left: 1.5rem;
}

.gallery-lightbox__nav--next {
    right: 1.5rem;
}


/* -------------------------------------------------------------
   RESPONSIVE
------------------------------------------------------------- */

@media (min-width: 1400px) {

    .gallery-grid {
        columns: 3;
    }

}


@media (max-width: 991.98px) {

    .gallery-layout {
        grid-template-columns: 190px minmax(0, 1fr);
        gap: 1.25rem;
    }

    .gallery-grid {
        columns: 2;
    }

    .gallery-sidebar {
        top: calc(var(--header-height, 92px) + 12px);
    }

}


@media (max-width: 767.98px) {

    .gallery-hero {
        min-height: 48vh;
    }

    .gallery-hero .hero-content {
        padding: 7.5rem 0 2.5rem;
    }


    /*
     * Sticky filter stays ON for mobile —
     * sticks the toggle button (box itself is display:none
     * until opened, handled in the toggle block below).
     */

    .gallery-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .gallery-sidebar {
        position: sticky;
        top: calc(var(--header-height, 92px) + 12px);
        z-index: 40;
        align-self: start;
    }


    .gallery-sidebar__box {
        padding: 1rem;
    }


    .gallery-checkboxes {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .7rem;
    }


    .gallery-grid {
        columns: 1;
    }


    .gallery-lightbox {
        padding: .75rem;
    }

    .gallery-lightbox__content {
        width: 92vw;
        max-width: 92vw;
    }

    .gallery-lightbox__image {
        max-width: 92vw;
        max-height: 72vh;
    }

    .gallery-lightbox__video {
        width: 92vw;
        max-width: 92vw;
        border-radius: 8px;
    }

    .gallery-lightbox__nav {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    .gallery-lightbox__nav--prev {
        left: .5rem;
    }

    .gallery-lightbox__nav--next {
        right: .5rem;
    }

}


@media (max-width: 480px) {

    .gallery-checkboxes {
        grid-template-columns: 1fr;
    }

}

/* =============================================================
   GALLERY FILTER BUTTONS (media type: All / Images / Videos)
============================================================= */

.gallery-filters {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: #fdf9f1;
    border-radius: 30px;
    padding: 4px;
}

.gallery-filter {
    border: none;
    background: transparent;
    color: #6f6a60;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-filter.active {
    background: #0d0d0d;
    color: #f5c542;
}

.gallery-filter:hover:not(.active) {
    background: #0d0d0d;
    color: #f5c542;
}


/* =============================================================
   MOBILE
============================================================= */

@media (max-width: 767.98px) {

    .gallery-filters {
        gap: .5rem;
        margin-top: 1.5rem;
    }

    .gallery-filter {
        padding: .65rem 1.1rem;
        font-size: .7rem;
    }

}

.gallery-filter-list {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.gallery-sidebar-filter {
    width: 100%;
    appearance: none;
    border: 1px solid var(--bsp-border-light);
    background: var(--bsp-white);
    color: var(--bsp-text-muted);

    border-radius: var(--radius-md);
    padding: .75rem .9rem;

    font-size: .78rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: left;

    cursor: pointer;

    transition:
        background-color .25s ease,
        color .25s ease,
        border-color .25s ease,
        transform .25s ease;
}

.gallery-sidebar-filter:hover {
    border-color: var(--bsp-gold);
    color: var(--bsp-amber);
    transform: translateX(3px);
}

.gallery-sidebar-filter.active {
    background: var(--bsp-black);
    border-color: var(--bsp-black);
    color: var(--bsp-gold-light);
}

.gallery-item {
    opacity: 1;
    transform: none;
    transition: opacity .4s ease, transform .4s ease;
}

.gallery-item.is-entering {
    opacity: 0;
    transform: translateY(16px);
}

.gallery-sentinel {
    width: 100%;
    display: flex;
    justify-content: center;
}

.gallery-loader {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 0;
    color: #6E6555;
    font-size: .9rem;
}

.gallery-loader__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0,0,0,0.15);
    border-top-color: #d4af37;
    border-radius: 50%;
    animation: gallery-spin 0.7s linear infinite;
}

@keyframes gallery-spin {
    to { transform: rotate(360deg); }
}

.gallery-end {
    padding: 24px 0;
    color: #6E6555;
    font-size: .9rem;
    text-align: center;
}

/* Video preview thumbnail inside the grid card */
.gallery-item--video .gallery-item__media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* Lightbox video element */
.gallery-lightbox__video {
    max-width: 100%;
    max-height: 80vh;
    display: none;
}


/* -------------------------------------------------------------
   MOBILE FILTER TOGGLE BUTTON (hidden on desktop)
------------------------------------------------------------- */

.gallery-filter-toggle {
    display: none;
}

@media (max-width: 767.98px) {

    .gallery-filter-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;

        appearance: none;
        border: 1px solid var(--bsp-border-light);
        background: var(--bsp-white);
        color: var(--bsp-text-dark);

        border-radius: var(--radius-md);
        padding: .85rem 1rem;

        font-size: .8rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .05em;

        cursor: pointer;
        box-shadow: var(--shadow-soft);
        transition: background-color .25s ease, color .25s ease;
    }

    .gallery-filter-toggle i.bi-sliders {
        color: var(--bsp-gold);
        margin-right: .4rem;
    }

    .gallery-filter-toggle__caret {
        transition: transform .25s ease;
    }

    .gallery-filter-toggle.active {
        background: var(--bsp-black);
        color: var(--bsp-gold-light);
        border-color: var(--bsp-black);
    }

    .gallery-filter-toggle.active i.bi-sliders {
        color: var(--bsp-gold-light);
    }

    .gallery-filter-toggle.active .gallery-filter-toggle__caret {
        transform: rotate(180deg);
    }

    /* Collapsible category panel — hangs below the sticky toggle,
       scrolls internally so it never pushes off-screen content */
    .gallery-sidebar__box {
        display: none;
        margin-top: .6rem;
        max-height: 60vh;
        overflow-y: auto;
    }

    .gallery-sidebar__box.is-open {
        display: block;
    }

    .gallery-checkboxes,
    .gallery-filter-list {
        display: flex;
        flex-direction: column;
        gap: .55rem;
    }

}
.gallery-lightbox__youtube {
    width: 100%;
    aspect-ratio: 16 / 9;
}

.gallery-lightbox__youtube iframe {
    width: 100%;
    height: 100%;
}
.gallery-sidebar__box {
    background: var(--bsp-white);
    border: 1px solid var(--bsp-border-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-soft);

    /* NEW: cap the height to the viewport and let it scroll internally */
    max-height: calc(100vh - var(--header-height, 92px) - 40px);
    overflow-y: auto;
}

/* Optional — slim, on-brand scrollbar instead of the default fat one */
.gallery-sidebar__box::-webkit-scrollbar {
    width: 6px;
}

.gallery-sidebar__box::-webkit-scrollbar-track {
    background: transparent;
}

.gallery-sidebar__box::-webkit-scrollbar-thumb {
    background: var(--bsp-border-light);
    border-radius: 10px;
}

.gallery-sidebar__box::-webkit-scrollbar-thumb:hover {
    background: var(--bsp-gold);
}
/* All Categories button */
.gallery-sidebar-filter[data-category="all"] {
     background-color: #cfa464;
    color: #fff;
    border-color: #b08d57;
}

/* All Categories when active */
.gallery-sidebar-filter[data-category="all"].active {
    background-color: var(--bsp-black);
    color: var(--bsp-gold-light);
    border-color: var(--bsp-black);
}