/* =============================================================================
   Testimonial Carousel Block
   BEM namespace: .testimonial-carousel
   ============================================================================= */

/* ── Block wrapper ───────────────────────────────────────────────────────── */

.testimonial-carousel {
	padding: 60px 0;
}

.testimonial-carousel--bg-white {
	background: #ffffff;
}

.testimonial-carousel--bg-grey {
	background: #f5f5f5;
}

/* ── Heading ─────────────────────────────────────────────────────────────── */

.testimonial-carousel__heading {
	text-align: center;
	color: #e74111;
	font-family: 'HelveticaNowDisplay', Helvetica, Arial, sans-serif;
	font-size: 34px;
	font-weight: bold;
	line-height: 1.2;
	letter-spacing: 0.5px;
	margin-bottom: 40px;
}

/* ── Wrapper (holds prev btn + track + next btn in a row) ─────────────────── */

.testimonial-carousel__wrapper {
	display: flex;
	align-items: center;
	gap: 16px;
}

/* ── Track (overflow hidden, position context for slides) ─────────────────── */

.testimonial-carousel__track {
	flex: 1;
	min-width: 0;
	position: relative;
	overflow: hidden;
	/* Height is set in JS to match the active slide */
}

/* ── Slides ──────────────────────────────────────────────────────────────── */

.testimonial-carousel__slide {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 48px;
	/* Non-active slides are absolutely positioned so they don't affect layout */
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.5s ease;
}

.testimonial-carousel__slide.is-active {
	position: relative; /* establishes track height */
	opacity: 1;
	pointer-events: auto;
}

/* ── Image ───────────────────────────────────────────────────────────────── */

.testimonial-carousel__image {
	flex: 0 0 42%;
	max-width: 42%;
}

.testimonial-carousel__image img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	display: block;
}

/* ── Content ─────────────────────────────────────────────────────────────── */

.testimonial-carousel__content {
	flex: 1;
	min-width: 0;
}

.testimonial-carousel__name {
	font-family: 'HelveticaNowDisplay', Helvetica, Arial, sans-serif;
	font-size: 22px;
	font-weight: bold;
	color: #333333;
	margin: 0 0 6px;
	line-height: 1.2;
}

.testimonial-carousel__title {
	font-size: 15px;
	color: #777777;
	margin: 0 0 12px;
	line-height: 1.4;
}

/* ── Stars ───────────────────────────────────────────────────────────────── */

.testimonial-carousel__stars {
	display: flex;
	gap: 3px;
	margin-bottom: 18px;
}

.testimonial-carousel__star {
	font-size: 22px;
	line-height: 1;
	color: #dddddd;
}

.testimonial-carousel__star.is-filled {
	color: #f5a623;
}

/* ── Review text ─────────────────────────────────────────────────────────── */

.testimonial-carousel__review {
	font-size: 15px;
	line-height: 1.75;
	color: #555555;
	margin: 0;
}

/* ── Nav buttons ─────────────────────────────────────────────────────────── */

.testimonial-carousel__btn {
	width: 38px;
	height: 38px;
	flex-shrink: 0;
	border: 1px solid #cfcfcf;
	background: #ffffff;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	color: #444444;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.testimonial-carousel--bg-grey .testimonial-carousel__btn {
	background: #f5f5f5;
}

.testimonial-carousel__btn:hover {
	background-color: #e74111;
	border-color: #e74111;
	color: #ffffff;
}

.testimonial-carousel__btn:disabled,
.testimonial-carousel__btn[style*="visibility: hidden"] {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
}

/* ── Tablet (≥ 768px) ────────────────────────────────────────────────────── */

@media (min-width: 768px) {
	.testimonial-carousel__image {
		flex: 0 0 40%;
		max-width: 40%;
	}
}

/* ── Desktop (≥ 960px) ───────────────────────────────────────────────────── */

@media (min-width: 960px) {
	.testimonial-carousel__heading {
		font-size: 40px;
	}

	.testimonial-carousel__name {
		font-size: 24px;
	}

	.testimonial-carousel__review {
		font-size: 16px;
	}
}

/* ── Mobile (≤ 767px) ────────────────────────────────────────────────────── */

@media (max-width: 767px) {
	.testimonial-carousel {
		padding: 40px 0;
	}

	.testimonial-carousel__heading {
		font-size: 26px;
		margin-bottom: 28px;
	}

	/* Stack the slide vertically: content on top, image below */
	.testimonial-carousel__slide {
		flex-direction: column;
		gap: 24px;
	}

	/* Content first visually on mobile */
	.testimonial-carousel__content {
		order: 1;
		width: 100%;
	}

	/* Image second visually on mobile — landscape, constrained width */
	.testimonial-carousel__image {
		order: 2;
		flex: 0 0 auto;
		max-width: 80%;
		width: 80%;
		margin: 0 auto;
	}

	/* Shrink arrows slightly on mobile */
	.testimonial-carousel__btn {
		width: 32px;
		height: 32px;
		font-size: 18px;
	}

	.testimonial-carousel__wrapper {
		gap: 10px;
	}

	.testimonial-carousel__name {
		font-size: 18px;
	}
}

/* ── Editor preview ──────────────────────────────────────────────────────── */

.block-editor .testimonial-carousel__track {
	/* In the editor the JS height-setting doesn't run, so ensure visibility */
	overflow: visible;
}

.block-editor .testimonial-carousel__slide {
	position: relative;
	opacity: 1;
	pointer-events: auto;
}
