/**
 * Homepage Testimonials section — client review cards.
 */

.sp-testimonials {
	padding: var(--sp-testimonials-pad-top) 0 var(--sp-testimonials-pad-bottom);
	background-color: #000;
	color: #fff;
}

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

.sp-testimonials__heading {
	margin: 0 0 var(--sp-testimonials-heading-bottom);
	font-family: "Helvetica Neue", Helvetica, var(--spaciefy-font);
	font-size: var(--sp-testimonials-heading-size);
	font-style: normal;
	font-weight: 500;
	line-height: 0.98;
	text-align: left;
	color: #fff;
}

.sp-testimonials__grid {
	display: grid;
	grid-template-columns: repeat(var(--sp-testimonials-grid-columns, 3), minmax(0, 1fr));
	gap: var(--sp-testimonials-card-gap);
}

.sp-testimonials__card {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	margin: 0;
	min-height: var(--sp-testimonials-card-min-height);
	overflow: hidden;
	border-radius: 0;
	background-color: #111;
	isolation: isolate;
}

.sp-testimonials__card-media {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	background-color: #111;
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
}

.sp-testimonials__video,
.sp-testimonials__photo {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	object-fit: cover;
	filter: grayscale(100%);
}

.sp-testimonials__mute-toggle {
	position: absolute;
	top: var(--sp-testimonials-audio-inset);
	right: var(--sp-testimonials-audio-inset);
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: auto;
	height: auto;
	min-width: var(--sp-tap-min);
	min-height: var(--sp-tap-min);
	padding: 8px;
	border: 0;
	border-radius: 999px;
	appearance: none;
	color: #fff;
	background-color: rgba(0, 0, 0, 0.55);
	mix-blend-mode: normal;
	filter: none;
	isolation: isolate;
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.sp-testimonials__mute-label {
	display: none;
}

.sp-testimonials__mute-toggle:hover {
	opacity: 0.75;
	transform: scale(1.04);
}

.sp-testimonials__mute-toggle:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.sp-testimonials__mute-icon {
	display: block;
	width: var(--sp-testimonials-audio-size);
	height: var(--sp-testimonials-audio-size);
	max-width: none;
	max-height: none;
	flex-shrink: 0;
}

.sp-testimonials__mute-icon--unmuted {
	display: none;
}

.sp-testimonials__card:not(.is-muted) .sp-testimonials__mute-icon--muted {
	display: none;
}

.sp-testimonials__card:not(.is-muted) .sp-testimonials__mute-icon--unmuted {
	display: block;
}

.sp-testimonials__play-toggle {
	position: relative;
	z-index: 2;
	display: inline-flex;
	flex-flow: row nowrap;
	align-items: center;
	align-self: flex-start;
	justify-content: center;
	gap: 8px;
	width: fit-content;
	max-width: 100%;
	height: auto;
	min-width: 0;
	min-height: 0;
	margin: 0 0 14px;
	padding: 9px 16px;
	border: 0;
	border-radius: 999px;
	appearance: none;
	color: var(--spaciefy-black);
	background-color: var(--spaciefy-yellow);
	mix-blend-mode: normal;
	filter: none;
	isolation: isolate;
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.sp-testimonials__play-toggle-icon {
	position: relative;
	display: block;
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
}

.sp-testimonials__play-toggle .sp-testimonials__play-icon {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: 16px;
	height: 16px;
	max-width: none;
	max-height: none;
}

.sp-testimonials__play-label {
	font-family: var(--spaciefy-font-manrope);
	font-size: clamp(14px, calc(0.8197vw + 11.7px), 18px);
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
}

.sp-testimonials__play-toggle:hover {
	opacity: 0.9;
	transform: scale(1.02);
}

.sp-testimonials__play-toggle:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.sp-testimonials__play-icon--pause {
	opacity: 0;
}

.sp-testimonials__card.is-playing .sp-testimonials__play-icon--play {
	opacity: 0;
}

.sp-testimonials__card.is-playing .sp-testimonials__play-icon--pause {
	opacity: 1;
}

.sp-testimonials__card:not(.is-playing) .sp-testimonials__mute-toggle {
	opacity: 0.45;
	pointer-events: none;
}

.sp-testimonials__card-overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000 100%);
	pointer-events: none;
}

.sp-testimonials__card-content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: 100%;
	padding: var(--sp-testimonials-card-pad);
}

.sp-testimonials__quote {
	margin: 0 0 var(--sp-testimonials-quote-bottom);
	padding: 0;
	border: 0;
}

.sp-testimonials__quote-text {
	margin: 0;
	font-family: "Helvetica Neue", Helvetica, var(--spaciefy-font);
	font-size: var(--sp-testimonials-quote-size);
	font-style: normal;
	font-weight: 400;
	line-height: 1.29;
	color: #fff;
}

.sp-testimonials__footer {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--sp-testimonials-footer-gap);
	margin: 0;
}

.sp-testimonials__meta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--sp-testimonials-meta-gap);
	min-width: 0;
	flex: 1 1 auto;
}

