/* ============================================================
   testimonios.css — Razonando QuímicaMente
   Estilos propios de la página "Testimonios y Método".
   Lo compartido (variables, reset, nav, page-hero, hero-tabs,
   botones, section, cta-final, footer, reveal) vive en main.css.
   ============================================================ */


/* ── STATS STRIP ── */
.stats-strip {
  background: white;
  border-bottom: 1px solid var(--gris-claro);
  padding: 2rem 5%;
  display: flex;
  gap: 0;
  justify-content: center;
  flex-wrap: wrap;
}

.stat-item {
  flex: 1;
  min-width: 160px;
  max-width: 220px;
  text-align: center;
  padding: 1rem 1.5rem;
  position: relative;
}

.stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: var(--gris-claro);
}

.stat-num {
  font-size: 2rem;
  color: var(--verde);
  line-height: 1;
}

/* Acento de color por estadística: verde · naranja · rojo · verde.
   Mantiene el verde como base y deja el rojo como detalle puntual. */
.stat-item:nth-child(2) .stat-num {
  color: var(--naranja);
}

.stat-item:nth-child(3) .stat-num {
  color: var(--rojo);
}

.stat-item:nth-child(4) .stat-num {
  color: var(--verde);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--gris-medio);
  margin-top: 0.3rem;
  line-height: 1.5;
}


/* ── INTRO — el punto de partida ── */
.intro-section {
  background: white;
}

.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-top: 2rem;
}

.intro-text p {
  font-size: 0.97rem;
  line-height: 1.9;
  color: var(--gris-medio);
  margin-bottom: 1.25rem;
}

.intro-text p:last-child {
  margin-bottom: 0;
}

.intro-text strong {
  color: var(--tinta);
}

.intro-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.intro-lista li {
  position: relative;
  padding-left: 1.9rem;
  font-size: 0.97rem;
  line-height: 1.6;
  color: var(--gris-medio);
}

.intro-lista li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.32rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--verde-palido);
}

.intro-lista li::after {
  content: '\2713';
  position: absolute;
  left: 4px;
  top: 0.32rem;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  color: var(--verde);
}

/* Mismo ciclo de acento verde · naranja · rojo que .punto-dolor y .stat-num */
.intro-lista li:nth-child(2)::before {
  background: var(--naranja-palido);
}

.intro-lista li:nth-child(2)::after {
  color: var(--naranja);
}

.intro-lista li:nth-child(3)::before {
  background: var(--rojo-palido);
}

.intro-lista li:nth-child(3)::after {
  color: var(--rojo);
}

.puntos-dolor {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.punto-dolor {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1.1rem 1.3rem;
  border-radius: 14px;
  background: var(--crema);
  border: 1px solid var(--gris-claro);
}

.punto-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Acento por tarjeta: verde · naranja · rojo · verde (mismo ciclo que .stat-num) */
.punto-dolor:nth-child(1) .punto-icon {
  background: var(--verde-palido);
  color: var(--verde);
}

.punto-dolor:nth-child(2) .punto-icon {
  background: var(--naranja-palido);
  color: var(--naranja);
}

.punto-dolor:nth-child(3) .punto-icon {
  background: var(--rojo-palido);
  color: var(--rojo);
}

.punto-dolor:nth-child(4) .punto-icon {
  background: var(--verde-palido);
  color: var(--verde);
}

.punto-texto {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--gris-medio);
}

.punto-texto strong {
  color: var(--tinta);
  font-family: 'Nunito', sans-serif;
}


/* ── AUDIOS ── */
.audios-section {
  background: var(--verde-fondo);
  position: relative;
  overflow: hidden;
}

.audios-section .section-label {
  color: var(--verde);
}

.audios-section .section-title {
  color: var(--tinta);
}

.audios-desc {
  color: var(--gris-medio);
  max-width: 560px;
  line-height: 1.8;
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}

.audios-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.audio-card {
  background: #fff;
  border: 1px solid var(--gris-claro);
  border-radius: 16px;
  padding: 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.audio-card:hover {
  transform: translateY(-3px);
  border-color: var(--verde-claro);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.09);
}

/* Estado reproduciendo: la tarjeta se resalta sutilmente */
.audio-card.playing {
  background: rgba(250, 151, 85, 0.12);
  border-color: rgba(250, 151, 85, 0.35);
}

/* Botón circular de reproducción */
.audio-play {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--naranja);
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.2s ease;
}

/* Los dos íconos (play/pause) se apilan centrados y se cruzan por opacidad */
.audio-play svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 0.25s ease;
}

/* El triángulo de play se ve ópticamente centrado corrido apenas a la derecha */
.audio-play .icon-play {
  transform: translate(-42%, -50%);
}

.icon-pause {
  opacity: 0;
}

.audio-card.playing .icon-play {
  opacity: 0;
}

.audio-card.playing .icon-pause {
  opacity: 1;
}

/* Realce del botón al pasar el mouse y al estar reproduciendo */
.audio-card:hover .audio-play {
  transform: scale(1.08);
}

.audio-card.playing .audio-play {
  box-shadow: 0 0 0 6px rgba(250, 151, 85, 0.18);
}

