/**
 * Portada — feed a ancho completo, sin tarjetas contenedoras.
 * Capas UX: lienzo (body) ≠ superficie de contenido (.td-app-main).
 */
body.td-home-portada {
    --td-home-edge-pad: max(16px, env(safe-area-inset-left, 0px));
    --td-home-edge-pad-r: max(16px, env(safe-area-inset-right, 0px));
    --td-home-canvas-bg: var(--td-brand-gray-light, #e6e6e6);
    --td-home-surface-bg: #ffffff;
    --td-home-surface-muted: #f3f3f3;
    --td-home-surface-border: rgba(51, 51, 51, 0.16);
    --td-home-section-divider: rgba(51, 51, 51, 0.14);
    --td-home-section-band: 6px;
    --td-home-row-hover: rgba(13, 27, 42, 0.04);
    --td-app-main-max: 100%;
    --td-bottom-nav-offset: 72px;
    background-color: var(--td-home-canvas-bg);
}

/* Sin franja gris entre cabecera y hub — el lienzo no debe verse en el corte */
body.td-home-portada .pwa-header-root {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
    box-shadow: 0 1px 0 rgba(226, 232, 240, 0.95) !important;
}

body.td-home-portada .pwa-header {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

body.td-home-portada .h-shell {
    padding-bottom: 6px !important;
}

body.td-home-portada #todoeldia-main,
body.td-home-portada .td-app-main.td-app-main--home-grid {
    margin-top: 0 !important;
    padding-top: 0 !important;
    background-color: var(--td-home-surface-bg) !important;
    background-image: none !important;
}

html[data-theme="light"] body.td-home-portada .td-app-main.td-app-main--home-grid {
    background-image: none !important;
}

body.td-home-portada .td-home-hub,
body.td-home-portada .td-home-intro {
    margin-top: 0 !important;
    padding-top: 0 !important;
    background: var(--td-home-surface-bg);
}

body.td-home-portada .td-home-hub__head {
    margin-top: 0 !important;
    padding-top: 16px !important;
}

html[data-theme="dark"] body.td-home-portada {
    --td-home-canvas-bg: #050810;
    --td-home-surface-bg: #101827;
    --td-home-surface-muted: #0c121c;
    --td-home-surface-border: rgba(71, 85, 105, 0.72);
    --td-home-section-divider: rgba(71, 85, 105, 0.9);
    --td-home-row-hover: rgba(255, 255, 255, 0.05);
    background-color: var(--td-home-canvas-bg);
}

/* Superficie de lectura: pegada al header, a ancho completo en móvil */
body.td-home-portada .td-app-main.td-app-main--home-grid,
body.td-home-portada .td-app-main.td-app-main--flush-cinta.td-app-main--home-grid {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0;
    background-color: var(--td-home-surface-bg);
    background-image: none;
    border: none;
    box-shadow: none;
}

html[data-theme="dark"] body.td-home-portada .td-app-main.td-app-main--home-grid {
    box-shadow: none;
}

/* Sin hueco entre header / avisos y contenido */
body.td-home-portada #sports-live-block.td-aviso-band {
    margin: 0 !important;
}

body.td-home-portada .pwa-header-root {
    margin-bottom: 0 !important;
    border-bottom: none !important;
    background: #ffffff !important;
    box-shadow: 0 1px 0 rgba(226, 232, 240, 0.95) !important;
}

html[data-theme="dark"] body.td-home-portada .pwa-header-root {
    background: #0f172a !important;
    box-shadow: 0 1px 0 rgba(51, 65, 85, 0.9) !important;
}

/* Portada sin chip de efeméride en header: quitar fila vacía del grid (causa hueco gris) */
body.td-home-portada .h-shell {
    grid-template-areas:
        "brand quick"
        "statusline statusline";
    gap: 8px 10px;
    padding-bottom: 10px;
}

body.td-home-portada .h-status-row {
    margin-bottom: 0;
}

body.td-home-portada .pwa-header-root + .td-app-main,
body.td-home-portada #sports-live-block + .td-app-main {
    margin-top: 0 !important;
}

body.td-home-portada .td-home-hub {
    padding-top: 0;
}

body.td-home-portada .td-app-main.td-app-main--home-grid > .td-home-anchor,
body.td-home-portada .td-app-main.td-app-main--home-grid > .td-home-mas-section {
    border-top: none;
    border-bottom: none;
    position: relative;
}

