﻿/* =====================================
   PROJECT GALLERY
===================================== */

.project-gallery {
    margin-top: 10px;
}

.gallery-subtitle {
    display: inline-block;
    color: #f44322;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.gallery-count {
    background: #f5f5f5;
    color: var(--secondary);
    padding: 9px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
}


/* Gallery Image */

.gallery-item {
    position: relative;
    height: auto;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    background: #eee;
}

.gallery-large {
    height: auto;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}


/* Overlay */

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient( to top, rgba(11,61,46,.55), rgba(11,61,46,.05) );
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: .35s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}


/* Zoom Button */

.gallery-zoom {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #444;
    border-radius: 50%;
    font-size: 20px;
    transform: scale(.7);
    transition: .35s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.gallery-item:hover .gallery-zoom {
    transform: scale(1);
}


/* More Photos */

.more-photos {
    position: absolute;
    right: 15px;
    bottom: 15px;
    background: rgba(0,0,0,.75);
    color: #fff;
    padding: 7px 13px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
}


/* =====================================
   LIGHTBOX
===================================== */

.gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(5,15,20,.96);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease;
    z-index: 99999;
}

    .gallery-lightbox.active {
        opacity: 1;
        visibility: visible;
    }


/* Lightbox Content */

.lightbox-content {
    width: min(1100px, 84vw);
    height: 82vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

    .lightbox-content img {
        max-width: 100%;
        max-height: calc(82vh - 60px);
        object-fit: contain;
        border-radius: 10px;
        box-shadow: 0 20px 70px rgba(0,0,0,.5);
        animation: galleryImageIn .3s ease;
    }

@keyframes galleryImageIn {

    from {
        opacity: 0;
        transform: scale(.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* Caption */

.lightbox-caption {
    color: rgba(255,255,255,.8);
    font-size: 14px;
    margin-top: 15px;
    text-align: center;
}


/* Close */

.lightbox-close {
    position: absolute;
    top: 22px;
    right: 25px;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    color: #fff;
    font-size: 20px;
    transition: .3s;
}

    .lightbox-close:hover {
        background: #f44322;
        border-color: #f44322;
        transform: rotate(90deg);
    }


/* Counter */

.lightbox-counter {
    position: absolute;
    top: 30px;
    left: 30px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    background: rgba(255,255,255,.1);
    padding: 8px 15px;
    border-radius: 30px;
}


/* Navigation */

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 55px;
    height: 55px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-size: 25px;
    transition: .3s;
}

    .lightbox-nav:hover {
        background: #f44322;
    }

.lightbox-prev {
    left: 25px;
}

.lightbox-next {
    right: 25px;
}


/* Prevent page scroll */

body.lightbox-open {
    overflow: hidden;
}


/* =====================================
   MOBILE
===================================== */

@media (max-width: 767px) {

    .gallery-large {
        height: auto;
    }

    .gallery-item {
        height: auto;
        border-radius: 12px;
    }

    .lightbox-content {
        width: 90vw;
        height: 75vh;
    }

    .lightbox-nav {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }

    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 42px;
        height: 42px;
    }

    .lightbox-counter {
        top: 18px;
        left: 15px;
    }
}


/* Reduced Motion Accessibility */

@media (prefers-reduced-motion: reduce) {

    .gallery-item img,
    .gallery-overlay,
    .gallery-zoom,
    .gallery-lightbox,
    .lightbox-content img {
        transition: none;
        animation: none;
    }
}
