/**
 * Featured reviews carousel.
 *
 * Lives wherever [sa_featured_reviews] is placed, so everything is scoped under
 * .sa-fr and nothing leans on the /reviews page stylesheet. Colours follow the
 * Astra globals like the reviews page does; typography is inherited, so the
 * heading picks up the theme's heading font inside Elementor.
 */

.sa-fr {
	--sa-fr-navy: var(--ast-global-color-0, #0b1e46);
	--sa-fr-ink: var(--ast-global-color-3, #3c4050);
	--sa-fr-muted: #767d90;
	--sa-fr-line: #e5e8ef;
	--sa-fr-star: #f5a623;
	--sa-fr-tint: #eaf0fb;
	--sa-fr-gap: 24px;

	width: 100%;

	/* No top padding: the section above already ends in its own, and the
	   two stacked read as a gap rather than a break. */
	padding-block: 0 64px;
	color: var(--sa-fr-ink);
	overflow: hidden;
}

/* ------------------------------------------------------------- Header -- */

.sa-fr__head {
	max-width: 1140px;
	margin: 0 auto 32px;
	padding-inline: 16px;
	text-align: center;
}

.sa-fr .sa-fr__eyebrow {
	margin: 0 0 6px;
	font-size: .8rem;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--ast-global-color-1, #da1e40);
}

.sa-fr .sa-fr__title {
	margin: 0;
	color: var(--sa-fr-navy);

	/* Stated, not inherited: the blog's reset leaves headings at 400, where the
	   theme here happens to make them bold. */
	font-weight: 700;
	font-size: clamp(1.9rem, 3.4vw, 2.75rem);
	line-height: 1.15;
}

.sa-fr__stats {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 12px 56px;
	margin-top: 22px;
}

.sa-fr__stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
}

.sa-fr__stat-value {
	font-size: 1.9rem;
	font-weight: 800;
	line-height: 1.1;
	color: var(--sa-fr-navy);
}

.sa-fr__stat-star {
	margin-left: 3px;
	font-size: 1.1rem;
	vertical-align: .35em;
	color: var(--sa-fr-star);
}

.sa-fr__stat-label {
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--sa-fr-muted);
}

/* -------------------------------------------------------------- Track -- */

/*
 * Two modes, switched by the script:
 *
 *  - Manual (the default). The viewport is an ordinary horizontal scroller,
 *    so a finger, a trackpad, or a mouse drag moves the cards with the
 *    browser's own momentum. This is also all a visitor gets without
 *    JavaScript or with reduced motion.
 *  - Auto (.sa-fr--auto). Overflow is clipped and the track slides by CSS
 *    animation — a transform on the compositor, with no per-frame script.
 *
 * The script converts the position when it switches, so the cards never jump.
 */
