body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f0f0f0;
}

header {
  background-color: #010d52;
  color: white;
  padding: 1rem;
  text-align: center;
}

main {
  padding: 0.3rem 1rem 1rem 1rem; /* top, right, bottom, left */
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

section.voz {
  background: white;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  padding: 0.3rem 1rem 1rem 1rem; /* top, right, bottom, left */
  width: 100%;
  max-width: 400px;

  /* Fade effect */
  opacity: 0;
  transition: opacity 2.8s ease;
  display: none;
}

section.voz.mostrando {
  display: block;
  opacity: 1;
}



.lista audio {
  width: 100%;
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  section.voz {
    width: 45%;
  }
}

@media (min-width: 1024px) {
  section.voz {
    width: 30%;
  }
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding: 0 0.5rem;
  flex-wrap: wrap;
}

.tab {
  background-color: #f0f0f0;
  border: 2px solid transparent;
  color: #333;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tab:hover {
  background-color: #e0e0e0;
}

.tab.active {
  background-color: #010d52;
  color: white;
  border-color: #010d52;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  transform: scale(1.03);
}



section.voz h2 {
  color: #010d52;
  border-bottom: 2px solid #010d52;
  padding-bottom: 0.3rem;
  margin-bottom: 1rem;
  text-align: center;
  transition: all 0.3s ease;
}

/* ... (Mantén todos tus estilos anteriores hasta este punto) ... */

section.voz {
  /* display: none; */ /* ELIMINA ESTA LÍNEA */
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s ease, transform 0.7s ease, visibility 0.7s ease; /* Añade 'visibility' a la transición */
  will-change: opacity, transform;
  
  /* *** NUEVO *** */
  position: absolute; /* Para que no ocupe espacio cuando está oculto y no empuje otros elementos */
  top: 0; /* Ajusta esto según dónde quieras que comience si no está en el flujo normal */
  left: 0;
  width: 100%; /* Asegúrate de que siga ocupando todo el ancho disponible */
  visibility: hidden; /* Oculta el elemento sin quitarlo del flujo, pero lo hace invisible para clicks */
}

section.voz.active {
  opacity: 1;
  transform: translateY(0);
  visibility: visible; /* Hace el elemento visible */
  position: static; /* O relative, para que ocupe su espacio en el flujo normal */
  /* Si usas position: absolute para las secciones inactivas, y luego position: static/relative para la activa,
     necesitarás ajustar el contenedor padre (main) para que se adapte.
     Una alternativa es gestionar la altura del contenedor padre con JavaScript o 'max-height'. */
}

/* Para manejar el espacio en el 'main' cuando las secciones son 'position: absolute' */
/* Esto puede ser complicado si 'main' debe contener solo una sección visible a la vez */
/* Si todas las secciones son position: absolute, el 'main' no tendrá una altura natural basada en el contenido */
/* Podrías necesitar un contenedor para las secciones dentro del 'main' que ajuste su altura con JavaScript
   o usar un enfoque diferente como 'max-height'. */

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

.item-audio {
  margin-bottom: 1.5rem;
  padding: 0.8rem;
  background-color: #fdfdfd;
  border-radius: 10px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}

.item-audio:hover {
  transform: scale(1.01);
}

.titulo-audio {
  margin: 0 0 0.5rem 0;
  font-weight: 600;
  font-size: 1.05rem;
  color: #010d52;
  text-align: center;
}

.hero-header {
  width: 100%;
  overflow: hidden;
  max-height: 250px;
}

.hero-header img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

.footer {
  text-align: center;
  background-color: #010d52;
  color: white;
  padding: 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  margin-top: 2rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.sticky-wrapper {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: white;
}

/* Estilos para que la imagen no se deforme */
.hero-header img {
  width: 100%;
  height: auto;
  display: block;
}

/* Tabs debajo de la imagen */
.tabs {
  display: flex;
  justify-content: space-around;
  flex-wrap: nowrap;
  padding: 0.5rem;
  border-bottom: 1px solid #ccc;
  background-color: white;
}

/* Estilo visual cuando haces scroll */
.sticky-wrapper::after {
  content: '';
  display: block;
  height: 1px;
  background: #ccc;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.audio-con-pdf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px; /* añade espacio entre audio e íconos */
}

.audio-con-pdf audio {
  flex-grow: 1;
  min-width: 180px; /* Asegura un tamaño mínimo para el reproductor */
  /* Resetea cualquier margen vertical que pueda existir por defecto */
  margin-top: 0;
  margin-bottom: 0;
}

.pdf-link {
  display: flex; /* Mantén esto para el centrado interno si la imagen fuera más pequeña que el enlace */
  align-items: center; /* Centra la imagen dentro del enlace si el enlace tiene altura */
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  /* Resetea cualquier margen vertical */
  margin-top: 0;
  margin-bottom: 0;
}

.pdf-icon-img {
  width: 48px; /* O el tamaño que desees para el icono */
  height: auto; /* Mantiene la proporción */
  
  /* *** Importante: Elimina 'vertical-align: middle;' *** */
  /* vertical-align: middle; */ /* Coméntalo o quítalo */
  
  display: block; /* Ayuda a que la imagen se comporte mejor en flexbox */
  /* Resetea cualquier margen vertical */
  margin-top: 0;
  margin-bottom: 0;
}

/* Opcional: Si el icono aún se ve demasiado alto/bajo en comparación con el reproductor,
   y quieres mantener el ancho del icono, puedes darle un 'height' fijo y 'object-fit'.
   Esto podría distorsionar la imagen si no es la proporción correcta.
   Prefiere ajustar el 'width' para que 'height: auto' funcione bien.
*/
/* Ejemplo si el icono es mucho más grande de lo deseado en altura pero el ancho te gusta:
.pdf-icon-img {
  width: 100px;
  height: 40px; // Altura fija que empareje la altura visual del reproductor
  object-fit: contain; // Asegura que la imagen no se recorte ni distorsione dentro de esa altura
}
*/

/* Opcional: Efectos de hover */
.pdf-link:hover .pdf-icon-img {
  opacity: 0.9;
  transform: scale(1.05);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Estilo para switch moderno */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  margin-left: 12px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: #010d52;
}

.switch input:checked + .slider:before {
  transform: translateX(20px);
}

/* Contenedor del título y el switch */
.titulo-con-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}


.titulo-audio {
  color: #010d52 !important;
  margin: 0; /* quitar márgenes que queden mal */
  font-weight: bold;
  flex: 1;
}

/* Cambiar switch a verde cuando está activo */
.switch input:checked + .slider {
  background-color: #010d52 !important;
}

/* Añadir margen debajo del contenedor de título y switch para separar del audio */
.titulo-con-switch {
  margin-bottom: 10px; /* espacio debajo */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.item-audio {
  transition: background-color 0.5s ease, transform 0.5s ease;
}

/* Fondo celeste claro para el item activo */
.item-audio.activo {
  background-color: #d0ebff; /* celeste clarito */
  box-shadow: 0 0 10px #85c1ff;
  transform: scale(1.03); /* opción para que destaque */
  z-index: 10;
}

hr {
  margin-top: 0.3rem;
  margin-bottom: 0.8rem;
}

.pdf-icon-img {
  width: 40px !important;
  height: 40px !important;
  object-fit: contain;  /* Asegura que se vea bien sin deformarse */
  display: block;
  margin: 0;
}





