﻿
/* =========================================
   PHOTO GALLERY
========================================= */

.photo-gallery-section {
    padding: 45px 0 70px;
    background: #fffdf9;
}

.photo-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 290px;
    gap: 14px;
}

/* Gallery Card */

.gallery-card {
    position: relative;
    display: block;
    min-width: 0;
    overflow: hidden;
    border-radius: 13px;
    background: #f3f1eb;
    text-decoration: none;
    isolation: isolate;
}

    .gallery-card img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
        transition: transform .6s ease;
    }

/* Image Sizes */

.gallery-large {
    grid-column: 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;
    gap: 10px;
    padding: 20px 16px;
    color: #fff;
    background: linear-gradient( to top, rgba(7, 23, 35, .88), rgba(7, 23, 35, .25) 45%, transparent 75% );
    opacity: 0;
    transition: opacity .35s ease;
}

    .gallery-overlay h3 {
        margin: 0 0 8px;
        color: #fff;
        font-size: 15px;
        font-weight: 700;
    }

    .gallery-overlay span {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        color: rgba(255,255,255,.9);
        font-size: 11px;
    }

        .gallery-overlay span i {
            color: #ff713c;
        }

.gallery-open {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 50%;
    color: #fff;
    font-size: 13px;
}

/* Hover Effects */

.gallery-card:hover img {
    transform: scale(1.07);
}

.gallery-card:hover .gallery-overlay {
    opacity: 1;
}

/* Touch Devices */

@media (hover: none) {
    .gallery-overlay {
        opacity: 1;
    }
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 991.98px) {

    .photo-gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-rows: 180px;
        gap: 12px;
    }
}

@media (max-width: 767.98px) {

    .photo-gallery-section {
        padding: 30px 0 45px;
    }

    .photo-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 175px;
        gap: 10px;
    }

    .gallery-large,
    .gallery-wide {
        grid-column: span 2;
    }

    .gallery-overlay {
        padding: 13px 11px;
    }

        .gallery-overlay h3 {
            font-size: 12px;
        }

        .gallery-overlay span {
            font-size: 10px;
        }

    .gallery-open {
        width: 29px;
        height: 29px;
        font-size: 11px;
    }
}

@media (max-width: 420px) {

    .photo-gallery-grid {
        grid-auto-rows: 155px;
    }

    .gallery-overlay h3 {
        font-size: 11px;
    }
}


/* =========================================
   IMAGE PREVIEW LIGHTBOX
========================================= */

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 70px;
    background: rgba(8, 15, 22, .92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: all .3s ease;
}

    .gallery-lightbox.active {
        opacity: 1;
        visibility: visible;
    }

.lightbox-content {
    position: relative;
    max-width: 1100px;
    width: 100%;
    max-height: 85vh;
    text-align: center;
    transform: scale(.94);
    transition: transform .3s ease;
}

.gallery-lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-content img {
    display: block;
    max-width: 100%;
    max-height: 78vh;
    width: auto;
    height: auto;
    margin: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 15px 60px rgba(0,0,0,.35);
}

.lightbox-caption {
    color: #fff;
    font-size: 14px;
    margin-top: 15px;
}

/* Close Button */

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 30px;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #183147;
    font-size: 20px;
    cursor: pointer;
    transition: .25s ease;
}

    .lightbox-close:hover {
        background: #f45116;
        color: #fff;
        transform: rotate(90deg);
    }

/* Navigation */

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-size: 17px;
    cursor: pointer;
    transition: .25s ease;
}

    .lightbox-nav:hover {
        background: #f45116;
        border-color: #f45116;
    }

.lightbox-prev {
    left: 25px;
}

.lightbox-next {
    right: 25px;
}

/* Responsive */

@media(max-width: 767px) {
    .gallery-lightbox {
        padding: 60px 15px;
    }

    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }

    .lightbox-nav {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }

    .lightbox-content img {
        max-height: 70vh;
    }
}

body.lightbox-open {
    overflow: hidden;
}


