/* ===== Belén la Radio — estilos ===== */

:root {
  --color-primary: #1e7fcb;
  --color-primary-dark: #145a94;
  --color-primary-light: #4fa3e0;
  --color-ink: #0f2942;
  --color-ink-soft: #33506b;
  --color-cream: #f7f5f0;
  --color-white: #ffffff;
  --color-gold: #c9a24b;
  --shadow-soft: 0 10px 30px rgba(15, 41, 66, 0.12);
  --shadow-card: 0 12px 28px rgba(15, 41, 66, 0.22);
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 8px;
  --header-h: 72px;
  --font-display: Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-trajan: "Cinzel", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-cream);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

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

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, var(--color-primary-dark), var(--color-primary));
  box-shadow: var(--shadow-soft);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo-link { display: flex; align-items: center; height: 40px; }
.logo-link img { height: 100%; width: auto; }

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

.nav-link {
  color: var(--color-white);
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  position: relative;
  transition: background 0.25s ease;
}

.nav-link:hover { background: rgba(255, 255, 255, 0.12); }

.nav-link.active { background: rgba(255, 255, 255, 0.18); }

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 4px;
  height: 2px;
  background: var(--color-gold);
  border-radius: 2px;
}

.btn-dona {
  background: var(--color-gold);
  color: var(--color-ink);
  font-weight: 700;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  border: none;
  box-shadow: 0 6px 16px rgba(201, 162, 75, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-dona:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(201, 162, 75, 0.5); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  background: var(--color-white);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle span { top: 19px; }
.nav-toggle span::before { top: -8px; }
.nav-toggle span::after { top: 8px; }
.nav-toggle.open span { background: transparent; }
.nav-toggle.open span::before { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span::after { transform: translateY(-8px) rotate(-45deg); }

/* ===== Views ===== */
.view { display: none; }
.view.active { display: block; animation: viewFadeIn 0.5s ease both; }

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

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background-image:
    linear-gradient(-45deg, rgba(15,41,66,0.86), rgba(30,127,203,0.58), rgba(20,90,148,0.8), rgba(51,80,107,0.7)),
    url("../img/Hero-Biblia.jpg");
  background-size: 400% 400%, cover;
  background-position: 0% 50%, center 35%;
  background-repeat: no-repeat, no-repeat;
  background-attachment: scroll, fixed;
  animation: gradientShift 16s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%, center 35%; }
  50% { background-position: 100% 50%, center 35%; }
  100% { background-position: 0% 50%, center 35%; }
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.08), transparent 45%),
    radial-gradient(circle at 80% 75%, rgba(201,162,75,0.15), transparent 50%);
  animation: raysDrift 20s ease-in-out infinite alternate;
}

@keyframes raysDrift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-2%, 2%) scale(1.05); }
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 24px;
  color: var(--color-white);
}

.hero-eyebrow {
  display: inline-block;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-gold);
  margin-bottom: 18px;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.1s forwards;
}

.hero-title {
  font-family: var(--font-trajan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 1.15;
  margin: 0 0 24px;
  opacity: 0;
  animation: fadeInUp 0.9s ease 0.3s forwards;
  text-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.hero-subtitle {
  max-width: 560px;
  margin: 0 auto 36px;
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.9);
  opacity: 0;
  animation: fadeInUp 0.9s ease 0.5s forwards;
}

.hero-scroll {
  opacity: 0;
  animation: fadeInUp 0.9s ease 0.7s forwards, bounce 2.4s ease-in-out 1.6s infinite;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
}

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

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ===== Section shell ===== */
.section {
  padding: 80px 0;
}

/* Sección 2 de home: entra sobre el hero (fixed) y suaviza el corte duro con un degradé
   largo y gradual, para que la transición se sienta orgánica y no cortada. */
#homeSection2 {
  position: relative;
  z-index: 3;
  background: var(--color-cream);
  padding-top: 130px;
}
#homeSection2::before {
  content: "";
  position: absolute;
  top: -320px;
  left: 0;
  right: 0;
  height: 320px;
  background: linear-gradient(to bottom,
    rgba(247,245,240,0) 0%,
    rgba(247,245,240,0.08) 35%,
    rgba(247,245,240,0.35) 60%,
    rgba(247,245,240,0.75) 82%,
    var(--color-cream) 100%);
  pointer-events: none;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: var(--color-ink);
  margin: 0 0 12px;
  text-align: center;
}
.section-sub {
  text-align: center;
  color: var(--color-ink-soft);
  max-width: 620px;
  margin: 0 auto 48px;
  line-height: 1.6;
}

