#gallery {
    -webkit-column-count: 3;
    -moz-column-count: 3;
    column-count: 3;
    -webkit-column-gap: 20px;
    -moz-column-gap: 20px;
    column-gap: 20px;
}

@media (max-width:800px) {
    #gallery {
        -webkit-column-count: 2;
        -moz-column-count: 2;
        column-count: 2;
    }
}

@media (max-width:600px) {
    #gallery {
        -webkit-column-count: 1;
        -moz-column-count: 1;
        column-count: 1;
    }
}

#gallery img,
#gallery video {
    width: 100%;
    height: auto;
    margin: 4% auto;
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
    cursor: pointer;
    transition: all 0.2s;
}

#gallery img:hover,
#gallery video:hover {
    transform: scale(1.01);
}

#gallery .modal-img:hover,
#gallery .modal-vid:hover {
    transform: none;
    cursor: default;
}

.modal-img,
.modal-vid {
    width: 100%;
    height: auto;
}

.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fade-in 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal.fade-out {
    animation: fade-out 0.1s ease-out;
}

@keyframes fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 700px;
    height: auto;
    transform: translateY(50px) scale(0.8, 0.8);
    animation: show-in 0.3s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes show-in {
    from {
        transform: translateY(50px) scale(0.8, 0.8);
    }

    to {
        transform: translateY(0px) scale(1, 1);
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}