/* ============================================================
   T.V. RADIO VILLA SAN PEDRO DE HUALLA 95.7 FM
   style.css — Mobile First · Azul / Rojo / Amarillo / Blanco
   El HERO completo es el reproductor.
   ============================================================ */

:root {
  --azul:        #0a2472;
  --azul-oscuro: #061642;
  --azul-claro:  #1a3fa8;
  --rojo:        #d81e26;
  --rojo-oscuro: #a8121a;
  --amarillo:    #ffc400;
  --blanco:      #ffffff;
  --gris-bg:     #f4f6fb;
  --gris-texto:  #5a6480;
  --sombra:      0 10px 30px rgba(10, 36, 114, .14);
  --mini-h:      72px;
  --font:        'Montserrat', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--blanco);
  color: var(--azul-oscuro);
  -webkit-font-smoothing: antialiased;
  /* espacio para el mini-player fijo en móvil */
  padding-bottom: calc(var(--mini-h) + env(safe-area-inset-bottom));
}

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

.container {
  width: min(100% - 2.5rem, 1100px);
  margin-inline: auto;
}

.txt-red { color: var(--rojo); }

/* ============================================================
   HEADER — oculto en móvil (el hero es la cabecera, estilo app)
   ============================================================ */
.header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--blanco);
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--azul) 33%, var(--rojo) 33% 66%, var(--amarillo) 66%) 1;
  box-shadow: 0 2px 14px rgba(10, 36, 114, .08);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: .6rem;
}

.header__brand { display: flex; align-items: center; gap: .6rem; }

.header__logo { width: 46px; height: auto; }

.header__name { line-height: 1.1; }
.header__name strong { display: block; font-size: .8rem; font-weight: 800; color: var(--azul); letter-spacing: .02em; }
.header__name strong em { font-style: normal; color: var(--rojo); }
.header__name small { font-size: .66rem; color: var(--gris-texto); font-weight: 600; }

.header__nav { display: flex; gap: .4rem; }

.header__nav a {
  font-weight: 700;
  font-size: .95rem;
  color: var(--azul);
  padding: .7rem .5rem;
  border-radius: 10px;
  transition: background .2s, color .2s;
}
.header__nav a:hover { background: var(--gris-bg); color: var(--rojo); }

/* ============================================================
   HERO = REPRODUCTOR
   ============================================================ */
.hero {
  position: relative;
  /* fondo.png atenuado bajo un velo azul (opacidad ~85%) para que no sea agresivo */
  background:
    linear-gradient(170deg, rgba(6, 22, 66, .9) 0%, rgba(10, 36, 114, .86) 60%, rgba(26, 63, 168, .82) 100%),
    url('../assets/fondo.jpg') center / cover no-repeat,
    var(--azul-oscuro);
  color: var(--blanco);
  overflow: hidden;
  padding-block: 0 3.2rem;
}

/* ---- Cabecera estilo app (solo móvil): logo sobre blanco ---- */
.hero__brandbar {
  position: relative;
  z-index: 2;
  background: var(--blanco);
  text-align: center;
  padding: 1.1rem 1rem .95rem;
  border-radius: 0 0 26px 26px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .3);
  margin-bottom: 1.8rem;
}
.hero__brandbar img {
  width: min(230px, 58vw);
  margin-inline: auto;
}
.hero__brandtitle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: .55rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--azul);
}
.hero__brandtitle .live-dot { background: var(--rojo); }

/* ---- Ondas de audio de fondo: ocupan todo el ancho del hero ---- */
.hero__eq {
  position: absolute;
  inset: auto 0 6px 0;
  height: 46%;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  padding-inline: 6px;
  opacity: .1;
  pointer-events: none;
  transition: opacity .6s;
}
.hero__eq span {
  flex: 1;
  height: 8%;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(to top, var(--azul-claro), var(--rojo) 55%, var(--amarillo));
  animation: eq 1s ease-in-out infinite;
  animation-play-state: paused;
  transition: height .4s;
}
.is-playing .hero__eq { opacity: .24; }
.is-playing .hero__eq span { animation-play-state: running; }

