/* =========================
   GALLERY SECTION
========================= */

.gallery-section {
    background: #ffffff;
    padding: 75px 0;
}


/* =========================
   GALLERY HEADER
========================= */

.gallery-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 40px;
    margin-bottom: 40px;
}


.gallery-header-content {
    max-width: 550px;
}


.gallery-header .section-label {
    margin-bottom: 16px;
}


.gallery-header h2 {
    margin: 0 0 14px;

    font-family: Georgia, serif;

    font-size: 38px;
    font-weight: 400;

    line-height: 1.12;

    color: #111111;
}


.gallery-header h2 em {
    color: #397c55;
    font-style: italic;
}


.gallery-description {
    max-width: 430px;

    margin: 0;

    color: #444444;

    font-size: 12px;
    line-height: 1.6;
}


/* =========================
   VIEW MORE BUTTON
========================= */

.view-all-gallery {
    flex-shrink: 0;

    min-height: 42px;

    padding: 0 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 12px;

    border: 1px solid #9ba89f;
    border-radius: 4px;

    background: transparent;

    color: #111111;

    font-size: 13px;
    font-weight: 500;

    text-decoration: none;

    transition:
        background 0.3s ease,
        border-color 0.3s ease,
        color 0.3s ease,
        transform 0.3s ease;
}


.view-all-gallery i {
    font-size: 11px;

    transition: transform 0.3s ease;
}


.view-all-gallery:hover {
    background: #063d2a;

    border-color: #063d2a;

    color: #ffffff;

    transform: translateY(-2px);
}


.view-all-gallery:hover i {
    transform: translateX(4px);
}


/* =========================
   GALLERY GRID
========================= */

.gallery-grid {
    display: grid;

    grid-template-columns: repeat(4, 1fr);

    grid-auto-rows: 190px;

    gap: 14px;
}


/* =========================
   GALLERY ITEM
========================= */

.gallery-item {
    position: relative;

    width: 100%;
    height: 100%;

    overflow: hidden;

    border-radius: 6px;

    background: #e9ece7;

    cursor: pointer;
}


/* =========================
   GALLERY IMAGE
========================= */

.gallery-item img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    transition:
        transform 0.6s ease,
        filter 0.4s ease;
}


/* =========================
   FEATURED IMAGE
========================= */

.gallery-large {
    grid-column: span 2;
    grid-row: span 2;
}


/* =========================
   OPTIONAL SIZES
========================= */

.gallery-tall {
    grid-row: span 2;
}


.gallery-wide {
    grid-column: span 2;
}


/* =========================
   IMAGE OVERLAY
========================= */

.gallery-overlay {
    position: absolute;

    inset: 0;

    display: flex;

    align-items: flex-end;
    justify-content: space-between;

    padding: 18px;

    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, 0.65),
            rgba(0, 0, 0, 0.05) 60%
        );

    opacity: 0;

    transition: opacity 0.35s ease;
}


/* Overlay title */

.gallery-overlay span {
    color: #ffffff;

    font-size: 11px;
    font-weight: 600;

    letter-spacing: 0.5px;
}


/* Overlay icon */

.gallery-overlay i {
    width: 34px;
    height: 34px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255, 255, 255, 0.7);

    border-radius: 50%;

    color: #ffffff;

    font-size: 12px;

    transform: translateY(8px);

    transition:
        transform 0.35s ease,
        background 0.35s ease,
        border-color 0.35s ease;
}


/* =========================
   HOVER
========================= */

.gallery-item:hover img {
    transform: scale(1.06);
}


.gallery-item:hover .gallery-overlay {
    opacity: 1;
}


.gallery-item:hover .gallery-overlay i {
    transform: translateY(0);
}


.gallery-overlay i:hover {
    background: #397c55;

    border-color: #397c55;
}


/* =========================
   TABLET / IPAD
========================= */

@media (max-width: 991.98px) {

    .gallery-section {
        padding: 65px 0;
    }


    /* Header */

    .gallery-header {
        gap: 25px;

        margin-bottom: 35px;
    }


    .gallery-header h2 {
        font-size: 34px;
    }


    .gallery-description {
        max-width: 320px;
    }


    /* Grid */

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);

        grid-auto-rows: 200px;

        gap: 12px;
    }


    /* Featured image */

    .gallery-large {
        grid-column: span 2;
        grid-row: span 2;
    }


    /* Touch devices */

    .gallery-overlay {
        opacity: 1;
    }


    .gallery-overlay i {
        transform: translateY(0);
    }

}


/* =========================
   SMALL TABLET
========================= */

@media (max-width: 767.98px) {

    .gallery-header {
        align-items: flex-start;
    }


    .gallery-header-content {
        max-width: 100%;
    }


    .gallery-description {
        max-width: 400px;
    }


    .gallery-grid {
        grid-auto-rows: 180px;
    }

}


/* =========================
   MOBILE
========================= */

