/* Container for the entire gallery */
.image-mosaic {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    grid-auto-rows: 240px;
    grid-auto-flow: dense;
    width: 100%;
}

.card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: end;
    background: #353535;
    color: #fff;
    box-shadow: rgba(3, 8, 20, 0.1) 0px 0.15rem 0.5rem, rgba(2, 8, 20, 0.1) 0px 0.075rem 0.175rem;
    height: 100%;
    width: 100%;
    border-radius: 4px;
    transition: all 500ms;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.card-wide {
    grid-column: span 2;
    grid-row: span 3;
}

.card-tall {
    grid-row: span 2;
}

@media screen and (min-width: 600px) {
    .card-tall {
        grid-row: span 2;
    }
    .card-wide {
        grid-column: span 2;
        grid-row: span 3;
    }
}

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

.lightbox-image-container {
    position: relative;
    width: 80%;
    height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin: 5vh auto; /* Equal top and bottom margin */
}

#lightbox-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 5px;
    transition: transform 0.1s ease;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0; /* Remove any default margins */
    padding: 20px; /* Equal padding on all sides to center with space */
}

.lightbox-close {
    position: absolute;
    top: 50px;
    right: 20px;
    font-size: 30px;
    color: white;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 50%;
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px; /* Larger buttons */
    color: white;
    /*background: rgba(255, 0, 0, 0.7); */
    border: none;
    padding: 15px 20px; /* Larger padding for bigger buttons */
    cursor: pointer;
    border-radius: 50%;
    z-index: 1003;
    transition: background 0.3s;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover, .lightbox-next:hover {
    background: rgba(255, 0, 0, 0.9); /* Darker red on hover */
}

@media (max-width: 768px) {
    .image-mosaic {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    .lightbox-image-container {
        width: 90%;
        height: 60vh;
        margin: 10vh auto; /* Adjusted for smaller screens */
    }
    #lightbox-image {
        padding: 15px; /* Slightly reduced padding for smaller screens */
    }
    .lightbox-prev, .lightbox-next {
        padding: 10px 15px; /* Adjusted padding for smaller screens */
    }
}

@media (max-width: 480px) {
    .image-mosaic {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    .lightbox-image-container {
        width: 95%;
        height: 50vh;
        margin: 10vh auto; /* Adjusted for smaller screens */
    }
    #lightbox-image {
        padding: 10px; /* Further reduced padding for very small screens */
    }
    .lightbox-prev, .lightbox-next {
        padding: 8px 12px; /* Adjusted padding for very small screens */
    }
}


.preview-modal{
    z-index:9999!important;
}