#galleri {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
}

#galleri img {
    width: 31%;
    margin: 0 0 2em 0;
    cursor: pointer;
    height: 200px;
    object-fit: cover;
}

#galleri p {
    display: none;
  }
  
#myModal {
    display: none;
    position: fixed;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 1;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
}
  
/* Modal Content */
#modal-content {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgb(41, 41, 41);
    margin: 0px auto;
    padding: 50px 0 100px 0;
    max-width: 800px;
}

.modalimg {
    max-width: 85%;
}




#imgtext {
    text-align: center;
    margin-top: -80px;
    padding: 0 20px;
    color: #ffffff;
}
  

/* The Close Button */
#close {
    cursor: pointer;
    margin: 0px auto -60px auto;
    max-width: 800px;
    text-align: right;
}

#close img {
    width: 20px;
    padding: 20px;
}
  
/* Next & previous buttons */
#prev, #next {
    cursor: pointer;
    margin: 20px;  
    z-index: 1;
    transition: 0.6s ease;
    user-select: none;
    -webkit-user-select: none;
}

#prev img, #next img {
    width: 20px;
}
/* media queries */

@media screen and (max-width: 940px) {

    main {
        margin: 2em 2em 5em 2em;
        padding: 2em;
    }
        .modalimg {
        max-width: 75%;
    }

}


@media screen and (max-width: 700px) {

    #galleri img {
        width: 47%;
    }

}


@media screen and (max-width: 500px) {

    #galleri img {
        width: 100%;
    }

}

@media screen and (max-width: 450px) {
    .modalimg {
        max-width: 65%;
    }
}

@media screen and (max-width: 370px) {
    .modalimg {
        max-width: 60%;
    }
}

@media screen and (max-width: 315px) {

    main {
        margin: 2em 1em 3em 1em;
        padding: 1em;
    }
}