/**
 * Kempsey Testimonials Carousel
 *
 * Matches Figma node 52:635 — Desktop:
 *   - 4-column row, gap 16px, items aligned to flex-start
 *   - Left: flex-1 thumbnail (177px tall) + nav arrows row below (20px gap)
 *   - Center: fixed video card 281×440 + quote card 479×440 (16px gap)
 *   - Right: flex-1 thumbnail (177px tall)
 *   - Border-radius 12px everywhere
 *   - Quote: Helvetica 28px black
 *   - Name: Poppins Medium 18px #606060
 */

.kempsey-testimonials {
	--kt-gap: 16px;
	--kt-radius: 12px;
	--kt-thumb-height: 177px;
	--kt-active-height: 440px;
	--kt-video-width: 281px;
	--kt-quote-width: 479px;
	--kt-arrow-size: 37px;
	--kt-play-size: 48px;
	--kt-quote-mark-size: 58px;
	--kt-quote-mark-color: #5B7CFF;
	--kt-quote-text: #000000;
	--kt-name-text: #606060;
	--kt-quote-bg: #ffffff;
	--kt-photo-bg: #d3d3d3;
	--kt-modal-bg: rgba(0, 0, 0, 0.85);
	--kt-play-bg: #ffffff;
	--kt-arrow-bg: #ffffff;
	--kt-arrow-fg: #1a1a1a;
	--kt-swap-duration: 250ms;

	position: relative;
	margin: 0 auto;
	max-width: 1280px;
	padding: 24px 0;
	box-sizing: border-box;
	display: flex;
	align-items: flex-start;
	gap: var(--kt-gap);
}

.kempsey-testimonials *,
.kempsey-testimonials *::before,
.kempsey-testimonials *::after {
	box-sizing: border-box;
}

/* --- Side columns (prev + next thumbnails) ----------------------- */

.kempsey-testimonials__side {
	flex: 1 0 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.kempsey-testimonials__side--prev {
	align-items: flex-end;
}

.kempsey-testimonials__side--next {
	align-items: flex-start;
	justify-content: center;
}

.kempsey-testimonials__side.is-empty {
	visibility: hidden;
}

.kempsey-testimonials__thumb {
	width: 100%;
	height: var(--kt-thumb-height);
	background: var(--kt-photo-bg);
	border-radius: var(--kt-radius);
	overflow: hidden;
	position: relative;
}

.kempsey-testimonials__thumb-photo {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: opacity var(--kt-swap-duration) ease;
}

.kempsey-testimonials.is-swapping .kempsey-testimonials__thumb-photo {
	opacity: 0;
}

/* --- Navigation arrows (below left thumb) ------------------------ */

.kempsey-testimonials__nav {
	display: flex;
	gap: 10px;
	align-items: center;
}

.kempsey-testimonials__prev,
.kempsey-testimonials__next {
	width: var(--kt-arrow-size);
	height: var(--kt-arrow-size);
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.12);
	background: var(--kt-arrow-bg);
	color: var(--kt-arrow-fg);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.kempsey-testimonials__prev:hover,
.kempsey-testimonials__next:hover,
.kempsey-testimonials__prev:focus-visible,
.kempsey-testimonials__next:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
	outline: none;
}

.kempsey-testimonials__prev svg,
.kempsey-testimonials__next svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

/* --- Active testimonial (video + quote cards) -------------------- */

.kempsey-testimonials__active {
	flex: 0 0 auto;
	display: flex;
	gap: var(--kt-gap);
	align-items: center;
}

/* --- Video card -------------------------------------------------- */

.kempsey-testimonials__video-card {
	position: relative;
	flex: 0 0 auto;
	width: var(--kt-video-width);
	height: var(--kt-active-height);
	border-radius: var(--kt-radius);
	overflow: hidden;
	background-color: var(--kt-photo-bg);
}

/* The photo background lives in its own inner element so it can fade
   independently of the card container during slide swaps. */
.kempsey-testimonials__video-bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	transition: opacity var(--kt-swap-duration) ease;
}

.kempsey-testimonials__video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: opacity var(--kt-swap-duration) ease;
}

.kempsey-testimonials.is-swapping .kempsey-testimonials__video-bg,
.kempsey-testimonials.is-swapping .kempsey-testimonials__video,
.kempsey-testimonials.is-swapping .kempsey-testimonials__play-btn {
	opacity: 0;
}

