/* ==========================================
   Stili Griglia a Puzzle per la Gallery (Forzata)
========================================== */
.puzzle-gallery {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px !important;
    margin-top: 30px !important;
    margin-bottom: 50px !important;
    width: 100% !important;
}

.puzzle-item {
    position: relative !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    background: #000 !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5) !important;
    border: 1px solid #333 !important;
    transition: transform 0.3s ease, border-color 0.3s ease !important;
    width: 100% !important;
}

.puzzle-item.tall {
    grid-row: span 2 !important;
    height: 485px !important;
}

.puzzle-item.normal {
    height: 230px !important;
}

.puzzle-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.5s ease, filter 0.3s ease !important;
    filter: brightness(0.85) !important;
}

.puzzle-item:hover img {
    transform: scale(1.06) !important;
    filter: brightness(1) !important;
}

.puzzle-item:hover {
    border-color: #ff3366 !important;
    z-index: 2 !important;
}

.puzzle-overlay {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 20px !important;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent) !important;
    display: flex !important;
    justify-content: center !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.puzzle-item:hover .puzzle-overlay {
    opacity: 1 !important;
}

/* Responsive per smartphone */
@media (max-width: 768px) {
    .puzzle-gallery {
        grid-template-columns: 1fr !important;
    }
    .puzzle-item.tall {
        height: 300px !important;
        grid-row: span 1 !important;
    }
}
/* Sfondo personalizzato per la sezione Produzioni/Animazione */
#section_3 {
    position: relative;
    background-image: url('../img/animazione.jpg') !important; /* Modifica il percorso se l'immagine è in un'altra cartella */
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important; /* Effetto parallax elegante quando scorri */
}

/* Overlay scuro semitrasparente per mantenere la leggibilità dei testi e delle card */
#section_3::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.88); /* Sfondo nero con opacità all'88% */
    z-index: 1;
}

/* Assicura che il contenuto della sezione stia sopra lo strato di sfondo */
#section_3 .container {
    position: relative;
    z-index: 2;
}