/* ============== RESET BÁSICO ============== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  /* Fondo claro para que no aparezca una franja oscura entre secciones */
  background-color: #f3f4f6;
  color: #ffffff;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ============== LAYOUT GENERAL ============== */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.btn {
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.7rem 1.8rem;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

/* ============== NAVBAR ============== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 20;
  background: #fbf1e6;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: #503a65;
}

.logo-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon img {
  width: 120%;
  height: 120%;
  object-fit: contain;
  display: block;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
}

.nav-links a {
  color: #503a65;
  position: relative;
  transition: color 0.15s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background-color: #503a65;
  transition: width 0.2s ease;
}

.nav-links a:hover {
  color: #7c5a8f;
}

.nav-links a:hover::after {
  width: 100%;
}

.btn-donate {
  background-color: #503a65;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(124, 34, 197, 0.4);
  white-space: nowrap;
}

.btn-donate:hover {
  background-color: #634978;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(124, 34, 197, 0.5);
}

/* ============== HERO ============== */

.hero {
  position: relative;
  height: 100vh;
  min-height: 540px;
  background-image: url(img/Mantonesymisterios.jpeg);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem;
  color: #ffffff;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.9));
}

.hero-content {
  position: relative;
  max-width: 900px;
  text-align: center;
  z-index: 2;
}

.hero-tagline {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 1.05rem;
  font-weight: 700;
  color: #e1d0f0;
}

.hero-title {
  margin-top: 1.2rem;
  font-size: clamp(2.3rem, 4vw, 3.5rem);
  font-weight: 700;
  line-height: 1.2;
}

.hero-title span {
  color: #a89bb8;
  display: inline-block;
}

.hero-meta {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #d1d5db;
}

