/* =========================================
   GALLERY SECTION
========================================= */

.gallery-section {
    width: 100%;
    padding: 90px 0;
    background: var(--body-bg);
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
}

.gallery-container {
    width: 100%;
    max-width: 1320px;
    padding: 0 25px;
    margin: 0 auto;
}

/* =========================================
   GALLERY GRID
========================================= */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    height: 245px;
    overflow: hidden;
    border-radius: var(--border-radius);
    background: var(--section-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* =========================================
   HOVER OVERLAY
========================================= */

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(6, 24, 61, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.gallery-plus {
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* border: 2px solid var(--light-text);
    border-radius: 50%; */
    color: var(--light-text);
    font-size: 23px;
    transform: scale(0.6);
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.09);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* .gallery-item:hover .gallery-plus {
    transform: scale(1);
    background: var(--primary-color);
    border-color: var(--primary-color);
} */

/* Keyboard Focus */

.gallery-item:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}

/* =========================================
   LIGHTBOX
========================================= */

.gallery-lightbox {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 24, 61, 0.96);
    z-index: 99999;

    display: flex;
    align-items: center;
    justify-content: center;
    padding: 55px 90px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gallery-lightbox.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* =========================================
   LIGHTBOX IMAGE
========================================= */

.lightbox-content {
    width: 100%;
    max-width: 1050px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 155px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.lightbox-caption {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    color: var(--light-text);
    font-size: 13px;
    padding-top: 15px;
}

/* =========================================
   CLOSE BUTTON
========================================= */

.lightbox-close {
    position: absolute;
    top: 22px;
    right: 30px;
    width: 45px;
    height: 45px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: var(--light-text);
    font-size: 22px;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-close:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: rotate(90deg);
}

/* =========================================
   PREVIOUS / NEXT BUTTONS
========================================= */

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: var(--light-text);
    font-size: 19px;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: var(--transition);
}

.lightbox-nav:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.lightbox-prev {
    left: 25px;
}

.lightbox-next {
    right: 25px;
}

/* =========================================
   TABLET
========================================= */

@media (max-width: 991px) {

    .gallery-section {
        padding: 70px 0;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .gallery-item {
        height: 240px;
    }

    .gallery-lightbox {
        padding: 55px 70px;
    }

    .lightbox-prev {
        left: 12px;
    }

    .lightbox-next {
        right: 12px;
    }
}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 600px) {

    .gallery-section {
        padding: 55px 0;
    }

    .gallery-container {
        padding: 0 15px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .gallery-item {
        height: 170px;
        border-radius: 7px;
    }

    .gallery-plus {
        width: 40px;
        height: 40px;
        font-size: 17px;
    }

    /* Touch device interaction */

    .gallery-item:active .gallery-overlay {
        opacity: 1;
    }

    .gallery-lightbox {
        padding: 55px 12px 35px;
    }

    .lightbox-content img {
        max-width: 100%;
        max-height: calc(100vh - 145px);
    }

    .lightbox-nav {
        top: auto;
        bottom: 20px;
        width: 42px;
        height: 42px;
        font-size: 15px;
        transform: none;
    }

    .lightbox-prev {
        left: 20px;
    }

    .lightbox-next {
        right: 20px;
    }

    .lightbox-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
    }

    .lightbox-caption {
        font-size: 11px;
        padding: 12px 5px 0;
    }
}

/* =========================================
   EXTRA SMALL MOBILE
========================================= */

@media (max-width: 360px) {

    .gallery-grid {
        gap: 9px;
    }

    .gallery-item {
        height: 145px;
    }

}

/* =========================================
   ACCESSIBILITY
========================================= */

@media (prefers-reduced-motion: reduce) {

    .gallery-section *,
    .gallery-lightbox *,
    .gallery-section *::before,
    .gallery-section *::after {
        transition: none !important;
        animation: none !important;
    }

}