/* Testimonials carousel (Splide) — shared by Track Record and Testimonials blocks */

.testimonials {
	max-width: var(--wrap-content);
	margin-inline: auto;
	padding: 6rem 1rem 3rem;
	text-align: center;

	@media (min-width: 768px) {
		text-align: left;
	}
}

.testimonials__heading {
	font-size: 2.25rem;
	line-height: 2.5rem;
	text-align: center;
	color: var(--offwhite);

	@media (min-width: 640px) {
		font-size: 3.75rem;
		line-height: 1;
	}

	.testimonials--light & {
		color: var(--green);
	}
}

.testimonials__carousel {
	position: relative;
	visibility: visible;

	/* Slides keep their own height; carousel.js sizes the track to the current quote on phones. */
	.splide__list {
		align-items: flex-start;
	}

	.splide__track {
		transition: height 0.3s ease;

		@media (prefers-reduced-motion: reduce) {
			transition: none;
		}
	}

	.splide__pagination {
		display: none;
		flex-wrap: wrap;
		align-items: center;
		justify-content: center;
		max-width: calc(32rem - 3rem);
		min-height: 1.5625rem;
		margin: 2rem auto 0;

		@media (min-width: 768px) {
			display: flex;
		}
	}

	.splide__pagination__page {
		display: block;
		width: 2.5rem;
		height: 2px;
		margin: 0.5rem;
		background-color: var(--sage-light);
		transition: background-color 0.15s;

		&.is-active {
			background-color: var(--sage);
		}

		.testimonials--light & {
			background-color: var(--green);

			&.is-active {
				background-color: var(--sage);
			}
		}
	}
}

.testimonials__arrows {
	position: absolute;
	bottom: 0;
	left: 50%;
	display: none;
	align-items: center;
	justify-content: space-between;
	width: min(32rem, 100%);
	height: 1.5625rem;
	transform: translateX(-50%);
	pointer-events: none;

	@media (min-width: 768px) {
		display: flex;
	}

	.splide__arrow {
		pointer-events: auto;
		color: var(--offwhite);

		.testimonials--light & {
			color: var(--green);
		}

		&:disabled {
			opacity: 0.4;
		}
	}

	svg path {
		stroke: currentColor;
	}
}

.testimonial__text {
	padding: 2rem 0 0.75rem;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--offwhite);
	white-space: pre-line;

	@media (min-width: 640px) {
		padding-right: 2rem;
	}

	.testimonials--light & {
		color: var(--green);
	}
}

.testimonial__cite {
	font-family: var(--font-label);
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 2px;
	color: var(--sage);
}
