/* =========================================================
   GALLERY PAGE
========================================================= */

.gallery-page-section {
    background: #ffffff;
}


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

.gallery-page-section .section-heading {
    margin-bottom: 55px;
}


/* =========================================================
   MASONRY GALLERY
========================================================= */
.gallery-masonry {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
}

/* =========================================================
   GALLERY CARD
========================================================= */

.gallery-masonry-item {
    display: inline-block;

    width: 100%;

    margin: 0 0 24px;

    vertical-align: top;

    break-inside: avoid;

    -webkit-column-break-inside: avoid;

    page-break-inside: avoid;

    background: #ffffff;

    border-radius: 18px;

    overflow: hidden;

    border: 1px solid rgba(0, 0, 0, 0.06);

    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.06);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}


.gallery-masonry-item:hover {
    transform: translateY(-5px);

    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.12);
}


/* =========================================================
   IMAGE BUTTON
========================================================= */

.gallery-masonry-image {
    position: relative;

    display: block;

    width: 100%;

    height: auto;

    padding: 0;

    margin: 0;

    border: 0;

    outline: none;

    background: #f4f6f8;

    cursor: pointer;

    overflow: hidden;

    line-height: 0;

    text-align: center;

    appearance: none;
}


/* =========================================================
   FULL ORIGINAL IMAGE
========================================================= */

.gallery-masonry-image img {
    display: block;

    width: 100%;

    height: auto;

    max-width: 100%;

    margin: 0 auto;

    /*
     * VERY IMPORTANT
     *
     * No fixed height.
     * No cover.
     * No cropping.
     * No distortion.
     */

    object-fit: contain;

    object-position: center;

    background: #f4f6f8;

    transition:
        transform 0.35s ease;
}


/*
 * Very small hover zoom.
 *
 * It does not crop the normal image.
 */

.gallery-masonry-item:hover
.gallery-masonry-image img {
    transform: scale(1.01);
}


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

.gallery-masonry-overlay {
    position: absolute;

    inset: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    background:
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.05),
            rgba(0, 0, 0, 0.55)
        );

    opacity: 0;

    transition:
        opacity 0.3s ease;
}


.gallery-masonry-item:hover
.gallery-masonry-overlay {
    opacity: 1;
}


/* =========================================================
   OVERLAY CONTENT
========================================================= */

.gallery-masonry-overlay-content {
    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 10px;

    color: #ffffff;
}


/* =========================================================
   OVERLAY ICON
========================================================= */

.gallery-masonry-overlay-icon {
    width: 58px;

    height: 58px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background: var(--primary);

    color: #ffffff;

    font-size: 20px;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.20);

    transform: scale(0.75);

    transition:
        transform 0.3s ease;
}


.gallery-masonry-item:hover
.gallery-masonry-overlay-icon {
    transform: scale(1);
}


/* =========================================================
   OVERLAY TEXT
========================================================= */

.gallery-masonry-overlay-text {
    font-size: 14px;

    font-weight: 600;

    letter-spacing: 0.2px;

    color: #ffffff;

    text-shadow:
        0 2px 5px rgba(0, 0, 0, 0.4);
}


/* =========================================================
   TITLE
========================================================= */

.gallery-masonry-content {
    padding: 17px 20px;

    background: #ffffff;
}


.gallery-masonry-content h3 {
    margin: 0;

    color: #111827;

    font-size: 17px;

    line-height: 1.5;

    font-weight: 700;
}


/* =========================================================
   EMPTY GALLERY
========================================================= */

.gallery-empty {
    padding: 90px 20px;
}


.gallery-empty-icon {
    width: 84px;

    height: 84px;

    margin: 0 auto 22px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background:
        rgba(59, 194, 241, 0.10);

    color: var(--primary);

    font-size: 32px;
}


.gallery-empty h3 {
    margin-bottom: 10px;

    font-size: 27px;

    font-weight: 700;
}


.gallery-empty p {
    margin: 0;

    color: #777;
}


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

.gallery-lightbox {
    width: 100vw;

    height: 100vh;

    max-width: none;

    max-height: none;

    margin: 0;

    padding: 20px;

    border: 0;

    background:
        rgba(0, 0, 0, 0.94);

    color: #ffffff;
}


.gallery-lightbox::backdrop {
    background:
        rgba(0, 0, 0, 0.94);
}


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

.gallery-lightbox-inner {
    position: relative;

    width: 100%;

    height: 100%;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;
}


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

.gallery-lightbox-image-wrap {
    width: 100%;

    height: calc(100% - 55px);

    display: flex;

    align-items: center;

    justify-content: center;
}


/* =========================================================
   FULL SIZE LIGHTBOX IMAGE
========================================================= */

.gallery-lightbox-image-wrap img {
    display: block;

    /*
     * Image can become very large,
     * but will never exceed viewport.
     */

    max-width: 96vw;

    max-height: 88vh;

    width: auto;

    height: auto;

    object-fit: contain;

    object-position: center;

    border-radius: 8px;

    box-shadow:
        0 20px 70px rgba(0, 0, 0, 0.50);
}


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

.gallery-lightbox-close {
    position: fixed;

    top: 18px;

    right: 22px;

    z-index: 100;

    width: 48px;

    height: 48px;

    display: flex;

    align-items: center;

    justify-content: center;

    border: 0;

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.12);

    color: #ffffff;

    font-size: 20px;

    cursor: pointer;

    transition:
        background 0.25s ease,
        transform 0.25s ease;
}


.gallery-lightbox-close:hover {
    background:
        rgba(255, 255, 255, 0.22);

    transform: rotate(90deg);
}


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

.gallery-lightbox-title {
    min-height: 25px;

    max-width: 90%;

    margin-top: 8px;

    color: #ffffff;

    font-size: 16px;

    font-weight: 600;

    text-align: center;
}


/* =========================================================
   BODY LOCK
========================================================= */

body.gallery-lightbox-open {
    overflow: hidden;
}


/* =========================================================
   TABLET
========================================================= */
@media (max-width: 991px) {

    .gallery-masonry {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {

    .gallery-page-section .section-heading {
        margin-bottom: 35px;
    }

 .gallery-masonry {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .gallery-masonry-item {
        margin-bottom: 0;
    }


   

    .gallery-masonry-content {
        padding: 14px 16px;
    }


    .gallery-masonry-content h3 {
        font-size: 16px;
    }


    /*
     * Keep overlay simple on mobile.
     */

    .gallery-masonry-overlay {
        display: none;
    }


    /* Lightbox */

    .gallery-lightbox {
        padding: 10px;
    }


    .gallery-lightbox-image-wrap {
        height: calc(100% - 45px);
    }


    .gallery-lightbox-image-wrap img {
        max-width: 97vw;

        max-height: 86vh;

        border-radius: 5px;
    }


    .gallery-lightbox-close {
        top: 10px;

        right: 10px;

        width: 42px;

        height: 42px;
    }


    .gallery-lightbox-title {
        font-size: 14px;
    }

}