/* Testimonios desde el CRM (js/testimonios.js): tarjeta editorial + carrusel.
   La base .testi-split es la misma que tenia la pagina de padres. */
.testi-header { max-width: 1080px; margin: 0 auto 36px; }
.testi-header .section-title { max-width: 780px; }
.testi-split {
  display: grid; grid-template-columns: 0.85fr 1.15fr;
  max-width: 1080px; margin: 0 auto;
  background: var(--white); border-radius: 6px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(44,74,110,0.10);
}
.testi-split--nophoto { grid-template-columns: 1fr; }
.testi-split-photo { position: relative; min-height: 100%; background: var(--cream-dark); }
.testi-split-photo img { position: absolute; inset: 0; width: 100%; height: 100% !important; object-fit: cover; object-position: center 30%; }
.testi-split-body { padding: 56px 52px; display: flex; flex-direction: column; justify-content: center; }
.testi-split-quote { margin: 0; padding: 0; }
/* Un texto largo se corta con un desvanecido y se lee entero en la ventana:
   la altura la pone js/testimonios.js (ajustar), para que no estire la
   tarjeta ni vuelva la foto una tira vertical. */
.testi-split-quote { overflow: hidden; font-size: clamp(15px, 1.5vw, 17px); }
.testi-split-quote.is-clamped {
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent);
          mask-image: linear-gradient(to bottom, #000 78%, transparent);
}
.testi-more {
  align-self: flex-start; margin-top: 14px; padding: 0; border: 0; background: none; cursor: pointer;
  font-family: 'Jost', sans-serif; font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--navy); border-bottom: 1px solid rgba(44,74,110,0.35); padding-bottom: 3px;
  transition: border-color 0.2s, color 0.2s;
}
.testi-more:hover { border-bottom-color: var(--navy); }
.testi-more[hidden] { display: none; }
.testi-more:focus-visible { outline: 2px solid var(--sky); outline-offset: 4px; }

/* Ventana con el testimonio entero */
.testi-dialog {
  /* margin:auto la centra: el reset de las paginas (* { margin: 0 }) la dejaba arriba a la izquierda */
  margin: auto; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 6px;
  background: var(--white); color: var(--navy); box-shadow: 0 30px 80px rgba(20,35,55,0.3);
}
.testi-dialog::backdrop { background: rgba(20,35,55,0.55); }
.testi-dialog-body { padding: 56px 52px 44px; max-height: calc(100vh - 48px); overflow-y: auto; box-sizing: border-box; }
.testi-dialog .testi-split-quote { max-height: none !important; overflow: visible; }
.testi-dialog { overflow: hidden; }
.testi-dialog-close {
  position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--white); border: 1px solid rgba(44,74,110,0.2); color: var(--navy);
}
.testi-dialog-close svg { width: 14px; height: 14px; }
.testi-dialog-close:hover { background: var(--navy); color: #fff; }
.testi-dialog-close:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.testi-split-quote p {
  font-family: 'Jost', sans-serif; font-weight: 300; font-style: normal;
  font-size: clamp(15px, 1.5vw, 17px); line-height: 1.85; color: var(--navy); margin: 0 0 18px;
}
.testi-split-quote p:last-child { margin-bottom: 0; }
.testi-split-sign {
  display: flex; flex-direction: column; gap: 3px;
  border-top: 1px solid rgba(44,74,110,0.1); padding-top: 20px; margin-top: 28px;
}
.testi-split-name { font-weight: 600; color: var(--navy); font-size: 14px; letter-spacing: 0.02em; }
.testi-split-meta { font-family: 'Cormorant Garamond', serif; color: var(--text-muted); font-size: 13px; font-style: italic; }

/* ── Carrusel ──
   Todas las diapositivas ocupan la misma celda de la rejilla: la altura es la
   del testimonio mas largo y la pagina no salta al cambiar. */
.testi-stage { display: grid; max-width: 1080px; margin: 0 auto; }
.testi-slide {
  grid-area: 1 / 1; opacity: 0; visibility: hidden; transform: translateX(14px);
  transition: opacity 0.7s ease, transform 0.7s ease, visibility 0s linear 0.7s;
}
.testi-slide.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
/* Con margin:auto la tarjeta se encogeria a su contenido dentro de la rejilla. */
.testi-stage > .testi-split { margin: 0; width: 100%; }

.testi-controls {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  max-width: 1080px; margin: 28px auto 0;
}
.testi-arrow {
  width: 44px; height: 44px; flex-shrink: 0; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid rgba(44,74,110,0.25); border-radius: 50%;
  color: var(--navy); transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.testi-arrow svg { width: 14px; height: 14px; }
.testi-arrow:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.testi-dots { display: flex; align-items: center; gap: 4px; }
.testi-dot {
  position: relative; width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer;
}
.testi-dot::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px;
  border-radius: 999px; background: rgba(44,74,110,0.25); transition: all 0.3s ease;
}
.testi-dot:hover::before { background: rgba(44,74,110,0.5); }
.testi-dot.is-active::before { width: 28px; margin-left: -14px; background: rgba(44,74,110,0.2); }
/* La pastilla activa se llena durante el tiempo de espera: se ve que el
   carrusel va a avanzar. Al terminar la animacion pasa al siguiente. */
.testi-dot::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 0; height: 8px; margin: -4px 0 0 -14px;
  border-radius: 999px; background: var(--sand); opacity: 0;
}
.testi-carousel.is-autoplay .testi-dot.is-active::after {
  opacity: 1; animation: testi-fill var(--testi-interval, 10s) linear forwards;
}
.testi-carousel.is-paused .testi-dot.is-active::after { animation-play-state: paused; }
@keyframes testi-fill { from { width: 0; } to { width: 28px; } }
.testi-counter { font-size: 12px; letter-spacing: 0.12em; color: var(--text-muted); min-width: 44px; text-align: center; }
.testi-arrow:focus-visible, .testi-dot:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }

@media (max-width: 768px) {
  .testi-split { grid-template-columns: 1fr !important; }
  .testi-split-photo { min-height: 320px; }
  .testi-split-body { padding: 40px 28px !important; }
  .testi-dialog-body { padding: 52px 24px 32px; }
  .testi-controls { gap: 10px; margin-top: 20px; }
  .testi-counter { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .testi-slide { transition: none; transform: none; }
}
