/*
Theme Name: Tómalo Radio
Theme URI: https://tomaloradio.com
Author: VacaWeb
Description: Tema a la medida para Tómalo Radio — reproductor en vivo, programación, playlist en tiempo real y donaciones.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: tomalo-radio
*/

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --red: #CC2229; --dark: #111111; --nav-bg: #1a1a1a;
  --light: #f4f4f4; --text: #222; --white: #fff;
  --player-h: 68px;
  --player-margin: 16px;
}
/* El reproductor ahora flota ABAJO (pedido del cliente), no arriba — el body
   ya no necesita espacio reservado arriba, sino abajo, para que el contenido
   nunca quede tapado por la barra flotante. */
/* overflow-x:hidden en html+body es una red de seguridad: evita que CUALQUIER
   elemento que se desborde (aunque sea un bug futuro) empuje toda la página
   más ancha que la pantalla y corte el sitio del lado derecho en móvil. */
html { overflow-x: hidden; max-width: 100%; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: var(--light); color: var(--text); padding-bottom: calc(var(--player-h) + (var(--player-margin) * 2)); overflow-x: hidden; max-width: 100%; }
a { color: inherit; }
img { max-width: 100%; }

/* ── PLAYER BAR — flotante, anclado abajo ── */
#player-bar {
  position: fixed; left: var(--player-margin); right: var(--player-margin); bottom: var(--player-margin); z-index: 1000;
  height: var(--player-h);
  background: #0a0a0a;
  border-radius: 16px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px;
  box-shadow: 0 10px 34px rgba(0,0,0,.55), 0 2px 10px rgba(0,0,0,.4);
  overflow: hidden;
}
#viz-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}
#player-bar > *:not(#viz-canvas) { position: relative; z-index: 1; }

#live-badge {
  background: var(--red); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
  padding: 3px 8px; border-radius: 3px;
  animation: pulse 1.8s infinite; flex-shrink: 0;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

#play-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--red); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .2s, transform .1s;
  box-shadow: 0 0 0 0 rgba(204,34,41,.5);
}
#play-btn.playing { animation: ring 1.5s infinite; }
@keyframes ring { 0%{box-shadow:0 0 0 0 rgba(204,34,41,.6)} 70%{box-shadow:0 0 0 10px rgba(204,34,41,0)} 100%{box-shadow:0 0 0 0 rgba(204,34,41,0)} }
#play-btn:hover { background: #a81b21; transform: scale(1.05); }
#play-btn svg { width: 18px; height: 18px; fill: #fff; }

/* min-width:0 es obligatorio aquí: sin esto, un título de canción largo y sin
   espacios empuja este elemento flex más ancho que su contenedor en vez de
   truncarse con "…", y esa fuga de ancho termina empujando TODA la página
   (incluida la barra flotante) más ancha que la pantalla en el celular. */
#now-playing { flex: 1; min-width: 0; overflow: hidden; }
#np-song { color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#np-artist { color: #bbb; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#np-show { color: #888; font-size: 11px; }

#volume-wrap { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
#volume-wrap svg { fill: #aaa; width: 16px; }
#volume { width: 80px; accent-color: var(--red); cursor: pointer; }
#player-logo img { height: 40px; width: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
audio { display: none; }