@keyframes eq {
  0%, 100% { height: 12%; }
  25%      { height: 88%; }
  50%      { height: 38%; }
  75%      { height: 64%; }
}

/* franja tricolor al pie del hero */
.hero__flag {
  position: absolute;
  inset: auto 0 0 0;
  height: 6px;
  background: linear-gradient(90deg, var(--azul-claro) 33%, var(--rojo) 33% 66%, var(--amarillo) 66%);
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.4rem;
}

/* ---- Carátula (oculta en móvil, como app; visible en escritorio) ---- */
.hero__cover { position: relative; display: none; }

.hero__cover img {
  width: 190px;
  height: 190px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .45);
  background: var(--blanco);
  transition: transform .4s ease;
}
.is-playing .hero__cover img { transform: scale(1.04); }

.hero__glow {
  position: absolute;
  inset: -10px;
  border-radius: 26px;
  background: conic-gradient(var(--azul-claro), var(--rojo), var(--amarillo), var(--azul-claro));
  filter: blur(20px);
  opacity: 0;
  z-index: -1;
  transition: opacity .5s;
}
.is-playing .hero__glow { opacity: .6; animation: spinGlow 6s linear infinite; }
@keyframes spinGlow { to { transform: rotate(360deg); } }

/* ---- Info de la canción ---- */
.hero__info {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__badge {
  display: none; /* en móvil el "EN VIVO" va en la barra de marca */
  align-items: center;
  gap: .45rem;
  background: var(--rojo);
  color: var(--blanco);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
  padding: .38rem .85rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--blanco);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(.7); }
}

.hero__label {
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .22em;
  color: var(--amarillo);
}

.hero__title {
  margin-top: .4rem;
  font-size: clamp(1.35rem, 5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
  max-width: 22ch;
}

.hero__artist {
  margin-top: .35rem;
  font-size: clamp(.9rem, 3vw, 1.05rem);
  font-weight: 600;
  color: rgba(255, 255, 255, .78);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  margin-top: 1rem;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .16);
  color: var(--blanco);
  font-size: .78rem;
  font-weight: 600;
  padding: .35rem .8rem;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.meta-chip b { font-weight: 800; color: var(--amarillo); }

/* ---- Controles ---- */
.hero__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-top: 1.4rem;
}

.btn-play {
  position: relative;
  width: 74px; height: 74px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--rojo), var(--rojo-oscuro));
  color: var(--blanco);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px rgba(216, 30, 38, .5);
  transition: transform .15s ease, box-shadow .2s;
}
.btn-play:hover  { transform: scale(1.06); }
.btn-play:active { transform: scale(.96); }

.btn-play svg { width: 32px; height: 32px; }
.btn-play .icon-pause { display: none; }
.is-playing .btn-play .icon-play  { display: none; }
.is-playing .btn-play .icon-pause { display: block; }

/* spinner de carga del stream */
.btn-play__spinner {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--amarillo);
  opacity: 0;
  animation: spin 1s linear infinite;
}
.is-loading .btn-play__spinner { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

.volume {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.volume__mute {
  background: none;
  border: 0;
  color: var(--blanco);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: .3rem;
}
.volume__mute svg { width: 22px; height: 22px; }
.volume__mute .icon-muted { display: none; }
.is-muted .volume__mute .icon-vol   { display: none; }
.is-muted .volume__mute .icon-muted { display: block; }

.volume__slider {
  -webkit-appearance: none;
  appearance: none;
  width: 110px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--amarillo) var(--vol, 80%), rgba(255, 255, 255, .25) var(--vol, 80%));
  outline: none;
  cursor: pointer;
}
.volume__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--blanco);
  border: 3px solid var(--amarillo);
  cursor: grab;
}
.volume__slider::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--blanco);
  border: 3px solid var(--amarillo);
  cursor: grab;
}

