

/* =========================================================
   BSN GALLERY
========================================================= */

.bsn-gallery {
    --bsn-red: #e21b23;
    --bsn-black: #080808;
    --bsn-dark: #111111;
    --bsn-border: rgba(255,255,255,0.12);
    --bsn-text: #ffffff;
    --bsn-muted: #999999;

    position: relative;
    width: 100%;
    padding: 110px 20px;
    background: var(--bsn-black);
    overflow: hidden;
}


/* CONTAINER */

.bsn-gallery-container {
    width: 100%;
    max-width: 1250px;
    margin: 0 auto;
}


/* =========================================================
   HEADER
========================================================= */

.bsn-gallery-header {
    max-width: 720px;
    margin: 0 auto 45px;
    text-align: center;
}

.bsn-gallery-label {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--bsn-red);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.bsn-gallery-header h2 {
    margin: 0 0 18px;
    color: var(--bsn-text);
    font-size: 46px;
    line-height: 1.15;
    font-weight: 800;
    text-transform: uppercase;
}

.bsn-gallery-header h2 span {
    color: var(--bsn-red);
}

.bsn-gallery-header p {
    max-width: 620px;
    margin: 0 auto;
    color: var(--bsn-muted);
    font-size: 15px;
    line-height: 1.8;
}


/* =========================================================
   FILTERS
========================================================= */

.bsn-gallery-filters {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 35px;
}

.bsn-gallery-filter {
    padding: 11px 24px;
    border: 1px solid var(--bsn-border);
    border-radius: 50px;
    background: transparent;
    color: #aaa;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition:
        background 0.3s ease,
        border-color 0.3s ease,
        color 0.3s ease,
        transform 0.3s ease;
}

.bsn-gallery-filter:hover {
    border-color: var(--bsn-red);
    color: #fff;
}

.bsn-gallery-filter.active {
    border-color: var(--bsn-red);
    background: var(--bsn-red);
    color: #fff;
}


/* =========================================================
   GRID
========================================================= */

.bsn-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 260px;
    gap: 16px;
}


/* CARD */

.bsn-gallery-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border-radius: 4px;
    background: var(--bsn-dark);
    cursor: pointer;

    opacity: 1;
    transform: scale(1);

    transition:
        opacity 0.35s ease,
        transform 0.35s ease;
}


/* LARGE CARD */

.bsn-gallery-card-large {
    grid-column: span 2;
    grid-row: span 2;
}


/* TALL CARD */

.bsn-gallery-card-tall {
    grid-row: span 2;
}


/* HIDDEN */

.bsn-gallery-card.bsn-gallery-hidden {
    display: none;
}


/* IMAGE */

.bsn-gallery-card > img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;

    transition:
        transform 0.7s cubic-bezier(.2,.7,.2,1);
}

.bsn-gallery-card:hover > img {
    transform: scale(1.08);
}


/* =========================================================
   OVERLAY
========================================================= */

.bsn-gallery-card-overlay {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    padding: 25px;

    background:
        linear-gradient(
            to top,
            rgba(0,0,0,0.90) 0%,
            rgba(0,0,0,0.40) 45%,
            rgba(0,0,0,0) 75%
        );

    opacity: 0;

    transition: opacity 0.35s ease;
}

.bsn-gallery-card:hover .bsn-gallery-card-overlay {
    opacity: 1;
}


/* INFO */

.bsn-gallery-card-info span {
    display: block;
    margin-bottom: 7px;

    color: var(--bsn-red);

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
}

.bsn-gallery-card-info h3 {
    margin: 0;

    color: #fff;

    font-size: 19px;
    line-height: 1.2;
    font-weight: 700;
}


/* OPEN BUTTON */

.bsn-gallery-open {
    width: 46px;
    height: 46px;

    flex: 0 0 46px;

    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 50%;

    background: rgba(255,255,255,0.08);

    color: #fff;

    font-size: 28px;
    font-weight: 300;
    line-height: 1;

    cursor: pointer;

    backdrop-filter: blur(8px);

    transition:
        background 0.3s ease,
        border-color 0.3s ease,
        transform 0.3s ease;
}

.bsn-gallery-open:hover {
    border-color: var(--bsn-red);
    background: var(--bsn-red);
    transform: rotate(90deg);
}


/* =========================================================
   LIGHTBOX
========================================================= */

.bsn-gallery-lightbox {
    position: fixed;
    inset: 0;

    z-index: 999999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 50px;

    background: rgba(0,0,0,0.96);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.bsn-gallery-lightbox.active {
    opacity: 1;
    visibility: visible;
}


/* LIGHTBOX CONTENT */

.bsn-gallery-lightbox-content {
    position: relative;

    width: min(1000px, 90vw);

    text-align: center;
}


/* LIGHTBOX IMAGE */

#bsnGalleryLightboxImage {
    display: block;

    width: auto;
    max-width: 100%;
    max-height: 75vh;

    margin: 0 auto;

    object-fit: contain;

    border-radius: 3px;

    box-shadow:
        0 20px 80px rgba(0,0,0,0.7);

    user-select: none;
}


