/* ==========================================================================
   Canciones del Retiro de Emaús - Hoja de Estilos Principal
   ========================================================================== */

:root {
  --navy-950: #071522;
  --navy-900: #0b2132;
  --navy-800: #123b4d;
  --blue-600: #176b83;
  --blue-500: #168da1;
  --sky-100: #e8f5f4;
  --gold-500: #c98b27;
  --gold-300: #ffd28a;
  --surface: #ffffff;
  --surface-soft: #f1f6f5;
  --text: #152a33;
  --muted: #667981;
  --border: #d8e5e3;
  --coral: #ef725d;
  --coral-soft: #fff0ec;
  --shadow: 0 20px 55px rgba(7, 21, 34, 0.12);
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #eef4f2;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    'Avenir Next',
    'Segoe UI',
    system-ui,
    -apple-system,
    sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 255, 255, 0.44) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 42, 51, 0.035) 1px, transparent 1px), #eef4f2;
  background-size: 32px 32px;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

/* ==========================================================================
   Cabecera Principal (Banner Oficial de Emaús)
   ========================================================================== */

.site-header {
  width: 100%;
  background: #06111c;
  border-bottom: 1px solid rgba(216, 229, 227, 0.8);
  box-shadow: 0 4px 20px rgba(7, 21, 34, 0.08);
}

.header-banner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.header-banner img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  /* object-fit: cover; */
  object-position: center 42%;
}

/* ==========================================================================
   Contenedor Principal de la Página
   ========================================================================== */

.page {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 30px 0 96px;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Presentación del Cancionero (Sección Integrada, sin efecto segundo header)
   ========================================================================== */

.intro-section {
  margin-bottom: 24px;
}

.intro-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  padding: 4px 2px;
}

.intro-text {
  max-width: 680px;
}

.intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid rgba(239, 114, 93, 0.28);
  border-radius: 999px;
  background: rgba(239, 114, 93, 0.08);
  color: var(--coral);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro-badge-icon {
  width: 14px;
  height: 14px;
}