.kempsey-testimonials__play-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: var(--kt-play-size);
	height: var(--kt-play-size);
	border-radius: 50%;
	border: 0;
	background: var(--kt-play-bg);
	color: #1a1a1a;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: transform 0.15s ease, opacity var(--kt-swap-duration) ease;
}

.kempsey-testimonials__play-btn:hover,
.kempsey-testimonials__play-btn:focus-visible {
	transform: translate(-50%, -50%) scale(1.06);
	outline: none;
}

.kempsey-testimonials__play-icon {
	width: 22px;
	height: 22px;
	fill: currentColor;
	margin-left: 3px;
}

/* --- Quote card -------------------------------------------------- */

.kempsey-testimonials__quote-card {
	position: relative;
	flex: 0 0 auto;
	width: var(--kt-quote-width);
	height: var(--kt-active-height);
	background: var(--kt-quote-bg);
	border: 1px solid var(--kt-quote-bg);
	border-radius: var(--kt-radius);
	padding: 31px 25px 25px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.kempsey-testimonials__quote-mark {
	width: var(--kt-quote-mark-size);
	height: var(--kt-quote-mark-size);
	fill: var(--kt-quote-mark-color);
	display: block;
	margin-bottom: 12px;
	flex-shrink: 0;
}

.kempsey-testimonials__quote {
	margin: 0;
	padding: 0;
	font-family: "Helvetica", "Helvetica Neue", Arial, sans-serif;
	font-weight: 400;
	font-size: 28px;
	line-height: 1.4;
	color: var(--kt-quote-text);
	border: 0;
	quotes: none;
	flex: 1 1 auto;
	overflow: hidden;
	word-break: break-word;
	transition: opacity var(--kt-swap-duration) ease;
}

.kempsey-testimonials__quote p {
	margin: 0 0 12px;
}

.kempsey-testimonials__quote p:last-child {
	margin-bottom: 0;
}

.kempsey-testimonials__name {
	margin: 0;
	font-family: "Poppins", "Helvetica Neue", Arial, sans-serif;
	font-weight: 500;
	font-size: 18px;
	line-height: 1.4;
	color: var(--kt-name-text);
	text-align: right;
	transition: opacity var(--kt-swap-duration) ease;
}

.kempsey-testimonials.is-swapping .kempsey-testimonials__quote,
.kempsey-testimonials.is-swapping .kempsey-testimonials__name {
	opacity: 0;
}

/* --- Modal ------------------------------------------------------- */

.kempsey-testimonials__modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: var(--kt-modal-bg);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.kempsey-testimonials__modal-content {
	position: relative;
	width: min(960px, 100%);
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.kempsey-testimonials__modal-content iframe,
.kempsey-testimonials__modal-content video {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

.kempsey-testimonials__modal-close {
	position: absolute;
	top: -56px;
	right: 0;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 0;
	background: #ffffff;
	color: #1a1a1a;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.kempsey-testimonials__modal-close:hover,
.kempsey-testimonials__modal-close:focus-visible {
	background: #f0f0f0;
	outline: none;
}

/* --- Responsive (preliminary — Figma is desktop-only) ------------ */

@media (max-width: 1100px) {
	.kempsey-testimonials {
		--kt-video-width: 240px;
		--kt-quote-width: 380px;
		--kt-active-height: 380px;
		--kt-thumb-height: 150px;
	}

	.kempsey-testimonials__quote {
		font-size: 22px;
	}
}

@media (max-width: 900px) {
	.kempsey-testimonials {
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
		--kt-video-width: 100%;
		--kt-quote-width: 100%;
		--kt-active-height: auto;
	}

	/* Mobile: show only the active card + centered nav arrows. */
	.kempsey-testimonials__thumb {
		display: none;
	}

	.kempsey-testimonials__side--next {
		display: none;
	}

	.kempsey-testimonials__side--prev {
		order: 2;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		gap: 0;
	}

	.kempsey-testimonials__active {
		order: 1;
		flex-direction: column;
		align-items: stretch;
		width: 100%;
	}

	.kempsey-testimonials__video-card {
		width: 100%;
		height: auto;
		aspect-ratio: 281 / 440;
	}

	.kempsey-testimonials__quote-card {
		width: 100%;
		height: auto;
		min-height: 300px;
		padding: 24px 20px 20px;
	}

	.kempsey-testimonials__quote {
		font-size: 20px;
	}

	.kempsey-testimonials__modal-close {
		top: -48px;
	}
}
