:root {
  --bg: #0b0c0f;
  --bg-start: #0e1a29; /* azul oscuro */
  --bg-end: rgba(255, 255, 255, 0.08); /* blanco muy opaco */
  --panel: #12131a;
  --panel-2: #0f1016;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #e50914;
  --accent-2: #ff3b3b;
  --border: #1f232b;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: linear-gradient(180deg, var(--bg-start) 0%, var(--bg-end) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, 'Helvetica Neue', Arial, 'Apple Color Emoji', 'Segoe UI Emoji';
}

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(12, 13, 18, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.branding { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 50%; background: rgba(255,255,255,0.06); padding: 2px; }
.brand-text { font-weight: 700; letter-spacing: 0.2px; font-family: 'Poppins', 'Inter', system-ui; }
/* Portada junto al logo en el header */
.brand-cover { width: 420px; height: 56px; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0,0,0,0.25); position: relative; overflow: hidden; }
.brand-cover::after { content: ""; position: absolute; inset: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06); }
.nav { display: flex; gap: 18px; }
.nav-link { color: var(--text); text-decoration: none; font-weight: 600; opacity: 0.88; }
.nav-link:hover, .nav-link.active { color: white; opacity: 1; }

.content { 
  display: grid; 
  grid-template-columns: minmax(0,1fr) 300px; 
  grid-template-areas:
    "hero schedule"
    "live schedule"
    "divider schedule"
    "news schedule";
  gap: 24px; 
  padding: 24px 16px; 
}
/* Portada sobre la señal en vivo */
.hero { grid-area: hero; display: flex; align-items: center; justify-content: center; }
.hero-img { width: 100%; height: 140px; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.live { grid-area: live; }
.section-divider { grid-area: divider; }
.news { grid-area: news; }
.schedule { grid-area: schedule; }

.live { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.live-header { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); }
.live-title { margin: 0; font-size: 20px; }
.badge-live { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 12px; letter-spacing: 0.8px; color: white; background: var(--accent); padding: 6px 10px; border-radius: 999px; }

.player-wrap { position: relative; background: #000; }
.player { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.player-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; background: rgba(0,0,0,0.3); }
.hidden { display: none !important; }

.section-divider { height: 4px; margin: 8px 0 0; border-radius: 999px; background: linear-gradient(90deg, rgba(229,9,20,0.9), rgba(255,59,59,0.8), rgba(255,255,255,0.12)); box-shadow: 0 0 12px rgba(229,9,20,0.35); }

.schedule { background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px; padding: 16px; align-self: start; position: sticky; top: 72px; }
.schedule-title { margin: 0 0 12px 0; font-size: 18px; }
.schedule-now { background: #121318; border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.schedule-nearby { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.nearby { background: #121318; border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.item { display: flex; align-items: center; gap: 10px; }
.item-time { font-weight: 700; color: var(--accent); min-width: 56px; }
.item-title { color: var(--text); }

.schedule-list { margin-top: 12px; border-top: 1px solid var(--border); max-height: 240px; overflow: auto; }
.schedule-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.schedule-row .title { color: var(--text); }
.schedule-row .time { color: var(--muted); font-weight: 600; }
.schedule-row.now .title { color: white; font-weight: 700; }

.schedule-error { margin-top: 12px; color: #f1b3b3; background: #2b1212; border: 1px solid #612525; border-radius: 10px; padding: 10px; }

.site-footer { border-top: 1px solid var(--border); margin-top: 8px; }
.site-footer .container { padding: 18px 16px; color: var(--muted); }

/* Noticias */
.news { margin-top: 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.news-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); }
.news-title { margin: 0; font-size: 20px; }
.news-sub { margin: 0; color: var(--muted); font-size: 13px; }

.news-slider { position: relative; padding: 12px 44px; }
.slider-viewport { overflow: hidden; border-radius: 12px; }
.slider-track { display: flex; gap: 12px; transition: transform 320ms ease; will-change: transform; }
.slider-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); border: 1px solid var(--border); color: #fff; width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; }
.slider-btn:hover { background: rgba(0,0,0,0.7); }
.slider-btn.prev { left: 8px; }
.slider-btn.next { right: 8px; }

.news-card { min-width: 300px; flex: 0 0 auto; background: #0c0d13; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; position: relative; }
.news-card .thumb { position: relative; height: 180px; background: #0b0c0f center/cover no-repeat; }
.news-card .thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0)); }
.news-card .meta { padding: 10px 12px; }
.news-card .title { margin: 0; font-size: 16px; color: var(--text); }
.news-card .date { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.news-card .link { position: absolute; inset: 0; }
.news-card a { text-decoration: none; color: inherit; }

.news-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 12px; }
.news-list .list-card { background: #0c0d13; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: grid; grid-template-columns: 140px 1fr; position: relative; }
.list-card .thumb { height: 100%; min-height: 100%; background: #0b0c0f center/cover no-repeat; }
.list-card .body { padding: 10px 12px; }
.list-card .title { margin: 0; font-size: 15px; }
.list-card .date { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.list-card .link { position: absolute; inset: 0; }
.list-card a { text-decoration: none; color: inherit; }

.news-error { margin: 12px; color: #f1b3b3; background: #2b1212; border: 1px solid #612525; border-radius: 10px; padding: 10px; }

.news-actions { display: flex; justify-content: center; padding: 8px 12px 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 999px; padding: 10px 16px; font-weight: 600; cursor: pointer; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 6px 16px rgba(229,9,20,0.3); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-yt { background: #ff0000; color: #fff; border-color: #b30000; box-shadow: 0 6px 16px rgba(255,0,0,0.28); }
.btn-yt:hover { filter: brightness(1.08); }
.btn-outline { background: transparent; color: #fff; }

/* Videos */
.videos { margin-top: 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.videos-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.videos-title { margin: 0; font-size: 20px; }
.videos-cta { display: flex; gap: 10px; }
.videos-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 12px; }
.video-item { position: relative; }
.video-item iframe { width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; border: 1px solid var(--border); background: #000; }

@media (max-width: 1024px) {
  .content { grid-template-columns: 1fr; grid-template-areas: "hero" "live" "divider" "news" "schedule"; }
  .schedule { position: static; }
  .news-list { grid-template-columns: repeat(2, 1fr); }
  .videos-grid { grid-template-columns: 1fr; }
  .videos-cta { width: 100%; justify-content: flex-start; }
  .brand-cover { width: 320px; height: 52px; }
}

@media (max-width: 600px) {
  .header-inner { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 8px; }
  .nav { width: 100%; justify-content: space-between; }
  .badge-live { font-size: 11px; padding: 5px 8px; }
  .live-title { font-size: 18px; }
  .news-slider { padding: 10px 38px; }
  .news-card { min-width: 240px; }
  .news-list { grid-template-columns: 1fr; }
  .videos-grid { grid-template-columns: 1fr; }
  .videos-cta { width: 100%; justify-content: center; }
  .brand-cover { display: none; }
}
/* Popup de noticia */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal.hidden { display: none; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(6px); }
.modal-dialog { position: relative; width: 92vw; max-width: 1000px; height: 90vh; background: #0f1016; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 14px 44px rgba(0,0,0,0.6); overflow: hidden; display: flex; flex-direction: column; }
.modal-close { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.5); border: 1px solid var(--border); color: #fff; width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; font-size: 18px; }
.modal-body { padding: 16px; overflow: auto; }
.modal-body img { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 10px auto; }
/* Forzar centrado si vienen con estilos de float desde Blogger */
.modal-body img[style*="float:left"],
.modal-body img[style*="float:right"] { float: none !important; display: block; margin: 10px auto !important; }
.modal-body figure { margin: 0; }
.modal-body figure img { display: block; margin: 10px auto; }
.modal-body h1, .modal-body h2, .modal-body h3, .modal-body h4 { margin-top: 0; }

/* Blur del fondo cuando el modal está activo */
body.modal-open .site-header,
body.modal-open .content,
body.modal-open .site-footer { filter: blur(5px); }