/**
 * Armeria 3S Marketing — reviews blocks and badges ([a3s_reviews], [a3s_reviews_badge], theme destinations).
 * Only --a3s-* tokens with fallbacks (SPEC-v1.1 §1.9).
 */

.a3s-reviews,
.a3s-rbadge {
	--a3s-star-on: var(--a3s-color-accent, #f2a900);
	--a3s-star-off: var(--a3s-color-border, #d9d9d9);
	font-family: var(--a3s-font-body, inherit);
	color: var(--a3s-color-text, #333);
}

.a3s-reviews .a3s-sr-only,
.a3s-rbadge .a3s-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Stars: fractional fill through --a3s-stars-pct (set inline per item). */
.a3s-stars {
	position: relative;
	display: inline-block;
	flex: 0 0 auto;
	font-size: 1em;
	line-height: 1;
	letter-spacing: 0.08em;
	white-space: nowrap;
	color: var(--a3s-star-off, #d9d9d9);
}

.a3s-stars::before {
	content: "\2605\2605\2605\2605\2605";
}

.a3s-stars::after {
	content: "\2605\2605\2605\2605\2605";
	position: absolute;
	inset: 0 auto 0 0;
	width: var(--a3s-stars-pct, 0%);
	overflow: hidden;
	color: var(--a3s-star-on, #f2a900);
}

/* ------------------------------------------------------------------ Badge */

.a3s-rbadge {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 0.75rem;
	max-width: 100%;
	font-size: 0.875rem;
	line-height: 1.3;
}

.a3s-rbadge__link {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 0.5rem;
	min-height: 44px;
	color: inherit;
	text-decoration: none;
}

.a3s-rbadge > .a3s-stars,
.a3s-rbadge > .a3s-rbadge__logo {
	align-self: center;
}

.a3s-rbadge__link:hover .a3s-rbadge__count,
.a3s-rbadge__link:focus-visible .a3s-rbadge__count {
	text-decoration: underline;
}

.a3s-rbadge__link:focus-visible,
.a3s-reviews a:focus-visible,
.a3s-rbadge a:focus-visible,
.a3s-reviews__btn:focus-visible,
.a3s-reviews__track:focus-visible {
	outline: 2px solid var(--a3s-color-primary, #e95e1b);
	outline-offset: 2px;
}

.a3s-rbadge__logo {
	font-weight: 700;
	color: var(--a3s-color-heading, #1a1a1a);
}

.a3s-rbadge__score {
	font-weight: 700;
	color: var(--a3s-color-heading, #1a1a1a);
}

.a3s-rbadge__count {
	color: var(--a3s-color-muted, #666);
}

.a3s-rbadge__trustbox {
	min-width: 0;
}

/* "Leave a review" link of the Google badge. */
.a3s-rbadge__cta {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 0.875rem;
	border: 1px solid var(--a3s-color-border, #d9d9d9);
	border-radius: var(--a3s-radius, 4px);
	color: var(--a3s-color-heading, #1a1a1a);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.a3s-rbadge__cta:hover {
	border-color: currentColor;
	text-decoration: underline;
}

.a3s-rbadge .a3s-reviews__transparency {
	margin: 0;
	font-size: 0.75rem;
}

/* Theme top bar: compact, inherits the bar colours. */
.a3s-rbadge--topbar,
.a3s-rbadge--topbar-mobile {
	flex-wrap: nowrap;
	font-size: 0.8125rem;
	color: inherit;
}

.a3s-rbadge--topbar .a3s-rbadge__logo,
.a3s-rbadge--topbar .a3s-rbadge__score,
.a3s-rbadge--topbar .a3s-rbadge__count,
.a3s-rbadge--topbar-mobile .a3s-rbadge__logo,
.a3s-rbadge--topbar-mobile .a3s-rbadge__score,
.a3s-rbadge--topbar-mobile .a3s-rbadge__count {
	color: inherit;
}

.a3s-rbadge--topbar .a3s-rbadge__link,
.a3s-rbadge--topbar-mobile .a3s-rbadge__link {
	flex-wrap: nowrap;
	min-height: 0;
	padding-block: 0.25rem;
}

.a3s-rbadge--topbar .a3s-reviews__transparency,
.a3s-rbadge--topbar-mobile .a3s-reviews__transparency {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: inherit; /* muted grey is unreadable on the charcoal bar */
	opacity: 0.85;
}

.a3s-rbadge--topbar .a3s-reviews__transparency a,
.a3s-rbadge--topbar-mobile .a3s-reviews__transparency a {
	color: inherit;
}

.a3s-rbadge--topbar-mobile {
	font-size: 0.75rem;
	gap: 0.5rem;
}

/* Keep the source label (Google/Trustpilot) visible; drop the count only on very narrow screens. */
@media (max-width: 359px) {
	.a3s-rbadge--topbar-mobile .a3s-rbadge__count {
		display: none;
	}
}

/* ------------------------------------------------------------------ Reviews block */

/*
 * Local tokens of the cards (templates and the dark-background scheme only change these).
 * Radius: three times the theme's large radius, never below 12px (rounded cards asked by the client).
 */
.a3s-reviews {
	--a3s-rv-radius: max(12px, calc(var(--a3s-radius-lg, 4px) * 3));
	--a3s-rv-pad: clamp(1.125rem, 1rem + 0.5vw, 1.5rem);
	--a3s-rv-gap: 1rem;
	--a3s-rv-bg: var(--a3s-color-bg, #fff);
	--a3s-rv-fg: var(--a3s-color-text, #231f20);
	--a3s-rv-heading: var(--a3s-color-heading, #231f20);
	--a3s-rv-muted: var(--a3s-color-muted, #5f5859);
	--a3s-rv-link: var(--a3s-color-link-hover, #b84a0e);
	--a3s-rv-accent: var(--a3s-color-primary, #e95e1b);
	--a3s-rv-chip: var(--a3s-color-surface, #f3f2f0);
	--a3s-rv-line: rgba(35, 31, 32, 0.08);
	--a3s-rv-avatar-bg: #231f20; /* Logo charcoal. */
	--a3s-rv-avatar-fg: #fff;
	--a3s-rv-shadow: 0 0 0 1px var(--a3s-rv-line), 0 1px 2px rgba(35, 31, 32, 0.05), 0 14px 32px -20px rgba(35, 31, 32, 0.35);
	--a3s-rv-ease: cubic-bezier(0.23, 1, 0.32, 1);
	display: grid;
	gap: 1rem;
	min-width: 0;
}

/* Dark background (scheme="dark" / Elementor "Background: Dark"). */
.a3s-reviews--on-dark {
	--a3s-rv-bg: #2e292a;
	--a3s-rv-fg: #efeceb;
	--a3s-rv-heading: #fff;
	--a3s-rv-muted: #c9c2bf;
	--a3s-rv-link: #ff9a5c;
	--a3s-rv-chip: rgba(255, 255, 255, 0.08);
	--a3s-rv-line: rgba(255, 255, 255, 0.1);
	--a3s-rv-shadow: 0 0 0 1px var(--a3s-rv-line), 0 14px 32px -20px rgba(0, 0, 0, 0.7);
	color: var(--a3s-rv-fg);
}

.a3s-reviews--on-dark .a3s-rbadge,
.a3s-reviews--on-dark .a3s-rbadge__logo,
.a3s-reviews--on-dark .a3s-rbadge__score,
.a3s-reviews--on-dark .a3s-rbadge__cta {
	color: var(--a3s-rv-heading);
}

.a3s-reviews--on-dark .a3s-rbadge__count,
.a3s-reviews--on-dark .a3s-reviews__transparency {
	color: var(--a3s-rv-muted);
}

.a3s-reviews > .a3s-rbadge {
	justify-self: start;
}

/* Summary badge above the cards: same orange stars as the cards (the standalone badge keeps its own colour). */
.a3s-reviews .a3s-rbadge {
	--a3s-star-on: var(--a3s-rv-accent);
}

.a3s-reviews__track {
	display: grid;
	gap: var(--a3s-rv-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Grid: equal-height cards (rows stretch, the card is a flex column with the footer pushed down). */
.a3s-reviews--grid .a3s-reviews__track {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.a3s-reviews--list .a3s-reviews__track {
	grid-template-columns: minmax(0, 1fr);
}

/* Masonry: CSS columns, cards keep their natural height. */
.a3s-reviews--masonry .a3s-reviews__track {
	display: block;
	columns: 3 280px;
	column-gap: var(--a3s-rv-gap);
}

.a3s-reviews--masonry .a3s-review {
	margin-bottom: var(--a3s-rv-gap);
	break-inside: avoid;
}

/* Carousel: native scroll-snap (keyboard: focus the track, arrow keys scroll), buttons added by reviews.js. */
.a3s-reviews__viewport {
	position: relative;
	min-width: 0;
}

.a3s-reviews--carousel .a3s-reviews__track {
	display: flex;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 4px;
	scrollbar-width: thin;
	/* Room for the card shadows inside the scroller (the shadow reaches ~26px below a card). */
	margin: -6px -6px -22px;
	padding: 6px 6px 28px;
}

.a3s-reviews--carousel .a3s-review {
	flex: 0 0 min(85%, 340px);
	scroll-snap-align: start;
}

.a3s-reviews__nav {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-top: 0.5rem;
}

.a3s-reviews__nav[hidden] {
	display: none;
}

.a3s-reviews__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	font-size: 1.5rem;
	line-height: 1;
	color: var(--a3s-rv-heading);
	background: var(--a3s-rv-chip);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color 150ms ease, color 150ms ease, transform 160ms var(--a3s-rv-ease);
}

@media (hover: hover) and (pointer: fine) {
	.a3s-reviews__btn:hover:not(:disabled) {
		color: var(--a3s-color-primary-contrast, #231f20);
		background: var(--a3s-rv-accent);
	}
}

.a3s-reviews__btn:active:not(:disabled) {
	transform: scale(0.94);
}

.a3s-reviews__btn:disabled {
	opacity: 0.4;
	cursor: default;
}

/* ------------------------------------------------------------------ Card (default template) */

.a3s-review {
	/* Containing block of the screen-reader texts: without it they escape the carousel scroller and widen the page. */
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	min-width: 0;
	box-sizing: border-box;
	padding: var(--a3s-rv-pad);
	color: var(--a3s-rv-fg);
	background: var(--a3s-rv-bg);
	border-radius: var(--a3s-rv-radius);
	box-shadow: var(--a3s-rv-shadow);
}

.a3s-review__main {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 0.5rem;
	min-width: 0;
}

.a3s-review__stars {
	--a3s-star-on: var(--a3s-rv-accent);
	--a3s-star-off: var(--a3s-rv-line);
	font-size: 1.125rem;
	line-height: 1;
}

.a3s-reviews--on-dark .a3s-review__stars {
	--a3s-star-off: rgba(255, 255, 255, 0.22);
}

.a3s-review__title {
	margin: 0.125rem 0 0;
	font-family: var(--a3s-font-heading, inherit);
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--a3s-rv-heading);
	overflow-wrap: anywhere;
}

.a3s-review__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.375rem;
	min-width: 0;
}

.a3s-review__text {
	align-self: stretch;
	font-size: 0.9375rem;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.a3s-review__text p {
	margin: 0 0 0.5em;
}

.a3s-review__text p:last-child {
	margin-bottom: 0;
}

/* Clamp only when scripts run (reviews.js reveals "Continue reading"); without JS the whole text is shown. */
@media (scripting: enabled) {
	.a3s-review__body:not(.is-open) > .a3s-review__text {
		display: -webkit-box;
		overflow: hidden;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: var(--a3s-clamp, 5);
		line-clamp: var(--a3s-clamp, 5);
	}
}

.a3s-review__more {
	display: inline-flex;
	align-items: center;
	min-height: 24px;
	padding: 0;
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--a3s-rv-link);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	background: none;
	border: 0;
	cursor: pointer;
}

.a3s-review__more[hidden] {
	display: none;
}

.a3s-review__more:hover {
	text-decoration-thickness: 2px;
}

.a3s-review__foot {
	display: grid;
	justify-items: start;
	gap: 0.625rem;
	margin-top: auto;
}

.a3s-review__person {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	min-width: 0;
}

.a3s-review__avatar {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--a3s-rv-avatar-fg);
	background: var(--a3s-rv-avatar-bg);
	border-radius: 50%;
}

.a3s-reviews--on-dark .a3s-review__avatar {
	--a3s-rv-avatar-bg: var(--a3s-color-primary, #e95e1b);
	--a3s-rv-avatar-fg: #231f20;
}

.a3s-review__who {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.3;
}

.a3s-review__author {
	overflow: hidden;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--a3s-rv-heading);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.a3s-review__author a {
	color: inherit;
}

.a3s-review__date {
	font-size: 0.8125rem;
	color: var(--a3s-rv-muted);
}

.a3s-review__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.375rem 0.75rem;
	/* Same height with or without the "Read on …" link, so the author rows line up across a row of cards. */
	min-height: 1.75rem;
	font-size: 0.8125rem;
}

/* Source badge: small pill with a generic pictogram (no brand logos). */
.a3s-review__origin {
	display: inline-flex;
	align-items: center;
	gap: 0.3125rem;
	padding: 0.25rem 0.625rem 0.25rem 0.5rem;
	font-weight: 500;
	line-height: 1.2;
	color: var(--a3s-rv-heading);
	background: var(--a3s-rv-chip);
	border-radius: 999px;
	white-space: nowrap;
}

.a3s-review__icon {
	flex: 0 0 auto;
	width: 0.875rem;
	height: 0.875rem;
	color: var(--a3s-rv-muted);
}

.a3s-review__origin--trustpilot .a3s-review__icon {
	color: #00b67a;
}

.a3s-review__origin--google .a3s-review__icon,
.a3s-review__origin--store .a3s-review__icon {
	color: var(--a3s-rv-accent);
}

.a3s-review__link {
	display: inline-flex;
	align-items: center;
	min-height: 24px;
	color: var(--a3s-rv-link);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.a3s-review__link:hover {
	text-decoration-thickness: 2px;
}

.a3s-review__sample {
	padding: 0.125rem 0.5rem;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--a3s-rv-heading);
	background: var(--a3s-rv-chip);
	border: 1px dashed var(--a3s-rv-muted);
	border-radius: var(--a3s-radius, 4px);
}

.a3s-reviews .a3s-review__more:focus-visible,
.a3s-reviews .a3s-review__link:focus-visible {
	outline: 2px solid var(--a3s-rv-accent);
	outline-offset: 2px;
	border-radius: 2px;
}

.a3s-reviews__transparency {
	margin: 1rem 0 0;
	font-size: 0.8125rem;
	color: var(--a3s-color-muted, #666);
}

.a3s-reviews__transparency a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.a3s-reviews__empty {
	padding: 1rem;
	border: 1px dashed var(--a3s-color-border, #d9d9d9);
	border-radius: 8px;
}

/* ------------------------------------------------------------------ Footer band (theme destination) */

.a3s-reviews-band {
	padding-block: clamp(1.5rem, 4vw, 3rem);
	background: var(--a3s-color-surface, #f5f5f5);
	border-top: 1px solid var(--a3s-color-border, #d9d9d9);
}

.a3s-reviews-band__inner {
	display: grid;
	gap: 1.25rem;
	width: 100%;
	max-width: var(--a3s-container, 1320px);
	margin-inline: auto;
	padding-inline: var(--a3s-gutter, 16px);
	box-sizing: border-box;
}

.a3s-reviews-band__inner > .a3s-rbadge {
	justify-self: center;
}

@media (prefers-reduced-motion: reduce) {
	.a3s-reviews__btn {
		transition: none;
	}

	.a3s-reviews--carousel .a3s-reviews__track {
		scroll-behavior: auto;
	}
}
