/* ==========================================================
   GALLERIA SENA MARMI
   Masonry (colonne CSS) + filtri stile menu + lightbox
   Full-width (container-fluid) con padding ai lati.
   Richiede: js/galleria.js
   ========================================================== */

/* ---------- Contenitore galleria: a tutta larghezza, con respiro ai lati ---------- */
.galleria-wrap {
    padding-left: 40px;
    padding-right: 40px;
}
@media (max-width: 991px) { .galleria-wrap { padding-left: 25px; padding-right: 25px; } }
@media (max-width: 767px) { .galleria-wrap { padding-left: 15px; padding-right: 15px; } }

/* ---------- FILTRI (stile menu header, a destra, con separatori) ---------- */
.galleria-filtri {
    text-align: right;
    margin: 0 0 26px;
    line-height: 1;
}
.galleria-filtri .filtro {
    display: inline-block;
    background: none;
    border: 0;
    border-left: 1px solid #d0d0d0;      /* separatore tra una voce e l'altra */
    padding: 2px 0 2px 22px;
    margin-left: 22px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #333;
    cursor: pointer;
    vertical-align: middle;
    transition: color .2s ease;
}
.galleria-filtri .filtro:first-child {   /* la prima voce non ha separatore a sinistra */
    border-left: 0;
    padding-left: 0;
    margin-left: 0;
}
.galleria-filtri .filtro:hover,
.galleria-filtri .filtro.active {
    color: #E30613;                       /* rosso brand — adatta all'esatto rosso del tema */
}
@media (max-width: 480px) {
    .galleria-filtri { text-align: center; }
    .galleria-filtri .filtro { padding-left: 12px; margin-left: 12px; }
    .galleria-filtri .filtro:first-child { padding-left: 0; margin-left: 0; }
}

/* ---------- GRIGLIA MASONRY ---------- */
.galleria {
    column-gap: 12px;
    -webkit-column-gap: 12px;
    column-count: 4;
    -webkit-column-count: 4;
}
@media (max-width: 1199px) { .galleria { column-count: 3; -webkit-column-count: 3; } }
@media (max-width: 767px)  { .galleria { column-count: 2; -webkit-column-count: 2; } }
@media (max-width: 480px)  { .galleria { column-count: 1; -webkit-column-count: 1; } }

.galleria-item {
    display: inline-block;
    width: 100%;
    margin: 0 0 12px;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    -webkit-column-break-inside: avoid;
    break-inside: avoid;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
    background: #fff;
}
.galleria-item.is-hidden { display: none; }   /* nascosto dal filtro */

.galleria-item img {
    display: block;
    width: 100%;
    height: auto;                             /* mantiene le proporzioni originali */
    transition: transform .35s ease;
}
.galleria-item:hover img { transform: scale(1.06); }

.galleria-item .overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0);
    transition: background .3s ease;
    display: flex; align-items: center; justify-content: center;
}
.galleria-item:hover .overlay { background: rgba(0,0,0,.35); }
.galleria-item .overlay i {                   /* icona lente (Font Awesome) */
    color: #fff; font-size: 28px; opacity: 0;
    transition: opacity .3s ease;
    text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.galleria-item:hover .overlay i { opacity: 1; }

/* ---------- LIGHTBOX ---------- */
.lb-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.92);
    z-index: 2000;
    display: none; opacity: 0;
    transition: opacity .25s ease;
}
.lb-overlay.open { display: block; opacity: 1; }

.lb-stage {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 60px 70px;
}
/* orizzontali + verticali: limite sia in larghezza che in altezza */
.lb-img {
    max-width: 100%; max-height: 100%;
    display: block; border-radius: 3px;
    box-shadow: 0 4px 30px rgba(0,0,0,.6);
    background: #111;
}

.lb-close, .lb-prev, .lb-next {
    position: absolute; z-index: 2010;
    color: #fff; background: rgba(0,0,0,.35);
    border: none; cursor: pointer; user-select: none;
    border-radius: 50%; transition: background .2s ease;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.25); }
.lb-close { top: 18px; right: 20px; width: 44px; height: 44px; font-size: 20px; line-height: 44px; text-align: center; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 22px; line-height: 52px; text-align: center; }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }

.lb-caption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 14px 20px 18px; text-align: center; color: #eee;
    background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0));
    font-size: 14px;
}
.lb-counter { position: absolute; top: 22px; left: 22px; color: #ccc; font-size: 13px; letter-spacing: 1px; z-index: 2010; }

@media (max-width: 600px) {
    .lb-stage { padding: 50px 12px; }
    .lb-prev { left: 6px; } .lb-next { right: 6px; }
    .lb-prev, .lb-next { width: 44px; height: 44px; line-height: 44px; }
}