/* ── FRG Mosaic — frontend v4.4 ── */

.frg-mosaic-wrap {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #0a0a0a;
    position: relative;
}

/* ── Desktop: flex con righe ── */
.frg-mosaic-desktop {
    position: absolute;
    top: -14%;
    left: -5%;
    width: 115%;
    height: 128%;
    transform: rotate(-5deg);
    transform-origin: center center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
    z-index: 0;
}

.frg-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex: 1;
    min-height: 0;
}

/* ── Mobile: grid flat, niente righe ── */
.frg-mosaic-mobile {
    display: none;
    position: absolute;
    top: -14%;
    left: -5%;
    width: 115%;
    height: 128%;
    transform: rotate(-5deg);
    transform-origin: center center;
    gap: 6px;
    box-sizing: border-box;
    z-index: 0;
}

/* ── Tile (condiviso) ── */
.frg-tile {
    flex: 1;
    position: relative;
    display: block;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    min-width: 0;
    min-height: 0;
}

.frg-tile:hover { z-index: 2; }

.frg-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    filter: grayscale(1) brightness(0.55);
    transition: filter 0.45s cubic-bezier(0.23, 1, 0.32, 1);
}

.frg-tile:hover img {
    filter: grayscale(0) brightness(1);
}

.frg-tile-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.2);
    transition: opacity 0.45s ease;
    pointer-events: none;
}

.frg-tile:hover .frg-tile-overlay { opacity: 0; }

div.frg-tile { cursor: default; }

/* ── Filtri glass ── */
.frg-filters {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(19, 22, 32, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 100px;
    white-space: nowrap;
}

.frg-filter-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 16px;
    border-radius: 100px;
    cursor: pointer;
    transition: color 0.25s ease, background 0.25s ease;
    flex-shrink: 0;
}

.frg-filter-btn:hover { color: #ffffff; }

.frg-filter-btn.frg-filter-active {
    background: linear-gradient(90deg, #FFD616, #F15411);
    color: #131620;
}

/* ── Testo sovrapposto ── */
.frg-mosaic-text { pointer-events: none; }
.frg-mosaic-text a,
.frg-mosaic-text .et_pb_button,
.frg-mosaic-text [role="button"] { pointer-events: auto; }

/* ── Mobile ── */
@media (max-width: 768px) {
    .frg-mosaic-wrap {
        overflow: hidden;
        touch-action: pan-y;
    }

    .frg-mosaic-desktop {
        display: none !important;
    }

    .frg-mosaic-mobile {
        display: grid !important;
    }

    .frg-filters {
        bottom: 16px;
        max-width: calc(100vw - 32px);
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
        padding: 6px 10px;
    }

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

    .frg-filter-btn {
        font-size: 0.7rem;
        padding: 5px 12px;
    }
}

@media (max-width: 480px) {
    .frg-mosaic-mobile {
        gap: 4px;
    }
}
