/**
 * Reviews: template-parts/home/reviews.php.
 * Mobile (2289:1198): cream, 48px top and bottom; heading, then the rating
 * bar running to the right screen edge with the mascot on it; 280 x 334
 * cards, 12px gap, swipe row to the screen edge; arrow buttons below.
 * From 768: heading left and badge right (437px, to the screen edge).
 * From 1024 (2080:478): 80px top, 86px bottom, 384 x 458 cards, arrows over the cards at the
 * screen edges. The card names use DM Sans (the frame uses Onest, which is
 * not a project font).
 */

.home-reviews {
	overflow-x: clip;
	padding: 48px 0;
	background: var(--color-cream);
}

.reviews__head {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.reviews__heading {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.reviews__eyebrow {
	margin: 0;
	color: var(--color-orange);
	font-size: var(--text-label-s);
	font-weight: var(--weight-semibold);
	letter-spacing: var(--tracking-label-s);
	line-height: var(--leading-label-s);
	text-transform: uppercase;
}

.reviews__title {
	max-width: 292px;
	margin: 0;
	color: var(--color-black);
	font-family: var(--font-display);
	font-size: var(--text-h2);
	font-weight: var(--weight-extrabold);
	letter-spacing: var(--tracking-h2);
	line-height: var(--leading-h2);
}

/* Rating bar 2289:1214: ink, rounded on the left only, to the screen edge. */
.reviews__rating {
	position: relative;
	display: flex;
	gap: 20px;
	align-items: center;
	margin-right: calc(-1 * var(--container-gutter));
	padding: 14px 20px;
	border-radius: var(--radius-md) 0 0 var(--radius-md);
	background: var(--color-ink);
	color: var(--color-white);
}

/* Past the gutter (screens wider than 1660) the bar keeps going to the screen
 * edge; the mascot stays where it is at 1660. */
.reviews__rating::after {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 100%;
	width: calc(var(--bleed) - var(--container-gutter));
	background: inherit;
	content: "";
}

.reviews__score {
	margin: 0;
	font-family: var(--font-display);
	font-size: 28px;
	font-weight: var(--weight-bold);
	letter-spacing: var(--tracking-h3);
	line-height: var(--leading-h3);
}

.reviews__divider {
	align-self: center;
	width: 0;
	height: 30px;
	border-left: 1px solid rgb(255 255 255 / 30%);
}

.reviews__summary {
	display: flex;
	flex-direction: column;
	gap: 4px;
	width: 96px;
}

.reviews__count {
	margin: 0;
	font-size: var(--text-body-s);
	line-height: var(--leading-body-s);
	text-align: center;
	white-space: nowrap;
}

/* 2286:3888: 171 x 127, the top of the mascot, bottom on the bar's bottom,
 * 13px past the screen edge. */
.reviews__mascot {
	position: absolute;
	right: -13px;
	bottom: 0;
	overflow: hidden;
	width: 171px;
	height: 127px;
	pointer-events: none;
}

.reviews__mascot img {
	display: block;
	width: 100%;
	height: auto;
}

/* Stars: the exported row of five, filled to the rating. */
.stars {
	position: relative;
	display: block;
	width: 70px;
	height: 11px;
}

.stars__img {
	display: block;
	width: 100%;
	height: 100%;
}

.stars > .stars__img {
	opacity: 0.25;
}

.stars__fill {
	position: absolute;
	inset: 0 auto 0 0;
	overflow: hidden;
}

/* Full-width row clipped by the fill; max-width: none, or the base img rule
 * squeezes it to the fill width (4-star reviews showed compressed stars). */
.stars__fill .stars__img {
	width: 70px;
	max-width: none;
}

.reviews__summary .stars,
.reviews__summary .stars__fill .stars__img {
	width: 96px;
	height: 15px;
}

/* Carousel 2289:1215 */
.reviews__carousel {
	position: relative;
	margin-top: 16px;
}

.reviews__track {
	display: flex;
	gap: 12px;
	/* Full bleed: the row runs to both screen edges; the first card starts on
	 * the content edge. */
	margin: 0 calc(-1 * var(--bleed));
	padding: 0 var(--bleed);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	list-style: none;
	scroll-behavior: smooth;
	scroll-padding-inline: var(--bleed);
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.reviews__track::-webkit-scrollbar {
	display: none;
}

/* Card 2289:1217: 280 x 334, stars 22px from the top, quote 15px below,
 * author row 64px tall under a cream line. */
.review {
	display: flex;
	flex: none;
	flex-direction: column;
	box-sizing: border-box;
	width: 280px;
	min-height: 334px;
	padding-top: 22px;
	border-radius: 11px;
	background: var(--color-white);
	scroll-snap-align: start;
}

.review > .stars {
	margin-left: 17px;
}

.review__text {
	flex: 1 0 auto;
	margin: 15px 0 0;
	padding: 0 22px 20px 17px;
	color: var(--color-black);
	font-size: var(--text-body-s);
	line-height: var(--leading-body-m);
}

.review__text p {
	margin: 0;
}

.review__author {
	display: flex;
	gap: 11px;
	align-items: center;
	padding: 14px;
	border-top: 1px solid var(--color-cream);
}

.review__avatar {
	flex: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
}

/* Not designed: the initials avatar for reviews without a photo. */
.review__avatar--initials {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--color-green);
	color: var(--color-white);
	font-size: var(--text-body-s);
	font-weight: var(--weight-semibold);
	line-height: 1;
}

.review__who {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
	color: var(--color-black);
}

.review__name {
	font-size: var(--text-body-s);
	font-weight: var(--weight-semibold);
	line-height: 1.2;
}

.review__country {
	font-size: 10px;
	line-height: 1.5;
}

/* Arrows 2286:3890: the exported orange circle; the button is the circle,
 * the drawing (with its margin) overflows it. Prev is the same drawing turned. */
.reviews__nav {
	display: flex;
	gap: 20px;
	margin-top: 16px;
}

.reviews__arrow {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 47px;
	height: 47px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	cursor: pointer;
	transition: all 0.2s ease;
}

.reviews__arrow img {
	flex: none;
	width: 67px;
	height: 67px;
	max-width: none;
}

.reviews__arrow--prev img {
	transform: scaleX(-1);
}

/* From 768 (tablet, not designed): heading and rating badge side by side, as on desktop. */
@media (min-width: 768px) {
	.reviews__head {
		flex-direction: row;
		align-items: flex-end;
		justify-content: space-between;
	}

	.reviews__heading {
		flex: 1 1 auto;
		gap: 8px;
		min-width: 0;
	}

	.reviews__title {
		max-width: none;
	}

	/* 2077:665: 437px visible, content 25px in, mascot (229 x 170) on the right. */
	.reviews__rating {
		flex: none;
		box-sizing: border-box;
		width: 437px;
		height: 72px;
		padding: 0 0 0 25px;
	}

	.reviews__mascot {
		right: 0;
		width: 229px;
		height: 170px;
	}
}

@media (min-width: 1024px) {
	/* The frame says 120px below, but the visible gap to the newsletter card
	 * (2061:575) is 86px; the extra frame height is a stray text (2077:632). */
	.home-reviews {
		padding: 80px 0 86px;
	}

	.reviews__carousel {
		margin-top: 48px;
	}

	.reviews__track {
		gap: var(--space-md);
	}

	/* Card 2077:501: 384 x 458, stars 30px from the top, quote 21px below,
	 * author row 88px tall. */
	.review {
		width: 384px;
		min-height: 458px;
		padding-top: 30px;
		border-radius: 15px;
	}

	.review > .stars,
	.review > .stars .stars__img {
		width: 96px;
		height: 15px;
	}

	.review > .stars {
		margin-left: 24px;
	}

	.review__text {
		margin-top: 21px;
		padding: 0 30px 24px 24px;
		font-size: 18px;
	}

	.review__author {
		gap: 15px;
		padding: 19px;
	}

	.review__avatar {
		width: 49px;
		height: 49px;
	}

	.review__name {
		font-size: 18px;
	}

	.review__country {
		font-size: var(--text-body-s);
	}

	/* 2077:606: 80px circles centred on the cards, 43px from the screen edges. */
	.reviews__nav {
		position: absolute;
		top: 50%;
		right: calc(43px - var(--bleed));
		left: calc(43px - var(--bleed));
		justify-content: space-between;
		margin: 0;
		pointer-events: none;
		transform: translateY(-50%);
	}

	.reviews__arrow {
		width: 80px;
		height: 80px;
		pointer-events: auto;
	}

	.reviews__arrow img {
		width: 115px;
		height: 115px;
	}
}

.reviews__nav[hidden] {
	display: none;
}