/* ── NAV ── */
nav.site-nav {
  background: var(--nav-bg);
  display: flex; align-items: center;
  padding: 0 24px; gap: 0;
  border-bottom: 3px solid var(--red);
  position: sticky; top: 0; z-index: 900;
}
.nav-logo { margin-right: 24px; }
.nav-logo img { height: 44px; padding: 6px 0; border-radius: 50%; }
.nav-links { display: flex; flex: 1; flex-wrap: wrap; list-style: none; }
.nav-links li { list-style: none; }
.nav-links a {
  color: #ccc; text-decoration: none;
  padding: 16px 14px; font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  transition: color .2s, background .2s; display: block;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.btn-donate {
  background: var(--red); color: #fff; border: none; cursor: pointer;
  padding: 8px 18px; border-radius: 4px; font-size: 13px; font-weight: 700;
  text-transform: uppercase; text-decoration: none; letter-spacing: .5px;
  transition: background .2s;
}
.btn-donate:hover { background: #a81b21; }
.btn-listen {
  background: transparent; color: #fff; border: 2px solid #444; cursor: pointer;
  padding: 7px 16px; border-radius: 4px; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: border-color .2s;
}
.btn-listen:hover { border-color: #888; }

/* mobile nav toggle */
#nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; padding: 10px; }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, #1a0000 0%, #2d0a0a 40%, #1a1a1a 100%);
  padding: 70px 24px; display: flex; align-items: center;
  justify-content: center; flex-direction: column; text-align: center;
  gap: 20px; min-height: 300px; position: relative; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: .18;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(204,34,41,.2) 0%, transparent 70%);
}
/* Fondo animado del hero (pedido del cliente: burbujas/rayas, mismo lenguaje
   visual que ya tiene la barra del reproductor) — va detrás del texto, delante
   del degradado de fondo. */
#hero-viz-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.hero h1 { color: #fff; font-size: 46px; font-weight: 900; position: relative; text-shadow: 0 2px 20px rgba(0,0,0,.8); }
.hero h1 span { color: var(--red); }
.hero p { color: #ccc; font-size: 16px; position: relative; max-width: 520px; text-shadow: 0 1px 4px rgba(0,0,0,.8); }
.hero-btns { display: flex; gap: 12px; position: relative; flex-wrap: wrap; justify-content: center; }
.hero-btn-main {
  background: var(--red); color: #fff; padding: 14px 32px; border-radius: 6px;
  font-size: 15px; font-weight: 700; text-decoration: none;
  border: none; cursor: pointer; transition: background .2s;
}
.hero-btn-main:hover { background: #a81b21; }
.hero-btn-sec {
  background: rgba(255,255,255,.1); backdrop-filter: blur(4px); color: #fff;
  padding: 14px 32px; border-radius: 6px; font-size: 15px; font-weight: 700;
  text-decoration: none; border: 2px solid rgba(255,255,255,.3); cursor: pointer;
  transition: border-color .2s;
}
.hero-btn-sec:hover { border-color: rgba(255,255,255,.7); }

/* ── TICKER ── */
.ticker-wrap {
  background: var(--red); color: #fff;
  padding: 10px 0; overflow: hidden; display: flex; align-items: center;
}
.ticker-label {
  background: #900; padding: 0 16px; font-size: 11px;
  font-weight: 800; letter-spacing: 1px; white-space: nowrap;
  display: flex; align-items: center; flex-shrink: 0;
  height: 36px;
}
/* min-width:0 es CRÍTICO aquí: .ticker-inner es intencionalmente larguísimo
   (todo el texto del ticker en una sola línea, para la animación de scroll
   infinito) — sin este min-width, ese ancho intrínseco se filtra hacia arriba
   y empuja TODA la página (nav, hero, reproductor) más ancha que la pantalla
   en el celular. Esta era la causa raíz real del corte a la derecha en móvil. */
.ticker-track { overflow: hidden; flex: 1; min-width: 0; }
.ticker-inner { display: flex; animation: ticker 35s linear infinite; white-space: nowrap; width: max-content; }
.ticker-inner span { padding: 0 40px; font-size: 13px; font-weight: 600; }
@keyframes ticker { from{transform:translateX(0)} to{transform:translateX(-50%)} }

/* ── LAYOUT ── */
.container { max-width: 1200px; margin: 0 auto; padding: 36px 24px; }
.section-title {
  font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 2px; color: var(--red);
  border-bottom: 2px solid var(--red); padding-bottom: 6px; margin-bottom: 22px;
}
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.grid-3col { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-bottom: 40px; }
.grid-main-side { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-bottom: 40px; }

/* ── CARDS ── */
.card {
  background: #fff; border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.1); transition: box-shadow .2s, transform .2s; cursor: pointer;
  text-decoration: none; display: block; color: inherit;
}
.card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.15); transform: translateY(-2px); }
.card img { width: 100%; display: block; object-fit: cover; height: 170px; }
.card-body { padding: 16px; }
.card-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--red); margin-bottom: 6px; }
.card-title { font-size: 16px; font-weight: 700; line-height: 1.3; margin-bottom: 8px; }
.card-sub { font-size: 13px; color: #666; line-height: 1.5; }
.card-date { font-size: 11px; color: #999; margin-top: 8px; }

.card-feat { position: relative; overflow: hidden; border-radius: 8px; cursor: pointer; text-decoration: none; display: block; }
.card-feat img { width: 100%; height: 230px; object-fit: cover; display: block; filter: brightness(.55); transition: filter .35s, transform .35s; }
.card-feat:hover img { filter: brightness(.75); transform: scale(1.03); }
.card-feat-body {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 20px;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
}
.card-feat-label { font-size: 10px; font-weight: 800; color: var(--red); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.card-feat-title { color: #fff; font-size: 19px; font-weight: 800; line-height: 1.2; }
.card-feat-sub { color: #ccc; font-size: 13px; margin-top: 4px; }

/* ── NOW PLAYING (tarjeta grande arriba de la playlist, con arte + ecualizador
   animado) — le da peso visual a esa columna en vez de dejar un hueco vacío
   cuando el historial real de canciones todavía tiene pocos registros. ── */
.nowplaying-card {
  background: linear-gradient(135deg, #1a0000 0%, #2d0a0a 60%, #1a1a1a 100%);
  border-radius: 12px; padding: 22px; position: relative; overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
.np-card-art {
  width: 84px; height: 84px; border-radius: 10px; margin-bottom: 14px;
  background: rgba(255,255,255,.06) center/cover no-repeat;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.np-card-bars {
  position: absolute; top: 22px; right: 22px;
  display: flex; align-items: flex-end; gap: 3px; height: 26px;
}
.np-card-bars span {
  width: 4px; background: var(--red); border-radius: 2px;
  animation: npbar 1s ease-in-out infinite;
}
.np-card-bars span:nth-child(1) { height: 40%; animation-delay: -0.9s; }
.np-card-bars span:nth-child(2) { height: 70%; animation-delay: -0.6s; }
.np-card-bars span:nth-child(3) { height: 100%; animation-delay: -0.3s; }
.np-card-bars span:nth-child(4) { height: 55%; animation-delay: -0.15s; }
.np-card-bars span:nth-child(5) { height: 85%; animation-delay: 0s; }
@keyframes npbar { 0%,100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.np-card-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--red);
  margin-bottom: 8px; text-transform: uppercase;
}
.np-card-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: pulse 1.8s infinite; }
.np-card-title { color: #fff; font-size: 17px; font-weight: 800; line-height: 1.3; margin-bottom: 4px; }
.np-card-artist { color: #bbb; font-size: 13px; }

/* ── PLAYLIST ── */
.playlist-box { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 6px rgba(0,0,0,.1); min-height: 120px; }
.pl-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f0f0; align-items: center; }
.pl-item:last-child { border-bottom: none; }
.pl-num { font-size: 12px; color: #bbb; width: 16px; flex-shrink: 0; text-align: center; }
.pl-img { width: 44px; height: 44px; border-radius: 4px; object-fit: cover; flex-shrink: 0; background: #eee; }
.pl-info { flex: 1; min-width: 0; overflow: hidden; }
.pl-song { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-artist { font-size: 12px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-time { font-size: 11px; color: #bbb; flex-shrink: 0; }
.pl-empty { color: #999; font-size: 13px; text-align: center; padding: 20px 0; }

/* ── SHOWS ── */
.shows-scroll { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 10px; }
.shows-scroll::-webkit-scrollbar { height: 4px; }
.shows-scroll::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }
.show-card { flex-shrink: 0; width: 178px; cursor: pointer; transition: transform .2s; text-decoration: none; display: block; color: inherit; }
.show-card:hover { transform: translateY(-3px); }
.show-card img { width: 178px; height: 178px; border-radius: 10px; object-fit: cover; display: block; box-shadow: 0 3px 12px rgba(0,0,0,.2); background: #ddd; }
.show-card .show-name { font-size: 13px; font-weight: 700; margin-top: 9px; }
.show-card .show-host { font-size: 12px; color: #888; }

/* ── DONATION BANNER ── */
.donate-banner {
  border-radius: 10px; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; margin-bottom: 40px; position: relative;
}
.donate-banner-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: brightness(.3) saturate(1.5);
}
.donate-banner-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 36px 40px; width: 100%; }
.donate-banner h2 { color: #fff; font-size: 26px; font-weight: 900; }
.donate-banner p { color: rgba(255,255,255,.8); font-size: 14px; margin-top: 4px; }
.btn-white {
  background: #fff; color: var(--red); padding: 13px 28px; border-radius: 6px;
  font-size: 14px; font-weight: 800; text-decoration: none; white-space: nowrap; flex-shrink: 0;
  transition: background .2s; border: none; cursor: pointer;
}
.btn-white:hover { background: #f0f0f0; }

/* ── FOOTER ── */
footer.site-footer { background: var(--nav-bg); color: #888; padding: 44px 24px 24px; margin-top: 40px; }
.footer-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-brand img { height: 50px; border-radius: 50%; margin-bottom: 12px; }
.footer-brand p { font-size: 13px; line-height: 1.6; }
.footer-col h4 { color: #fff; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col a { display: block; color: #888; text-decoration: none; font-size: 13px; margin-bottom: 7px; transition: color .2s; }
.footer-col a:hover { color: #fff; }
.footer-bottom { max-width: 1200px; margin: 0 auto; border-top: 1px solid #2a2a2a; padding-top: 18px; font-size: 12px; text-align: center; }
.footer-bottom a { color: #666; text-decoration: none; }

/* ── PAGE / SINGLE CONTENT ── */
.page-content-wrap { max-width: 820px; margin: 0 auto; padding: 50px 24px; }
.page-content-wrap h1 { font-size: 32px; font-weight: 900; margin-bottom: 18px; }
.page-content-wrap .entry-meta { color: #999; font-size: 13px; margin-bottom: 24px; }
.page-content-wrap .entry-content { font-size: 16px; line-height: 1.8; }
.page-content-wrap .entry-content p { margin-bottom: 18px; }
.page-content-wrap .entry-content img { border-radius: 8px; margin: 20px 0; }
.page-content-wrap .featured-img { width: 100%; border-radius: 10px; margin-bottom: 24px; max-height: 420px; object-fit: cover; }
.archive-header { max-width: 1200px; margin: 0 auto; padding: 40px 24px 0; }
.archive-header h1 { font-size: 30px; font-weight: 900; }

/* ── RESPONSIVE ── */
@keyframes modalIn { from{opacity:0;transform:translateY(20px) scale(.97)} to{opacity:1;transform:translateY(0) scale(1)} }
@media(max-width:900px) { .grid-main-side { grid-template-columns: 1fr; } .footer-grid { grid-template-columns: 1fr 1fr; } }
@media(max-width:680px) {
  :root { --player-margin: 8px; --player-h: 60px; }
  .grid-2col, .grid-3col { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; } #volume-wrap { display: none; }
  #nav-toggle { display: block; margin-left: auto; }
  .nav-links { display: none; width: 100%; flex-direction: column; order: 3; }
  nav.site-nav { flex-wrap: wrap; }
  nav.site-nav.nav-open .nav-links { display: flex; }
  .nav-links a { padding: 12px 8px; font-size: 13px; }
  .donate-banner-inner { flex-direction: column; text-align: center; }
}
@media(max-width:480px) { .footer-grid { grid-template-columns: 1fr; } }
