
/* ================= GALLERY FILTER UX ================= */

.gallery-item {
    transition:
        opacity .4s ease,
        transform .4s ease;
}

.gallery-item.hide {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    display: none; /* 👈 QUESTA È LA CHIAVE */
}



.gallery-item{
    opacity:0;
    transform:translateY(40px);
    transition:.7s ease;
}

.gallery-item.show{
    opacity:1;
    transform:translateY(0);
}

/* ================= CENTER GALLERY FILTER ================= */

.gallery-filter {
    display: flex;
    justify-content: center;   /* CENTRA ORIZZONTALMENTE */
    align-items: center;
    gap: 15px;
    margin: 40px auto 50px;
    text-align: center;
    flex-wrap: wrap;
}


.gallery-filter button {
    padding: 10px 22px;
    border-radius: 30px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font-weight: 500;
    transition: 
        background .3s ease,
        color .3s ease,
        transform .2s ease,
        box-shadow .3s ease;
}

.gallery-filter button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(0,242,255,.4);
}

.gallery-filter button.active {
    background: linear-gradient(90deg,var(--accent),var(--accent2));
    color: #000;
    box-shadow: 0 0 20px rgba(0,242,255,.6);
}

/* ================= FIX GALLERIA IMMAGINI ENORMI ================= */

#lavori {
    position: relative;
}

.gallery-grid {
    max-width: 1200px;
    margin: 60px auto 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: #000;
}

/* dimensione controllata */
.gallery-item img {
    width: 100%;
    height: 100%;
    aspect-ratio: 4 / 5;          /* PERFETTO per foto da telefono */
    object-fit: cover;
    object-position: center top;  /* evita tagli brutti */
    display: block;
}
