main {
    margin: 3rem 5vw;
}

.gallery {
    display: grid;
    max-width: 1400px;
    justify-content: center;
    margin: auto;
    gap: 40px;
    text-align: center;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    align-items:center;
}

figcaption{
    margin-top: 15px;
    line-height: 25px;
    letter-spacing: 5px;
    /* font-size: large; */
    font-weight: 500;
    text-transform: uppercase;
    /* font-size: 20px; */
    width: 50%;
    margin: auto;
}

.gallery img {
    display: block;
    /* max-width: 300px;
    min-height: 300px; */
    width: 100%;
    margin:auto;
    /* margin-bottom: 0px; */
    border-radius: 5px;
    cursor: pointer;
    object-fit: cover;
    max-width: 600px;
}

.gallery div {
    width:100%;
}

.gallery div img:hover {
    opacity: .5;
}

/* Style the images used to trigger the modal */
.modal-img {
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
}

/* .modal-img:hover {
    opacity: 0.7;
} */

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

/* Modal Content (image) */
.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    /* max-height:70vh; */
}

/* Caption of Modal Image */
#caption {
    margin: auto;
    display: block;
    width: 80%;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
    /* font-size: large; */
    font-weight: 500;
    font-family: "Montserrat", sans-serif;
    /* font-size: 1.2rem; */
    text-transform: uppercase;
    letter-spacing: 5px;
}

/* Add Animation - Zoom in the Modal */
.modal-content, #caption {
    animation-name: zoom;
    animation-duration: 0.3s;
}

@keyframes zoom {
    from {transform:scale(0)}
    to {transform:scale(1)}
}

/* The Close Button */
.close {
    position: absolute;
    right: 10vw;
    top: 100px;
    /* right: 35px;
    top: 15px; */
    color: #f1f1f1;
    font-size: 60px;
    font-weight: bold;
    transition: 0.3s;
}

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

/* .close {right: 8rem; } */

/*.gallery > div:last-child {
    grid-column: 1 / -1;
    justify-self: center;
}*/

@media screen and (min-width: 760px) {
    .modal-content {
    width: 50%;
}

}

@media screen and (min-width: 1100px) {
    .gallery {
        grid-template-columns: repeat(3, minmax(300px, 1fr));
    }

    .close {margin-right:15%;}

    .modal-content {
        width: 50%;
    }
}