/*
 * TEN · RC6.11 · Pulido visual posterior a integración Patronato
 *
 * Alcance deliberadamente pequeño:
 * 1) Empieza aquí: Patronato conserva la jerarquía tipográfica del resto de tarjetas.
 * 2) Empieza aquí: CTAs de PP / Investigación familiar / Fusilados se leen como botones TEN.
 * 3) Guías: recupera el aire entre el grid de guías y el puente de producto.
 * 4) Cierre de página: si el último bloque es navy TEN, se fusiona visualmente con el footer.
 *
 * No cambia contenido, slugs, SEO, productos, derechos, checkout ni Motor TEN.
 */

/* 1 · Empieza aquí · Patronato dentro de tarjeta estrecha ------------------ */
.ten-start-next__box:has(a[href*="/patronato-proteccion-mujer/"]) h3 {
    max-width: 100%;
    font-size: clamp(1.42rem, 2vw, 1.72rem) !important;
    line-height: 1.18;
    letter-spacing: -0.01em;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}

/* Evita que el párrafo principal de Patronato quede visualmente comprimido. */
.ten-start-next__box:has(a[href*="/patronato-proteccion-mujer/"]) > p:not(.ten-eyebrow):not(.ten-start-next__price) {
    line-height: 1.58;
}

/* 2 · Empieza aquí · CTAs homogéneos -------------------------------------
 * Las tarjetas canónicas anteriores a Patronato usan enlaces de texto.
 * Se les da la misma jerarquía visual de botón TEN sin reescribir contenido.
 */
.ten-start-next__box a[href="/primera-pista/"],
.ten-start-next__box a[href="/kit-investigacion-familiar-1936-1950/"],
.ten-start-next__box a[href="/metodo-ten-02-fusilados-desaparecidos-restos/"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 100%;
    min-height: 48px;
    margin-top: 0.35rem;
    padding: 0.78rem 1.15rem;
    border: 1px solid var(--ten-navy, #132335);
    border-radius: 3px;
    background: var(--ten-navy, #132335);
    color: #fff !important;
    font-weight: 750;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    box-sizing: border-box;
}

.ten-start-next__box a[href="/primera-pista/"]:hover,
.ten-start-next__box a[href="/kit-investigacion-familiar-1936-1950/"]:hover,
.ten-start-next__box a[href="/metodo-ten-02-fusilados-desaparecidos-restos/"]:hover,
.ten-start-next__box a[href="/primera-pista/"]:focus-visible,
.ten-start-next__box a[href="/kit-investigacion-familiar-1936-1950/"]:focus-visible,
.ten-start-next__box a[href="/metodo-ten-02-fusilados-desaparecidos-restos/"]:focus-visible {
    border-color: var(--ten-navy-hover, #0D1926);
    background: var(--ten-navy-hover, #0D1926);
    color: #fff !important;
}

/* 3 · Guías · separación inequívoca entre grid y puente -------------------
 * La regla anterior dependía de adyacencia directa. Esta versión se apoya
 * sólo en el contexto de catálogo, por lo que sobrevive a wrappers Gutenberg.
 */
.ten-guides-catalog .ten-guides-cluster-bridge {
    margin-top: clamp(2.5rem, 4vw, 3.25rem) !important;
}

/* 4 · Navy + footer · continuidad visual ---------------------------------
 * Sólo actúa cuando el último elemento real del contenido es un bloque navy.
 * No afecta a páginas que terminan en blanco o warm.
 */
body:has(.entry-content > .ten-section--navy:last-child) .site-content,
body:has(.entry-content > .ten-section--navy:last-child) .content-area,
body:has(.entry-content > .ten-section--navy:last-child) .site-main,
body:has(.entry-content > .ten-section--navy:last-child) article,
body:has(.entry-content > .ten-section--navy:last-child) .inside-article,
body:has(.entry-content > .ten-section--navy:last-child) .entry-content {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

body:has(.entry-content > .ten-section--navy:last-child) .entry-content > .ten-section--navy:last-child,
body:has(.entry-content > .ten-section--navy:last-child) .site-footer {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

@media (max-width: 820px) {
    .ten-guides-catalog .ten-guides-cluster-bridge {
        margin-top: 2rem !important;
    }

    .ten-start-next__box:has(a[href*="/patronato-proteccion-mujer/"]) h3 {
        font-size: clamp(1.35rem, 6vw, 1.62rem) !important;
        line-height: 1.2;
    }

    .ten-start-next__box a[href="/primera-pista/"],
    .ten-start-next__box a[href="/kit-investigacion-familiar-1936-1950/"],
    .ten-start-next__box a[href="/metodo-ten-02-fusilados-desaparecidos-restos/"] {
        width: 100%;
    }
}
