/* Grid layout for thumbnails */
.image-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.image-thumb {
    width: 100%;

    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    grid-column: span 12;
}

@media screen and (min-width: 640px) {
    .image-thumb {
       
        grid-column: span 6;
    }
}

@media screen and (min-width: 768px) {
    .image-thumb:nth-child(n+2) {
        grid-column: span 3;
    }
}

/* Modal overlay */
.modal {
    display: none;
    position: fixed;            /* Stick to viewport */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;              /* High z-index to be on top */
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;


    justify-content: center; /* horizontal center */
    align-items: center;     /* vertical center */
}

/* Show modal when active */
.modal.show {
    display: flex;
}

/* Fullscreen image */
.modal-content {
    max-width: 90%;
    max-height: 90%;
    margin-top: 20%;
  
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    object-fit: contain; /* ensures image scales well */
}

/* Close button */
.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
}