/* ===== Reveal on scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Programs grid (home) ===== */
/* Flexbox en vez de grid: así la última fila incompleta (3 cards) queda centrada
   en vez de pegada a la izquierda con un hueco vacío a la derecha. */
.programs-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
}

.program-card {
  flex: 0 1 calc((100% - 3 * 22px) / 4);
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  box-shadow: var(--shadow-card);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.program-card:hover,
.program-card:focus-within { transform: translateY(-8px) scale(1.02); box-shadow: 0 20px 40px rgba(15,41,66,0.3); }

.program-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.program-card:hover img,
.program-card:focus-within img { transform: scale(1.06); }

.program-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(15,41,66,0.92) 0%, rgba(15,41,66,0.15) 55%, transparent 75%);
  transition: background 0.35s ease;
}
.program-card:hover::after,
.program-card:focus-within::after {
  background: rgba(15,41,66,0.88);
}

.program-card-body {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 22px 20px;
  color: var(--color-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: translateY(34%);
  transition: transform 0.35s ease;
}
.program-card:hover .program-card-body,
.program-card:focus-within .program-card-body {
  transform: translateY(0);
}
.program-card-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 6px;
  line-height: 1.15;
}
.program-card-host {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-primary-light);
  font-weight: 700;
}
.program-card-desc {
  margin: 14px 0 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: rgba(255,255,255,0.94);
  max-width: 92%;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: opacity 0.35s ease, max-height 0.35s ease;
}
.program-card:hover .program-card-desc,
.program-card:focus-within .program-card-desc {
  opacity: 1;
  max-height: 220px;
}

/* ===== Bienvenidos ===== */
.welcome {
  background: var(--color-white);
}
.welcome-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.3fr;
  gap: 56px;
  align-items: center;
}
.welcome-emblem {
  display: flex;
  justify-content: center;
}
.welcome-emblem img {
  width: 220px;
  filter: drop-shadow(0 16px 30px rgba(15,41,66,0.18));
  animation: floatSlow 6s ease-in-out infinite;
}
@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
.welcome-text h3 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 18px;
  color: var(--color-primary-dark);
}
.welcome-text p {
  color: var(--color-ink-soft);
  line-height: 1.75;
  margin: 0 0 18px;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-ink);
  color: rgba(255,255,255,0.75);
  padding: 56px 0 110px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.2fr;
  gap: 40px;
  text-align: left;
}

.footer-col h4 {
  color: var(--color-white);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 16px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { transition: color 0.2s ease; }
.footer-col a:hover { color: var(--color-white); }
.footer-col address {
  font-style: normal;
  line-height: 1.6;
  margin-top: 16px;
}

.footer-brand .logo-link { height: auto; margin-bottom: 16px; }
.footer-brand .logo-link img { height: 30px; }
.footer-tagline { max-width: 280px; line-height: 1.6; margin: 0 0 18px; font-size: 0.9rem; }

.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.footer-social a:hover { background: var(--color-primary); transform: translateY(-2px); }

.footer-copy {
  font-size: 0.85rem;
  opacity: 0.6;
  margin-top: 48px;
  text-align: center;
}

/* ===== Programación view ===== */
.programacion-hero {
  padding: 70px 0 28px;
  text-align: center;
  background-image:
    linear-gradient(180deg, rgba(15,41,66,0.9), rgba(20,90,148,0.88)),
    url("../img/Hero-Biblia.jpg");
  background-size: cover, cover;
  background-position: center, center 30%;
  background-repeat: no-repeat, no-repeat;
  color: var(--color-white);
}
.programacion-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 10px;
}
.programacion-hero p { color: rgba(255,255,255,0.75); margin: 0 0 20px; }

.tz-switch {
  display: inline-flex;
  gap: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-pill);
  padding: 4px;
}
.tz-option {
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.8);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  transition: all 0.25s ease;
}
.tz-option.active {
  background: var(--color-white);
  color: var(--color-primary-dark);
  box-shadow: 0 6px 14px rgba(0,0,0,0.2);
}

.schedule-day-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--color-gold);
  vertical-align: super;
}

.day-tabs {
  position: sticky;
  top: var(--header-h);
  z-index: 100;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 18px 24px;
  background: var(--color-white);
  box-shadow: 0 6px 18px rgba(15,41,66,0.08);
  scrollbar-width: none;
}
.day-tabs::-webkit-scrollbar { display: none; }

