.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 90vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: contain;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s ease;
}

.close:hover {
    color: #fff;
}

.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 16px;
    cursor: pointer;
    font-size: 24px;
    border-radius: 4px;
    transition: background 0.3s;
    z-index: 1001;
}

.nav-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

#prevButton {
    left: 20px;
}

#nextButton {
    right: 20px;
}

#caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    font-size: 16px;
}

@media (max-width: 768px) {
    .nav-button {
        padding: 12px;
        font-size: 15px;
    }

    .modal-content {
        max-width: 95%;
        max-height: 125vh;
        top: 47%;
    }

    .description-container {
        font-size: 10px;
    }

    .h2 { font-size: 1em;

    }

    .nav-button {
        top: 49%;
    }

    #prevButton {
        left: 10px;
    }

    #nextButton {
        right: 10px;
    }
}
