.img-overlay figure {
    margin: 0;
    max-width: 95%;
    max-height: 95%;
}
/* Overlay trasparente */
.img-overlay {
    position: fixed;       /* rimane sopra tutto */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* trasparenza sulla pagina sottostante */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;       /* clicca per chiudere */
    z-index: 9999;         /* sopra tutto */
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none; /* inizialmente non cliccabile */
}

/* Quando l’overlay è attivo */
.img-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Immagine ingrandita */
.img-overlay img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain; /* mantiene proporzioni senza tagliare */
    border-radius: 6px;
    box-shadow: 0 0 20px rgba(0,0,0,0.6);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}


/* Animazione “zoom in” */
.img-overlay.active img {
    transform: scale(1);
}