/* =========================================================
   SECTION
========================================================= */

.anwa-gallery-section {
    position: relative;
    padding:130px 0;
    background:var(--anwa-background);
    overflow: hidden;
}


/* =========================================================
   CONTAINER
========================================================= */

.gallery-container {
    width:
        min(
            calc(100% - 80px),
            1280px
        );
    margin: 0 auto;
}


/* =========================================================
   HEADER
========================================================= */

.gallery-section-header {
    display: grid;
    grid-template-columns:1.25fr .75fr;
    gap:80px;
    align-items: end;
    margin-bottom:60px;
}


.gallery-eyebrow {
    display: block;
    margin-bottom:18px;
    color:var(--anwa-primary);
    font-size:var(--font-12);
    font-weight:var(--weight-700);
    letter-spacing:2.5px;
}


.gallery-heading h2 {
    max-width:850px;
    font-size:
        clamp(
            var(--font-48),
            5.5vw,
            var(--font-80)
        );

    line-height:
        .98;

    letter-spacing:
        -3.5px;

    font-weight:
        var(--weight-500);

    color:
        var(--anwa-text);
}


.gallery-heading h2 em {

    color:
        var(--anwa-primary);

    font-style:
        normal;
}


.gallery-description {

    padding-bottom:
        5px;
}


.gallery-description p {

    max-width:
        410px;

    color:
        var(--anwa-muted);

    font-size:
        var(--font-12);

    line-height:
        1.9;
}


/* =========================================================
   MASONRY GALLERY
========================================================= */

.anwa-photo-gallery {

    column-count:3;
    column-gap:14px;
    width:100%;
}


/* =========================================================
   PHOTO ITEM
========================================================= */

.anwa-gallery-item {

    position:
        relative;

    display:
        inline-block;

    width:
        100%;

    margin:
        0 0 18px;

    overflow:
        hidden;

    /* border-radius:
        18px; */

    background:
        var(--anwa-dark);

    cursor:
        pointer;

    break-inside:
        avoid;

    opacity:
        0;

    transform:
        translateY(25px);

    animation:
        galleryPhotoIn .65s
        cubic-bezier(.22,1,.36,1)
        forwards;
}


@keyframes galleryPhotoIn {

    to {

        opacity:
            1;

        transform:
            translateY(0);

    }

}


/* =========================================================
   PHOTO
========================================================= */

.anwa-gallery-item img {

    display:
        block;

    width:
        100%;

    height:
        auto;

    transition:
        transform .8s
        cubic-bezier(.22,1,.36,1);
}


.anwa-gallery-item:hover img {

    transform:
        scale(1.06);
}


/* =========================================================
   IMAGE OVERLAY
========================================================= */

.gallery-photo-overlay {

    position:
        absolute;

    inset:
        0;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    background:
        rgba(61,0,117,.58);

    opacity:
        0;

    transition:
        opacity .35s ease;
}


.anwa-gallery-item:hover
.gallery-photo-overlay {

    opacity:
        1;
}


/* =========================================================
   VIEW ICON
========================================================= */

.gallery-view-icon {

    width:
        54px;

    height:
        54px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    border-radius:
        50%;

    background:
        white;

    color:
        var(--anwa-dark);

    font-size:
        var(--font-14);

    transform:
        scale(.7);

    transition:
        transform .4s
        cubic-bezier(.22,1,.36,1);
}


.anwa-gallery-item:hover
.gallery-view-icon {

    transform:
        scale(1);
}


/* =========================================================
   PHOTO NUMBER
========================================================= */

.gallery-photo-number {
    position:absolute;
    top:15px;
    left:15px;
    z-index:2;
    padding:6px 9px;
    border:1px solid rgba(255,255,255,.2);
    border-radius:30px;
    background:rgba(61,0,117,.45);
    backdrop-filter:blur(8px);
    color:white;
    font-size:var(--font-12);
    font-weight:var(--weight-500);
    opacity:0;
    transform:translateY(-5px);
    transition:.3s ease;
}


