/* el revistazo — Piloto de lectura (2026-11-20): rayita de progreso,
   chip «Te quedaste aquí» y la barra unificada de la bocinita con
   Compartir integrado (rediseño 2026-11-20).
   Colores de la casa: amarillo #FFD400, tinta #1c1a15, crema #FAF8F4. */

.er-progreso {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1200;
  background: transparent;
  pointer-events: none;
}
.er-progreso > i {
  display: block;
  height: 100%;
  width: 0;
  background: #FFD400;
}

.er-chip {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  z-index: 1190;
  background: #1c1a15;
  color: #fff;
  border: 2px solid #FFD400;
  border-radius: 999px;
  padding: 10px 20px;
  font: 700 0.95rem/1.2 system-ui, sans-serif;
  box-shadow: 0 6px 22px rgba(28, 26, 21, 0.35);
  cursor: pointer;
}

.er-destello {
  animation: er-destello 1.8s ease-out;
}
@keyframes er-destello {
  0% { background: #FFF0A6; }
  100% { background: transparent; }
}

.er-escuchar {
  margin: 20px 0 4px;
}
/* El atributo hidden manda: sin esto, el display:flex/inline-flex de los
   componentes lo pisaba y el reproductor se veía siempre (barra fantasma
   en 0:00 y controles duplicados). */
.er-escuchar [hidden] {
  display: none !important;
}

/* Barra unificada de lectura (2026-11-20): una sola superficie clara
   bajo el título con el círculo de escuchar, Canuta en miniatura, los
   textos, la pista de progreso y Compartir al extremo derecho — ya no
   hay piezas flotando por separado. El botón original de arranque
   (.er-btn-escuchar) queda en el DOM solo como destino del JS: la
   entrada visible es el círculo y los textos, que le delegan el clic. */
.er-btn-escuchar { display: none !important; }
.er-barra {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #ddd6c4;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 2px 10px rgba(28, 26, 21, 0.06);
}
.er-play {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #1c1a15;
  background: #FFD400;
  color: #1c1a15;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}
.er-play:active { transform: translateY(1px); }
/* Cargando: tres puntitos dentro del círculo mientras llega el audio. */
.er-escuchar.er-prep .er-play > svg { opacity: 0; }
.er-escuchar.er-prep .er-play::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: #1c1a15;
  box-shadow: -9px 0 0 #1c1a15, 9px 0 0 #1c1a15;
  animation: er-puntos 1s ease-in-out infinite;
}
@keyframes er-puntos {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Canuta, la bocinita: muñequito mínimo de la casa (CSS/SVG puro),
   integrado a la barra en miniatura, pegado al círculo.
   Reposo: respira apenas. Preparando: onditas tenues que laten.
   Leyendo: las onditas se mueven. Pausa: vuelve a reposo. */
.er-canuta {
  flex: 0 0 auto;
  margin-right: 6px;
}
.er-bocina {
  position: relative;
  display: block;
  width: 30px;
  height: 30px;
}
.er-bocina > svg {
  display: block;
  transform-origin: 50% 50%;
  animation: er-respira 4.2s ease-in-out infinite;
}
@keyframes er-respira {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}
.er-ondas {
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  height: 14px;
  opacity: 0.22;
}
.er-ondas > i {
  display: block;
  width: 3px;
  height: 5px;
  background: #1c1a15;
  border-radius: 2px;
}
.er-escuchar.er-prep .er-ondas { animation: er-espera 1.6s ease-in-out infinite; }
@keyframes er-espera {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.55; }
}
.er-escuchar.er-sonando .er-ondas { opacity: 1; }
.er-escuchar.er-sonando .er-ondas > i { animation: er-onda 0.9s ease-in-out infinite; }
.er-escuchar.er-sonando .er-ondas > i:nth-child(2) { animation-delay: 0.18s; }
.er-escuchar.er-sonando .er-ondas > i:nth-child(3) { animation-delay: 0.36s; }
@keyframes er-onda {
  0%, 100% { height: 4px; }
  50% { height: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .er-bocina > svg,
  .er-ondas,
  .er-escuchar.er-sonando .er-ondas > i,
  .er-escuchar.er-prep .er-play::after,
  .er-destello { animation: none !important; }
}
/* Columna central de la barra: dos líneas de texto, la pista fina con
   su relleno amarillo y los tiempos. La pista se ve desde el inicio,
   vacía y discreta; los tiempos aparecen cuando existen (duración
   conocida) o cuando el reproductor está activo. */
.er-player {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.er-textos {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.er-escuchar:not(.er-activo) .er-textos { cursor: pointer; }
.er-linea1 {
  font: 700 1rem/1.25 system-ui, sans-serif;
  color: #1c1a15;
}
.er-linea2 {
  font: 0.82rem/1.3 system-ui, sans-serif;
  color: #55504a;
}
.er-pista {
  display: flex;
  align-items: center;
  gap: 8px;
}
.er-seek {
  flex: 1 1 auto;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, #FFD400 var(--er-prog, 0%), #e8e2d4 var(--er-prog, 0%));
  margin: 0;
  cursor: pointer;
}
.er-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #1c1a15;
  border: 2px solid #FFD400;
}
.er-seek::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #1c1a15;
  border: 2px solid #FFD400;
}
.er-seek::-moz-range-track { background: transparent; }
.er-mini {
  display: none;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.er-escuchar.er-activo .er-mini { display: inline-flex; }
.er-vel {
  flex: 0 0 auto;
  background: #FAF8F4;
  border: 1.5px solid #1c1a15;
  border-radius: 999px;
  padding: 5px 9px;
  font: 700 0.82rem/1 system-ui, sans-serif;
  cursor: pointer;
  min-width: 48px;
}
.er-cerrar {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: #55504a;
  font-size: 1rem;
  cursor: pointer;
  padding: 5px;
}
.er-times {
  display: none;
  justify-content: space-between;
  gap: 8px;
  font: 0.78rem/1.3 system-ui, sans-serif;
  color: #55504a;
}
.er-escuchar.er-activo .er-times,
.er-escuchar.er-con-dur .er-times { display: flex; }
.er-msg {
  color: #1c1a15;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.er-estado {
  margin: 8px 0 0;
  font: italic 0.9rem/1.4 system-ui, sans-serif;
  color: #55504a;
}

/* Compartir dentro de la barra: píldora con borde al extremo derecho,
   de la misma altura visual que el bloque de audio, y su panel
   flotando bajo la barra (en el teléfono manda la hoja nativa). */
.er-barra .er-compartir {
  margin: 0;
  flex: 0 0 auto;
}
.er-barra .er-btn-compartir {
  border-width: 1.5px;
  padding: 9px 16px;
  font-size: 0.95rem;
}
.er-barra .er-comp-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(620px, 94vw);
  max-width: none;
  margin-top: 0;
  z-index: 80;
  box-shadow: 0 10px 30px rgba(28, 26, 21, 0.18);
}

/* La radio de la revista: qué está sonando y el interruptor de la
   continuidad, bajo el reproductor y en el lenguaje de la casa. */
.er-ahora {
  margin: 10px 0 0;
  font: 0.95rem/1.45 system-ui, sans-serif;
  color: #55504a;
  max-width: 640px;
}
.er-ahora-etq {
  font-weight: 700;
  color: #1c1a15;
}
.er-ahora-link {
  color: #1c1a15;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #FFD400;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.er-seguir {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  font: 600 0.9rem/1.3 system-ui, sans-serif;
  color: #1c1a15;
  cursor: pointer;
  max-width: 640px;
}
.er-seguir input {
  width: 18px;
  height: 18px;
  accent-color: #1c1a15;
}

/* En el teléfono la barra se acomoda en dos filas: círculo, Canuta,
   textos y Compartir arriba; la pista abarca todo el ancho abajo. */
@media (max-width: 560px) {
  .er-barra { flex-wrap: wrap; row-gap: 10px; padding: 12px; }
  .er-player { display: contents; }
  .er-play { order: 1; }
  .er-canuta { order: 2; }
  .er-textos { order: 3; flex: 1 1 auto; }
  .er-barra .er-compartir { order: 4; }
  .er-pista { order: 5; flex: 1 1 100%; }
  .er-times { order: 6; flex: 1 1 100%; }
  .er-vel { min-width: 46px; padding: 5px 8px; }
  .er-chip { bottom: 14px; width: max-content; max-width: 92vw; }
}
