/*
 * Testimonials (front end).
 *
 * The composition from docs/design/testimonials/variant-a.html, rebuilt with
 * the review corrections and then the owner's second pass: the sage slab and the
 * section head are gone (the cards sit straight on the page), the cards carry no
 * shadow, and the centred card is level and lifted while its two neighbours tilt
 * outwards like a hand of cards. Still no fade over the quote (a 6-line clamp
 * plus a "Read full review" control that appears only when the text is actually
 * cut), cards share the tallest height with the foot pinned to the bottom, and
 * the photo stories keep their scrim but lose stars, quote and read-more.
 *
 * Tokens copied from assets/css/membership-plans.css and the child theme:
 * cream #F7EEDD, paper #FBF7EC, olive #A2AA68, green #30442C, and the three
 * brand families (Arapey display, Radio Canada body, Montserrat UI). Olive
 * #A2AA68 is never a text colour (2.3:1): text olive is #4F5A31 (6.4:1 on
 * cream), the quote is #46543F (7.5:1 on paper) and stars use #78833E,
 * graphics only. With no panel fill the card edge is a hairline
 * rgba(#30442C, .16): paper on cream is only 1.07:1, so the border is what
 * makes the shape read, not a shadow.
 *
 * Scoped to .wn-testi. No build step, no icon font, no !important.
 * Loaded only on a page whose content carries [wn_testimonials].
 */

