/* Estructura del reproductor publico.  Sin dependencias externas.
 * Los colores y tipografias salen todos de theme.css: aqui no hay ni un
 * valor de marca escrito a mano, para que cambiar de cliente sea cambiar
 * un unico fichero.
 *
 * Las reglas de cabecera, botones, pildoras, tarjetas y pie replican las de
 * www.pozueloradio.es para que la transicion entre las dos paginas no se note.
 */

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 7% 12%, rgba(255, 64, 1, .08), transparent 26%),
    radial-gradient(circle at 86% 2%, rgba(4, 60, 88, .08), transparent 32%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { width: min(var(--max), calc(100% - 44px)); margin: 0 auto; }

/* --- cabecera ------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.nav {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.logo img { width: 214px; height: auto; }

.nav ul {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.nav a:hover { color: var(--brand); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  font-family: inherit;
  border: 0;
  cursor: pointer;
  box-shadow: var(--brand-glow);
}

.btn:hover { background: var(--brand-dark); color: #fff; }

.btn.secondary {
  background: #fff;
  color: var(--blue);
  border: 1px solid rgba(4, 60, 88, .18);
  box-shadow: none;
}

/* --- pildoras ------------------------------------------------------------ */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 14px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  text-transform: uppercase;
  letter-spacing: .075em;
  font-size: 12px;
  font-weight: 900;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 9px 14px;
  background: #fff;
  color: var(--blue);
  border: 1px solid var(--line);
  font-weight: 850;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* El punto del directo: late para que se vea de un vistazo que hay senal. */
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  position: relative;
  flex: none;
}

.dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--brand);
  opacity: 0;
  animation: latido 2.4s ease-out infinite;
}

@keyframes latido {
  0%   { transform: scale(.55); opacity: .65; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { opacity: 0; }
}

/* Sin senal el punto se apaga y deja de latir. */
body.offline .dot { background: var(--muted); }
body.offline .dot::after { animation: none; }
body.offline .eyebrow { color: var(--muted); background: var(--blue-soft); }

/* --- tarjeta del directo ------------------------------------------------- */

.live { padding: 46px 0 8px; }

.live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.live-card {
  position: relative;
  overflow: hidden;
  padding: 34px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.live-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
}

.art {
  aspect-ratio: 1;
  border-radius: 24px;
  overflow: hidden;
  background: var(--soft);
  border: 1px solid var(--line);
  box-shadow: 0 14px 40px rgba(4, 60, 88, .13);
}

.art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.now-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .075em;
}

.song-title {
  margin: 0;
  font-family: var(--font-titulo);
  font-size: clamp(30px, 3.6vw, 52px);
  line-height: 1.04;
  letter-spacing: -.045em;
  color: var(--blue);
  overflow-wrap: anywhere;
}

.song-artist {
  margin: 14px 0 0;
  color: var(--brand-dark);
  font-size: 19px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

/* --- controles ----------------------------------------------------------- */

.controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 30px;
}

.play {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 26px 0 0;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  box-shadow: var(--brand-glow);
  transition: background .15s ease, transform .15s ease;
}

.play:hover:not(:disabled) { background: var(--brand-dark); }
.play:active:not(:disabled) { transform: scale(.98); }

.play:disabled {
  background: var(--soft);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}

.play-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  flex: none;
}

.play-icon svg { width: 22px; height: 22px; fill: currentColor; }

/* Solo se ve uno de los dos iconos, segun este sonando o no. */
.icon-pause { display: none; }
body.playing .icon-play { display: none; }
body.playing .icon-pause { display: block; }

.volume {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--blue);
}

.volume svg { width: 20px; height: 20px; fill: currentColor; flex: none; }

.volume input[type="range"] {
  width: 130px;
  accent-color: var(--brand);
  cursor: pointer;
}

.status {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  min-height: 1.2em;
}

/* Linea de avance de la cancion, pegada al borde inferior de la tarjeta. */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--blue-soft);
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand);
  transition: width .9s linear;
}

/* --- historial ---------------------------------------------------------- */

.history { padding: 58px 0 10px; }

.section-title {
  margin: 0 0 26px;
  font-family: var(--font-titulo);
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1.04;
  letter-spacing: -.045em;
  color: var(--ink);
}

.section-title span { color: var(--brand); }

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.history-list li {
  display: grid;
  grid-template-columns: 54px 46px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 15px 24px;
  border-top: 1px solid var(--line);
}

.history-list li:first-child { border-top: 0; }

.history-time {
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.history-art {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--soft);
}

.history-song { min-width: 0; }

.history-song strong {
  display: block;
  font-family: var(--font-titulo);
  font-size: 18px;
  font-weight: normal;
  color: var(--ink);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.history-song em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.history-empty {
  padding: 22px 24px;
  color: var(--muted);
}

/* --- pie ---------------------------------------------------------------- */

.footer {
  margin-top: 70px;
  padding: 42px 0;
  background: var(--blue);
  color: #fff;
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
}

.footer img { width: 170px; }
.footer small { color: rgba(255, 255, 255, .76); }
.footer a:hover { color: #fff; text-decoration: underline; }

/* --- accesibilidad y foco ----------------------------------------------- */

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dot::after { animation: none; }
  .progress span { transition: none; }
  .play { transition: none; }
}

/* --- adaptable ---------------------------------------------------------- */

@media (max-width: 980px) {
  .nav ul { display: none; }
  .live-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .art { max-width: 260px; }
  .logo img { width: 172px; }
}

@media (max-width: 560px) {
  .wrap { width: calc(100% - 30px); }
  .live-card { padding: 24px; }
  .live { padding-top: 30px; }
  .controls { gap: 14px; }
  .play { width: 100%; justify-content: flex-start; }
  .volume { width: 100%; }
  .volume input[type="range"] { flex: 1; width: auto; }
  .history-list li {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 18px;
  }
  .history-time { display: none; }
}
