/* Style the Image Used to Trigger the Modal */
.mi-image {    
    cursor: pointer;
    transition: 0.3s;
}

.mi-image:hover {opacity: 0.7;}

/* The Modal (background) */
.mi-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 100000; /* Sit on top */
    /*padding-top: 55px; /* Location of the box */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    /*overflow: auto; /* Enable scroll if needed */
    overflow: hidden; /* prevent scroll on swipe-animation
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
}

.mi-modal a{
    text-decoration: none;
    color: var(--krube);
}

/* Modal Content (Image) */
.mi-modal-content {
    margin: auto;
    display: block;
    height: 90%; 
    /*  
    object-fit: scale-down;
    */
    object-fit: contain;
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0);
    border: 0;
}

/* Caption of Modal Image (Image Text) - Same Width as the Image */
.mi-caption_image {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1000px;
    text-align: center;
    color: #f8f9fa;
    padding: 10px 0;
}

/* Add Animation - Zoom in the Modal */
.mi-animation-zoom {
    animation-name: zoom;
    animation-duration: 0.6s;
}

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

/* Add Animation - Swipe in from Left to Middle */
.mi-animation-fromLeft {
    animation-name: fromLeft;
    animation-duration: 0.6s;
}

@keyframes fromLeft {
    from {transform:translateX(-50%)}
    to {transform:translateX(0%)}
}

/* Add Animation - Swipe in from Right to Middle */
.mi-animation-fromRight {
    animation-name: fromRight;
    animation-duration: 0.6s;
}
@keyframes fromRight {
    from {transform:translateX(50%)}
    to {transform:translateX(0%)}
}

/* The Close Button */
.mi-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f8f9fa;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

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

/* Next & previous buttons */
.mi-prev,
.mi-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    font-weight: bold;
    font-size: 20px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
}

/* Position the "next button" to the right */
.mi-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.mi-grid-img{
    max-height: 35vh;
    max-width: 40vw;
    object-fit: cover;
}


/* 100% Image Width on Smaller Screens */
@media only screen and (max-width: 700px){
    .mi-modal-content {
        width: 100%;
        max-height: 100%;
    }
    .mi-modal {
        padding-top:55px;   /* damit close-button sichtbar bleibt */
    }

    .mi-grid-img{
        max-height: 50vh;
        max-width: 100vw;
        width: 100%;
        object-fit: cover;
    }
}