/* FILTRI */
.filters {
    text-align: center;
    margin-bottom: 30px;
    margin-top: 30px;
}

.filter-btn {
    padding: 12px 24px;
    font-size: 18px;
    margin: 0 10px;
    background: #ddd;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
    background: #97CA41;
    color: white;
}

/* GALLERY GRID */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    padding: 30px;
    gap: 25px;
}

.item img,
.item video {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* CARD DELLA GALLERY */
.gallery-grid .item {
    width: 100%;
    max-width: 320px;          /* leggermente più grande */
    height: 320px;             /* più alta = meno taglio */
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;

    /* Ombra morbida */
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Effetto hover leggero */
.gallery-grid .item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.22);
}

/* IMMAGINI E VIDEO */
.gallery-grid img,
.gallery-grid video {
    width: 100%;
    height: 100%;

    /* Riempie la card senza spazi neri */
    object-fit: cover;

    /* Centra il contenuto per evitare tagli brutti */
    object-position: top;

    /* Leggero zoom per eliminare micro-bordi */
    transform: scale(1.03);
}

/* LIGHTBOX */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
}

.lightbox.visible {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
}

.arrow {
    position: absolute;
    top: 50%;
    font-size: 60px;
    color: white;
    cursor: pointer;
    user-select: none;
    transform: translateY(-50%);
}

.arrow.left {
    left: 40px;
}

.arrow.right {
    right: 40px;
}

.arrow:hover,
.close:hover {
    color: #97CA41;
}

/* ============================
   GALLERY — VERSIONE MOBILE
   ============================ */
@media (max-width: 768px) {

    /* Griglia più fitta: 3–4 card per riga */
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
        padding: 15px;
    }

    /* Card più piccole */
    .gallery-grid .item {
        max-width: 160px;
        height: 160px;
        border-radius: 10px;
    }

    /* Immagini più piccole e centrate */
    .gallery-grid img,
    .gallery-grid video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        transform: scale(1); /* niente zoom */
        border-radius: 10px;
    }

    /* ============================
       LIGHTBOX — VERSIONE MOBILE
       ============================ */

    /* Contenitore lightbox centrato */
/* ============================
   MOBILE — Lightbox ottimizzata
   ============================ */
@media (max-width: 768px) {

    /* Contenitore lightbox centrato */
    .lightbox {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Contenuto centrato */
    .lightbox-content {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: auto;
        position: relative;
    }

    /* Immagine/video centrati e più piccoli */
    .lightbox-content img,
    .lightbox-content video {
        max-width: 85%;
        max-height: 55vh;
        margin: 0 auto;
        display: block;
        border-radius: 10px;
    }

    /* ============================
       FRECCE — NASCONDI IN MOBILE
       ============================ */
    .arrow {
        display: none !important;
    }

    /* Bottone chiudi più piccolo */
    .close {
        font-size: 24px;
        top: 15px;
        right: 20px;
    }
}

}

.video-thumb {
    position: relative;
    width: 100%;
    height: 100%;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: white;
    opacity: 0.85;
    pointer-events: none;
}
