/* =========================================
   Gallery Layout
   ========================================= */
 
.wp-block-gallery {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
}
 
.wp-block-gallery .wp-block-image,
.wp-block-gallery figure {
    margin: 0 !important;
    overflow: hidden;
    aspect-ratio: 4/3;
}
 
.wp-block-gallery .wp-block-image img,
.wp-block-gallery figure img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
 
.wp-block-gallery .wp-block-image img:hover,
.wp-block-gallery figure img:hover {
    opacity: 0.85;
}
 
/* =========================================
   Lightbox
   ========================================= */
 
#sr-lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.92);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
 
#sr-lightbox.attivo {
    display: flex;
}
 
#sr-lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 2px;
}
 
#sr-lightbox-chiudi {
    position: absolute;
    top: 20px; right: 30px;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    user-select: none;
}
 
#sr-lightbox-prev,
#sr-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 48px;
    cursor: pointer;
    user-select: none;
    padding: 0 20px;
    line-height: 1;
}
 
#sr-lightbox-prev { left: 10px; }
#sr-lightbox-next { right: 10px; }
 
#sr-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #ccc;
    font-size: 14px;
}
 
@media (max-width: 600px) {
    .wp-block-gallery {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