.anwa-gallery-item:hover
.gallery-photo-number {

    opacity:
        1;

    transform:
        translateY(0);
}


/* =========================================================
   LOAD MORE AREA
========================================================= */

.gallery-loader-area {

    display:
        flex;

    flex-direction:
        column;

    align-items:
        center;

    justify-content:
        center;

    margin-top:
        55px;
}


/* =========================================================
   LOAD MORE BUTTON
========================================================= */

.gallery-load-more {

    display:
        inline-flex;

    align-items:
        center;

    gap:
        14px;

    padding:
        14px 20px 14px 24px;

    border:
        1px solid
        var(--anwa-primary);

    border-radius:
        50px;

    background:
        transparent;

    color:
        var(--anwa-primary);

    font-family:
        inherit;

    font-size:
        var(--font-12);

    font-weight:
        var(--weight-600);

    cursor:
        pointer;

    transition:
        var(--anwa-transition);
}


.gallery-load-more:hover {

    background:
        var(--anwa-primary);

    color:
        white;

    transform:
        translateY(-3px);

    box-shadow:
        0 12px 30px
        rgba(90,15,175,.2);
}


/* =========================================================
   LOAD MORE ICON
========================================================= */

.load-more-icon {

    width:
        31px;

    height:
        31px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    border-radius:
        50%;

    background:
        var(--anwa-light);

    color:
        var(--anwa-primary);

    transition:
        .35s ease;
}


.gallery-load-more:hover
.load-more-icon {

    background:
        white;

    transform:
        translateY(2px);
}


/* =========================================================
   LOADING
========================================================= */

.gallery-loading {

    display:
        none;

    align-items:
        center;

    gap:
        10px;

    color:
        var(--anwa-muted);

    font-size:
        var(--font-12);
}


.gallery-loading.active {

    display:
        flex;
}


.loading-spinner {

    width:
        18px;

    height:
        18px;

    border:
        2px solid
        var(--anwa-light);

    border-top-color:
        var(--anwa-primary);

    border-radius:
        50%;

    animation:
        gallerySpinner .7s linear infinite;
}


@keyframes gallerySpinner {

    to {

        transform:
            rotate(360deg);

    }

}


/* =========================================================
   END MESSAGE
========================================================= */

.gallery-end-message {

    display:
        none;

    align-items:
        center;

    gap:
        15px;

    color:
        var(--anwa-muted);

    font-size:
        var(--font-12);

    letter-spacing:
        .4px;
}


.gallery-end-message.active {

    display:
        flex;
}


.end-line {

    width:
        35px;

    height:
        1px;

    background:
        var(--anwa-border);
}


/* =========================================================
   LIGHTBOX
========================================================= */

.gallery-lightbox {

    position:
        fixed;

    inset:
        0;

    z-index:
        9999;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    padding:
        30px;

    opacity:
        0;

    visibility:
        hidden;

    transition:
        opacity .35s ease,
        visibility .35s ease;
}


.gallery-lightbox.active {

    opacity:
        1;

    visibility:
        visible;
}


/* =========================================================
   BACKDROP
========================================================= */

.lightbox-backdrop {

    position:
        absolute;

    inset:
        0;

    background:
        rgba(17,0,32,.92);

    backdrop-filter:
        blur(12px);
}


/* =========================================================
   WRAPPER
========================================================= */

.lightbox-wrapper {

    position:
        relative;

    z-index:
        2;

    width:
        min(
            1200px,
            94vw
        );

    height:
        min(
            92vh,
            850px
        );

    display:
        flex;

    flex-direction:
        column;

    align-items:
        center;

    justify-content:
        center;
}


/* =========================================================
   IMAGE AREA
========================================================= */

.lightbox-image-area {

    width:
        100%;

    height:
        calc(100% - 75px);

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    padding:
        20px 60px;
}