.sp-testimonials__name {
	font-family: "Helvetica Neue", Helvetica, var(--spaciefy-font);
	font-size: var(--sp-testimonials-name-size);
	font-style: normal;
	font-weight: 500;
	line-height: 0.98;
	text-align: left;
	color: #fff;
}

.sp-testimonials__company {
	font-family: "Helvetica Neue", Helvetica, var(--spaciefy-font);
	font-size: var(--sp-testimonials-company-size);
	font-style: normal;
	font-weight: 400;
	line-height: 1.2;
	text-align: left;
	letter-spacing: var(--sp-testimonials-company-tracking);
	text-transform: uppercase;
	color: #fff;
	opacity: 0.5;
}

.sp-testimonials__logo {
	display: flex;
	flex-shrink: 0;
	justify-content: flex-end;
	align-items: flex-end;
}

.sp-testimonials__logo-image {
	width: auto;
	max-width: var(--sp-testimonials-logo-max-width);
	max-height: var(--sp-testimonials-logo-max-height);
	object-fit: contain;
}

/* Tablet — 2 columns */
@media (max-width: 992px) {
	:root {
		--sp-testimonials-grid-columns: 2;
	}
}

/* ---------------------------------------------------------------------------
 * Mobile — one card at a time, swiped.
 *
 * The grid turns into a scroll-snap track so paging is native; the dots and
 * arrows below it are built by testimonials-slider.js and only exist while
 * this breakpoint is active.
 * ------------------------------------------------------------------------- */

@media (max-width: 768px) {
	:root {
		--sp-testimonials-grid-columns: 1;
	}

	.sp-testimonials__grid {
		display: flex;
		grid-template-columns: none;
		gap: 0;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x mandatory;
		scroll-behavior: smooth;
		overscroll-behavior-x: contain;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.sp-testimonials__grid::-webkit-scrollbar {
		display: none;
	}

	.sp-testimonials__card {
		flex: 0 0 100%;
		width: 100%;
		min-height: clamp(420px, 146vw, 620px);
		scroll-snap-align: start;
		display: flex;
		flex-direction: column;
		justify-content: flex-end;
	}

	.sp-testimonials__card-content {
		min-height: 0;
	}

	.sp-testimonials__card-overlay {
		background: linear-gradient(
			180deg,
			rgba(0, 0, 0, 0) 0%,
			rgba(0, 0, 0, 0.35) 45%,
			#000 100%
		);
	}

	.sp-testimonials__quote-text {
		line-height: 1.35;
	}

	.sp-testimonials__company {
		line-height: 1.25;
	}

	.sp-testimonials__mute-icon {
		width: 16px;
		height: 16px;
	}

	.sp-testimonials__controls {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 16px;
		margin-top: clamp(18px, calc(1.0929vw + 15.61px), 24px);
	}

	.sp-testimonials__dots {
		display: flex;
		align-items: center;
		gap: 4px;
	}

	/* Dots are 9px by design, so each one carries an invisible tap area. */
	.sp-testimonials__dot {
		position: relative;
		width: 9px;
		height: 9px;
		padding: 0;
		border: 0;
		border-radius: 999px;
		background-color: rgba(255, 255, 255, 0.25);
		cursor: pointer;
		transition: width 0.25s ease, background-color 0.25s ease;
	}

	.sp-testimonials__dot.is-active {
		width: 21px;
		background-color: var(--spaciefy-white);
	}

	.sp-testimonials__dot::after {
		content: "";
		position: absolute;
		top: 50%;
		left: 50%;
		width: var(--sp-tap-min);
		height: var(--sp-tap-min);
		transform: translate(-50%, -50%);
	}

	.sp-testimonials__nav {
		display: flex;
		align-items: center;
		gap: 8px;
	}

	.sp-testimonials__nav-button {
		position: relative;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 35px;
		height: 35px;
		padding: 0;
		border: 1px solid rgba(255, 255, 255, 0.35);
		border-radius: 999px;
		color: var(--spaciefy-white);
		background: transparent;
		cursor: pointer;
		transition: opacity 0.2s ease, border-color 0.2s ease;
	}

	.sp-testimonials__nav-button:disabled {
		opacity: 0.35;
		cursor: default;
	}

	.sp-testimonials__nav-button svg {
		width: 16px;
		height: 16px;
	}

	.sp-testimonials__nav-button::after {
		content: "";
		position: absolute;
		top: 50%;
		left: 50%;
		width: var(--sp-tap-min);
		height: var(--sp-tap-min);
		transform: translate(-50%, -50%);
	}
}

@media (max-width: 480px) {
	.sp-testimonials__footer {
		flex-direction: column;
		align-items: flex-start;
	}

	.sp-testimonials__logo {
		align-self: flex-end;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sp-testimonials__play-toggle,
	.sp-testimonials__mute-toggle {
		transition: none;
	}

	.sp-testimonials__play-toggle:hover,
	.sp-testimonials__mute-toggle:hover {
		transform: none;
	}
}