.wn-testi {
	--wn-display: "Arapey", Georgia, "Times New Roman", serif;
	--wn-sans: "Radio Canada", system-ui, -apple-system, "Segoe UI", sans-serif;
	--wn-ui: "Montserrat", system-ui, sans-serif;

	--wn-paper: #FBF7EC;
	--wn-green: #30442C;
	--wn-ink: #FCF8EC;
	--wn-olive-ink: #4F5A31;
	--wn-star: #78833E;
	--wn-quote: #46543F;

	--wn-gap: 14px;
	--wn-lines: 6;
	--wn-radius: 24px;
	/* Horizontal room the viewport clips outside the card edge. It stays at
	   zero until the fan starts: a tilted card hangs ~12px past its layout
	   box, and a padded viewport clips at its padding box, so this is the
	   only place that room can come from without the next card peeking. */
	--wn-bleed: 0px;
	/* The fan, measured in the reference: neighbours out by under 5deg, a
	   little smaller and lower, the centred card level and lifted. Rotation
	   is on the card as a whole and never on the type. */
	--wn-tilt: 4deg;
	--wn-sink: 10px;
	--wn-lift: 14px;
	--wn-shrink: 0.97;

	position: relative;
	width: 100%;
	max-width: 100%;
	overflow-x: clip;
	padding: clamp(20px, 4vw, 58px) clamp(10px, 4vw, 48px);
	color: var(--wn-green);
	font-family: var(--wn-sans);
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

.wn-testi,
.wn-testi *,
.wn-testi *::before,
.wn-testi *::after {
	box-sizing: border-box;
}

.wn-testi :focus-visible {
	outline: 2px solid var(--wn-olive-ink);
	outline-offset: 3px;
}

/* Screen-reader-only text (the read-more's member name, the live status). */
.wn-testi .wn-testi__vh,
.wn-testi .wn-testi__status {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* The shared star/chevron sprite: rendered, never laid out. */
.wn-testi .wn-testi__sprite {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

/* --------------------------------------------------------------------------
   Frame
   The sage slab and the head are gone: the cards sit on the page itself, so the
   wrapper only carries the measure. No fill, no radius, no shadow, and no
   clipping either - the fan's rotated corners need the room.
   -------------------------------------------------------------------------- */

.wn-testi .wn-testi__panel {
	position: relative;
	max-width: 1240px;
	margin: 0 auto;
	padding: clamp(10px, 1.4vw, 20px) 0 clamp(8px, 1.2vw, 16px);
}

/* --------------------------------------------------------------------------
   Carousel
   The viewport is a plain horizontal scroller until the script marks the
   section data-live: without JS the first page still reads and the rest stays
   reachable by scrolling. Once live, the track is translated and the viewport
   clips exactly one page, so no neighbour peeks.
   -------------------------------------------------------------------------- */

.wn-testi .wn-testi__carousel {
	position: relative;
	/* The head is gone from the markup; this keeps the old spacing on a page
	   that still renders one. */
	margin-top: clamp(24px, 3vw, 44px);
	/* Horizontal inset lives here, not on the viewport: a padded viewport
	   clips at its padding box, which let the next card peek through the
	   inset on desktop. */
	padding: 0 clamp(16px, 4vw, 48px);
}

/* With the head removed the carousel is the panel's first child: no dead gap. */
.wn-testi .wn-testi__panel > .wn-testi__carousel:first-child {
	margin-top: 0;
}

.wn-testi .wn-testi__viewport {
	/* Vertical room, not layout: a fanned card hangs past its own box top and
	   bottom, and the clip is the padding box. The inline bleed buys the same
	   room sideways without moving the cards - and it never exceeds one gap,
	   so the next card still cannot show. */
	margin: 0 calc(-1 * var(--wn-bleed));
	padding: clamp(12px, 1.6vw, 24px) var(--wn-bleed);
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: none;
	-ms-overflow-style: none;
	-webkit-overflow-scrolling: touch;
}

.wn-testi .wn-testi__viewport::-webkit-scrollbar {
	display: none;
}

.wn-testi .wn-testi__carousel[data-live="1"] .wn-testi__viewport {
	overflow: hidden;
}

.wn-testi .wn-testi__track {
	display: flex;
	align-items: stretch;
	gap: var(--wn-gap);
	margin: 0;
	padding: 0;
	list-style: none;
	transform: translate3d(0, 0, 0);
	transition: transform 0.62s cubic-bezier(0.22, 0.61, 0.36, 1);
	will-change: transform;
}

/* One card per view below 1080px: no slice of the next card at the edge. */
.wn-testi .wn-testi__card {
	position: relative;
	display: flex;
	flex: 0 0 100%;
	flex-direction: column;
	gap: 14px;
	min-width: 0;
	min-height: 300px;
	padding: 22px 20px 18px;
	background: var(--wn-paper);
	/* No shadow, by request: paper on cream is a 1.03:1 step, so the hairline
	   is what draws the shape. .16 keeps it visible without turning into a
	   second frame. */
	border: 1px solid rgba(48, 68, 44, 0.16);
	border-radius: var(--wn-radius);
	transform-origin: 50% 50%;
	transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* No hover state on the card: the lift belongs to the centred card, and a
   second moving state on hover would fight it. */

/* --------------------------------------------------------------------------
   Quote card
   Every card in a page shares the tallest height (flex stretch), the quote
   takes the free space and the foot holds the baseline with margin-top: auto.
   A short quote therefore leaves air above the author row, never a dead block
   below it.
   -------------------------------------------------------------------------- */

.wn-testi .wn-testi__top {
	display: flex;
	align-items: center;
	gap: 11px;
	min-width: 0;
}

.wn-testi .wn-testi__avatar {
	display: grid;
	flex: none;
	place-items: center;
	width: 42px;
	height: 42px;
	background: #E4E3C7;
	border: 1px solid rgba(48, 68, 44, 0.09);
	border-radius: 50%;
	color: var(--wn-olive-ink);
	font-family: var(--wn-ui);
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0.05em;
}

.wn-testi .wn-testi__avatar--photo {
	object-fit: cover;
}

.wn-testi .wn-testi__name {
	overflow: hidden;
	color: var(--wn-green);
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.3;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wn-testi .wn-testi__quote {
	flex: 1 1 auto;
	min-height: 0;
}

/* Six lines, then the browser's own ellipsis. No gradient overlay: a fade over
   a single line reads as a smudge, and the control below says what it does. */
.wn-testi .wn-testi__quote p {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: var(--wn-quote);
	font-size: 15.5px;
	line-height: 1.55;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--wn-lines);
	line-clamp: var(--wn-lines);
	text-wrap: pretty;
}

.wn-testi .wn-testi__more {
	align-self: flex-start;
	min-height: 32px;
	margin-top: -4px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
	color: var(--wn-olive-ink);
	font-family: var(--wn-ui);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.wn-testi .wn-testi__more[hidden] {
	display: none;
}

/* Astra and Elementor style `button:hover` and `button:focus` with the kit
   colours at 0,2,1 - one step above the 0,2,0 reset above - so this link filled
   with dark brown on hover, and again after the dialog closed when focus
   returned here. The owner wants no hover styling at all ("mending tidak ada
   saja"), so every state is pinned to the resting look, colour included; the
   extra class wins the state and focus is left to the outline. */
.wn-testi .wn-testi__more:hover,
.wn-testi .wn-testi__more:active,
.wn-testi .wn-testi__more:focus {
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--wn-olive-ink);
}

.wn-testi .wn-testi__foot {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	margin-top: auto;
}

.wn-testi .wn-testi__pill {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 30px;
	padding: 0 12px;
	background: rgba(162, 170, 104, 0.2);
	border-radius: 999px;
	color: var(--wn-olive-ink);
	font-family: var(--wn-ui);
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.05em;
	white-space: nowrap;
}

/* `display: inline-flex` above outranks the UA `[hidden] { display: none }`, so
   an empty tag pill in the dialog still took its 30px row plus the 8px column
   gap and pushed the name above the avatar's middle. Owner report. */
.wn-testi .wn-testi__pill[hidden] {
	display: none;
}

.wn-testi .wn-testi__stars {
	display: inline-flex;
	align-items: center;
	gap: 1.5px;
}

.wn-testi .wn-testi__star {
	display: block;
	flex: none;
	width: 11px;
	height: 11px;
	fill: var(--wn-star);
}

.wn-testi .wn-testi__star--off {
	opacity: 0.3;
}

.wn-testi .wn-testi__value {
	font-variant-numeric: tabular-nums;
}

.wn-testi .wn-testi__glyph {
	color: rgba(162, 170, 104, 0.55);
	font-family: var(--wn-display);
	font-size: 46px;
	line-height: 0.62;
	transform: translateY(7px);
	user-select: none;
}

/* --------------------------------------------------------------------------
   Photo story
   Full-bleed portrait under a bottom scrim. The scrim is the only reason the
   name is readable over a photo: #30442C runs 0.88 at the text baseline, so
   #FCF8EC keeps more than 4.5:1 even over a white frame. The tag pill sits on
   paper, so it does not depend on the photo at all.
   -------------------------------------------------------------------------- */

.wn-testi .wn-testi__card--photo {
	display: block;
	padding: 0;
	overflow: hidden;
	border-color: rgba(48, 68, 44, 0.16);
}

.wn-testi .wn-testi__shot {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 30%;
}

.wn-testi .wn-testi__shot--empty {
	display: grid;
	place-items: center;
	background: #DFDBBF;
}

.wn-testi .wn-testi__shot-initials {
	display: grid;
	place-items: center;
	width: 96px;
	height: 96px;
	background: rgba(251, 247, 236, 0.6);
	border: 1px solid rgba(48, 68, 44, 0.1);
	border-radius: 50%;
	color: var(--wn-green);
	font-family: var(--wn-ui);
	font-size: 30px;
	font-weight: 600;
	letter-spacing: 0.06em;
}

.wn-testi .wn-testi__shot-foot {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	/* The extra top padding is fade room, not layout: the scrim must still be
	   ~0.85 opaque where the name sits, so the gradient has to reach zero
	   above the text instead of inside it. */
	padding: 64px 18px 18px;
	/* The scrim lives on ::before, not here: Elementor prints
	   `.e-con ... * { background-image: none !important }` for its lazy
	   containers and silently removed the gradient on the home page. A
	   pseudo-element is not matched by `*`, and isolation keeps the scrim
	   above the photo while the name and pill stay above it. */
	isolation: isolate;
}

.wn-testi .wn-testi__shot-foot::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image: linear-gradient(
		to top,
		rgba(48, 68, 44, 0.94) 0%,
		rgba(48, 68, 44, 0.84) 62%,
		rgba(48, 68, 44, 0) 100%
	);
	pointer-events: none;
}

.wn-testi .wn-testi__shot-name {
	color: var(--wn-ink);
	font-family: var(--wn-display);
	font-size: 21px;
	line-height: 1.1;
}

.wn-testi .wn-testi__pill--tag {
	background: var(--wn-paper);
	color: var(--wn-green);
}

/* --------------------------------------------------------------------------
   Controls
   Arrows are 44x44, dots are 40x40 targets around a 7px mark. Hidden until
   the script is running: without JS the row is a plain scroller and dead
   controls would only mislead.
   -------------------------------------------------------------------------- */

.wn-testi .wn-testi__controls {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: clamp(8px, 1.4vw, 18px) 24px 0;
}

.wn-testi .wn-testi__carousel[data-live="1"] .wn-testi__controls {
	display: flex;
}

.wn-testi .wn-testi__arrow {
	display: grid;
	flex: none;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	background: transparent;
	border: 1px solid rgba(48, 68, 44, 0.22);
	border-radius: 50%;
	/* Same leak as the dots: Astra/Elementor give every `button` a 0/1/2px
	   shadow and a native face. The ring above is the whole look. */
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
	color: var(--wn-green);
	cursor: pointer;
	transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.wn-testi .wn-testi__arrow svg {
	width: 16px;
	height: 16px;
}

.wn-testi .wn-testi__arrow--flip {
	transform: rotate(180deg);
}

/* Same collision as the dots below: the kit's `button:hover` / `button:focus`
   rules (0,2,1) would paint an arrow in its dark brown - on focus after a click,
   and on hover when the arrow is disabled and cannot take the brand fill. Both
   states keep the plain brand ring; this rule sits below the hover fill's
   specificity on purpose, so hovering an enabled arrow still fills it. */
.wn-testi .wn-testi__arrow:focus,
.wn-testi .wn-testi__arrow[disabled]:hover {
	background: transparent;
	border-color: rgba(48, 68, 44, 0.22);
	color: var(--wn-green);
}

.wn-testi .wn-testi__arrow:hover:not([disabled]) {
	background: var(--wn-green);
	border-color: var(--wn-green);
	color: var(--wn-ink);
}

.wn-testi .wn-testi__arrow[disabled] {
	opacity: 0.32;
	cursor: default;
}

.wn-testi .wn-testi__dots {
	display: flex;
	align-items: center;
}

.wn-testi .wn-testi__dot {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
	color: var(--wn-green);
	cursor: pointer;
}

/* Astra and Elementor both style `button` with a radius and a 0/1/2px shadow,
   and their `button:hover` / `button:focus` rules carry the kit's dark brown at
   0,2,1 - one class step above the 0,2,0 reset above. That is the square the owner
   saw: hovering a dot, or focusing it with a click, filled its 40x40 target.
   The extra `.wn-testi__dots` step wins the state back in every case, and the
   dot stays flat: no fill, no border, no shadow, nothing on hover. Focus is
   still perceivable, but only through the outline below. */
.wn-testi .wn-testi__dots .wn-testi__dot,
.wn-testi .wn-testi__dots .wn-testi__dot:hover,
.wn-testi .wn-testi__dots .wn-testi__dot:active,
.wn-testi .wn-testi__dots .wn-testi__dot:focus {
	background-color: transparent;
	background-image: none;
	border: 0;
	box-shadow: none;
	color: var(--wn-green);
}

.wn-testi .wn-testi__dots .wn-testi__dot:focus-visible {
	outline: 2px solid var(--wn-olive-ink);
	outline-offset: 2px;
}

.wn-testi .wn-testi__dot i {
	display: block;
	width: 7px;
	height: 7px;
	background: rgba(48, 68, 44, 0.32);
	border-radius: 999px;
	transition: width 0.3s ease, background 0.3s ease;
}

.wn-testi .wn-testi__dot[aria-current="true"] i {
	width: 24px;
	background: var(--wn-green);
}

/* --------------------------------------------------------------------------
   Read-more dialog
   Native <dialog>: Esc and the focus return come from the platform; the
   script adds the backdrop click and the close button.
   -------------------------------------------------------------------------- */

.wn-testi .wn-testi__dialog {
	width: min(560px, calc(100vw - 32px));
	max-width: none;
	max-height: calc(100vh - 32px);
	margin: auto;
	padding: 0;
	background: transparent;
	border: 0;
	color: var(--wn-green);
}

.wn-testi .wn-testi__dialog::backdrop {
	background: rgba(48, 68, 44, 0.55);
}

.wn-testi .wn-testi__dialog-body {
	position: relative;
	max-height: calc(100vh - 48px);
	padding: clamp(22px, 4vw, 34px);
	overflow-y: auto;
	background: var(--wn-paper);
	border-radius: 22px;
	box-shadow: 0 40px 80px -40px rgba(48, 68, 44, 0.6);
}

.wn-testi .wn-testi__dialog-close {
	position: absolute;
	top: 10px;
	right: 10px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	background: rgba(48, 68, 44, 0.06);
	border: 0;
	border-radius: 50%;
	color: var(--wn-green);
	cursor: pointer;
}

.wn-testi .wn-testi__dialog-close:hover {
	background: rgba(48, 68, 44, 0.12);
}

.wn-testi .wn-testi__dialog-close svg {
	width: 18px;
	height: 18px;
}

.wn-testi .wn-testi__dialog-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-right: 44px;
}

.wn-testi .wn-testi__dialog-avatar {
	display: flex;
	flex: none;
}

.wn-testi .wn-testi__dialog-meta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	min-width: 0;
}

.wn-testi .wn-testi__dialog-meta .wn-testi__name {
	overflow: visible;
	font-size: 17px;
	white-space: normal;
}

.wn-testi .wn-testi__dialog-rating {
	display: flex;
	align-items: center;
	margin-top: 18px;
}

.wn-testi .wn-testi__dialog-rating .wn-testi__pill {
	min-height: 34px;
	padding: 0 14px;
	font-size: 12px;
}

.wn-testi .wn-testi__dialog-rating .wn-testi__star {
	width: 13px;
	height: 13px;
}

.wn-testi .wn-testi__dialog-quote {
	margin: 16px 0 0;
	padding: 0;
	border: 0;
	color: var(--wn-quote);
	font-family: var(--wn-sans);
	font-size: 15.5px;
	font-style: normal;
	line-height: 1.65;
	overflow-wrap: anywhere;
	text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   Three cards per page from 1080px, and the fan. The step is measured in the
   script, so the gap can stay a token.

   The script marks the centred card `--active`, the one to its left `--prev`
   and the one to its right `--next`, so the pattern always follows the page you
   are on rather than the card's position in the list. Below 1080 there is one
   card per view and nothing to fan, so none of this applies.
   -------------------------------------------------------------------------- */

@media (min-width: 1080px) {
	.wn-testi {
		--wn-gap: 26px;
		/* Two pixels short of the gap: the clip edge then lands 2px clear of the
		   neighbouring card, which absorbs the subpixel rounding that would
		   otherwise leave a hairline sliver of the next page in view. */
		--wn-bleed: calc(var(--wn-gap) - 2px);
	}

	.wn-testi .wn-testi__card {
		flex: 0 0 calc((100% - (var(--wn-gap) * 2)) / 3);
		padding: 22px 22px 18px;
	}

	/* A fanned card hangs up to ~21px past its own box (a 356x330 card at 4deg,
	   sunk 10 and shrunk 3%); 26px keeps the corners clear of the clip on every
	   page, whatever the quote length does to the shared height. */
	.wn-testi .wn-testi__viewport {
		padding-block: 26px;
	}

	.wn-testi .wn-testi__quote p {
		font-size: 15.5px;
	}

	/* Level, a lift instead of a shadow, and stacked above the neighbours so
	   its hairline is never cut by the tilted card next to it. */
	.wn-testi .wn-testi__card--active {
		transform: translateY(calc(-1 * var(--wn-lift)));
		z-index: 2;
	}

	/* Neighbours lean away from the centre, sit a little lower and a shade
	   smaller, which is what makes the group read as a hand of cards rather
	   than a broken grid. The rotation is on the card as a whole, capped well
	   under 5deg, so the type only tilts with its card. */
	.wn-testi .wn-testi__card--prev {
		transform: translateY(var(--wn-sink)) rotate(calc(-1 * var(--wn-tilt))) scale(var(--wn-shrink));
		z-index: 1;
	}

	.wn-testi .wn-testi__card--next {
		transform: translateY(var(--wn-sink)) rotate(var(--wn-tilt)) scale(var(--wn-shrink));
		z-index: 1;
	}
}

/* --------------------------------------------------------------------------
   Phone: one card per view, tighter insets, five dots still fit beside the
   arrows (5 x 40 + 2 x 44 + gaps = 300px inside 390). No fan and no bleed:
   with one card there is no neighbour to lean against, and no tilt means no
   corner hanging outside the clip.
   -------------------------------------------------------------------------- */

@media (max-width: 680px) {
	.wn-testi {
		--wn-radius: 20px;
		padding: 16px 10px 24px;
	}

	.wn-testi .wn-testi__panel {
		padding: 8px 0 6px;
	}

	.wn-testi .wn-testi__carousel {
		padding: 0 14px;
	}

	.wn-testi .wn-testi__card {
		min-height: 280px;
		padding: 20px 18px 16px;
	}

	.wn-testi .wn-testi__quote p {
		font-size: 15px;
	}

	.wn-testi .wn-testi__controls {
		gap: 2px;
		padding: 14px 8px 0;
	}

	.wn-testi .wn-testi__dot {
		width: 40px;
	}

	.wn-testi .wn-testi__dot i {
		width: 6px;
		height: 6px;
	}

	.wn-testi .wn-testi__dot[aria-current="true"] i {
		width: 18px;
	}

	.wn-testi .wn-testi__dialog {
		width: calc(100vw - 20px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.wn-testi .wn-testi__track,
	.wn-testi .wn-testi__card,
	.wn-testi .wn-testi__arrow,
	.wn-testi .wn-testi__dot i {
		transition: none;
	}
}