.lightbox-image-area img {

    max-width:
        100%;

    max-height:
        100%;

    width:
        auto;

    height:
        auto;

    object-fit:
        contain;

    /* border-radius:
        8px; */

    box-shadow:
        0 30px 80px
        rgba(0,0,0,.5);

    transition:
        opacity .2s ease;
}


/* =========================================================
   CLOSE
========================================================= */

.lightbox-close {

    position:
        absolute;

    top:
        5px;

    right:
        5px;

    z-index:
        10;

    width:
        44px;

    height:
        44px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    border:
        1px solid
        rgba(255,255,255,.25);

    border-radius:
        50%;

    background:
        rgba(255,255,255,.08);

    color:
        white;

    cursor:
        pointer;

    transition:
        .3s ease;
}


.lightbox-close:hover {

    background:
        white;

    color:
        var(--anwa-dark);

    transform:
        rotate(90deg);
}


/* =========================================================
   PREVIOUS / NEXT
========================================================= */

.lightbox-navigation {

    position:
        absolute;

    top:
        50%;

    z-index:
        10;

    width:
        52px;

    height:
        52px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    border:
        1px solid
        rgba(255,255,255,.25);

    border-radius:
        50%;

    background:
        rgba(255,255,255,.08);

    color:
        white;

    cursor:
        pointer;

    transform:
        translateY(-50%);

    transition:
        .3s ease;
}


.lightbox-navigation:hover {

    background:
        white;

    color:
        var(--anwa-dark);
}


.lightbox-prev {

    left:
        0;
}


.lightbox-next {

    right:
        0;
}


/* =========================================================
   BOTTOM BAR
========================================================= */

.lightbox-bottom {

    width:
        100%;

    min-height:
        75px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        20px;

    padding:
        10px 20px;
}


.lightbox-photo-info {

    display:
        flex;

    flex-direction:
        column;

    gap:
        5px;

    color:
        white;
}


.lightbox-photo-title {

    font-size:
        var(--font-12);

    font-weight:
        var(--weight-500);
}


.lightbox-photo-counter {

    color:
        rgba(255,255,255,.5);

    font-size:
        var(--font-12);
}


/* =========================================================
   DOWNLOAD
========================================================= */

.lightbox-download {

    display:
        inline-flex;

    align-items:
        center;

    gap:
        9px;

    padding:
        12px 18px;

    border-radius:
        0px;

    background:
        white;

    color:
        var(--anwa-dark);

    font-size:
        var(--font-12);

    font-weight:
        var(--weight-600);

    transition:
        .3s ease;
}


.lightbox-download:hover {

    background:
        var(--anwa-light);

    transform:
        translateY(-2px);
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1200px) {

    .anwa-photo-gallery {

        column-count:
            3;
    }

}


@media (max-width: 850px) {

    .gallery-section-header {

        grid-template-columns:
            1fr;

        gap:
            25px;
    }


    .anwa-photo-gallery {

        column-count:
            2;
    }

}


@media (max-width: 600px) {

    .gallery-container {

        width:
            calc(100% - 40px);
    }


    .anwa-gallery-section {

        padding:
            90px 0;
    }


    .gallery-heading h2 {

        font-size:
            var(--font-48);

        letter-spacing:
            -2px;
    }


    .anwa-photo-gallery {

        column-count:
            1;

        column-gap:
            0;
    }


    .anwa-gallery-item {

        margin-bottom:
            14px;

        /* border-radius:
            14px; */
    }


    .lightbox-image-area {

        height:
            calc(100% - 110px);

        padding:
            20px 10px;
    }


    .lightbox-navigation {

        width:
            40px;

        height:
            40px;
    }


    .lightbox-prev {

        left:
            5px;
    }


    .lightbox-next {

        right:
            5px;
    }


    .lightbox-bottom {

        padding:
            10px 5px;
    }


    .lightbox-download {

        padding:
            10px 13px;
    }


    .lightbox-download span {

        display:
            none;
    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {

        animation-duration:
            .01ms !important;

        transition-duration:
            .01ms !important;

        scroll-behavior:
            auto !important;
    }

}