/* ================================
   GALLERY
================================ */

.gallery-section {
    background: #FAF9F5;
}

.gallery-heading {
    max-width: 700px;
    margin: 0 auto;
}

.gallery-subtitle {
    display: inline-block;
    font-family: var(--body);
    font-size: 12px;
    letter-spacing: 3px;
    color: #C8A96A;
    margin-bottom: 12px;
}

.gallery-heading h2 {
    font-family: var(--heading);
    font-size: 48px;
    color: #2F6A52;
    margin-bottom: 15px;
}

.gallery-heading p {
    font-family: var(--body);
    color: #666;
    line-height: 1.8;
}


/* Gallery Grid */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 240px;
    gap: 18px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}


/* Different Sizes */

.gallery-large {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-tall {
    grid-row: span 2;
}

.gallery-wide {
    grid-column: span 2;
}


/* Hover */

.gallery-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(24, 51, 41, 0.55);
    opacity: 0;
    transition: 0.4s ease;
}

.gallery-overlay span {
    color: #fff;
    border: 1px solid rgba(255,255,255,0.7);
    padding: 10px 22px;
    font-family: var(--body);
    font-size: 13px;
    letter-spacing: 1px;
    transform: translateY(15px);
    transition: 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-item:hover .gallery-overlay span {
    transform: translateY(0);
}


/* ================================
   LIGHTBOX
================================ */

.gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
}

.gallery-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.gallery-lightbox img {
    max-width: 85%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}


/* Buttons */

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    z-index: 2;
}

.lightbox-close {
    top: 25px;
    right: 35px;
    font-size: 40px;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 35px;
    padding: 20px;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    color: #C8A96A;
}


/* ================================
   MOBILE
================================ */

@media (max-width: 991px) {

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 220px;
    }

    .gallery-large {
        grid-column: span 2;
        grid-row: span 2;
    }

    .gallery-wide {
        grid-column: span 2;
    }
}


@media (max-width: 575px) {

    .gallery-heading h2 {
        font-size: 36px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 250px;
        gap: 12px;
    }

    .gallery-large,
    .gallery-wide {
        grid-column: span 1;
        grid-row: span 1;
    }

    .gallery-tall {
        grid-row: span 1;
    }

    .gallery-lightbox img {
        max-width: 92%;
        max-height: 80vh;
    }

    .lightbox-prev {
        left: 5px;
    }

    .lightbox-next {
        right: 5px;
    }
}