:root {
  --bg: #0b0714;
  --bg-alt: #150f24;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-border: rgba(255, 255, 255, 0.09);
  --pink: #ff2e88;
  --cyan: #29f4d6;
  --violet: #9b5cff;
  --amber: #ffb648;
  --red: #ff2138;
  --text: #f4ede4;
  --text-muted: #a99bc4;
  --player-h: 68px;
  --topbar-h: 64px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  padding-top: var(--topbar-h);
  padding-bottom: calc(var(--player-h) + 12px);
  position: relative;
  overflow-x: hidden;
}

h1, h2, .logo-text { font-family: "Orbitron", sans-serif; }

a { color: inherit; text-decoration: none; }

/* background scanlines, subtle */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 10%, rgba(155, 92, 255, 0.14), transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(255, 46, 136, 0.12), transparent 45%),
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.025) 0px,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 3px
    );
  opacity: 0.6;
}

/* grano sutil, onda afiche fotocopiado */
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- Topbar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(11, 7, 20, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--surface-border);
  z-index: 30;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-img {
  height: 42px;
  width: auto;
  display: block;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 31;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.nav {
  position: fixed;
  top: var(--topbar-h);
  left: 0; right: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--surface-border);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  z-index: 29;
}
.nav.open { max-height: 260px; }

.nav a {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.nav a.active { color: var(--cyan); }

@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .nav {
    position: static;
    flex-direction: row;
    max-height: none;
    background: transparent;
    border-bottom: none;
    gap: 4px;
  }
  .nav a {
    padding: 8px 14px;
    border-bottom: none;
    border-radius: 8px;
  }
  .nav a:hover { background: var(--surface); }
}

/* ---------- Layout / views ---------- */
main {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.view { display: none; animation: fadeIn 0.35s ease; }
.view.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-title {
  font-size: 22px;
  margin: 6px 0 4px;
}
.section-sub {
  color: var(--text-muted);
  font-size: 13.5px;
  margin: 0 0 20px;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--surface-border);
}
.hero-content {
  padding: 32px 12px 28px;
}
.hero-eyebrow {
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 16px;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 46, 136, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(255, 46, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 46, 136, 0); }
}

.hero-desc {
  color: var(--text-muted);
  font-size: 12.5px;
  max-width: 380px;
  margin: 14px 0 0;
  line-height: 1.5;
}
.hero-desc:empty { display: none; margin: 0; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Mobile: reproductor arriba, logo abajo. Web: logo fijo a la izquierda,
   reproductor ocupando el resto del espacio (ver media query más abajo). */
.hero-bar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
}
.hero-bar-player-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.hero-bar-player-col .hero-eyebrow { margin: 0; }

.hero-bar-logo-col {
  display: flex;
  justify-content: center;
}
.hero-bar-logo-wrap {
  margin: 0;
}
.hero-bar-logo {
  height: auto;
  width: 100%;
  max-width: 220px;
  display: block;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.5));
}

.hero-player {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 14px 18px;
}
.hero-player-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  color: #0b0714;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}
.hero-player-btn:hover { transform: translateY(-2px); }
.hero-player-btn:active { transform: translateY(0); }

