#grid {
    max-width: 1100px;
    margin: 40px auto;
    column-count: 1;
    padding: 10px;
    column-gap: 10px;
}

#grid img {
    width: 100%;
    padding: 5px 0px;
}


@media (min-width: 550px) {

#grid {
    column-count: 2;
}

}

@media (min-width: 800px) {

#grid {
    column-count: 3;
}

}

/* MODAL */


#grid-modal {
    height: 100vh;
    width: 100%;
    position: fixed;
    top: 0px;
    left: 0px;
    transition: 0.7s;
    z-index: 6;
    background-color: black;
}

#grid-modal.opened {
    transform: translateY(0%);
}

#grid-modal.closed {
    transform: translateY(-100%)
}

#grid-modal img:nth-child(1) {
    object-fit: contain;
    width: 100%;
    height: 100%;
}

#grid-modal img:nth-child(2) {
    height: 40px;
    position: absolute;
    right: 10px;
    top: 10px;
    filter: invert(100%);

    padding: 0px;
    border-radius: 50%;
    background-color: white;

    box-sizing: initial;
}

#grid-modal img:nth-child(3), #grid-modal img:nth-child(4) {
    height: 40px;
    position: absolute;
    top: 46%;
    filter: invert(100%);
    
    padding: 5px;
    border-radius: 50%;
    background-color: white;
    box-sizing: initial;
}

#grid-modal img:nth-child(3) {
    left: 5px;
}

#grid-modal img:nth-child(4) {
    right: 5px;
}

@media (any-hover) {

    #grid-modal img:nth-child(2), #grid-modal img:nth-child(3), #grid-modal img:nth-child(4) {
        cursor: pointer;
    } 

    #grid img {
        cursor: pointer;
    }

}

@media (min-width: 800px) {
    #grid-modal img:nth-child(2) {
        right: 40px;
        top: 30px;
        height: 50px;
    }

    #grid-modal img:nth-child(3), #grid-modal img:nth-child(4) {
        height: 55px;
    }
}