/* Testimonials section — seamless slow marquee (JS clones the card set) */

.testimonials {
	display: flex;
	flex-direction: column;
	gap: var(--space-2xl);
	padding-block: var(--space-3xl);
	background-color: var(--color-bg-light);
	overflow: hidden;
}

.testimonials__inner {
	display: flex;
	flex-direction: column;
}

.testimonials__header {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-md);
	max-width: 36rem;
	margin-inline: auto;
	text-align: center;
}

.testimonials__label {
	display: inline-flex;
	align-items: center;
	min-height: 1.75rem;
	padding: var(--space-xs) var(--space-md);
	border-radius: var(--radius-full);
	background-color: var(--color-bg-gray);
	color: var(--color-text-dark);
	font-size: var(--fs-small);
	font-weight: var(--fw-medium);
	line-height: 1;
}

.testimonials__heading {
	font-size: var(--fs-h2);
	font-weight: var(--fw-bold);
	letter-spacing: -0.035em;
	line-height: 1.1;
	color: var(--color-text-dark);
}

.testimonials__subheading {
	font-size: var(--fs-body);
	line-height: 1.6;
	color: var(--color-text-muted);
}

/* Fallback before JS runs (and for reduced motion): a plain swipeable row. */
.testimonials__marquee {
	overflow-x: auto;
	padding-bottom: var(--space-sm);
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.testimonials__marquee.is-marquee {
	overflow: hidden;
	padding-bottom: 0;
	/* Soften both ends so cards enter and leave instead of being cut off. */
	mask-image: linear-gradient(
		90deg,
		transparent,
		#000 5%,
		#000 95%,
		transparent
	);
	-webkit-mask-image: linear-gradient(
		90deg,
		transparent,
		#000 5%,
		#000 95%,
		transparent
	);
}

.testimonials__track {
	display: flex;
	gap: var(--space-md);
	width: max-content;
	padding-inline: var(--space-md);
}

.testimonials__track.is-marquee {
	animation: ri-testimonials-marquee var(--ri-marquee-duration, 60s) linear infinite;
	will-change: transform;
}

/* Let visitors stop the lane to finish reading a quote. */
.testimonials__marquee:hover .testimonials__track.is-marquee,
.testimonials__marquee:focus-within .testimonials__track.is-marquee {
	animation-play-state: paused;
}

@keyframes ri-testimonials-marquee {
	from {
		transform: translate3d(0, 0, 0);
	}

	to {
		transform: translate3d(calc(-1 * var(--ri-marquee-distance, 0px)), 0, 0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.testimonials__track.is-marquee {
		animation: none;
		will-change: auto;
	}
}

.testimonials__card {
	display: flex;
	flex-direction: column;
	gap: var(--space-md);
	flex: 0 0 min(85vw, 22rem);
	min-height: 16rem;
	padding: var(--space-xl);
	border: 1px solid rgba(17, 17, 17, 0.08);
	border-radius: 1rem;
	background-color: var(--color-bg-light);
}

.testimonials__stars {
	display: flex;
	align-items: center;
	gap: 0.2rem;
	color: #e0e0e0;
}

.testimonials__star.is-active {
	color: #f5c542;
}

.testimonials__quote {
	flex: 1;
	margin: 0;
}

.testimonials__quote p {
	font-size: var(--fs-body);
	line-height: 1.55;
	color: var(--color-text-dark);
}

.testimonials__author {
	display: flex;
	align-items: center;
	gap: var(--space-md);
	margin-top: auto;
}

.testimonials__avatar {
	width: 2.5rem;
	height: 2.5rem;
	border-radius: var(--radius-full);
	object-fit: cover;
	background-color: var(--color-bg-gray);
	flex-shrink: 0;
}

.testimonials__author-meta {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

.testimonials__name {
	font-size: var(--fs-small);
	font-weight: var(--fw-bold);
	line-height: 1.3;
	color: var(--color-text-dark);
}

.testimonials__role {
	font-size: 0.75rem;
	line-height: 1.35;
	color: var(--color-text-muted);
}

@media (min-width: 768px) {
	.testimonials {
		padding-block: 5rem;
	}

	.testimonials__track {
		gap: var(--space-lg);
		padding-inline: var(--space-lg);
	}

	.testimonials__card {
		flex-basis: min(70vw, 24rem);
		padding: var(--space-xl) var(--space-2xl);
	}
}