/* ============================================================
   NOSOTROS (los textos que salieron del hero)
   ============================================================ */
.about {
  padding-block: 2.6rem;
  background: var(--blanco);
}

.about__inner {
  text-align: center;
  max-width: 640px;
}

.about__freq {
  margin-top: .5rem;
  font-weight: 700;
  color: var(--rojo);
  font-size: .95rem;
}

.about__slogan {
  margin-top: .7rem;
  color: var(--gris-texto);
  font-size: .95rem;
  line-height: 1.6;
}

/* ============================================================
   HISTORIAL
   ============================================================ */
.history {
  background: var(--gris-bg);
  padding-block: 3rem 3.5rem;
}

.section-title {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 800;
  color: var(--azul);
  text-align: center;
}

.section-sub {
  text-align: center;
  color: var(--gris-texto);
  font-size: .92rem;
  margin-top: .4rem;
  margin-bottom: 1.8rem;
}

.history__list {
  list-style: none;
  display: grid;
  gap: .7rem;
  max-width: 640px;
  margin-inline: auto;
}

.history__item {
  display: flex;
  align-items: center;
  gap: .9rem;
  background: var(--blanco);
  border-radius: 14px;
  padding: .65rem .9rem;
  box-shadow: 0 4px 14px rgba(10, 36, 114, .07);
  border-left: 4px solid var(--amarillo);
  animation: fadeUp .45s ease both;
}
.history__item:nth-child(odd) { border-left-color: var(--rojo); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.history__num {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--azul);
  color: var(--blanco);
  font-size: .8rem;
  font-weight: 800;
}

.history__art {
  flex-shrink: 0;
  width: 46px; height: 46px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--gris-bg);
}

.history__song  { font-weight: 700; font-size: .9rem; color: var(--azul-oscuro); overflow-wrap: anywhere; }
.history__by    { font-size: .78rem; color: var(--gris-texto); font-weight: 600; margin-top: .1rem; }

.history__empty {
  text-align: center;
  color: var(--gris-texto);
  font-size: .9rem;
  padding: 1.4rem;
  background: var(--blanco);
  border-radius: 14px;
  border: 2px dashed #d8ddee;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  position: relative;
  background: linear-gradient(160deg, var(--azul-oscuro), var(--azul));
  color: rgba(255, 255, 255, .85);
}

.footer__flag {
  height: 6px;
  background: linear-gradient(90deg, var(--azul-claro) 33%, var(--rojo) 33% 66%, var(--amarillo) 66%);
}

.footer__inner {
  display: grid;
  gap: 1.8rem;
  padding-block: 2.5rem;
  text-align: center;
}

.footer__logo { width: 90px; margin-inline: auto; margin-bottom: .7rem; }

.footer__col h3 {
  color: var(--amarillo);
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .6rem;
}
.footer__col p { font-size: .88rem; line-height: 1.6; }
.footer__col a:hover { color: var(--amarillo); }

.footer__social {
  display: flex;
  justify-content: center;
  gap: .8rem;
}
.footer__social a {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .1);
  transition: background .25s, transform .2s;
}
.footer__social a:hover { background: var(--rojo); transform: translateY(-3px); }
.footer__social svg { width: 20px; height: 20px; }

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding: 1rem;
  text-align: center;
  font-size: .74rem;
  color: rgba(255, 255, 255, .55);
}

/* ---------- Crédito del desarrollador (minimalista) ---------- */
.dev-card {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-top: .9rem;
  opacity: .55;
  transition: opacity .25s;
}
.dev-card:hover { opacity: 1; }

.dev-card__label {
  font-size: .68rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .8);
  letter-spacing: .02em;
}

.dev-card__logo {
  height: 18px;
  width: auto;
}

