* {
    margin: 0;
    padding: 0;
    background-color: #000000;
}

#image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(256px, 4fr));
    gap: 1px;
}

@media (orientation: portrait) {
    #image-gallery {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns if viewport height is greater */
    }
}

.image-container {
    position: relative;
    overflow: hidden;
    width: 256px;
    height: 256px;
    /* Placeholder background color */
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    width: 256px;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s;
    cursor: pointer;
    /* Add cursor pointer for clickable images */
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    overflow: auto;
}

.modal-content {
    display: block;
    margin: 10% auto;
    max-width: 80%;
    max-height: 80%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.1);
}

.modal-content img {
    display: block;
    margin: auto;
    width: 40vw;
    max-width: 100%;
    max-height: 100%;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}