.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 10px;
    justify-content: center;
    align-items: flex-end;
}

.gallery img {
    height: auto;
    width: auto;
    cursor: pointer;
    border-radius: 6px;
    transition: transform 0.2s;
    max-height: 300px;
    /* oder passender gemeinsamer Wert */
    object-fit: contain;
}

.gallery img:hover {
    transform: scale(1.05);
    border-color: #fff;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.modal-content {
    max-width: 70%;
    max-height: 70%;
    border-radius: 10px;
    box-shadow: 0 0 20px #000;
}

.close,
.nav {
    position: absolute;
    color: white;
    font-size: 40px;
    cursor: pointer;
    user-select: none;
    z-index: 1000;
    top: 50%;
}

.nav-rsp {
    color: white;
    cursor: pointer;
    user-select: none;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    display: none;
}

.close {
    top: 20px;
    right: 30px;
}

.nav {
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    border: none;
    padding: 10px 20px;
    font-size: 50px;
}

.nav:hover {
    background: rgba(255, 255, 255, 0.1);
}

.prevImage {
    left: 80px;
}

.nextImage {
    right: 80px;
}

.modal-info {
    margin-top: 12px;
    color: white;
    text-align: center;
    font-size: 16px;
}

.modal-info a {
    color: white;
    text-decoration: underline;
    margin: 0 8px;
    font-size: 16px;
}


.modal-info i {
    font-size: 30px
}

.modal-info a:not(:nth-child(2)) {
    margin-left: 30px;
}

@media(max-width: 768px) {
    .gallery img {
        width: 350px;
    }
}

@media(max-width: 1270px) {
    .modal-content {
        max-width: 100%;
        max-height: 100%;
    }

    .nav {
        display: none;
    }

    .nav-rsp {
        display: unset;
    }

    .nav-rsp i {
        font-size: 50px;
    }

    .modal-info a:not(:nth-child(2)) {
        margin-left: unset;
    }

    .modal-info a:not(:first-child) {
        margin-left: 30px;
    }

}

@media only screen and (max-device-width: 1270px) and (orientation: landscape) {
    .modal-info {
        display: none;
    }

    .nav {
        display: unset;
    }

    .prevImage {
        left: 50px;
    }

    .nextImage {
        right: 50px;
    }
}