.lg-gallery-wrapper {
    width: 100%;
    box-sizing: border-box;
}

.lg-gallery-wrapper * {
    box-sizing: border-box;
}

.lg-filters {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 30px;
}

.lg-filter {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 9px 18px;
    border: 1px solid #d5d5d5;
    border-radius: 100px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.lg-filter:hover {
    border-color: currentColor;
}

.lg-filter.is-active {
    background: #1d1d1d;
    border-color: #1d1d1d;
    color: #fff;
}

.lg-gallery {
    display: grid;
    grid-template-columns: repeat(var(--lg-columns-desktop, 4), minmax(0, 1fr));
    gap: var(--lg-gap, 30px);
    width: 100%;
}

.lg-item {
    min-width: 0;
}

.lg-item[hidden] {
    display: none !important;
}

.lg-logo-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.lg-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: var(--lg-logo-height, 120px);
}

.lg-logo img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: var(--lg-object-fit, contain);
}

.lg-caption {
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
    line-height: 1.4;
}

.lg-no-results {
    padding: 30px 15px;
    text-align: center;
    opacity: .7;
}

@media (max-width: 1024px) {
    .lg-gallery {
        grid-template-columns: repeat(var(--lg-columns-tablet, 3), minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .lg-gallery {
        grid-template-columns: repeat(var(--lg-columns-mobile, 2), minmax(0, 1fr));
    }

    .lg-filters {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        width: 100%;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .lg-filters::-webkit-scrollbar {
        display: none;
    }

    .lg-filter {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 8px 15px;
        font-size: 13px;
    }
}


/* ==========================================================
   SCROLL REVEAL - si ripete ogni volta che il logo rientra
   nel viewport, senza richiedere il reload della pagina.
   ========================================================== */
.lg-motion-enabled .lg-item {
    opacity: 0;
    transform: translate3d(0, 24px, 0) scale(.97);
    filter: blur(4px);
    transition:
        opacity .55s cubic-bezier(.2,.7,.2,1),
        transform .65s cubic-bezier(.2,.7,.2,1),
        filter .55s ease;
    transition-delay: var(--lg-reveal-delay, 0ms);
    will-change: opacity, transform, filter;
}

.lg-motion-enabled .lg-item.is-in-view {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
    .lg-motion-enabled .lg-item,
    .lg-motion-enabled .lg-item.is-in-view {
        opacity: 1;
        transform: none;
        filter: none;
        transition: none;
    }
}