.hero-eq {
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 22px;
  flex-shrink: 0;
  overflow: hidden;
}
.hero-eq span {
  flex: 1 1 0;
  min-width: 1px;
  background: var(--cyan);
  border-radius: 1px;
  height: var(--h, 10px);
  transform: scaleY(0.35);
  transform-origin: bottom;
  opacity: 0.5;
}
.hero-player.playing .hero-eq span {
  opacity: 1;
  animation: wave-bar var(--dur, 1s) ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

.hero-player-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.hero-player-status {
  font-size: 14.5px;
  font-weight: 700;
}
.hero-player-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  margin-right: 6px;
  vertical-align: middle;
}
.hero-player.live .hero-player-status { color: var(--pink); }
.hero-player.live .hero-player-status::before {
  background: var(--pink);
  animation: pulse 1.6s infinite;
}
.hero-player-sub {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Web: logo fijo a la izquierda, reproductor grande ocupando todo el resto
   del ancho — el ecualizador crece para llenar el espacio, sin huecos. */
@media (min-width: 640px) {
  .hero-bar {
    flex-direction: row;
    align-items: stretch;
    gap: 28px;
  }
  .hero-bar-logo-col {
    order: -1;
    flex: 0 0 auto;
    align-items: center;
  }
  .hero-bar-player-col {
    flex: 1 1 auto;
    justify-content: center;
  }

  .hero-player {
    height: 100%;
    padding: 22px 30px;
    gap: 22px;
  }
  .hero-player-btn {
    width: 64px;
    height: 64px;
    font-size: 20px;
  }
  .hero-eq {
    flex: 1 1 auto;
    height: 40px;
    gap: 2px;
  }
  .hero-player-info {
    flex: 0 0 auto;
    text-align: right;
    white-space: nowrap;
  }
  .hero-player-status { font-size: 17px; }
  .hero-player-sub { font-size: 13.5px; max-width: 260px; white-space: normal; }
}

/* ---------- Programa destacado (flyer) ---------- */
.featured-show {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  overflow: hidden;
  margin-top: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
.featured-show-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
}
.featured-show-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.featured-show-body { padding: 18px 20px 22px; text-align: left; }
.featured-tag {
  display: inline-block;
  align-self: flex-start;
  width: fit-content;
  font-family: "Orbitron", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0b0714;
  background: var(--red);
  padding: 4px 10px;
  border-radius: 4px;
  transform: rotate(-2deg);
  margin-bottom: 12px;
}
.featured-show-title { font-size: 22px; margin: 0 0 4px; }
.featured-show-host { font-size: 13px; color: var(--cyan); font-weight: 600; margin: 0 0 8px; }
.featured-show-desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.5; margin: 0 0 12px; max-width: 560px; }
.featured-show-time {
  font-size: 12px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

@media (min-width: 640px) {
  .featured-show { display: flex; align-items: stretch; }
  .featured-show-media { width: 42%; aspect-ratio: auto; }
  .featured-show-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
}

/* ---------- Panels / lists ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 18px;
  padding: 20px;
  margin-top: 16px;
}
.panel-title {
  font-size: 15px;
  margin: 0 0 14px;
  color: var(--cyan);
  letter-spacing: 0.03em;
}
.panel-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: -8px 0 14px;
}

.today-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.today-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  font-size: 13.5px;
}
.today-list li.live-now {
  background: rgba(255, 46, 136, 0.1);
  border: 1px solid rgba(255, 46, 136, 0.35);
}
.today-list .t-time { color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.today-list .t-name { font-weight: 600; flex: 1; padding: 0 10px; }
.today-list .t-host { color: var(--text-muted); font-size: 12px; }
.today-empty { color: var(--text-muted); font-size: 13.5px; padding: 6px 2px; }

.link-more {
  display: inline-block;
  margin-top: 16px;
  font-size: 13px;
  color: var(--cyan);
  font-weight: 600;
}

/* ---------- Schedule (full) ---------- */
.schedule-day { margin-bottom: 22px; }
.schedule-day h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.schedule-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  margin-bottom: 8px;
}
.schedule-item.live-now {
  border-color: rgba(255, 46, 136, 0.5);
  background: rgba(255, 46, 136, 0.08);
}
.schedule-time {
  font-size: 12.5px;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.schedule-main {
  flex: 1;
  min-width: 0;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.schedule-name { font-weight: 600; font-size: 14px; }
.schedule-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.schedule-host { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ---------- Videos de YouTube ---------- */
.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .video-grid { grid-template-columns: repeat(3, 1fr); }
}
.video-grid-preview {
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}
/* mobile: solo se ve el primer video, con insignia de "hay más adentro" */
.video-grid-preview .video-item:nth-child(n + 2) { display: none; }
.video-grid-preview .video-info { display: none; }
.video-more-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--red);
  color: #0b0714;
  font-family: "Orbitron", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
@media (min-width: 640px) {
  .video-grid-preview { grid-template-columns: repeat(3, 1fr); }
  .video-grid-preview .video-item:nth-child(n + 2) { display: block; }
  .video-more-badge { display: none; }
}
.video-item {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  background: var(--bg-alt);
}
.video-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: none;
  cursor: pointer;
  background: #000;
}
.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.75;
}
.video-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  color: #0b0714;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}
.video-item iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: none;
}
.video-info {
  padding: 10px 12px 12px;
}
.video-title {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 4px;
}
.video-yt-link {
  font-size: 11.5px;
  color: var(--cyan);
  font-weight: 600;
}
.video-grid-preview .video-info { padding: 8px 10px 10px; }
.video-grid-preview .video-title { font-size: 11px; }

