/* Familia pelota-libre — portada. Colores editables: var(--c-*) (los escribe el generador). */
html { margin-top: 0 !important; }

* { font-family: arial, Arial, Helvetica, sans-serif; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--c-portada);
}

/* ================= CABECERA ================= */
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: linear-gradient(to right, var(--c-primario), var(--c-oscuro));
  box-shadow: 0 2px 8px rgba(20, 50, 30, .15);
}

header.site-header *,
#menu-modal * { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: .3px;
  white-space: nowrap;
  text-decoration: none;
  flex: none;
}
.logo:hover { color: #fff; }
.logo svg, .logo img { display: block; width: 27px; height: 27px; flex: none; }
.logo img { object-fit: contain; }
.logo-punto { fill: var(--c-acento); }
.logo i { font-style: normal; opacity: .85; font-weight: 700; }

.navbar { display: flex; gap: .9rem; flex-wrap: nowrap; justify-content: flex-end; min-width: 0; }
.navbar a {
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  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: #fff; opacity: 1; border-bottom-color: #fff; }

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

/* Panel lateral en móvil */
#menu-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 30, 20, .45);
}
.modal-content {
  position: relative;
  width: 270px;
  max-width: 80%;
  height: 100%;
  padding: 22px;
  box-sizing: border-box;
  background: #fff;
  border-right: 1px solid #d9e3dc;
  overflow-y: auto;
}
#menu-close {
  position: absolute;
  top: 14px; right: 14px;
  background: none;
  border: 0;
  color: #74847a;
  cursor: pointer;
}
#menu-close svg { display: block; width: 1.5rem; height: 1.5rem; }
#menu-close:hover { color: var(--c-texto); }

.modal-nav { display: flex; flex-direction: column; margin-top: 2.2rem; }
.modal-nav a {
  padding: 12px 2px;
  color: #4a5a51;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid #e7eee9;
}
.modal-nav a:hover { color: var(--c-primario); }

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

/* ================= CONTENIDO ================= */
main {
  margin: 0.6rem auto;
  width: 91.666667%;
  max-width: 66.666667%;
}

h1 {
  text-align: center;
  font-size: 2.25rem;
  font-weight: bold;
  margin-top: 0.6rem;
  margin-bottom: 1.25rem;
  color: var(--c-titulo);
}

.description {
  text-align: left;
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
  color: #4b5563;
}
.description p { margin: 0 0 1rem; }
.description p:last-child { margin-bottom: 0; }
.description h2 { color: var(--c-titulo); font-size: 1.4rem; margin: 1.6rem 0 .6rem; }
.description a { color: var(--c-primario); text-decoration: underline; }

/* Agenda */
#wraper {
  width: 100%;
  margin: 0 auto 1.25rem;
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
}

.agenda-header {
  background: linear-gradient(to right, var(--c-primario), var(--c-oscuro));
  color: white;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  flex-grow: 1;
  padding: 0.5rem;
}

#title-agenda { font-size: 1rem; font-weight: bold; margin: 0; }

#menu {
  margin: 0;
  padding: 0;
  background-color: #fff;
  box-shadow: 0 2px 4px 0 rgba(0,0,0,.1);
}
#menu > li { border-bottom: 1px solid #e5e7eb; list-style: none; }
#menu > li:hover { background-color: #f9fbfc; }

/* ================= TARJETAS DE CANALES ================= */
.channels-title {
  text-align: center;
  font-size: 1.875rem;
  margin-bottom: 1.75rem;
  margin-top: 2.5rem;
  font-weight: 600;
  color: var(--c-titulo);
}

.cards-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.card {
  background-color: white;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
  border-radius: 1rem;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover { transform: scale(1.05); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); }

.card-image {
  height: 12rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f3f4f6;
}
.card-image img { height: 6rem; width: 6rem; object-fit: contain; }

.card-content { padding: 1.5rem; text-align: center; }
.card-content h3 { color: #1f2937; font-weight: bold; font-size: 1.25rem; margin-bottom: 0.5rem; }
.card-content p { color: #4b5563; margin-bottom: 1.5rem; }

.btn-watch {
  background-color: var(--c-oscuro);
  color: white;
  font-weight: bold;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  text-decoration: none;
  display: inline-block;
}

/* ================= PREGUNTAS FRECUENTES ================= */
.faq { margin-top: 2.5rem; }
.faq h2 { text-align: center; font-size: 1.5rem; font-weight: 600; color: var(--c-titulo); margin: 0 0 1rem; }
.faq details {
  margin-bottom: 10px;
  padding: 13px 15px;
  border: 1px solid #d9e3dc;
  border-radius: 6px;
  background: #fff;
}
.faq summary {
  display: flex;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  color: #1f2937;
  font-weight: 700;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "＋"; color: var(--c-primario); }
.faq details[open] summary::before { content: "－"; }
.faq details > div { margin-top: 9px; color: #4b5563; line-height: 1.6; }
.faq details > div p { margin: 0 0 .6rem; }

/* ================= ANUNCIOS ================= */
.ad { margin: 1rem auto; text-align: center; overflow: hidden; }
.ad:empty { display: none; }

/* ================= PIE ================= */
footer {
  min-height: 2.5rem;
  background-color: var(--c-pie);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}
.footer-title { text-align: center; font-size: 0.875rem; }
.footer-legal { width: 100%; font-size: .78rem; line-height: 1.5; opacity: .75; }
.footer-legal p { margin: 0; }

.redes { display: flex; justify-content: center; gap: 1rem; margin: 0; padding: 0; }
.redes > li { list-style-type: none; }
.red-item { color: inherit; font-size: 0.875rem; text-decoration: none; transition: color 0.15s ease-in-out; }
.red-item:hover { color: var(--c-primario); }

/* ================= RESPONSIVE ================= */
@media (max-width: 800px) {
  .cards-container { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  main { max-width: 90%; width: 100%; }
  #title-agenda { font-size: 18px; }
}
@media (max-width: 480px) {
  .cards-container { grid-template-columns: 1fr; }
}
@media only screen and (max-device-width: 812px) and (-webkit-min-device-pixel-ratio: 2) {
  #menu { padding: 0 5px; }
  .cards-container { grid-template-columns: 1fr; }
}

/* 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, 56px) - 22px) * 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; }

/* Como en el original (pedido 29-oct): el texto bajo los canales sin caja, sobre el fondo de la página,
   y el reproductor de canales y eventos sin el cuadro que lo enmarcaba. */
.texto-seo, .texto-seo.description { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.subiframe { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 8px 0 0 !important; }

/* Texto largo de la portada a la misma escala que Fútbol Libre: lectura cómoda, no gritona */
.texto-seo.description { font-size: 15px; line-height: 1.75; }
.texto-seo.description h2 { font-size: 20px; line-height: 1.3; margin: 1.6em 0 .5em; }
.texto-seo.description h2:first-child { margin-top: 0; }
.texto-seo.description h3 { font-size: 16px; line-height: 1.35; margin: 1.4em 0 .4em; color: var(--c-titulo); }
.texto-seo.description p { margin: 0 0 1em; }
.texto-seo.description ul, .texto-seo.description ol { margin: 0 0 1em; padding-left: 1.3em; }
.texto-seo.description li { margin-bottom: .35em; }

/* Título y texto de encima de la agenda a la escala de Fútbol Libre (los colores siguen siendo los de Pelota Libre) */
main > h1 { font-size: 26px; line-height: 1.25; margin: .6rem 0 18px; }
main > .description { font-size: 15px; line-height: 1.7; margin-bottom: 18px; }
main > .description p + p { margin-top: .7em; }
