/* General Styles for Thumbnail Images */
main img {
    max-width: 33.33%;
    height: auto; /* Corrected to ensure proportional scaling */
    padding: 1vw;
    display: block;
    margin-left: auto;
    margin-right: auto;
    border-radius: 5px; /* Rounded corners for thumbnails */
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease; /* Smooth scaling and opacity */
}

/* Hover Effects for Thumbnail Images */
main img:hover {
    transform: scale(1.05); /* Enlarges the image on hover */
    /* filter: brightness(1.1); Increases brightness by 15% */
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Modal Content */
.modal-content {
    margin: auto;
    max-width: 80%;
    max-height: 70%;
    object-fit: contain; /* Maintains aspect ratio */
    display: block;
}

/* Caption for Modal Images */
#caption {
    color: white;
    font-size: 1.2rem;
    text-align: center;
    margin-top: 10px;
}

/* Close Button */
.close {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover, .close:focus {
    color: #bbb;
}

/* Navigation Buttons */
.prev, .next {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 18px;
    padding: 10px 20px;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.prev {
    left: 10px;
}

.next {
    right: 10px;
}

.prev:hover, .next:hover {
    background-color: rgba(255, 255, 255, 0.7);
    color: black;
}

/* Mobile Responsive Styles */
@media only screen and (max-width: 700px) {
    .modal-content {
        width: 100%;
    }
}