@media (max-width: 575.98px) {

    .gallery-section {
        padding: 55px 0;
    }


    /* Header */

    .gallery-header {
        display: block;

        margin-bottom: 30px;
    }


    .gallery-header-content {
        max-width: 100%;
    }


    .gallery-header .section-label {
        margin-bottom: 14px;
    }


    .gallery-header h2 {
        font-size: 30px;

        line-height: 1.15;
    }


    .gallery-description {
        max-width: 100%;

        margin-top: 15px;

        font-size: 13px;

        line-height: 1.6;
    }


    /* View button */

    .view-all-gallery {
        margin-top: 22px;

        min-height: 40px;

        font-size: 12px;
    }


    /* Grid */

    .gallery-grid {
        grid-template-columns: 1fr;

        grid-auto-rows: 230px;

        gap: 10px;
    }


    /* Reset special sizes */

    .gallery-large,
    .gallery-tall,
    .gallery-wide {
        grid-column: span 1;

        grid-row: span 1;
    }


    /* Featured image */

    .gallery-large {
        height: 280px;
    }


    /* Overlay */

    .gallery-overlay {
        padding: 15px;
    }


    .gallery-overlay span {
        font-size: 12px;
    }


    .gallery-overlay i {
        width: 32px;
        height: 32px;

        font-size: 11px;
    }

}


/* =========================
   VERY SMALL MOBILE
========================= */

@media (max-width: 375px) {

    .gallery-section {
        padding: 45px 0;
    }


    .gallery-header h2 {
        font-size: 28px;
    }


    .gallery-grid {
        grid-auto-rows: 210px;
    }


    .gallery-large {
        height: 250px;
    }

}


/* =========================================================
   GALLERY LIGHTBOX
========================================================= */

.gallery-lightbox {
    position: fixed;

    inset: 0;

    z-index: 9999;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 30px;

    background: rgba(0, 0, 0, 0.88);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}


/* =========================
   ACTIVE LIGHTBOX
========================= */

.gallery-lightbox.active {
    opacity: 1;
    visibility: visible;
}


/* Prevent page scrolling */

body.gallery-lightbox-open {
    overflow: hidden;
}


/* =========================
   LIGHTBOX CONTENT
========================= */

.lightbox-content {
    position: relative;

    width: 100%;
    max-width: 1100px;

    height: 100%;

    display: flex;

    align-items: center;
    justify-content: center;
}


/* =========================
   IMAGE WRAPPER
========================= */

.lightbox-image-wrapper {
    position: relative;

    width: auto;
    max-width: 900px;
    max-height: 85vh;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;
}


/* =========================
   LIGHTBOX IMAGE
========================= */

.lightbox-image {
    max-width: 100%;
    max-height: 78vh;

    width: auto;
    height: auto;

    display: block;

    object-fit: contain;

    border-radius: 4px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.35);
}


/* =========================
   LIGHTBOX CAPTION
========================= */

.lightbox-caption {
    width: 100%;

    margin-top: 14px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    color: #ffffff;
}


.lightbox-title {
    font-size: 13px;
    font-weight: 500;
}


.lightbox-counter {
    flex-shrink: 0;

    font-size: 11px;

    opacity: 0.75;
}


/* =========================
   LIGHTBOX BUTTONS
========================= */

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;

    z-index: 10;

    border: none;

    display: flex;

    align-items: center;
    justify-content: center;

    cursor: pointer;

    color: #ffffff;

    background: rgba(255, 255, 255, 0.12);

    transition:
        background 0.3s ease,
        transform 0.3s ease;
}


.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: #397c55;
}


/* =========================
   CLOSE
========================= */

.lightbox-close {
    top: 15px;
    right: 15px;

    width: 42px;
    height: 42px;

    border-radius: 50%;

    font-size: 17px;
}


/* =========================
   PREVIOUS / NEXT
========================= */

.lightbox-prev,
.lightbox-next {
    top: 50%;

    width: 46px;
    height: 46px;

    border-radius: 50%;

    transform: translateY(-50%);
}


.lightbox-prev {
    left: 10px;
}


.lightbox-next {
    right: 10px;
}


.lightbox-prev:hover,
.lightbox-next:hover {
    transform:
        translateY(-50%)
        scale(1.05);
}


/* =========================
   LIGHTBOX TABLET
========================= */

@media (max-width: 991.98px) {

    .gallery-lightbox {
        padding: 20px;
    }


    .lightbox-image-wrapper {
        max-width: 85%;
    }


    .lightbox-image {
        max-height: 75vh;
    }


    .lightbox-prev {
        left: 0;
    }


    .lightbox-next {
        right: 0;
    }

}


/* =========================
   LIGHTBOX MOBILE
========================= */

@media (max-width: 575.98px) {

    .gallery-lightbox {
        padding: 15px;
    }


    .lightbox-image-wrapper {
        width: 100%;
        max-width: 100%;
    }


    .lightbox-image {
        max-width: 100%;
        max-height: 70vh;
    }


    .lightbox-close {
        top: 8px;
        right: 8px;

        width: 38px;
        height: 38px;

        font-size: 15px;
    }


    .lightbox-prev,
    .lightbox-next {
        width: 38px;
        height: 38px;

        font-size: 12px;
    }


    .lightbox-prev {
        left: 2px;
    }


    .lightbox-next {
        right: 2px;
    }


    .lightbox-caption {
        margin-top: 10px;

        gap: 10px;
    }


    .lightbox-title {
        font-size: 12px;
    }


    .lightbox-counter {
        font-size: 10px;
    }

}