/* ===========================
   GALLERY GRID
=========================== */

.galleryGrid {
    width: 90%;
    max-width: 1400px;
    margin: 40px auto;
    
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}


/* ===========================
   GALLERY IMAGES
=========================== */

.galleryGrid img {
    width: 100%;
    height: 250px;

    object-fit: cover;
    display: block;

    border-radius: 10px;
    cursor: pointer;

    transition: transform 0.3s ease,
                box-shadow 0.3s ease;
}


/* ===========================
   IMAGE HOVER
=========================== */

.galleryGrid img:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}


/* ===========================
   GALLERY MODAL
=========================== */

#galleryModal {
    position: fixed;
    inset: 0;

    background: rgba(0, 0, 0, 0.95);

    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    z-index: 9999;

    padding: 30px;
}


/* Show modal */

#galleryModal.active {
    display: flex;
}


/* ===========================
   MAIN VIEWER
=========================== */

.galleryViewer {
    position: relative;

    width: 90%;
    max-width: 1100px;
    height: 75vh;

    display: flex;
    align-items: center;
    justify-content: center;
}


/* ===========================
   MAIN IMAGE
=========================== */

#mainGalleryImage {
    max-width: 85%;
    max-height: 70vh;

    object-fit: contain;

    border-radius: 8px;
}


/* ===========================
   CLOSE BUTTON
=========================== */

.closeGallery {
    position: absolute;

    top: -20px;
    right: 0;

    width: 45px;
    height: 45px;

    border: none;
    border-radius: 50%;

    background: white;
    color: black;

    font-size: 30px;
    line-height: 1;

    cursor: pointer;

    z-index: 10;
}


/* ===========================
   IMAGE COUNTER
=========================== */

.imageCounter {
    position: absolute;

    top: 20px;
    left: 50%;

    transform: translateX(-50%);

    color: white;

    font-size: 16px;
    font-weight: bold;

    z-index: 5;
}


/* ===========================
   ARROWS
=========================== */

.galleryArrow {
    position: absolute;

    top: 50%;
    transform: translateY(-50%);

    width: 50px;
    height: 50px;

    border: none;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.9);
    color: black;

    font-size: 28px;

    cursor: pointer;

    z-index: 10;
}


.galleryArrow:hover {
    background: white;
}


.prevArrow {
    left: 0;
}


.nextArrow {
    right: 0;
}


/* ===========================
   THUMBNAILS
=========================== */

.galleryThumbnails {
    width: 90%;
    max-width: 1100px;

    display: flex;
    gap: 10px;

    overflow-x: auto;

    padding: 10px 0;
}


/* Thumbnail */

.galleryThumb {
    width: 80px;
    height: 60px;

    object-fit: cover;

    flex-shrink: 0;

    border-radius: 6px;

    opacity: 0.5;

    cursor: pointer;

    border: 2px solid transparent;

    transition: 0.2s ease;
}


.galleryThumb:hover {
    opacity: 1;
}


.galleryThumb.active {
    opacity: 1;

    border: 2px solid white;
}


/* ===========================
   TABLET
=========================== */

@media (max-width: 900px) {

    .galleryGrid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .galleryGrid img {
        height: 220px;
    }

}


/* ===========================
   MOBILE
=========================== */

@media (max-width: 600px) {

    .galleryGrid {
        width: 94%;

        grid-template-columns: repeat(2, 1fr);

        gap: 10px;

        margin: 25px auto;
    }

    .galleryGrid img {
        height: 180px;
        border-radius: 7px;
    }

    .galleryViewer {
        width: 100%;
        height: 70vh;
    }

    #mainGalleryImage {
        max-width: 90%;
        max-height: 60vh;
    }

    .galleryArrow {
        width: 40px;
        height: 40px;

        font-size: 22px;
    }

    .prevArrow {
        left: 5px;
    }

    .nextArrow {
        right: 5px;
    }

}