/* 8-country testimonial pool — grid, fold, expand control */
.testimonials-grid--pool8 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .testimonials-grid--pool8 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

.testimonials-section .testimonial-card {
  transition: opacity 0.45s ease, transform 0.45s ease;
}

/* Collapsed: mobile — hide index >= 2 */
@media (max-width: 767.98px) {
  .testimonials-grid--pool8:not(.is-expanded) .testimonial-card--fold-mobile {
    display: none;
  }

  .testimonials-section .testimonial-card {
    padding: 1.1rem 1.15rem;
  }
}

/* Collapsed: desktop — hide index >= 4 */
@media (min-width: 768px) {
  .testimonials-grid--pool8:not(.is-expanded) .testimonial-card--fold-desktop {
    display: none;
  }

  .testimonials-section .testimonial-card {
    padding: 1.35rem 1.5rem;
  }
}

/* Expanded: fade in previously hidden cards */
.testimonials-grid--pool8.is-expanded .testimonial-card--fold-mobile,
.testimonials-grid--pool8.is-expanded .testimonial-card--fold-desktop {
  animation: testimonial-card-reveal 0.48s ease forwards;
}

@keyframes testimonial-card-reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Avatar slot: <picture> is the flex item — lock size so long copy cannot squeeze it */
.testimonial-card .who picture {
  flex: 0 0 48px;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: block;
  overflow: hidden;
  border-radius: 50%;
}

.testimonial-card__avatar-img {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  max-width: none;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.testimonial-card__avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  flex: 0 0 48px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--navy-mid, #1e293b);
  color: var(--white, #fff);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.testimonial-card .who {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.testimonial-card .who-meta {
  flex: 1 1 auto;
  min-width: 0;
}

/* —— Show more / less —— */
.testimonials-pool__actions {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
}

@media (max-width: 767.98px) {
  .testimonials-pool__actions {
    margin-top: 1.25rem;
  }
}

.testimonials-pool__toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.65rem 1.35rem;
  font-family: var(--font-head, var(--font));
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--navy, #0b172a);
  background: linear-gradient(180deg, #ffffff 0%, var(--gray-50, #f8fafc) 100%);
  border: 1px solid var(--gray-200, #e2e8f0);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.testimonials-pool__toggle::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.35), rgba(15, 23, 42, 0.08));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.testimonials-pool__toggle:hover {
  border-color: rgba(249, 115, 22, 0.45);
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.12);
  color: var(--orange-hover, #ea580c);
}

.testimonials-pool__toggle:hover::before {
  opacity: 1;
}

.testimonials-pool__toggle:focus-visible {
  outline: 2px solid var(--orange, #f97316);
  outline-offset: 3px;
}

.testimonials-pool__toggle-icon {
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.25s ease;
}

.testimonials-pool__toggle.is-expanded .testimonials-pool__toggle-icon {
  transform: rotate(-135deg) translateY(1px);
}

[dir="rtl"] .testimonials-pool__toggle-icon {
  transform: rotate(-45deg) translateY(-2px);
}

[dir="rtl"] .testimonials-pool__toggle.is-expanded .testimonials-pool__toggle-icon {
  transform: rotate(135deg) translateY(1px);
}

.testimonials-pool__toggle[hidden] {
  display: none;
}