.dev-card__name {
  font-size: .74rem;
  font-weight: 800;
  color: var(--blanco);
  letter-spacing: .06em;
}

/* ============================================================
   MINI PLAYER STICKY (estilo app · móvil)
   ============================================================ */
.mini-player {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 60;
  height: var(--mini-h);
  padding: 0 1rem calc(env(safe-area-inset-bottom) / 2);
  display: flex;
  align-items: center;
  gap: .8rem;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--azul) 33%, var(--rojo) 33% 66%, var(--amarillo) 66%) 1;
  box-shadow: 0 -6px 24px rgba(10, 36, 114, .15);
}

.mini-player__cover {
  width: 46px; height: 46px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--gris-bg);
}

.mini-player__info { flex: 1; min-width: 0; }

.mini-player__title {
  font-size: .84rem;
  font-weight: 700;
  color: var(--azul);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ecualizador pequeño del mini-player */
.equalizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
}
.equalizer span {
  width: 3px;
  height: 12%;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(to top, var(--azul), var(--rojo) 55%, var(--amarillo));
  animation: eq 1s ease-in-out infinite;
  animation-play-state: paused;
  opacity: .35;
  transition: opacity .4s;
}
.is-playing .equalizer span {
  animation-play-state: running;
  opacity: 1;
}
.equalizer span:nth-child(5n+1) { animation-duration: .9s;  animation-delay: -.2s; }
.equalizer span:nth-child(5n+2) { animation-duration: .7s;  animation-delay: -.45s; }
.equalizer span:nth-child(5n+3) { animation-duration: 1.1s; animation-delay: -.1s; }
.equalizer span:nth-child(5n+4) { animation-duration: .6s;  animation-delay: -.6s; }
.equalizer span:nth-child(5n+5) { animation-duration: .95s; animation-delay: -.3s; }

.equalizer--mini {
  height: 14px;
  margin-top: .25rem;
  justify-content: flex-start;
}

.mini-player__btn {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--rojo), var(--rojo-oscuro));
  color: var(--blanco);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(216, 30, 38, .4);
}
.mini-player__btn svg { width: 22px; height: 22px; }
.mini-player__btn .icon-pause { display: none; }
.is-playing .mini-player__btn .icon-play  { display: none; }
.is-playing .mini-player__btn .icon-pause { display: block; }

/* ============================================================
   ESCRITORIO (≥ 900px)
   ============================================================ */
@media (min-width: 900px) {

  body { padding-bottom: 0; }

  /* header visible con nav horizontal */
  .header { display: block; }
  .header__nav a { padding: .55rem 1rem; font-size: .88rem; }
  .header__logo { width: 56px; }
  .header__name strong { font-size: .95rem; }
  .header__name small  { font-size: .72rem; }

  /* sin barra de marca: el header ya tiene el logo */
  .hero__brandbar { display: none; }
  .hero__badge { display: inline-flex; }
  .hero__cover { display: block; }

  /* hero-player horizontal */
  .hero { padding-block: 4.5rem 5rem; }
  .hero__inner {
    flex-direction: row;
    text-align: left;
    justify-content: center;
    gap: 3.5rem;
  }
  .hero__cover img { width: 260px; height: 260px; }
  .hero__info { align-items: flex-start; }
  .hero__title { max-width: 26ch; }
  .hero__meta, .hero__controls { justify-content: flex-start; }
  .hero__eq { gap: 7px; }

  /* footer en 3 columnas */
  .footer__inner {
    grid-template-columns: repeat(3, 1fr);
    text-align: left;
  }
  .footer__logo { margin-inline: 0; }
  .footer__social { justify-content: flex-start; }

  /* mini player oculto en escritorio */
  .mini-player { display: none; }
}

/* Accesibilidad: respetar reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
  .hero__eq span,
  .equalizer span,
  .live-dot,
  .hero__glow { animation: none !important; }
}
