/**
 * REDE catálogo móvil v1.0.0 — capa complementaria, sin tocar el motor de filtros.
 * Reglas: una tarjeta completa por deslizado, contador discreto, sin texto vecino cortado.
 * Solo los portales REDE de cocina/baño (el PHP restringe IDs 2791 y 8881).
 */
body.postid-2791.rede-family-hub-page .post-author-info,
body.postid-2791.rede-family-hub-page nav.post-navigation {
    display: none !important;
}

.rede-family-hub-page .rede-mobile-gallery-count {
    display: none;
}

@media screen and (max-width: 767px) {
    body.rede-family-hub-page .rede-family-hub__projects {
        /* No dejar 14% de la próxima tarjeta visible: contenía texto recortado. */
        grid-auto-columns: 100% !important;
        padding: 2px 0 14px !important;
        scroll-padding-inline: 0 !important;
        scroll-snap-type: x mandatory;
        overscroll-behavior-inline: contain;
    }

    body.rede-family-hub-page .rede-family-hub__projects > .rede-family-hub__project,
    body.rede-family-hub-page .rede-family-hub__projects > .rede-premeson-auto-card {
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
        scroll-snap-align: start;
    }

    /* Los proyectos inyectados por el Puente añadían un título grande,
     * mientras el catálogo nativo solo enseña «Ver proyecto real».
     * Igualar exclusivamente la presentación móvil sin borrar títulos/SEO. */
    body.rede-family-hub-page .rede-family-hub__projects .rede-premeson-auto-copy {
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 9px 8px 10px !important;
        min-width: 0;
    }
    body.rede-family-hub-page .rede-family-hub__projects .rede-premeson-auto-copy strong {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }
    body.rede-family-hub-page .rede-family-hub__projects .rede-premeson-auto-copy > span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 38px;
        padding: 8px 15px;
        border-radius: 999px;
        background: #f2fff7;
        color: #087c41;
        border: 1px solid #bfe8d1;
        font-size: 14px;
        font-weight: 850;
        line-height: 1.3;
        text-align: center;
        white-space: normal;
    }

    /* El contador es solo orientativo: no cubre fotografías ni CTAs. */
    body.rede-family-hub-page .rede-mobile-gallery-count {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        margin: 0 1px 7px;
        min-height: 19px;
    }
    body.rede-family-hub-page .rede-mobile-gallery-count__value {
        display: inline-block;
        padding: 3px 8px;
        border-radius: 999px;
        border: 1px solid #e2e3e5;
        background: #f7f7f7;
        color: #696c70;
        font: 600 11px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
        letter-spacing: 0.02em;
        box-shadow: none;
    }
    body.rede-family-hub-page .rede-mobile-gallery-count[hidden] {
        display: none !important;
    }
}

/* 1.0.1 - Restaurar filtros visibles en varias filas.
 * Alcance: EXCLUSIVAMENTE la franja de botones de Material en móvil.
 * No toca carrusel, fotografías, contador, títulos ni la lógica de selección.
 */
@media screen and (max-width: 767px) {
    body.rede-family-hub-page .rede-family-hub__filter-group[data-filter-group="material"] .rede-family-hub__chips {
        display: flex !important;
        flex-flow: row wrap !important;
        justify-content: flex-start !important;
        align-items: center !important;
        column-gap: 8px !important;
        row-gap: 8px !important;
        overflow: visible !important;
        white-space: normal !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
    body.rede-family-hub-page .rede-family-hub__filter-group[data-filter-group="material"] .rede-family-hub__chips > button,
    body.rede-family-hub-page .rede-family-hub__filter-group[data-filter-group="material"] .rede-family-hub__chips > a {
        display: inline-flex !important;
        flex: 0 1 auto !important;
        align-items: center !important;
        justify-content: center !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        text-align: center !important;
    }
}

/* v1.0.3 — Regla aprobada de proyectos reales: no mostrar nombres grandes
 * de tarjetas añadidas por el Puente, tampoco en ESCRITORIO.
 * Aplica solo a los catálogos REDE (Cocina ID2791 y Baño ID8881);
 * NO afecta home, SEO/HTML, fotos, filtros, scroll, conteo ni enlaces.
 * El título sigue disponible para lectores de pantalla.
 */
body.rede-family-hub-page .rede-family-hub__projects .rede-premeson-auto-card .rede-premeson-auto-copy strong {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
