/* ============================================================
   Teducas Management — Testimonios
   ============================================================ */

/* ── Filtros ─────────────────────────────────────────────── */
.tdm-testimonials-wrap {
  --tdm-testi-bg:     #1a1a1a;
  --tdm-testi-text:   #d4cfc7;
  --tdm-testi-muted:  #7a756d;
  --tdm-testi-gold:   #c9a84c;
  --tdm-testi-radius: 12px;
}

.tdm-testi-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  justify-content: center;
}
.tdm-testi-filter-btn {
  padding: 8px 18px;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 50px;
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.tdm-testi-filter-btn:hover,
.tdm-testi-filter-btn.is-active {
  border-color: transparent;
  color: #fff;
  background: var(--svc-color, #512b7f);
}
.tdm-testi-filter-btn[data-service=""].is-active {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
}

/* ── Filtros por rubro/categoría ─────────────────────────── */
.tdm-testi-cat-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 28px;
  justify-content: center;
}
.tdm-testi-cat-btn {
  padding: 5px 14px;
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 50px;
  background: transparent;
  color: rgba(255,255,255,0.45);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  transition: all 0.2s ease;
}
.tdm-testi-cat-btn:hover,
.tdm-testi-cat-btn.is-active {
  border-color: var(--tdm-testi-gold, #c9a84c);
  color: var(--tdm-testi-gold, #c9a84c);
  background: rgba(201,168,76,0.12);
}
.tdm-testi-cat-btn[data-category=""].is-active {
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.08);
}

/* ── Grid ────────────────────────────────────────────────── */
.tdm-testi-grid {
  display: grid;
  gap: 24px;
}
.tdm-testi-grid--1col { grid-template-columns: 1fr; }
.tdm-testi-grid--2col { grid-template-columns: repeat(2, 1fr); }
.tdm-testi-grid--3col { grid-template-columns: repeat(3, 1fr); }
.tdm-testi-grid--4col { grid-template-columns: repeat(4, 1fr); }
.tdm-testi-grid--5col { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1200px) {
  .tdm-testi-grid--5col { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1024px) {
  .tdm-testi-grid--4col,
  .tdm-testi-grid--5col { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .tdm-testi-grid--3col,
  .tdm-testi-grid--4col,
  .tdm-testi-grid--5col { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .tdm-testi-grid--2col,
  .tdm-testi-grid--3col,
  .tdm-testi-grid--4col,
  .tdm-testi-grid--5col { grid-template-columns: 1fr; }
}

/* ── Paginación ──────────────────────────────────────────── */
.tdm-testi-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 36px;
}
.tdm-testi-pagination:empty { display: none; }

.tdm-testi-pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}
.tdm-testi-pagination__btn:hover:not(:disabled) {
  border-color: var(--tdm-testi-gold, #c9a84c);
  color: var(--tdm-testi-gold, #c9a84c);
}
.tdm-testi-pagination__btn:disabled {
  opacity: 0.25;
  cursor: default;
}
.tdm-testi-pagination__info {
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  font-weight: 600;
  min-width: 80px;
  text-align: center;
}

/* ── Tarjeta ─────────────────────────────────────────────── */
.tdm-testi-card {
  background: var(--tdm-testi-bg, #1a1a1a);
  border-radius: var(--tdm-testi-radius, 12px);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  outline: none;
}
.tdm-testi-card:hover,
.tdm-testi-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.35);
}
.tdm-testi-card:focus-visible {
  box-shadow: 0 0 0 3px #c9a84c;
}

/* ── Badge servicio ──────────────────────────────────────── */
.tdm-testi-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ── Texto ───────────────────────────────────────────────── */
.tdm-testi-text {
  position: relative;
  padding-left: 8px;
}
.tdm-testi-quote {
  font-size: 56px;
  line-height: 0;
  color: var(--tdm-testi-gold, #c9a84c);
  position: absolute;
  top: 24px;
  left: -4px;
  opacity: 0.6;
  font-family: Georgia, serif;
}
.tdm-testi-text__content {
  color: var(--tdm-testi-text, #d4cfc7);
  font-size: 14px;
  line-height: 1.65;
  padding-left: 12px;
}
.tdm-testi-text__content p {
  margin: 0 0 8px;
}
.tdm-testi-text__content p:last-child { margin-bottom: 0; }

/* ── Media ───────────────────────────────────────────────── */
.tdm-testi-media {
  border-radius: 8px;
  overflow: hidden;
}
.tdm-testi-media--image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}
.tdm-testi-media--video iframe,
.tdm-testi-media--video .wp-block-embed__wrapper iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: none;
  border-radius: 8px;
}
.tdm-testi-video-link {
  display: inline-block;
  padding: 10px 18px;
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
}

/* ── Rating ──────────────────────────────────────────────── */
.tdm-testi-rating {
  display: flex;
  gap: 3px;
}
.tdm-testi-star {
  font-size: 16px;
  color: rgba(255,255,255,0.2);
}
.tdm-testi-star--filled {
  color: var(--tdm-testi-gold, #c9a84c);
}

/* ── Autor ───────────────────────────────────────────────── */
.tdm-testi-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.tdm-testi-author__photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.tdm-testi-author__initials {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}
.tdm-testi-author__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tdm-testi-author__name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.tdm-testi-author__role {
  font-size: 12px;
  color: var(--tdm-testi-muted, #7a756d);
}

/* ── Empty ───────────────────────────────────────────────── */
.tdm-testi-empty {
  text-align: center;
  color: var(--tdm-testi-muted, #7a756d);
  padding: 40px 0;
  grid-column: 1 / -1;
}

/* ── Animación filtro ────────────────────────────────────── */
.tdm-testi-card.is-hidden {
  display: none;
}

/* ── Previsualización (imagen / vídeo) ───────────────────── */
.tdm-testi-preview {
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #111;
  position: relative;
}
.tdm-testi-preview__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.tdm-testi-card:hover .tdm-testi-preview__overlay,
.tdm-testi-card:focus-visible .tdm-testi-preview__overlay {
  opacity: 1;
}
.tdm-testi-preview__overlay span {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.9);
  color: #0d0a16;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.tdm-testi-preview--video .tdm-testi-preview__play {
  font-size: 20px;
  padding-left: 3px; /* optical center for ▶ */
}

/* iframe / video embed en tarjeta (pausado, sin controles) */
.tdm-testi-preview__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  display: block;
}
/* object-fit sólo aplica a <video> nativo, no a <iframe> */
video.tdm-testi-preview__video {
  object-fit: cover;
}

/* Fallback thumbnail cuando no hay URL de vídeo */
.tdm-testi-preview__thumb {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.tdm-testi-preview--vertical .tdm-testi-preview__thumb {
  background-position: center top;
}

/* Video vertical (portrait) */
.tdm-testi-preview--vertical {
  aspect-ratio: 9 / 16;
}

/* ── Excerpt (texto) ─────────────────────────────────────── */
.tdm-testi-excerpt {
  position: relative;
  padding-left: 8px;
  flex: 1;
}
.tdm-testi-excerpt .tdm-testi-quote {
  font-size: 52px;
  line-height: 0;
  color: var(--tdm-testi-gold, #c9a84c);
  position: absolute;
  top: 22px;
  left: -4px;
  opacity: 0.5;
  font-family: Georgia, serif;
}
.tdm-testi-excerpt p {
  color: var(--tdm-testi-text, #d4cfc7);
  font-size: 14px;
  line-height: 1.6;
  padding-left: 12px;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Grid loading state ──────────────────────────────────── */
.tdm-testi-loading {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.2s;
}

/* ══════════════════════════════════════════════════════════
   Modal overlay
══════════════════════════════════════════════════════════ */
.tdm-testi-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.tdm-testi-modal-overlay[hidden] {
  display: none;
}

/* Backdrop */
.tdm-testi-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
}
.tdm-testi-modal-overlay.is-open .tdm-testi-modal-backdrop {
  background: rgba(0, 0, 0, 0.78);
}

/* Caja */
.tdm-testi-modal-box {
  position: relative;
  z-index: 1;
  background: #1a1724;
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  /* Scrolbar invisible pero funcional */
  scrollbar-width: none;
  -ms-overflow-style: none;
  transform: translateY(24px) scale(0.97);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.25s ease;
}
.tdm-testi-modal-box::-webkit-scrollbar {
  display: none;
}
.tdm-testi-modal-overlay.is-open .tdm-testi-modal-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Cerrar */
.tdm-testi-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.6);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  z-index: 2;
}
.tdm-testi-modal-close:hover {
  background: rgba(201, 168, 76, 0.15);
  border-color: rgba(201, 168, 76, 0.5);
  color: #c9a84c;
}

/* Cuerpo */
.tdm-testi-modal-body {
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Top (badge) */
.tdm-testi-modal-data__top {
  margin-bottom: 4px;
}
.tdm-testi-badge--lg {
  font-size: 12px !important;
  padding: 4px 12px !important;
}

/* Plan badge (outline) */
.tdm-testi-badge--plan {
  background: transparent;
  border: 1px solid currentColor;
  opacity: 0.9;
}

/* Media */
.tdm-testi-modal__media--image img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}
.tdm-testi-modal__media--video {
  border-radius: 10px;
  overflow: hidden;
  /* Plyr theming */
  --plyr-color-main: #c9a84c;
  --plyr-video-background: #0a0812;
  --plyr-range-fill-background: #c9a84c;
  --plyr-control-spacing: 10px;
}
.tdm-testi-modal__media--video iframe,
.tdm-testi-modal__media--video video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: none;
  border-radius: 10px;
}
/* Plyr container reset inside modal */
.tdm-testi-modal__media--video .plyr {
  border-radius: 10px;
  overflow: hidden;
}
.tdm-testi-modal__media--video .plyr--video {
  aspect-ratio: 16 / 9;
}

/* Video vertical en modal */
.tdm-testi-modal__media--vertical {
  display: flex;
  justify-content: center;
}
.tdm-testi-modal__media--vertical iframe,
.tdm-testi-modal__media--vertical video {
  width: auto;
  height: min(70vh, 520px);
  aspect-ratio: 9 / 16;
  max-width: 100%;
}
.tdm-testi-modal__media--vertical .plyr--video {
  aspect-ratio: 9 / 16;
  width: auto;
  height: min(70vh, 520px);
}

/* Texto */
.tdm-testi-modal__text {
  position: relative;
  padding-left: 12px;
}
.tdm-testi-modal__text .tdm-testi-quote {
  font-size: 64px;
  line-height: 0;
  color: var(--tdm-testi-gold, #c9a84c);
  position: absolute;
  top: 28px;
  left: -6px;
  opacity: 0.45;
  font-family: Georgia, serif;
}
.tdm-testi-modal__text-body {
  color: var(--tdm-testi-text, #d4cfc7);
  font-size: 16px;
  line-height: 1.75;
  padding-left: 16px;
}
.tdm-testi-modal__text-body p {
  margin: 0 0 12px;
}
.tdm-testi-modal__text-body p:last-child { margin-bottom: 0; }

/* Autor dentro del modal */
.tdm-testi-modal__author {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 4px;
}
.tdm-testi-author__photo--lg {
  width: 56px !important;
  height: 56px !important;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.tdm-testi-author__initials--lg {
  width: 56px !important;
  height: 56px !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}

/* Lock scroll cuando el modal está abierto */
body.tdm-modal-lock {
  overflow: hidden;
}

@media (max-width: 600px) {
  .tdm-testi-modal-box { border-radius: 12px; }
  .tdm-testi-modal-body { padding: 24px 18px 20px; }
}
