#modaldiv {
    display: none;
    position: fixed;
    z-index: 1;
    padding: 0;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
}

#modalimg {
    border-radius: 10px;
    height: 98%;
    width: auto;
    margin: auto;
    max-width: 98%;
    z-index: -1;

    position: absolute;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;
}

#modalcap {
    display: block;
    position: absolute;
    left: 0;
    bottom: 1em;
    margin: 0;
    padding: 0;
    width: 100%;    
    color: white;
    font-size: 2em;
    text-align: center;
    text-shadow: 3px 3px 5px rgba(0,0,0,1);
}

#modalimg, #modalcap {
    animation-name: zoom;
    animation-duration: 0.5s;
}

@keyframes zoom {
    from {opacity: 0;}
    to {opacity: 1;}
}

#modalclo {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}
#modalclo:hover, #modalclo:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

@media only screen and (max-width: 1366px) {
    #modalimg {
        height: auto;
        width: 98%;
        max-height: 98%;
    }
}