/* Masonry Collage Setup */
.collage {
    column-count: 3; /* Adjust based on screen size */
    column-gap: 15px;
    padding: 20px;
}

.collage-item {
    break-inside: avoid; /* Prevents images from splitting across columns */
    margin-bottom: 15px;
    cursor: pointer;
    position: relative;
}

/* --- UPDATED FOR SMOOTH CROSSFADE --- */

/* Stack cycling images perfectly on top of each other */
.collage-item.cycle-images {
    display: grid;
}

.collage-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Put all cycling images in the same grid spot and make them transparent */
.collage-item.cycle-images img {
    grid-area: 1 / 1; /* Forces them to overlap */
    opacity: 0;       /* Hides the image */
    transition: opacity 1s ease-in-out; /* The crossfade speed */
}

/* Make the active image visible */
.collage-item.cycle-images img.active {
    opacity: 1;
    z-index: 2; /* Ensures the active image stays on top */
}

/* Ensure single-image containers (non-cycling) display normally */
.collage-item:not(.cycle-images) img {
    display: block;
}

/* ------------------------------------ */

/* Dark Modal Overlay */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Dark background */
    overflow-y: auto;
}

.modal-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 50px;
}

.modal-content img {
    max-height: 80vh;
    max-width: 90%;
    border-radius: 5px;
}

.close-btn {
    position: absolute;
    top: 20px; right: 40px;
    color: white; font-size: 40px; cursor: pointer;
}