.audio-info {
  flex: 1;
  min-width: 0;
}

.audio-info strong {
  display: block;
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  color: var(--tinta);
  margin-bottom: 0.2rem;
}

.audio-info span {
  font-size: 0.78rem;
  color: var(--gris-medio);
}

.audio-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
}

.audio-wave span {
  display: block;
  width: 3px;
  background: var(--gris-claro);
  border-radius: 2px;
  animation: wave 1.2s ease-in-out infinite;
  /* La onda queda quieta hasta que se reproduce el audio */
  animation-play-state: paused;
}

/* Mientras suena: la onda se mueve y se tiñe de naranja */
.audio-card.playing .audio-wave span {
  animation-play-state: running;
  background: var(--naranja);
}

.audio-wave span:nth-child(1) {
  height: 8px;
  animation-delay: 0s;
}

.audio-wave span:nth-child(2) {
  height: 14px;
  animation-delay: 0.1s;
}

.audio-wave span:nth-child(3) {
  height: 20px;
  animation-delay: 0.2s;
}

.audio-wave span:nth-child(4) {
  height: 12px;
  animation-delay: 0.3s;
}

.audio-wave span:nth-child(5) {
  height: 18px;
  animation-delay: 0.4s;
}

.audio-wave span:nth-child(6) {
  height: 8px;
  animation-delay: 0.5s;
}

.audio-wave span:nth-child(7) {
  height: 14px;
  animation-delay: 0.3s;
}

@keyframes wave {

  0%,
  100% {
    transform: scaleY(1);
  }

  50% {
    transform: scaleY(0.45);
  }
}

/* ── BARRA DE PROGRESO (reemplaza la onda decorativa) ── */
.audio-progress {
  margin-top: 0.65rem;
}

.audio-bar {
  position: relative;
  height: 7px;
  border-radius: 100px;
  background: var(--gris-claro);
  cursor: pointer;
  touch-action: none;
}

.audio-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0%;
  min-width: 7px;
  border-radius: 100px;
  background: var(--naranja);
  pointer-events: none;
}

/* tirador (thumb) al final del relleno */
.audio-bar-fill::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.2s;
}

.audio-card:hover .audio-bar-fill::after,
.audio-card.playing .audio-bar-fill::after {
  opacity: 1;
}

.audio-time {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  color: var(--gris-medio);
  font-variant-numeric: tabular-nums;
}

.audio-nota {
  margin-top: 1.5rem;
  background: rgba(250, 151, 85, 0.12);
  border: 1px solid rgba(250, 151, 85, 0.2);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  font-size: 0.82rem;
  color: var(--gris-medio);
  line-height: 1.7;
}


/* ── GALERÍA INSTAGRAM (masonry) ── */
.galeria-section {
  background: var(--crema);
}

.galeria-intro {
  max-width: 620px;
  font-size: 0.97rem;
  line-height: 1.9;
  color: var(--gris-medio);
  margin-top: 1rem;
  margin-bottom: 2.5rem;
}

.galeria-masonry {
  columns: 5;
  column-gap: 1rem;
  /* Tope calculado según los .webp de 700px que se generan en
     img/testimonios/ (ver commit "Regenera las 40 fotos de testimonios"):
     5 columnas de ~337px c/u a 2x retina piden ~674px, apenas por debajo
     de los 700px disponibles. No subir de ~1800px (a 5 columnas) sin
     regenerar las fotos a mayor resolución, o vuelve a pixelar en
     pantallas grandes. */
  max-width: 1750px;
  /* Sin "margin: auto" (a propósito): el título/intro de arriba están
     flush-left contra el padding de la section, así que centrar la
     grilla la dejaba como una isla separada, con un hueco grande entre
     el título y las tarjetas. Sin centrar, arranca pegada al mismo
     borde que el título. */
}

.galeria-card {
  break-inside: avoid;
  background: white;
  border: 1px solid var(--gris-claro);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1rem;
  display: inline-block;
  width: 100%;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.galeria-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--verde-claro);
}

.galeria-card img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.4s ease;
}

.galeria-card-footer {
  padding: 0.65rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.galeria-card-ig {
  font-size: 0.68rem;
  color: var(--gris-medio);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.galeria-card-ig svg {
  flex-shrink: 0;
  opacity: 0.6;
}

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .galeria-masonry {
    columns: 3;
  }
}

@media (max-width: 960px) {
  .intro-grid {
    grid-template-columns: 1fr;
  }

  .audios-grid {
    grid-template-columns: 1fr;
  }

  .galeria-masonry {
    columns: 2;
  }

  .stat-item:not(:last-child)::after {
    display: none;
  }
}

@media (max-width: 600px) {
  .galeria-masonry {
    columns: 1;
  }

  .stats-strip {
    flex-direction: column;
    align-items: center;
  }

  .stat-item {
    max-width: 100%;
    width: 100%;
    border-bottom: 1px solid var(--gris-claro);
    padding: 0.9rem 0;
  }

  .stat-item:last-child {
    border-bottom: none;
  }
}