/* =========================================================
   LIGHTBOX DETAILS
========================================================= */

.bsn-gallery-lightbox-details {
    margin-top: 18px;
    text-align: center;
}

.bsn-gallery-lightbox-details span {
    display: block;

    margin-bottom: 5px;

    color: var(--bsn-red);

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
}

.bsn-gallery-lightbox-details h3 {
    margin: 0;

    color: #fff;

    font-size: 20px;
    font-weight: 700;
}

.bsn-gallery-counter {
    margin-top: 8px;

    color: #777;

    font-size: 12px;
}


/* =========================================================
   LIGHTBOX BUTTONS
========================================================= */

.bsn-gallery-close,
.bsn-gallery-prev,
.bsn-gallery-next {
    position: absolute;

    z-index: 5;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 50px;
    height: 50px;

    padding: 0;

    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;

    background: rgba(255,255,255,0.08);

    color: #fff;

    cursor: pointer;

    transition:
        background 0.3s ease,
        border-color 0.3s ease,
        transform 0.3s ease;
}

.bsn-gallery-close:hover,
.bsn-gallery-prev:hover,
.bsn-gallery-next:hover {
    border-color: var(--bsn-red);
    background: var(--bsn-red);
}


/* CLOSE */

.bsn-gallery-close {
    top: 25px;
    right: 25px;

    font-size: 32px;
    font-weight: 300;
}


/* PREVIOUS */

.bsn-gallery-prev {
    top: 50%;
    left: 30px;

    transform: translateY(-50%);

    font-size: 20px;
}

.bsn-gallery-prev:hover {
    transform: translateY(-50%) scale(1.05);
}


/* NEXT */

.bsn-gallery-next {
    top: 50%;
    right: 30px;

    transform: translateY(-50%);

    font-size: 20px;
}

.bsn-gallery-next:hover {
    transform: translateY(-50%) scale(1.05);
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 991px) {

    .bsn-gallery {
        padding: 80px 20px;
    }

    .bsn-gallery-header h2 {
        font-size: 38px;
    }

    .bsn-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 230px;
    }

    .bsn-gallery-card-large {
        grid-column: span 2;
        grid-row: span 2;
    }

    .bsn-gallery-card-tall {
        grid-row: span 1;
    }

    .bsn-gallery-card-overlay {
        opacity: 1;
    }

    .bsn-gallery-lightbox {
        padding: 25px 15px;
    }

    .bsn-gallery-prev {
        left: 12px;
    }

    .bsn-gallery-next {
        right: 12px;
    }

}


@media (max-width: 600px) {

    .bsn-gallery {
        padding: 65px 15px;
    }

    .bsn-gallery-header {
        margin-bottom: 30px;
    }

    .bsn-gallery-header h2 {
        font-size: 30px;
    }

    .bsn-gallery-header p {
        font-size: 14px;
    }


    .bsn-gallery-filters {
        gap: 7px;
    }

    .bsn-gallery-filter {
        padding: 9px 15px;
        font-size: 10px;
    }


    .bsn-gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 260px;
    }

    .bsn-gallery-card-large {
        grid-column: span 1;
        grid-row: span 1;
    }

    .bsn-gallery-card-tall {
        grid-row: span 1;
    }


    .bsn-gallery-card-overlay {
        opacity: 1;
        padding: 20px;
    }


    .bsn-gallery-lightbox {
        padding: 20px 10px;
    }

    #bsnGalleryLightboxImage {
        max-height: 65vh;
    }


    .bsn-gallery-close {
        top: 12px;
        right: 12px;

        width: 42px;
        height: 42px;
    }


    .bsn-gallery-prev,
    .bsn-gallery-next {
        width: 42px;
        height: 42px;
    }

    .bsn-gallery-prev {
        left: 8px;
    }

    .bsn-gallery-next {
        right: 8px;
    }


    .bsn-gallery-lightbox-details h3 {
        font-size: 17px;
    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .bsn-gallery *,
    .bsn-gallery *::before,
    .bsn-gallery *::after {
        transition: none !important;
        animation: none !important;
    }

}

.bsn-gallery-extra {
    display: none;
}

.bsn-gallery-view-all-wrap {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.bsn-gallery-view-all {
    display: inline-flex;
    align-items: center;
    gap: 14px;

    padding: 14px 28px;

    border: 1px solid #e21b23;
    background: transparent;
    color: #fff;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;

    cursor: pointer;

    transition: all 0.3s ease;
}

.bsn-gallery-view-all:hover {
    background: #e21b23;
}

.bsn-gallery-view-all-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 24px;
    height: 24px;

    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 50%;

    font-size: 18px;
    font-weight: 300;

    transition: transform 0.3s ease;
}

.bsn-gallery-view-all:hover .bsn-gallery-view-all-icon {
    transform: rotate(90deg);
}


/* After View All is clicked */

.bsn-gallery-view-all-wrap.bsn-gallery-expanded
.bsn-gallery-view-all-icon {
    transform: rotate(45deg);
}