/* Separador entre módulos: franja de lienzo + línea de acento */
body.td-home-portada .td-app-main.td-app-main--home-grid > .td-home-anchor::after,
body.td-home-portada .td-app-main.td-app-main--home-grid > .td-home-mas-section::after {
    content: "";
    display: block;
    height: var(--td-home-section-band);
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--td-home-canvas-bg) 88%, #64748b) 0%,
        var(--td-home-canvas-bg) 18%,
        var(--td-home-canvas-bg) 82%,
        color-mix(in srgb, var(--td-home-canvas-bg) 88%, #64748b) 100%
    );
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

body.td-home-portada .td-app-main.td-app-main--home-grid > .td-home-intro {
    border-top: none;
    border-bottom: none;
    position: relative;
}

body.td-home-portada .td-app-main.td-app-main--home-grid > .td-home-intro::after {
    display: none;
    height: 0;
}

body.td-home-portada .td-app-main.td-app-main--home-grid > .td-home-footer {
    border-top: var(--td-home-section-band) solid var(--td-home-canvas-bg);
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 14px;
}

body.td-home-portada:has(.td-home-footer) .td-app-main.td-app-main--home-grid {
    padding-bottom: 0;
}

body.td-home-portada .td-home-footer {
    background: var(--td-brand-navy, #0d1b2a);
}

/* Cabeceras de bloque — rail de color (editorial, sin card) */
body.td-home-portada .com-catalog--home .com-catalog__head,
body.td-home-portada .central-em-sc--home .central-em-sc__top,
body.td-home-portada .td-home-mas__head,
body.td-home-portada .td-home-hub__head {
    position: relative;
    padding-top: 14px;
    padding-bottom: 14px;
}

body.td-home-portada .com-catalog--home .com-catalog__head::before,
body.td-home-portada .central-em-sc--home .central-em-sc__top::before,
body.td-home-portada .td-home-mas__head::before,
body.td-home-portada .td-home-hub__head::before {
    content: "";
    position: absolute;
    left: var(--td-home-edge-pad, 16px);
    top: 4px;
    bottom: 10px;
    width: 4px;
    border-radius: 3px;
    background: var(--hc-accent, var(--td-brand-navy, #0d1b2a));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--hc-accent, var(--td-brand-navy, #0d1b2a)) 25%, transparent);
}

body.td-home-portada .com-catalog--home .com-catalog__head::after,
body.td-home-portada .central-em-sc--home .central-em-sc__top::after,
body.td-home-portada .td-home-mas__head::after,
body.td-home-portada .td-home-hub__head::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--hc-accent, var(--td-brand-navy, #0d1b2a)), transparent 72%);
    opacity: 0.28;
    pointer-events: none;
}

body.td-home-portada .td-home-hub__head::before {
    background: linear-gradient(180deg, var(--td-brand-navy, #0d1b2a) 0%, #059669 100%);
}

body.td-home-portada .td-home-hub__head::after {
    background: linear-gradient(90deg, var(--td-brand-navy, #0d1b2a), transparent 72%);
    opacity: 0.35;
}

body.td-home-portada .central-em-sc--home .central-em-sc__top::before {
    background: #dc2626;
}

body.td-home-portada .td-home-mas__head::before {
    background: #dc2626;
}

body.td-home-portada .com-catalog--home .com-catalog__brand,
body.td-home-portada .central-em-sc--home .central-em-sc__brand {
    padding-left: 0;
}

body.td-home-portada .com-catalog--home .com-catalog__link {
    margin-right: var(--td-home-edge-pad-r, 16px);
}

/* Plano: sin elevación en chips/tiles del hub ni ítems de catálogo */
body.td-home-portada .td-home-hub__chip,
body.td-home-portada .td-home-hub__efem-card,
body.td-home-portada .com-catalog--home .com-list__item,
body.td-home-portada .central-em-sc--home .central-em-sc__tile {
    box-shadow: none !important;
    border-radius: 0 !important;
}

body.td-home-portada .td-home-hub__sug .td-home-hub__tile,
body.td-home-portada .td-home-hub__grid--accesos .td-home-hub__tile {
    border-radius: 12px !important;
}

body.td-home-portada .td-home-hub__hoy-row {
    border-radius: 12px;
}

/* Anular tarjetas flotantes del tema global */
body.td-home-portada .td-app-main [class$="__card"] {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    transform: none !important;
}

@media (hover: hover) and (pointer: fine) {
    body.td-home-portada .td-app-main [class$="__card"]:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

.td-home-anchor {
    scroll-margin-top: calc(var(--td-home-sticky-top, 112px) + 56px);
    width: 100%;
    min-width: 0;
}

.td-home-anchor:focus {
    outline: none;
}

.td-home-anchor > * {
    animation: td-home-section-in 0.45s ease both;
}

@keyframes td-home-section-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .td-home-anchor > * {
        animation: none;
    }
}

.td-app-main.td-app-main--home-grid {
    gap: 0;
}

body.td-home-portada .td-app-main.td-app-main--home-grid {
    padding-bottom: 0 !important;
    min-height: 0 !important;
}

/* Sugerencias del día: bloque de entrada unificado */
.td-home-intro {
    display: flex;
    flex-direction: column;
    gap: 0;
    grid-column: 1 / -1;
    padding-bottom: 4px;
}

/* --- Escritorio: grilla editorial plana sobre lienzo --- */
@media (min-width: 900px) {
    body.td-home-portada {
        --td-home-edge-pad: 24px;
        --td-home-edge-pad-r: 24px;
    }

    body.td-home-portada .td-app-main.td-app-main--home-grid {
        max-width: min(920px, calc(100vw - 32px));
        margin: 0 auto 24px;
        padding-left: 0;
        padding-right: 0;
        border: 1px solid var(--td-home-surface-border);
        box-shadow: 0 8px 32px -14px rgba(15, 23, 42, 0.12);
    }

    html[data-theme="dark"] body.td-home-portada .td-app-main.td-app-main--home-grid {
        box-shadow: 0 12px 36px -12px rgba(0, 0, 0, 0.42);
    }

    .td-app-main.td-app-main--home-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "intro"
            "footer";
        align-items: start;
        gap: 0;
    }

    body.td-home-portada .td-app-main.td-app-main--home-grid > .td-home-anchor,
    body.td-home-portada .td-app-main.td-app-main--home-grid > .td-home-mas-section {
        border-top: none;
        border-bottom: none;
    }

    body.td-home-portada .td-app-main.td-app-main--home-grid > .td-home-anchor::after,
    body.td-home-portada .td-app-main.td-app-main--home-grid > .td-home-mas-section::after,
    body.td-home-portada .td-app-main.td-app-main--home-grid > .td-home-intro::after {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    .td-app-main.td-app-main--home-grid > link {
        display: contents;
    }

    .td-home-intro {
        grid-area: intro;
        gap: 0;
    }

    .td-home-footer {
        grid-area: footer;
    }

    .td-home-sections {
        position: static;
        margin-bottom: 0;
        padding-bottom: 0;
        background: var(--td-home-surface-bg, #fff);
        -webkit-mask-image: none;
        mask-image: none;
    }

    .td-home-sections__hint {
        font-size: 0.6875rem;
        letter-spacing: 0.08em;
        margin-bottom: 6px;
    }

    .td-home-sections__track {
        gap: 10px;
        padding: 0;
    }
}

@media (min-width: 1200px) {
    body.td-home-portada .td-app-main.td-app-main--home-grid {
        max-width: min(980px, calc(100vw - 48px));
    }
}

/* Logo más grande en portada */
body.td-home-portada .pwa-header .h-logo-mark {
    width: 52px;
    height: 52px;
}

body.td-home-portada .pwa-header .h-logo {
    font-size: 1.3125rem;
}

body.td-home-portada .pwa-header .h-logo-tagline__text {
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
}

body.td-home-portada .h-logo-wrapper:not(.td-home-footer__logo) {
    gap: 12px;
}

@media (min-width: 480px) {
    body.td-home-portada .pwa-header .h-logo-mark {
        width: 56px;
        height: 56px;
    }

    body.td-home-portada .pwa-header .h-logo {
        font-size: 1.4rem;
    }

    body.td-home-portada .pwa-header .h-logo-tagline__text {
        font-size: 0.75rem;
    }
}

/* Sin franja gris entre cabecera y contenido (móvil) */
@media (max-width: 899px) {
    body.td-home-portada {
        background-color: var(--td-home-surface-bg) !important;
        background-image: none !important;
    }

    body.td-home-portada .pwa-header-root {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    body.td-home-portada .h-shell {
        padding-bottom: 10px !important;
    }

    body.td-home-portada .pwa-header-root + #todoeldia-main,
    body.td-home-portada #sports-live-block + #todoeldia-main {
        margin-top: 0 !important;
        border-top: none !important;
    }
}
