.gallery {
    width: 100%;
    display: block;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    padding: 20px;
}

.gallery img {   
  
    cursor: pointer;
    transition: transform 0.3s;
    border-radius: 5px;
}

.gallery img:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.lightbox-content {
    display: block;
    margin: 10px auto;
    max-width: 90%;
    max-height: 95vh;
    animation: zoom 0.6s;
}

@keyframes zoom {
    from {transform: scale(0.5)}
    to {transform: scale(1)}
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close-btn:hover {
    color: #bbb;
}

.caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #fff;
    padding: 10px 0;
    font-size: 18px;
}

/* Navegação */
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.3s;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.5);
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev {
    left: 0;
    border-radius: 0 3px 3px 0;
}

.prev:hover, .next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Responsividade */
@media only screen and (max-width: 768px) {
    .lightbox-content {
        max-width: 95%;
        max-height: 85vh;
    }
    
    .caption {
        font-size: 16px;
    }
}