.day-tab {
  flex: 0 0 auto;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(15,41,66,0.12);
  background: var(--color-cream);
  color: var(--color-ink-soft);
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.25s ease;
}
.day-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 8px 18px rgba(30,127,203,0.35);
}

.schedule-list {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 24px 90px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.schedule-item {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: 0 6px 16px rgba(15,41,66,0.08);
  animation: slotFadeIn 0.4s ease both;
}
@keyframes slotFadeIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.schedule-time {
  flex: 0 0 68px;
  font-weight: 800;
  color: var(--color-primary-dark);
  font-size: 0.95rem;
}
.schedule-thumb {
  flex: 0 0 76px;
  height: 42px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
}
.schedule-thumb img { width: 100%; height: 100%; object-fit: cover; }
.schedule-thumb .note-icon { color: rgba(255,255,255,0.85); font-size: 1.4rem; }

.schedule-info { flex: 1; min-width: 0; }
.schedule-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.schedule-host {
  font-size: 0.82rem;
  color: var(--color-ink-soft);
}
.schedule-badge {
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}
.schedule-badge.show { background: rgba(30,127,203,0.12); color: var(--color-primary-dark); }
.schedule-badge.music { background: rgba(201,162,75,0.16); color: #8a6d2e; }

.schedule-empty {
  text-align: center;
  color: var(--color-ink-soft);
  padding: 40px 0;
}

/* ===== Floating player ("EL REPRODUCTOR") ===== */
.player-dock {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: top 0.4s ease;
}

.player-toggle {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 10px 24px rgba(30,127,203,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  animation: pulseRing 2.6s ease-in-out infinite;
}
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(30,127,203,0.45); }
  70% { box-shadow: 0 0 0 14px rgba(30,127,203,0); }
  100% { box-shadow: 0 0 0 0 rgba(30,127,203,0); }
}

.player-frame-wrap {
  position: relative;
  width: 470px;
  height: 145px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  transition: opacity 0.3s ease;
}

.player-frame-wrap iframe {
  transform-origin: top left;
}

/* Escritorio: formato horizontal compacto (470x145). El iframe de RadioKing
   cambia a un layout "cuadrado" más grande si detecta menos ancho real, así
   que aquí forzamos su ancho nativo para que se quede en modo horizontal. */
@media (min-width: 721px) {
  .player-frame-wrap iframe {
    width: 470px !important;
    height: 145px !important;
  }
}

.player-minimize {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: rgba(15,41,66,0.55);
  color: var(--color-white);
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.player-dock.collapsed .player-frame-wrap {
  transform: scale(0.05);
  opacity: 0;
  pointer-events: none;
  position: absolute;
}
.player-dock.collapsed .player-toggle { display: flex; }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .program-card { flex-basis: calc((100% - 2 * 22px) / 3); }
  .welcome-grid { grid-template-columns: 1fr; text-align: center; }
  .welcome-emblem img { width: 160px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .main-nav { position: fixed; top: var(--header-h); left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--color-ink); padding: 16px; gap: 4px; transform: translateY(-140%); transition: transform 0.3s ease; }
  .main-nav.open { transform: translateY(0); }
  .nav-link, .btn-dona { text-align: center; width: 100%; }
  .nav-toggle { display: block; }
  .programs-grid { gap: 14px; }
  .program-card { flex-basis: calc((100% - 14px) / 2); }
  .section { padding: 56px 0; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; gap: 32px; }
  .footer-tagline { max-width: none; margin-left: auto; margin-right: auto; }
  .footer-social { justify-content: center; }
  .footer-brand .logo-link { justify-content: center; }

  /* En móvil dejamos que el reproductor de RadioKing use su propio modo
     "cuadrado" (más grande, con carátula), que activa solo cuando le damos
     menos ancho real — por eso NO forzamos su alto, para que su script
     interno pueda calcular el suyo libremente. */
  .player-frame-wrap {
    width: 300px;
    height: auto;
    min-height: 220px;
  }
  .player-frame-wrap iframe {
    width: 300px !important;
  }
}

@media (max-width: 480px) {
  .program-card { flex-basis: calc((100% - 14px) / 2); }
  .schedule-thumb { flex-basis: 60px; height: 34px; }
  .schedule-time { flex-basis: 56px; font-size: 0.85rem; }

  .player-frame-wrap {
    width: 260px;
    height: auto;
    min-height: 200px;
  }
  .player-frame-wrap iframe {
    width: 260px !important;
  }
}
