/**
 * Modo TV — estilos propios.
 *
 * Todos los selectores llevan prefijo "tv-" para no colisionar con
 * style.final.css, que se carga antes y aporta el reset, las variables de
 * :root, el fondo aurora y los componentes .header / .icon-btn / .live-pill.
 * Este archivo no redefine ningún selector de style.final.css.
 */

/* ── Correcciones heredadas de style.final.css ──────────────────────────
   La portada es una "app" de pantalla fija: su body lleva height:100vh y
   overflow:hidden, y .app-container está limitado a 500px para el player
   centrado. Esta página tiene contenido largo y un video que debe
   respirar, así que ambas reglas se anulan.

   Se acotan a body.tv-page para que sean explícitas. Además tv.css solo
   se carga en tv.php, de modo que la portada no se ve afectada. */

body.tv-page {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: block;
}

body.tv-page .app-container {
    max-width: 1180px;
    margin: 0 auto;
}

/* Los orbs de color son el fondo del player de la portada, donde quedan
   detrás de una cápsula pequeña y centrada. Aquí caen detrás de texto que
   hay que leer, así que se atenúan y se fijan al viewport para que no
   sigan al contenido al hacer scroll. */
body.tv-page .aurora-bg {
    position: fixed;
    opacity: 0.18;
}

.tv-main {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 0 3rem;
}

/* ── Marca en el header ─────────────────────────────────────────────── */

.tv-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: var(--text);
}

/* El header de la portada vive en 500px de ancho, donde el logo solo basta.
   Aquí el contenedor llega a 1180px y quedaría un hueco enorme, así que se
   acompaña con el nombre. Se oculta en móvil, donde no cabe. */
.tv-brand-name {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    opacity: 0.85;
}

@media (max-width: 700px) {
    .tv-brand-name {
        display: none;
    }
}

/* ── Encabezado de la señal ─────────────────────────────────────────── */

.tv-signal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0.5rem 0 1.25rem;
}

.tv-signal-title {
    font-size: clamp(1.4rem, 4vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.tv-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.tv-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--aurora-3);
    flex: 0 0 auto;
}

/* Solo se aplica cuando se verificó que hay emisión al aire. */
.tv-pill-live {
    background: rgba(255, 0, 0, 0.12);
    border-color: rgba(255, 59, 48, 0.35);
    color: #ff5b52;
}

.tv-pill-live .tv-pill-dot {
    background: #ff3b30;
    animation: tv-pulse 1.8s ease-in-out infinite;
}

@keyframes tv-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
    .tv-pill-live .tv-pill-dot {
        animation: none;
    }
}

/* ── Marco del video, 16:9 ──────────────────────────────────────────── */

.tv-frame {
    position: relative;
    width: 100%;
    border-radius: 18px;
    overflow: hidden;
    background: #050505;
    border: 1px solid var(--glass-border);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

/* Fallback de proporción para navegadores sin aspect-ratio. */
.tv-frame::before {
    content: "";
    display: block;
    padding-top: 56.25%;
}

@supports (aspect-ratio: 16 / 9) {
    .tv-frame {
        aspect-ratio: 16 / 9;
    }

    .tv-frame::before {
        display: none;
    }
}

.tv-frame iframe,
.tv-frame .tv-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ── Estado sin señal ───────────────────────────────────────────────── */

.tv-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.6rem;
    padding: 2rem 1.5rem;
    background:
        radial-gradient(circle at 50% 40%, rgba(74, 0, 224, 0.18), transparent 60%),
        #050505;
}

.tv-placeholder-icon {
    opacity: 0.35;
    margin-bottom: 0.4rem;
}

.tv-placeholder-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.tv-placeholder-text {
    font-size: 0.95rem;
    opacity: 0.6;
    max-width: 34ch;
    line-height: 1.5;
}

/* ── Acciones bajo el video ─────────────────────────────────────────── */

.tv-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.1rem;
}

.tv-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.15rem;
    border-radius: 14px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.tv-action:hover {
    background: rgba(255, 255, 255, 0.11);
}

.tv-action:active {
    transform: scale(0.97);
}

.tv-action-primary {
    background: linear-gradient(135deg, var(--aurora-1), var(--aurora-2));
    border-color: transparent;
}

.tv-action-primary:hover {
    background: linear-gradient(135deg, var(--aurora-2), var(--aurora-1));
}

/* ── Titulares de Aurora ────────────────────────────────────────────── */

.tv-news {
    margin-top: 2.5rem;
}

.tv-news-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.5;
    margin-bottom: 0.9rem;
}

.tv-news-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.7rem;
    list-style: none;
}

.tv-news-item a {
    display: block;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    /* Más opaco que var(--glass) a propósito: con el 5% de la portada, el
       resplandor de los orbs se cuela y estorba la lectura del titular. */
    background: rgba(14, 14, 20, 0.72);
    border: 1px solid var(--glass-border);
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s;
}

.tv-news-item a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tv-news-cat {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--aurora-3);
    margin-bottom: 0.35rem;
}

.tv-news-headline {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.4;
}

.tv-news-empty {
    font-size: 0.9rem;
    opacity: 0.5;
}

.tv-news-more {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.55rem 0;
    color: var(--text);
    opacity: 0.65;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.tv-news-more:hover {
    opacity: 1;
}

/* ── Móvil ──────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .tv-frame {
        border-radius: 12px;
    }

    .tv-actions .tv-action {
        flex: 1 1 100%;
        justify-content: center;
    }
}