.hero-actions {
  margin-top: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.btn-play {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #503a65;
  box-shadow: 0 15px 35px rgba(180, 137, 216, 0.377);
  border: 4px solid rgba(15, 23, 42, 0.7);
  transition: all 0.3s ease;
}

.btn-play:hover {
  transform: scale(1.1);
  box-shadow: 0 20px 45px rgba(180, 137, 216, 0.5);
}

.play-icon {
  font-size: 1.4rem;
  margin-left: 2px;
  color: #ffffff;
}

.hero-actions-text {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

/* ============== SECCIÓN SPOTIFY ============== */

.spotify-section {
  background-color: #503a65;
  padding: 3rem 0;
  border-top: 3px solid #634978;
}

.spotify-container {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
  gap: 2rem;
  align-items: center;
}

.spotify-text h2 {
  font-size: 1.8rem;
  margin-bottom: 0.8rem;
  color: #ffffff;
}

.spotify-text p {
  color: #e1d0f0;
  font-size: 0.95rem;
  line-height: 1.7;
}

.spotify-player iframe {
  width: 100%;
  border: none;
}

/* ============== EPISODIOS (MAIN) ============== */

.main-content {
  position: relative;
  background-color: #f3f4f6;
  color: #111827;
  padding: 4rem 0 0 0;
}

.main-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('img/flores-patron.jpg');
  background-size: 400px;
  background-repeat: repeat;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.main-content > * {
  position: relative;
  z-index: 1;
}

.episodes-section {
  width: 100%;
}

.episodes-header {
  margin-bottom: 2rem;
}

.episodes-header h2 {
  font-size: 1.9rem;
  margin-bottom: 0.5rem;
  color: #111827;
}

.episodes-header p {
  color: #4b5563;
  font-size: 0.95rem;
  line-height: 1.6;
}

.episodes-container .loading,
.episodes-container .error {
  padding: 2rem 0;
  color: #4b5563;
  text-align: center;
}

/* Tarjetas de episodios */

.episode-card {
  display: grid;
  grid-template-columns: minmax(0, 0.5fr) minmax(0, 2fr);
  gap: 2rem;
  align-items: center;
  /* Menos espacio inferior para que la paginación quede más cerca */
  margin-bottom: 1.5rem;
}

.episode-image {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background-color: #111827;
  aspect-ratio: 1/1;
}

.episode-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Botón de play centrado sobre la miniatura */
.play-button-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: none;
  background-color: #ffffff;
  color: #111827;
  font-size: 1.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.play-button-card:hover:not([disabled]) {
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.45);
}

.play-button-card[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.episode-info {
  padding-right: 1rem;
}

.episode-category {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  color: #503a65;
  font-weight: 600;
}

.episode-title {
  margin-top: 0.6rem;
  font-size: 1.8rem;
  line-height: 1.2;
  color: #111827;
}

.episode-meta {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #6b7280;
}

.episode-description {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: #4b5563;
  line-height: 1.6;
}

/* ============== PAGINACIÓN ============== */

.pagination-section {
  position: relative;
  background-color: #f3f4f6;
  /* Reducir el hueco con los episodios */
  padding: 1rem 0 3rem 0;
  margin-top: -1.5rem;
}

.pagination-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('img/flores-patron.jpg');
  background-size: 400px;
  background-repeat: repeat;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.pagination-container {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pagination-btn {
  border: none;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.7rem 1.3rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.pagination-prev {
  background-color: #fbf1e6; /* crema, consistente con la sección principal */
  color: #6b5b95;
  box-shadow: 0 6px 14px rgba(107, 91, 149, 0.25);
}

.pagination-prev:hover:not([disabled]) {
  background-color: #f5e0c8;
  color: #503a65;
  transform: translateX(-2px);
}

.pagination-next {
  background-color: #6b5b95;
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(107, 91, 149, 0.4);
}

.pagination-next:hover:not([disabled]) {
  background-color: #8b7ab8;
  box-shadow: 0 10px 22px rgba(139, 122, 184, 0.5);
  transform: translateX(2px);
}

.pagination-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* ============== FOOTER ============== */

.footer {
  background-color: #503a65;
  color: #e1d0f0;
  padding: 1.5rem 0;
  font-size: 0.85rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.podcast-platforms {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.platform-link {
  color: #e1d0f0;
  transition: all 0.2s ease;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.platform-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  opacity: 0.7;
}

.footer-copyright {
  font-size: 0.85rem;
  opacity: 0.7;
  text-align: right;
}

.footer a {
  color: #e1d0f0;
  transition: color 0.2s ease;
}

.footer a:hover {
  text-decoration: underline;
  color: #ffffff;
}

/* ============== AUDIO PLAYER CUSTOM STYLES ============== */

.spotify-player {
  position: relative;
  background: linear-gradient(135deg, #fbf1e6 0%, #f5e6d3 100%);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(107, 91, 149, 0.15);
  border: 1px solid rgba(107, 91, 149, 0.1);
}

.spotify-player audio {
  width: 100%;
  height: 46px;
  border-radius: 999px;
  outline: none;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.spotify-player audio:hover {
  border-color: rgba(79, 70, 229, 0.6);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1);
  transform: translateY(-1px);
}

.spotify-player audio:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.35);
}

.spotify-player audio::-webkit-media-controls-panel {
  background-color: transparent;
  padding: 4px 8px;
  border-radius: 999px;
}

.spotify-player audio::-webkit-media-controls-play-button,
.spotify-player audio::-webkit-media-controls-timeline,
.spotify-player audio::-webkit-media-controls-current-time-display,
.spotify-player audio::-webkit-media-controls-time-remaining-display,
.spotify-player audio::-webkit-media-controls-mute-button,
.spotify-player audio::-webkit-media-controls-toggle-closed-captions-button,
.spotify-player audio::-webkit-media-controls-volume-slider {
  filter: none;
  transition: all 0.15s ease;
}

.spotify-player audio::-webkit-media-controls-play-button:hover,
.spotify-player audio::-webkit-media-controls-mute-button:hover {
  transform: scale(1.05);
}

.spotify-player audio::-webkit-media-controls-timeline {
  height: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
}

.spotify-player audio::-webkit-media-controls-current-time-display,
.spotify-player audio::-webkit-media-controls-time-remaining-display {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #374151;
  text-shadow: none;
}

/* Enhanced accessibility for high contrast mode */
@media (prefers-contrast: high) {
  .spotify-player audio {
    border-width: 3px;
    border-color: #000000;
  }
  
  .spotify-player audio:focus {
    box-shadow: 0 0 0 4px #ffffff, 0 0 0 6px #000000;
  }
}

/* Enhanced accessibility for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .spotify-player audio,
  .spotify-player audio:hover,
  .spotify-player audio:focus,
  .spotify-player audio::-webkit-media-controls-play-button:hover,
  .spotify-player audio::-webkit-media-controls-mute-button:hover {
    transition: none;
    transform: none;
  }
}

/* ============== RESPONSIVE ============== */

@media (max-width: 900px) {
  .nav-links {
    display: none;
    position: fixed;
    right: 1rem;
    left: 1rem;
    bottom: 4.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    background: #fbf1e6;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.35);
    z-index: 40;
  }

  .nav-links.nav-links--open {
    display: flex;
  }

  .mobile-menu-toggle {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: none;
    background-color: #503a65;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 10px 24px rgba(80, 58, 101, 0.6);
    cursor: pointer;
    z-index: 50;
  }

  .mobile-menu-toggle:active {
    transform: scale(0.96);
    box-shadow: 0 6px 16px rgba(80, 58, 101, 0.7);
  }

  .spotify-container {
    grid-template-columns: 1fr;
  }

  .episode-card {
    grid-template-columns: 1fr;
  }

  .episode-info {
    padding-right: 0;
  }

  .hero {
    height: 80vh;
  }
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 2rem;
  }

  .logo {
    font-size: 0.9rem;
  }

  .logo-icon {
    width: 60px;
    height: 60px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .pagination-container {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-container {
    padding: 0.6rem 1rem;
  }

  .btn-donate {
    /* Versión más pequeña del botón en móviles */
    font-size: 0.7rem;
    padding: 0.45rem 0.9rem;
  }
}