.sa-fr__viewport {
	/* Room above and below so the card shadows are not clipped. */
	padding-block: 10px 26px;
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scroll-behavior: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.sa-fr__viewport::-webkit-scrollbar {
	display: none;
}

.sa-fr--still .sa-fr__viewport {
	overflow: hidden;
}

.sa-fr--moving.sa-fr--ready .sa-fr__viewport {
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
	cursor: grab;
}

.sa-fr--dragging .sa-fr__viewport {
	cursor: grabbing;
	user-select: none;
}

.sa-fr--auto .sa-fr__viewport {
	overflow: hidden;
}

.sa-fr__track {
	display: flex;
	width: max-content;
}

.sa-fr--auto .sa-fr__track {
	animation: sa-fr-scroll var(--sa-fr-duration, 60s) linear infinite;
	will-change: transform;
}

/* Two identical groups, each padded by one gap on its trailing edge, so
   sliding by exactly half the track lands the second where the first began. */
.sa-fr .sa-fr__group {
	display: flex;
	gap: var(--sa-fr-gap);
	margin: 0;
	padding: 0 var(--sa-fr-gap) 0 0;
	list-style: none;
}

/* Without the script there is no loop to hide the repeats in, so show each
   review once as a plain swipeable row. */
.sa-fr--moving:not(.sa-fr--ready) .sa-fr__group[aria-hidden="true"],
.sa-fr--moving:not(.sa-fr--ready) .sa-fr__card[aria-hidden="true"] {
	display: none;
}

.sa-fr--moving:not(.sa-fr--ready) .sa-fr__group {
	padding-left: 16px;
}

.sa-fr--still .sa-fr__track {
	width: auto;
	justify-content: center;
}

.sa-fr--still .sa-fr__group {
	flex-wrap: wrap;
	justify-content: center;
	padding: 0 16px;
}

@keyframes sa-fr-scroll {
	from {
		transform: translate3d(0, 0, 0);
	}

	to {
		transform: translate3d(-50%, 0, 0);
	}
}

/* Tabbing into a card or scrolling the section out of view holds the
   animation where it is. A paused animation does no work at all. */
.sa-fr--auto .sa-fr__viewport:focus-within .sa-fr__track,
.sa-fr--offscreen .sa-fr__track {
	animation-play-state: paused;
}

/* So does resting a mouse on it. Limited to real hover: a phone keeps :hover
   on the last thing tapped, which would freeze the row after a swipe. */
@media (hover: hover) {
	.sa-fr--auto .sa-fr__viewport:hover .sa-fr__track {
		animation-play-state: paused;
	}
}

/* --------------------------------------------------------------- Card -- */

.sa-fr .sa-fr__card {
	flex: 0 0 auto;
	width: min(360px, 80vw);
	margin: 0;
	display: flex;
}

.sa-fr__figure {
	display: flex;
	flex-direction: column;
	width: 100%;
	margin: 0;
	padding: 24px 26px 22px;
	background: #fff;
	border: 1px solid var(--sa-fr-line);
	border-radius: 16px;
	box-shadow: 0 1px 2px rgba(11, 30, 70, .04), 0 10px 24px rgba(11, 30, 70, .06);
}

.sa-fr__stars {
	display: inline-flex;
	gap: 2px;
	line-height: 0;
}

.sa-fr__star {
	width: 16px;
	height: 16px;
	fill: var(--sa-fr-line);
}

.sa-fr__star.is-on {
	fill: var(--sa-fr-star);
}

/* The review's own headline, above the quote. Clamped to two lines so a long
   one cannot stretch every card in the row to match it. */
.sa-fr .sa-fr__headline {
	margin: 12px 0 0;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--sa-fr-navy);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.sa-fr .sa-fr__quote {
	flex: 1;
	margin: 14px 0 20px;
	padding: 0;
	border: 0;
	font-style: normal;
	quotes: none;
}

.sa-fr .sa-fr__quote::before,
.sa-fr .sa-fr__quote::after {
	content: none;
}

.sa-fr .sa-fr__quote p {
	margin: 0;
	font-size: .95rem;
	line-height: 1.65;
	color: var(--sa-fr-ink);
	display: -webkit-box;
	-webkit-line-clamp: 6;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.sa-fr__author {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.sa-fr__avatar {
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	border-radius: 5px;
	object-fit: cover;
	background: var(--sa-fr-tint);
}

/* Elementor ships a global `img { border-radius: 0 }` (0,1,1) that outranks the
   avatar rule, so reviewer photos rendered square while the initials
   placeholder stayed round. Assert the radius one class above the theme: 5px
   reads as a small portrait tile rather than a bubble. */
.sa-fr .sa-fr__avatar {
	border-radius: 5px;
}

.sa-fr__avatar--initials {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--sa-fr-navy);
	font-size: .85rem;
	font-weight: 700;
	letter-spacing: .02em;
}

.sa-fr__who {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.sa-fr__name {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: .95rem;
	font-weight: 700;
	color: var(--sa-fr-navy);
}

.sa-fr__verified {
	width: 14px;
	height: 14px;
	fill: #0b7a3b;
	flex-shrink: 0;
}

.sa-fr__place {
	font-size: .82rem;
	color: var(--sa-fr-muted);
}

.sa-fr__pill {
	margin-left: auto;
	flex-shrink: 0;
	padding: 4px 11px;
	border-radius: 999px;
	background: #f2f4f8;
	color: var(--sa-fr-navy);
	font-size: .72rem;
	font-weight: 700;
}

/* --------------------------------------------------------------- Foot -- */

.sa-fr__foot {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 24px;
	padding-inline: 16px;
}

.sa-fr .sa-fr__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 7px 14px;
	border: 1px solid var(--sa-fr-line);
	border-radius: 999px;
	background: #fff;
	color: var(--sa-fr-ink);
	font-size: .8rem;
	font-weight: 600;
	line-height: 1.2;

	/* The theme uppercases and letter-spaces every button. */
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
}

.sa-fr .sa-fr__toggle[hidden] {
	display: none;
}

.sa-fr .sa-fr__toggle:hover,
.sa-fr .sa-fr__toggle:focus {
	background: #f7f8fb;
	color: var(--sa-fr-navy);
	border-color: #cfd5e2;
}

.sa-fr .sa-fr__toggle:focus-visible {
	outline: 2px solid var(--sa-fr-navy);
	outline-offset: 2px;
}

/* Pause bars, drawn with borders so no icon font is needed. */
.sa-fr__toggle-icon {
	width: 8px;
	height: 10px;
	box-sizing: border-box;
	border-left: 3px solid currentColor;
	border-right: 3px solid currentColor;
}

/* Play triangle. */
.sa-fr--paused .sa-fr__toggle-icon {
	width: 0;
	height: 0;
	border-top: 5px solid transparent;
	border-bottom: 5px solid transparent;
	border-left: 8px solid currentColor;
	border-right: 0;
}

.sa-fr .sa-fr__link {
	font-size: .9rem;
	font-weight: 700;
	color: var(--sa-fr-navy);
	text-decoration: none;
}

.sa-fr .sa-fr__link:hover,
.sa-fr .sa-fr__link:focus {
	color: var(--ast-global-color-1, #da1e40);
	text-decoration: underline;
	text-underline-offset: 3px;
}

@media (max-width: 640px) {
	.sa-fr {
		--sa-fr-gap: 16px;
		padding-block: 0 48px;
	}

	.sa-fr__stats {
		gap: 10px 36px;
	}

	.sa-fr__figure {
		padding: 20px 20px 18px;
	}
}

/* No motion for visitors who have asked for less of it. The script never
   starts the animation for them; the row stays a swipeable scroller. */
@media (prefers-reduced-motion: reduce) {
	.sa-fr .sa-fr__toggle {
		display: none;
	}
}