/* ---------- News ---------- */
.news-list { display: flex; flex-direction: column; gap: 12px; }
.news-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  cursor: pointer;
}
.news-thumb {
  width: 92px;
  height: 92px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-alt);
}
.news-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-body { flex: 1; min-width: 0; max-width: 640px; }
.news-date { font-size: 11px; color: var(--text-muted); letter-spacing: 0.04em; }
.news-title { font-size: 15px; font-weight: 700; margin: 3px 0 4px; }
.news-excerpt { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.news-full {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--surface-border);
  display: none;
}
.news-card.expanded .news-full { display: block; }
.news-card.expanded .news-excerpt { display: none; }

/* ---------- Lectura de miércoles (portada) ---------- */
.lectura-teaser {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lectura-teaser-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-alt);
  flex-shrink: 0;
}
.lectura-teaser-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(20%);
}
.lectura-teaser-tag {
  display: inline-block;
  font-family: "Orbitron", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0b0714;
  background: var(--red);
  padding: 4px 10px;
  border-radius: 4px;
}
.lectura-teaser-title { font-size: 19px; margin: 10px 0 2px; }
.lectura-teaser-author { font-size: 12.5px; color: var(--cyan); font-weight: 600; margin: 0 0 10px; }
.lectura-teaser-intro { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; margin: 0 0 14px; max-width: 520px; }
.lectura-teaser-link { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--cyan); }

@media (min-width: 640px) {
  .lectura-teaser { flex-direction: row; align-items: stretch; }
  .lectura-teaser-media { width: 38%; aspect-ratio: auto; }
  .lectura-teaser-text { flex: 1; display: flex; flex-direction: column; justify-content: center; }
}

/* ---------- Efemérides (portada) ---------- */
.efemerides-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 480px) {
  .efemerides-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 700px) {
  .efemerides-grid { grid-template-columns: repeat(4, 1fr); }
}
.efemeride-card {
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--surface-border);
  cursor: pointer;
}
.efemeride-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
}
.efemeride-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.efemeride-decade {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--red);
  color: #0b0714;
  font-family: "Orbitron", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
}
.efemeride-body { padding: 12px 14px 14px; }
.efemeride-date {
  font-size: 10.5px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.efemeride-title { font-size: 13.5px; font-weight: 700; margin: 4px 0 6px; line-height: 1.3; }
.efemeride-summary { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.efemeride-full {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.55;
  display: none;
}
.efemeride-card.expanded .efemeride-summary { display: none; }
.efemeride-card.expanded .efemeride-full { display: block; }
.efemeride-toggle {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 24px 16px 12px;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ---------- Persistent player bar ---------- */
.player-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--player-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: rgba(11, 7, 20, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--surface-border);
  z-index: 40;
}

.player-play {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  color: #0b0714;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}

.eq {
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 20px;
  flex-shrink: 0;
  overflow: hidden;
}
.eq span {
  flex: 1 1 0;
  min-width: 1px;
  background: var(--cyan);
  border-radius: 1px;
  height: var(--h, 10px);
  transform: scaleY(0.35);
  transform-origin: bottom;
  opacity: 0.5;
}
.player-bar.playing .eq span {
  opacity: 1;
  animation: wave-bar var(--dur, 1s) ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

@keyframes wave-bar {
  0%, 100% { transform: scaleY(0.35); }
  50% { transform: scaleY(1); }
}

.player-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.player-status {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-bar.live .player-status { color: var(--pink); }
.player-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.volume {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  flex-shrink: 0;
}
.volume input[type="range"] {
  width: 80px;
  accent-color: var(--cyan);
}
@media (min-width: 560px) {
  .volume { display: flex; }
}
