/* ==========================================================================
   Familia Roja Directa — hoja de estilos única
   Los colores editables llegan como --c-<clave> (los escribe el núcleo en el
   <head>); los tonos derivados se calculan aquí con color-mix().
   Navegadores sin color-mix() (Chrome < 111: TV y Android viejos) usan los
   tonos fijos de reserva, calculados con los colores por defecto. En una
   variable no sirve poner la reserva delante (la variable se guarda tal cual
   y falla al usarla), por eso color-mix() va dentro de @supports.
   ========================================================================== */

:root {
  --bg: var(--c-fondo, #0a1825);
  --bg-soft: #0d1b33;
  --surface: var(--c-superficie, #112240);
  --surface-2: #1a2b4a;
  --border: #2a3b55;
  --border-soft: #1c2c46;

  --text: var(--c-texto, #e0e0e0);
  --text-dim: #aebbcd;
  --text-mute: #8595aa;

  --brand: var(--c-primario, #d20000);
  --brand-strong: #b10000;
  --brand-dark: #8f0000;
  --brand-soft: rgba(210, 0, 0, .18);
  --gold: var(--c-acento, #ffd700);
  --gold-hover: #ffe75c;
  --gold-soft: rgba(255, 215, 0, .12);
  --gold-soft-2: rgba(255, 215, 0, .2);
  --cabecera: var(--c-cabecera, #000);
  --live: #ff4d4d;

  --r-sm: 6px;
  --r: 10px;

  --shadow: 0 3px 12px rgba(0, 0, 0, .35);
  --ring: 0 0 0 3px rgba(255, 215, 0, .35);

  color-scheme: dark;
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  :root {
    --bg-soft: color-mix(in srgb, var(--bg) 90%, #2836b1);
    --surface-2: color-mix(in srgb, var(--surface) 80%, #3e4f72);
    --border: color-mix(in srgb, var(--surface) 50%, #43546a);
    --border-soft: color-mix(in srgb, var(--surface) 80%, #48545e);
    --text-dim: color-mix(in srgb, var(--text) 50%, #7c96ba);
    --text-mute: color-mix(in srgb, var(--text) 50%, #2a4a74);
    --brand-strong: color-mix(in srgb, var(--brand) 84.3%, #000);
    --brand-dark: color-mix(in srgb, var(--brand) 68.1%, #000);
    --brand-soft: color-mix(in srgb, var(--brand) 18%, transparent);
    --gold-hover: color-mix(in srgb, var(--gold) 60%, #ffffe6);
    --gold-soft: color-mix(in srgb, var(--gold) 12%, transparent);
    --gold-soft-2: color-mix(in srgb, var(--gold) 20%, transparent);
    --ring: 0 0 0 3px color-mix(in srgb, var(--gold) 35%, transparent);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img, svg, iframe { display: block; max-width: 100%; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hover); }
ul { list-style: none; }

:where(button, a, input, select, textarea, summary):focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}

/* ================= HEADER ================= */

header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 22px;
  background: var(--cabecera);
  border-bottom: 3px solid var(--brand);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: .3px;
  white-space: nowrap;
  flex: none;
}
.logo:hover { color: #fff; }
.logo svg { width: 27px; height: 27px; flex: none; }
.logo rect { fill: var(--brand); }
.logo i { font-style: normal; opacity: .85; font-weight: 700; }

.navbar { display: flex; gap: .85rem; flex-wrap: nowrap; justify-content: flex-end; min-width: 0; }
.navbar a {
  color: #fff;
  font-size: 13.5px;
  white-space: nowrap;
  font-weight: 500;
  opacity: .9;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: opacity .2s, border-color .2s;
}
.navbar a:hover,
.navbar a[aria-current="page"] { color: var(--gold); opacity: 1; border-bottom-color: var(--brand); }

#menu-toggle {
  display: none;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  padding: 2px;
}
#menu-toggle svg { width: 1.6rem; height: 1.6rem; }

/* Panel lateral en móvil */
#menu-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, .6);
}
#menu-modal.open { display: block; }

.modal-content {
  position: relative;
  width: 270px;
  max-width: 80%;
  height: 100%;
  padding: 22px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
#menu-close {
  position: absolute;
  top: 14px; right: 14px;
  background: none;
  border: 0;
  color: var(--text-mute);
  cursor: pointer;
}
#menu-close svg { width: 1.5rem; height: 1.5rem; }
#menu-close:hover { color: var(--text); }

.modal-nav { display: flex; flex-direction: column; margin-top: 2.2rem; }
.modal-nav a {
  padding: 12px 2px;
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-soft);
}
.modal-nav a:hover { color: var(--gold); }

/* ================= MAIN ================= */
/* Mismo cálculo que el sitio de referencia: 91.66 % de ancho con tope
   del 66.66 % de la pantalla. Se añade un tramo intermedio para que en
   portátiles de 1024-1200 px no quede exageradamente estrecho. */

main {
  width: 91.666667%;
  max-width: 66.666667%;
  margin: .6rem auto;
  padding: 20px 0;
  flex: 1 0 auto;
}

@media (max-width: 1200px) { main { max-width: 92%; } }
@media (max-width: 768px)  { main { width: 100%; max-width: 95%; padding: 12px 0; } }

/* ================= TÍTULOS ================= */

h1 {
  color: var(--gold);
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
  margin: .6rem 0 18px;
}
h2 { font-size: 20px; font-weight: 700; line-height: 1.3; }
h3 { font-size: 15px; font-weight: 700; }

.section-title {
  color: var(--text);
  text-align: center;
  margin: 35px 0 18px;
}

/* ================= DESCRIPCIÓN ================= */

.description {
  padding: 16px 18px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.7;
  box-shadow: var(--shadow);
}
.description strong { color: var(--text); }
.description p + p { margin-top: .7em; }

/* ================= AGENDA ================= */

#wraper {
  width: 100%;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.agenda-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: .45rem .6rem;
  background: linear-gradient(to right, var(--brand-strong), var(--brand-dark));
  color: #fff;
  text-align: center;
}
#title-agenda { font-size: .95rem; font-weight: 700; margin: 0; }

/* Buscador de la agenda */
.agenda-search {
  position: relative;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-soft);
}
.agenda-search svg {
  position: absolute;
  left: 24px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-mute);
  pointer-events: none;
}
.agenda-search input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;   /* 16px evita el zoom automático de iOS al enfocar */
}
.agenda-search input::placeholder { color: var(--text-mute); }
.agenda-search input:focus { border-color: var(--gold); }

#menu { margin: 0; padding: 0; }
.agenda-item[hidden] { display: none; }

.agenda-item {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background-color .15s;
}
.agenda-item:last-child { border-bottom: 0; }
.agenda-item:hover { background: rgba(224, 224, 224, .05); }
.agenda-item.is-open { background: var(--brand-soft); }

.agenda-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.agenda-info { display: flex; align-items: center; flex: 1; min-width: 0; }

.agenda-time {
  flex: none;
  width: 3.4rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.agenda-item.is-live .agenda-time { color: #fb7185; }

.agenda-flag {
  flex: none;
  width: 1.5rem; height: 1.5rem;
  margin-left: .5rem;
  border-radius: 3px;
  object-fit: cover;
  background: var(--surface-2);
}

.agenda-title {
  flex: 1;
  min-width: 0;
  margin-left: .75rem;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.tag {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-mute);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.tag--live { background: rgba(244, 63, 94, .18); color: #fb7185; }
.tag--ended { background: transparent; border: 1px solid var(--border); color: var(--text-mute); }

/* Los eventos ya emitidos se atenúan para que destaquen los que vienen. */
.agenda-item.is-ended .agenda-time,
.agenda-item.is-ended .agenda-title { color: var(--text-mute); font-weight: 600; }
.agenda-item.is-ended .agenda-flag { opacity: .6; }
.agenda-item.is-ended:hover .agenda-title { color: var(--text-dim); }

/* Eventos marcados como "destacado" en Strapi */
.agenda-item.is-featured {
  background: linear-gradient(90deg, var(--gold-soft), transparent 70%);
  box-shadow: inset 3px 0 0 var(--gold);
}
.agenda-item.is-featured:hover { background: linear-gradient(90deg, var(--gold-soft-2), var(--surface-2) 70%); }
.agenda-item.is-featured.is-open { background: var(--brand-soft); }
.agenda-item.is-featured .agenda-title { color: var(--gold); }
.agenda-star { flex: none; margin-left: .5rem; color: var(--gold); }

.agenda-chevron { flex: none; color: var(--text-mute); transition: transform .25s ease; }
.agenda-item.is-open .agenda-chevron { transform: rotate(180deg); color: var(--gold); }

/* Submenú desplegable con animación de altura */
.agenda-submenu {
  height: 0;
  opacity: 0;
  overflow: hidden;
  margin-left: 2.9rem;
  transition: height .35s ease, opacity .3s ease, margin-top .35s ease;
}
.agenda-submenu.open { opacity: 1; margin-top: 8px; }

.submenu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  transition: background-color .15s, color .15s;
}
.submenu-item:hover { background: rgba(224, 224, 224, .07); color: var(--text); }
.submenu-dot {
  width: 7px; height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--text-mute);
  transition: background-color .15s;
}
.submenu-item:hover .submenu-dot { background: var(--gold); }
.submenu-item small { color: var(--text-mute); font-weight: 600; }

.agenda-msg { padding: 26px 14px; text-align: center; color: var(--text-mute); font-size: 14px; }

/* ================= TARJETAS DE CANAL ================= */

.cards-container {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 560px) { .cards-container { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .cards-container { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card {
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--brand); }

.card-image {
  display: grid;
  place-items: center;
  padding: 10px 0;
}
.card-image span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 84px;
  padding: 8px;
  border-radius: 10px;
  background: #fff;
}
.card-image img { max-width: 132px; max-height: 66px; width: auto; height: auto; object-fit: contain; }

.card h3 { color: var(--text); margin-bottom: 5px; font-size: 16px; }
.card p { color: var(--text-mute); font-size: 13px; line-height: 1.45; margin-bottom: 14px; }

.btn-watch {
  display: inline-block;
  margin-top: auto;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  background: var(--brand-strong);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  transition: background-color .2s;
}
.card:hover .btn-watch,
.btn-watch:hover { background: var(--brand); color: #fff; }

/* ================= REPRODUCTOR ================= */

.subiframe {
  width: 100%;
  margin: 16px auto;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}
.preframe { border-radius: 8px; overflow: hidden; background: #000; }
/* La página es color-scheme: dark y el reproductor externo no declara ninguno
   (= light). Con esquemas distintos el navegador pinta el iframe de blanco
   opaco mientras carga; con "light" coinciden, el iframe queda transparente
   y se ve el negro de .preframe hasta que aparece el player. */
#embedIframe { width: 100%; aspect-ratio: 16 / 9; border: 0; color-scheme: light; background: #000; }

.centerfull { width: 100%; text-align: center; }

#btnIframe {
  width: 100%;
  max-width: 240px;
  margin: 8px auto 4px;
  padding: 9px 20px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--brand-strong);
  color: #fff;
  font: 600 13px/1 inherit;
  cursor: pointer;
  transition: background-color .2s;
}
#btnIframe:hover { background: var(--brand); }

.player-hint { margin-top: 6px; color: var(--text-mute); font-size: 13px; }

/* ================= TEXTO LARGO / FAQ ================= */

.prose { color: var(--text-dim); font-size: 15px; line-height: 1.75; }
.prose h2 { color: var(--text); margin: 1.6em 0 .5em; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin-bottom: 1em; }
.prose strong { color: var(--text); }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.3em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--gold); }

.grid-leagues {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.grid-leagues li {
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.grid-leagues a { font-weight: 700; font-size: 14px; }
.grid-leagues span { display: block; margin-top: 2px; color: var(--text-mute); font-size: 12px; }

.grid-sports {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.sport {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  transition: transform .2s, border-color .2s;
}
.sport:hover { transform: translateY(-3px); border-color: var(--brand); color: var(--text); }
.sport em { display: block; margin-bottom: 8px; font-size: 1.8rem; font-style: normal; }
.sport h2 { margin-bottom: 5px; font-size: 17px; }
.sport p { color: var(--text-mute); font-size: 13px; }

.faq { display: grid; gap: 10px; }
.faq details {
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.faq summary {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  list-style: none;
  font-size: 15px;
  font-weight: 700;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "＋"; color: var(--brand); }
.faq details[open] summary::before { content: "－"; }
.faq p { margin-top: 9px; color: var(--text-dim); font-size: 14px; }

.info-box {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  font-size: 15px;
}
.info-box b { display: block; color: var(--text); margin-top: 12px; }
.info-box b:first-child { margin-top: 0; }
.info-box span { color: var(--text-dim); }

.section { margin-top: 32px; }

/* ================= PUBLICIDAD ================= */
/* Contenedores con la medida ya reservada: no provocan saltos de diseño. */

.ad { display: grid; place-items: center; margin: 18px auto; overflow: hidden; }
.ad--leaderboard { width: 728px; height: 90px; max-width: 100%; }
.ad--box { width: 300px; height: 250px; max-width: 100%; }
@media (max-width: 767px) { .ad--leaderboard { display: none; } }

/* ================= FOOTER ================= */

footer.site-footer {
  margin-top: auto;
  padding: 18px 22px;
  background: var(--cabecera);
  border-top: 3px solid var(--brand);
  color: var(--text-mute);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
  font-size: .875rem;
}
.footer-title { color: var(--text-dim); }
.footer-title strong { color: var(--text); }
.redes { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.red-item { color: var(--text-dim); font-size: .875rem; font-weight: 600; }
.red-item:hover { color: var(--gold); }
.footer-legal { width: 100%; color: var(--text-mute); font-size: .78rem; line-height: 1.5; }

/* ================= RESPONSIVE ================= */

/* Logo y menú siempre en una fila: con poco ancho, hamburguesa */
@media (max-width: 1180px) {
  .navbar { display: none; }
  #menu-toggle { display: flex; }
}

@media (max-width: 900px) {
  .navbar { display: none; }
  #menu-toggle { display: flex; }
  header.site-header { padding: 8px 16px; }
  .logo { font-size: 19px; }
}

@media (max-width: 768px) {
  h1 { font-size: 22px; }
  #title-agenda { font-size: .88rem; }
  .section-title { font-size: 17px; }
  .agenda-title { font-size: 14px; }
  .agenda-submenu { margin-left: 1rem; }
}

@media (max-width: 480px) {
  .card { padding: 14px 10px; }
  .card-image span { width: 66px; height: 66px; }
  .card-image img { width: 50px; height: 50px; }
  .card h3 { font-size: 14px; }
  .agenda-time { width: 2.9rem; font-size: 14px; }
  .tag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Secciones fuera de pantalla: el navegador ahorra trabajo de renderizado. */
.defer { content-visibility: auto; contain-intrinsic-size: auto 480px; }


/* ================= AÑADIDOS DE ROJA DIRECTA ================= */

/* Las banderas de la agenda son escudos y banderas apaisadas */
.agenda-flag { width: 1.7rem; height: 1.3rem; object-fit: contain; background: transparent; }

/* Páginas de canal y del reproductor */
h1.title { color: var(--gold); font-size: clamp(1.25rem, 3.4vw, 1.7rem); margin: 6px 0 4px; }

.info-box {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  font-size: 15px;
  color: var(--text-dim);
}
.info-box h2 { color: var(--gold); font-size: 17px; margin-bottom: 8px; }

/* El bloque SEO del original usa h3 y h4 */
.prose h3 { color: var(--text); font-size: 16.5px; margin: 1.3em 0 .4em; }
.prose h4 { color: var(--text); font-size: 15px; margin: 1.1em 0 .3em; }

/* ================= AÑADIDOS DE LA FAMILIA ================= */

/* Reproductor sin destello blanco (igual que las otras familias): mientras carga,
   el iframe queda oculto sobre el fondo negro de .preframe y aparece con un fundido
   cuando app.js quita "is-loading". La animación es solo un respaldo por si app.js
   no llegara a ejecutarse. */
.preframe { position: relative; aspect-ratio: 16 / 9; }
#embedIframe { position: relative; z-index: 1; transition: opacity .3s ease; }
.preframe.is-loading #embedIframe { opacity: 0; animation: player-reveal .3s ease 6s forwards; }
@keyframes player-reveal { to { opacity: 1; } }

/* Enlace a la agenda completa bajo la lista */
.agenda-more { margin: -4px 0 8px; text-align: center; font-size: 14px; }
.agenda-more a { color: var(--text-dim); }
.agenda-more a:hover { color: var(--gold); }

/* /agenda.html: solo la lista, sin cabecera ni pie */
body.agenda-only { padding: 10px; }
body.agenda-only #wraper { max-width: 900px; margin: 0 auto; }

.section-desc { margin: -8px 0 18px; text-align: center; color: var(--text-mute); font-size: 14px; }
.info-box p + p { margin-top: .8em; }

/* Migas de pan */
.migas { margin: 2px 0 8px; color: var(--text-mute); font-size: 13px; }
.migas a { color: var(--text-dim); }
.migas a:hover { color: var(--gold); }
.migas [aria-current] { color: var(--text); }

/* Preguntas frecuentes (h.faq) */
.faq { margin-top: 32px; }
.faq > h2 { text-align: center; margin-bottom: 8px; }
.faq details > div { margin-top: 9px; color: var(--text-dim); font-size: 14px; }
.faq details > div p + p { margin-top: .6em; }

/* Huecos de publicidad (h.anuncio) */
.ad--cabecera, .ad--agenda, .ad--canal, .ad--pie { max-width: 100%; min-height: 90px; }
.ad--pie { margin-bottom: 0; }


/* ================= PÁGINA DE CANAL ================= */
/* El reproductor manda: ancho grande, justo bajo la cabecera; el texto va debajo, discreto. */
body.pagina-canal main { width: 100%; max-width: min(1180px, 96%); padding-top: 10px; }
.pagina-canal .subiframe { margin-top: 0; }
.canal-info { margin-top: 14px; color: var(--text-mute); font-size: 14px; }
.canal-info .migas { margin: 0 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.canal-info h1.title { text-align: left; font-size: clamp(1.05rem, 2.4vw, 1.3rem); margin: 0 0 8px; }
.canal-info .info-box { margin-top: 0; padding: 12px 14px; font-size: 14px; color: var(--text-mute); box-shadow: none; }
.canal-info .info-box h2 { font-size: 15px; }

/* Filas completas: el panel calcula columnas que dividen exacto al número de canales (--cols-*). */
.cards-container[style*="--cols-p"] { grid-template-columns: repeat(var(--cols-p), minmax(0, 1fr)) !important; }
@media (min-width: 560px) { .cards-container[style*="--cols-m"] { grid-template-columns: repeat(var(--cols-m), minmax(0, 1fr)) !important; } }
@media (min-width: 900px) { .cards-container[style*="--cols-g"] { grid-template-columns: repeat(var(--cols-g), minmax(0, 1fr)) !important; } }

/* Reproductor lo más grande posible SIN scroll: 16:9 limitado por el alto de la ventana
   (alto visible − cabecera − 22 px de margen; el botón de recargar puede quedar debajo). Pensado para laptops de 15,6" (≈1366×768 / 1536×730 útiles). */
.subiframe { max-width: none !important; width: 100% !important; padding-top: 8px !important; margin-top: 0 !important; }
.subiframe .preframe {
  position: relative !important; padding: 0 !important; height: auto !important; max-width: 100% !important;
  aspect-ratio: 16 / 9; margin: 0 auto !important;
  width: min(100%, calc((100svh - var(--alto-cabecera, 52px) - 46px) * 16 / 9)) !important;
}
.subiframe .preframe iframe { position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; border: 0; }
.subiframe .player-hint { margin: 4px 0 0 !important; }

/* Página de canal y reproductor de eventos: sin marcos, discreto (pedido 29-oct). El reproductor manda; el resto acompaña. */
body.pagina-canal .subiframe { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 8px 0 0 !important; }
body.pagina-canal .preframe { border-radius: 6px; }
body.pagina-canal #btnIframe {
  max-width: 190px; padding: 7px 16px; margin-top: 10px;
  background: transparent; color: var(--text); font-weight: 500;
  border: 1px solid rgba(224, 224, 224, .22);
}
body.pagina-canal #btnIframe:hover { background: rgba(224, 224, 224, .08); border-color: var(--brand); }
body.pagina-canal .player-hint { color: rgba(224, 224, 224, .55); font-size: 12.5px; }
.canal-info { color: var(--text); }
.canal-info .info-box { border: 0; background: transparent; box-shadow: none; padding: 0; color: rgba(224, 224, 224, .9); font-size: 15px; line-height: 1.7; }
.canal-info h1.title, .canal-info .info-box h2, .canal-info .info-box h3 { color: var(--text); font-weight: 600; letter-spacing: 0; }
.canal-info h1.title { font-size: clamp(1rem, 2.2vw, 1.2rem); margin: 0 0 10px; }
.canal-info .info-box h2 { font-size: 16px; margin: 1.2em 0 .4em; }
.canal-info .info-box h3 { font-size: 15px; margin: 1em 0 .3em; }
.canal-info .info-box strong { color: var(--text); font-weight: 600; }
.canal-info .info-box a { color: var(--gold); }
/* títulos del canal: el dorado del diseño original, con grosor medio */
.canal-info h1.title, .canal-info .info-box h2, .canal-info .info-box h3 { color: var(--gold); font-weight: 600; }
/* Texto bajo los canales: como en el original (section.prose), sin recuadro, sobre el fondo de la página */
.texto-seo.description { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; margin-bottom: 0; }
/* El texto del canal no pasa del ancho del reproductor (misma fórmula que .preframe) y queda centrado bajo él */
body.pagina-canal .canal-info { width: min(100%, calc((100svh - var(--alto-cabecera, 52px) - 46px) * 16 / 9)); margin-left: auto; margin-right: auto; }

/* Tonos con color-mix() sobre el color del texto (lo cambia cada web). Fuera de @supports
   quedan los rgba() de reserva con el texto por defecto (#e0e0e0) para Chrome < 111:
   con var() dentro, poner la reserva delante no sirve (el navegador no la descarta). */
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .agenda-item:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
  .submenu-item:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
  body.pagina-canal #btnIframe { border-color: color-mix(in srgb, var(--text) 22%, transparent); }
  body.pagina-canal #btnIframe:hover { background: color-mix(in srgb, var(--text) 8%, transparent); border-color: var(--brand); }
  body.pagina-canal .player-hint { color: color-mix(in srgb, var(--text) 55%, transparent); }
  .canal-info .info-box { color: color-mix(in srgb, var(--text) 90%, transparent); }
}

/* ================= AGENDA CON TECLADO Y MANDO DE TV ================= */
/* La fila de cada partido es un <button> (aria-expanded lo pone app.js). Dentro va
   .agenda-row en un <span> con flex: un <button> flex falla en navegadores viejos. */
.agenda-toggle {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.agenda-toggle:focus { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.agenda-toggle:focus:not(:focus-visible) { outline: none; }
/* Plegado: además de alto 0, visibility:hidden para que el tabulador y el mando no
   entren en las señales ocultas. Al cerrar, se oculta cuando termina la animación. */
.agenda-submenu { visibility: hidden; transition: height .35s ease, opacity .3s ease, margin-top .35s ease, visibility 0s linear .35s; }
.agenda-submenu.open { visibility: visible; transition: height .35s ease, opacity .3s ease, margin-top .35s ease, visibility 0s; }

/* ================= REPRODUCTOR EN NAVEGADORES VIEJOS ================= */
/* TV y Android antiguos: sin aspect-ratio (Chrome < 88) el cuadro quedaba con alto 0;
   se usa el truco del padding 16:9. top/left por si falta inset (Chrome < 87). */
.subiframe .preframe iframe { top: 0 !important; left: 0 !important; }
@supports not (aspect-ratio: 16 / 9) {
  .subiframe .preframe { height: 0 !important; padding-top: 56.25% !important; }
}
/* Con movimiento reducido no hay animación de respaldo: el iframe se ve desde el principio. */
@media (prefers-reduced-motion: reduce) {
  .preframe.is-loading #embedIframe { opacity: 1; }
}
