
.photoGallery {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 15px auto 25px auto;  /* centers the whole block */
    justify-content: center;      /* centers the thumbnails inside */
    max-width: 900px;             /* optional, keeps it from stretching too wide */
}

.photoGallery {
    padding: 10px;
    background: #f7f5f2;
    border: 1px solid #e0d8cc;
    border-radius: 4px;
}

.galleryThumb {
    display: block;
    width: 140px;
    height: auto;
    border: 1px solid #b9b1a4;
    padding: 3px;
    background: #fff;
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.galleryThumb:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 14px rgba(0,0,0,.15);
}

#galleryOverlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.94);
    display: none;
    z-index: 9998;
}

#galleryLightbox {
    position: fixed;
    max-width: 92vw;
    max-height: 88vh;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 30px rgba(0,0,0,.75);
    display: none;
    z-index: 10000;
}

#galleryCaption {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 14px;
    text-align: center;
    color: #fff;
    background: rgba(0,0,0,.72);
    display: none;
    z-index: 10001;
}

#galleryClose {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,.68);
    cursor: pointer;
    display: none;
    z-index: 10002;
}

#galleryClose:before,
#galleryClose:after {
    content: '';
    position: absolute;
    top: 10px;
    left: 20px;
    width: 2px;
    height: 22px;
    background: #fff;
}

#galleryClose:before {
    transform: rotate(45deg);
}

#galleryClose:after {
    transform: rotate(-45deg);
}

.galleryArrow {
    position: fixed;
    top: 50%;
    width: 44px;
    height: 70px;
    margin-top: -35px;
    border: none;
    background: rgba(0,0,0,.5);
    cursor: pointer;
    display: none;
    z-index: 10001;
}

#galleryPrev {
    left: 16px;
}

#galleryNext {
    right: 16px;
}

.galleryArrow:before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    margin: 25px auto 0 auto;
    border: 10px solid transparent;
}

#galleryPrev:before {
    border-right-color: #fff;
    border-left: none;
}

#galleryNext:before {
    border-left-color: #fff;
    border-right: none;
}

@media (max-width: 700px) {
    .galleryThumb {
        width: 110px;
    }

    #galleryPrev {
        left: 8px;
    }

    #galleryNext {
        right: 8px;
    }

    #galleryClose {
        top: 8px;
        right: 8px;
    }
}
