/* Image Modal (Lightbox) */
.image-modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 10000;
    /* Sit on top */
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    /* Center content vertically */
    justify-content: center;
    /* Center content horizontally */
}

/* Modal Content (image) */
.modal-content {
    margin: auto;
    display: block;
    width: auto;
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    animation-name: zoom;
    animation-duration: 0.3s;
    position: relative;
    /* Context for nav buttons if appended here */
}

@keyframes zoom {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}

/* The Close Button */
.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10001;
}

.close-modal:hover,
.close-modal:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Caption of Modal Image (Image Text) - Optional */
#modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

/* Navigation Buttons */
.modal-nav-btn {
    position: fixed;
    /* Fixed relative to viewport to always stay on sides */
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 24px;
    cursor: pointer;
    z-index: 10002;
    border-radius: 8px;
    transition: background 0.2s;
}

.modal-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-nav-btn.prev {
    left: 20px;
}

.modal-nav-btn.next {
    right: 20px;
}

/* Add Animation - Zoom in the Modal */
.image-modal .modal-content,
#caption {
    animation-name: zoom;
    animation-duration: 0.3s;
}

@media only screen and (max-width: 700px) {
    .modal-content {
        width: 100%;
    }

    .modal-nav-btn {
        padding: 10px 15px;
        font-size: 18px;
    }
}