/* Photo gallery */

/* Modal wrapper */
.modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}

/* Image inside modal */
.modal-content {
    max-width: 90%;
    max-height: 90%;
    width:90%;
    border-radius: 10px;
}

/* Close button */
.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* Nav arrows */
.modal-nav {
    position: absolute;
    top: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    user-select: none;
    padding: 20px;
}

img.modal-content {
  max-width:768px;
}

.modal-nav.prev { left: 2px; }
.modal-nav.next { right: 2px; }

.flex-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content:center;
}

.flex-gallery img {
    width: 300px;           /* desktop width */
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    display: block;
    object-fit: cover;
}

.gallery-item-wrapper {
    position: relative; 
    flex: 1 1 auto; 
    width:40%;
    min-width: 100px; /* Minimum size before wrapping */
    max-width: 200px; /* Maximum size to prevent single-column layout on wide screens */
    height: auto;
    margin: 5px; 
}

/* Style for the delete button */
.delete-gallery-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 100;
    opacity: 0.8;
    padding: 0.25rem 0.5rem;
    transition: opacity 0.3s;
}

/* Optional: Make the button more prominent on hover */
.gallery-item-wrapper:hover .delete-gallery-image-btn {
    opacity: 1;
}

/* Ensure the thumbnail fits the wrapper */
.gallery-item-wrapper .gallery_image_thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover; 
}

/* Mobile: force 3 columns */
@media (max-width: 600px) {
    .flex-gallery img {
        width: calc(33.33% - 10px); /* 3 per row */
    }
}


