/* Himnos de la Comuna - estilos de pagina. Sin tildes en comentarios (ver plan). */

.himnos-lista { display: grid; gap: 20px; }

.himno-card {
  display: flex;
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow .25s ease, transform .25s ease;
}
.himno-card:hover { box-shadow: 0 6px 22px rgba(61,46,26,.10); transform: translateY(-2px); }

.himno-band { width: 6px; flex: none; background: var(--primary); }
.himno-card:nth-child(2) .himno-band { background: var(--accent-blue); }
.himno-card:nth-child(3) .himno-band { background: var(--accent-gold); }

.himno-body { flex: 1; min-width: 0; padding: 22px 26px; }

.himno-top { display: flex; align-items: center; gap: 10px; }
.himno-localidad {
  font-size: 12px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent-blue);
}
.himno-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent-gold); flex: none; }
.himno-dur { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.himno-titulo {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(21px, 2.6vw, 27px);
  font-weight: 700; line-height: 1.2;
  color: var(--text-primary);
  margin: 4px 0 16px;
}

/* Reproductor nativo: visible solo cuando NO hay JS */
.himnos-js .himno-card audio { display: none; }
.himno-card audio { width: 100%; margin-bottom: 14px; }
.himno-ui { display: none; }
.himnos-js .himno-ui { display: block; }

.himno-player { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }

.himno-play {
  width: 46px; height: 46px; flex: none;
  border: 0; border-radius: 50%; cursor: pointer;
  background: var(--primary); color: var(--text-light);
  display: grid; place-items: center;
  transition: background .2s ease, transform .15s ease;
}
.himno-play:hover { background: #A8481B; transform: scale(1.06); }
.himno-play:focus-visible { outline: 3px solid var(--accent-gold); outline-offset: 2px; }
/* Lucide reemplaza cada <i data-lucide> por un <svg>, asi que los selectores
   de tamano deben cubrir ambos elementos. */
.himno-play i, .himno-play svg { width: 20px; height: 20px; }
.himno-play .ic-pause { display: none; }
.himno-play.is-playing .ic-play { display: none; }
.himno-play.is-playing .ic-pause { display: block; }

.himno-progress { flex: 1; min-width: 0; }

.himno-bar {
  position: relative; height: 6px; border-radius: var(--radius-pill);
  background: var(--surface-hover); cursor: pointer;
}
.himno-bar:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 4px; }
.himno-bar-fill {
  position: absolute; top: 0; left: 0; bottom: 0; width: 0;
  background: var(--primary); border-radius: var(--radius-pill);
}
.himno-bar-knob {
  position: absolute; top: 50%; left: 0;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--primary);
  transform: translate(-50%, -50%);
  opacity: 0; transition: opacity .2s ease;
}
.himno-bar:hover .himno-bar-knob,
.himno-bar:focus-visible .himno-bar-knob { opacity: 1; }

.himno-times {
  display: flex; justify-content: space-between;
  margin-top: 7px; font-size: 12px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.himno-tools { display: flex; align-items: center; gap: 12px; flex: none; }
.himno-vol { width: 74px; accent-color: var(--primary); cursor: pointer; }
.himno-descarga {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  color: var(--text-muted); transition: color .2s ease, background .2s ease;
}
.himno-descarga:hover { color: var(--primary); background: var(--bg-secondary); }
.himno-descarga:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; }
.himno-descarga i, .himno-descarga svg { width: 18px; height: 18px; }

.himno-creditos { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.himno-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-secondary);
  background: var(--bg-secondary);
  border-radius: var(--radius-pill); padding: 5px 12px;
}
.himno-pill i, .himno-pill svg { width: 13px; height: 13px; color: var(--accent-blue); flex: none; }

/* Sin JS el boton no sirve para nada, asi que no se muestra: la letra ya
   esta desplegada. Con JS el boton aparece y el panel nace plegado. */
.himno-letra-toggle { display: none; }
.himnos-js .himno-letra-toggle { display: flex; }
.himnos-js .himno-letra { display: none; }
.himnos-js .himno-letra.is-open { display: block; }

.himno-letra-toggle {
  width: 100%; border: 0; background: none; cursor: pointer;
  border-top: 1px solid var(--border-light);
  padding: 13px 0 0; margin: 0;
  align-items: center; justify-content: space-between;
  font: inherit; font-size: 14px; font-weight: 600;
  color: var(--accent-blue);
}
.himno-letra-toggle:hover { color: var(--primary); }
.himno-letra-toggle:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 3px; }
.himno-letra-toggle span { display: inline-flex; align-items: center; gap: 7px; }
.himno-letra-toggle i, .himno-letra-toggle svg { width: 16px; height: 16px; }
.himno-chevron { transition: transform .25s ease; }
.himno-letra-toggle[aria-expanded="true"] .himno-chevron { transform: rotate(180deg); }

.himno-letra {
  margin-top: 14px; padding: 18px 22px;
  background: var(--bg-secondary); border-radius: var(--radius-sm);
  columns: 2; column-gap: 34px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 17px; line-height: 1.85; color: var(--text-secondary);
}
.himno-letra p { margin: 0 0 1.1em; break-inside: avoid; }
.himno-letra p:last-child { margin-bottom: 0; }

.himno-error {
  font-size: 13px; color: var(--text-muted);
  display: flex; align-items: center; gap: 7px;
  padding: 10px 0;
}
/* Sin esto el display:flex de arriba gana sobre el [hidden] del navegador
   y el mensaje de error queda siempre visible. */
.himno-error[hidden] { display: none; }
/* Si el audio no carga, el mensaje reemplaza al reproductor en vez de
   convivir con el: un player muerto pero manipulable confunde mas que ayuda. */
.himno-card--error .himno-player { display: none; }
.himno-error i, .himno-error svg { width: 15px; height: 15px; }

@media (max-width: 768px) {
  .himno-body { padding: 18px 20px; }
  .himno-letra { columns: 1; padding: 16px 18px; }
  .himno-player { flex-wrap: wrap; }
  .himno-progress { order: 2; flex-basis: calc(100% - 60px); }
  .himno-tools { order: 3; width: 100%; justify-content: flex-end; margin-top: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .himno-card, .himno-play, .himno-chevron, .himno-bar-knob { transition: none; }
  .himno-card:hover { transform: none; }
}
