.gallery {
    display: grid;
    max-width: 1200px;
    margin: 0 auto;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    padding: 10px;

}

.gallery img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s;
    aspect-ratio: 1/1;
    object-fit: cover;
}

.thumbnail:hover {
    transform: scale(1.05);
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.lightbox img {
    max-width: 90vw;
    /* Use viewport width for scaling */
    max-height: 90vh;
    /* Use viewport height for scaling */
    /* width: auto; */
    /* Maintain the natural aspect ratio */
    /* height: auto; */
    /* Maintain the natural aspect ratio */
    object-fit: contain;
    /* Ensure the whole image fits without cropping */

    /* Optional: adds a subtle shadow */
}

.lightbox:target {
    display: flex;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: white;
    font-size: 4rem;
    text-decoration: none;
}