.testimonials {
  padding: var(--section-padding);
  background: var(--bg-primary);
  overflow: hidden;
}

/* Marquee wrapper — clips overflow and adds fade edges */
.testimonials__marquee {
  position: relative;
  margin-top: 3rem;
  overflow: hidden;
  /* fade left + right edges into bg */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

/* The scrolling track — contains two identical sets of cards */
.testimonials__track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  animation: marquee 30s linear infinite;
}

.testimonials__marquee:hover .testimonials__track {
  animation-play-state: paused;
}

@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.testimonial-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 2rem;
  border-bottom: 3px solid var(--accent);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 380px;
  flex-shrink: 0;
}

.testimonial-card__quote {
  font-size: 4rem;
  line-height: 0.6;
  color: var(--accent);
  font-family: Georgia, serif;
  user-select: none;
}

.testimonial-card__text {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.75;
  flex: 1;
}

.testimonial-card__author {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.testimonial-card__name {
  font-weight: 700;
  font-size: 0.95rem;
}

.testimonial-card__location {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Dots — mobile only */
.testimonials__dots {
  display: none;
}

@media (max-width: 640px) {
  .testimonials__dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
  }

  .testimonials__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
  }

  .testimonials__dot.active {
    background: var(--accent);
    transform: scale(1.25);
  }
}

@media (max-width: 640px) {
  .testimonials__marquee {
    /* Switch from auto-scroll to swipeable snap scroll */
    -webkit-mask-image: none;
    mask-image: none;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-top: 2rem;
    padding-bottom: 0.5rem;
  }

  .testimonials__marquee::-webkit-scrollbar {
    display: none;
  }

  .testimonials__track {
    animation: none;
    width: auto;
    padding: 0 1.25rem;
    gap: 1rem;
  }

  /* Hide the duplicated cards — only needed for the infinite loop */
  .testimonial-card[aria-hidden="true"] {
    display: none;
  }

  .testimonial-card {
    width: 82vw;
    flex-shrink: 0;
    scroll-snap-align: center;
    padding: 1.25rem 1.5rem;
  }

  .testimonial-card__text {
    font-size: 0.9rem;
  }
}