.intro-title {
  margin: 12px 0 8px;
  color: var(--navy-900);
  font-size: clamp(1.85rem, 3.8vw, 2.55rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.intro-copy {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.intro-stats {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.stat-pill {
  min-width: 96px;
  padding: 12px 18px;
  border: 1px solid rgba(216, 229, 227, 0.95);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 14px rgba(7, 21, 34, 0.035);
  backdrop-filter: blur(10px);
  text-align: center;
}

.stat-pill-num {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-pill-label {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ==========================================================================
   Tarjeta del Reproductor de Audio (Sticky)
   ========================================================================== */

.player-card {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-xl);
  background: rgba(250, 253, 252, 0.94);
  box-shadow:
    0 20px 55px rgba(7, 21, 34, 0.16),
    0 2px 0 rgba(255, 255, 255, 0.86) inset;
  backdrop-filter: blur(18px);
}

.cover {
  width: 78px;
  height: 78px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 210, 138, 0.7) 0 3px, transparent 4px),
    linear-gradient(145deg, var(--coral), #b74352 55%, var(--navy-900));
  box-shadow:
    0 10px 24px rgba(183, 67, 82, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.cover svg {
  width: 32px;
  height: 32px;
}

.now-label {
  color: var(--coral);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.now-title {
  margin: 4px 0 9px;
  color: var(--navy-900);
  font-size: 1.05rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
}

input[type='range'] {
  width: 100%;
  height: 5px;
  accent-color: var(--coral);
  cursor: pointer;
}

.player-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn,
.play-btn,
.download-btn {
  border: 0;
  cursor: pointer;
  transition:
    transform 0.18s cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease;
}

.icon-btn:hover,
.play-btn:hover,
.download-btn:hover {
  transform: translateY(-2px);
}

.icon-btn:active,
.play-btn:active,
.download-btn:active {
  transform: translateY(0) scale(0.97);
}

.icon-btn:focus-visible,
.play-btn:focus-visible,
.download-btn:focus-visible,
.search:focus-visible,
input[type='range']:focus-visible {
  outline: 3px solid rgba(239, 114, 93, 0.34);
  outline-offset: 3px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--navy-800);
  background: #eaf2f1;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.main-play {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--coral);
  box-shadow: 0 10px 24px rgba(239, 114, 93, 0.3);
}

.main-play:hover {
  background: #db604e;
  box-shadow: 0 13px 28px rgba(239, 114, 93, 0.35);
}

.main-play svg {
  width: 23px;
  height: 23px;
}

/* ==========================================================================
   Cabecera del Catálogo y Búsqueda
   ========================================================================== */

.content-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin: 44px 0 20px;
}

.content-head h2 {
  margin: 0;
  color: var(--navy-900);
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.content-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.search-wrap {
  position: relative;
  width: min(340px, 100%);
}

.search-wrap svg {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 19px;
  color: var(--blue-600);
}

.search {
  width: 100%;
  min-height: 48px;
  padding: 0 16px 0 44px;
  border: 1px solid rgba(216, 229, 227, 0.92);
  border-radius: 13px;
  outline: none;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  box-shadow: 0 5px 18px rgba(7, 21, 34, 0.04);
}

.search::placeholder {
  color: #839399;
}

.search:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 4px rgba(239, 114, 93, 0.12);
}

/* ==========================================================================
   Lista de Canciones
   ========================================================================== */

.track-list {
  display: grid;
  gap: 10px;
}

.track {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 12px 14px;
  border: 1px solid rgba(216, 229, 227, 0.95);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 6px 20px rgba(7, 21, 34, 0.035);
  animation: track-enter 0.45s cubic-bezier(0.23, 1, 0.32, 1) both;
  transition:
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.track:nth-child(2) {
  animation-delay: 30ms;
}
.track:nth-child(3) {
  animation-delay: 60ms;
}
.track:nth-child(4) {
  animation-delay: 90ms;
}

.track:hover {
  transform: translateY(-1px);
  border-color: rgba(239, 114, 93, 0.48);
  box-shadow: 0 12px 25px rgba(7, 21, 34, 0.08);
}

.track.active {
  border-color: rgba(239, 114, 93, 0.55);
  background: linear-gradient(90deg, #fff4f0, rgba(255, 255, 255, 0.92));
  box-shadow: 0 12px 28px rgba(239, 114, 93, 0.1);
}

.play-btn {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--blue-600);
  background: var(--sky-100);
}

.track.active .play-btn {
  color: #fff;
  background: var(--coral);
  box-shadow: 0 7px 16px rgba(239, 114, 93, 0.22);
}

.play-btn svg {
  width: 21px;
  height: 21px;
}

.track-title {
  margin: 0;
  color: var(--navy-900);
  font-size: 0.96rem;
  font-weight: 800;
}

.track-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.track-number {
  color: var(--coral);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.track-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.size {
  min-width: 54px;
  color: var(--muted);
  text-align: right;
  font-size: 0.84rem;
}

.download-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 800;
  background: var(--navy-900);
  box-shadow: 0 5px 12px rgba(7, 21, 34, 0.12);
}

.download-btn svg {
  width: 18px;
  height: 18px;
}

.download-btn:hover {
  background: var(--blue-600);
}

/* ==========================================================================
   Estados Vacíos y Pie de Página
   ========================================================================== */

.empty {
  display: none;
  padding: 42px 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #c7d9d6;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.56);
}

.footnote {
  margin-top: 24px;
  padding: 16px 20px;
  border-top: 1px solid rgba(216, 229, 227, 0.9);
  color: var(--muted);
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.6;
}

@keyframes track-enter {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Diseño Responsivo (Tablets y Móviles)
   ========================================================================== */

@media (max-width: 820px) {
  .page {
    width: min(100% - 28px, 1120px);
    padding-top: 22px;
  }

  .intro-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .intro-stats {
    width: 100%;
    max-width: 320px;
  }

  .stat-pill {
    flex: 1;
  }

  .player-card {
    top: 12px;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .player-actions {
    grid-column: 1 / -1;
    justify-content: center;
    border-top: 1px solid var(--border);
    padding-top: 12px;
  }

  .content-head {
    align-items: stretch;
    flex-direction: column;
    margin-top: 36px;
  }

  .search-wrap {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .page {
    width: min(100% - 20px, 1120px);
    padding-top: 16px;
    padding-bottom: 70px;
  }

  .header-banner img {
    max-height: none;
  }

  .intro-title {
    font-size: clamp(1.55rem, 6.5vw, 2rem);
    margin: 10px 0 6px;
  }

  .intro-copy {
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .player-card {
    top: 8px;
    padding: 12px;
    border-radius: 20px;
    gap: 10px;
  }

  .cover {
    width: 60px;
    height: 60px;
    border-radius: 15px;
  }

  .now-title {
    font-size: 0.95rem;
  }

  .timeline {
    grid-template-columns: 36px 1fr 36px;
    gap: 7px;
  }

  .track {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 11px;
    padding: 11px;
  }

  .track-actions {
    grid-column: 2;
    justify-content: space-between;
  }

  .size {
    text-align: left;
  }

  .download-btn span {
    display: none;
  }

  .download-btn {
    width: 42px;
    padding: 0;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
