/**
 * RSI Toolkit — Testimonials Slider widget.
 *
 * Baked to the 2026 Figma "Words that inspire us" section: heading, a slide of
 * media (square, optional video) + Roboto quote + name/role, with dots + arrow
 * controls.
 *
 * ── Crossfade, not a sliding track ──────────────────────────────────────────
 * Every slide sits in the SAME grid cell and only .is-active is shown. The old
 * version translated a flex row by -100% per slide; in Arabic the row runs
 * right-to-left, so that moved the quotes out of view and left a blank white
 * frame (measured 0% of any slide visible after one "next"). Stacking has no
 * direction, and the cell is as tall as the tallest slide, so switching never
 * makes the section jump in height.
 */

.rsi-tst {
	/* Background + padding come from the Elementor container, not the widget. */
}

.rsi-tst__inner {
	max-width: 1200px;
	margin: 0 auto;
}

.rsi-tst__heading {
	font-family: 'Alexandria', sans-serif;
	font-weight: 700;
	font-size: 34px;
	line-height: 41px;
	color: #0a0a0a;
	margin: 0 0 32px;
}

.rsi-tst__viewport {
	overflow: hidden;
}

.rsi-tst__track {
	display: grid;
	touch-action: pan-y; /* vertical page scroll stays native; JS reads sideways swipes */
}

.rsi-tst__slide {
	grid-area: 1 / 1;
	display: flex;
	flex-direction: row;
	gap: 80px;
	align-items: center;
	opacity: 0;
	visibility: hidden;
	/* visibility waits for the fade-out to finish before hiding. */
	transition: opacity .8s ease, visibility 0s linear .8s;
}

.rsi-tst__slide.is-active {
	z-index: 1;
	opacity: 1;
	visibility: visible;
	transition: opacity .8s ease, visibility 0s;
}

/* The photograph settles from a slight zoom as its slide comes in. */
.rsi-tst__slide .rsi-tst__media img {
	transform: scale(1.08);
	transition: transform 1.6s cubic-bezier(.22, .61, .36, 1), filter .3s ease;
}

.rsi-tst__slide.is-active .rsi-tst__media img {
	transform: scale(1);
}

/* The quote, then the name, rise into place a beat after the photo. */
.rsi-tst__slide .rsi-tst__quote,
.rsi-tst__slide .rsi-tst__who {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity .7s ease, transform .9s cubic-bezier(.22, .61, .36, 1);
}

.rsi-tst__slide.is-active .rsi-tst__quote {
	opacity: 1;
	transform: none;
	transition-delay: .2s;
}

.rsi-tst__slide.is-active .rsi-tst__who {
	opacity: 1;
	transform: none;
	transition-delay: .35s;
}

.rsi-tst__media {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
	height: 520px;
	border-radius: 8px;
	overflow: hidden;
	background: #eee;
}

.rsi-tst__content {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 32px;
	align-items: flex-start;
}

.rsi-tst__media--video {
	cursor: pointer;
}

.rsi-tst__media img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	display: block;
}

.rsi-tst__slide.is-active .rsi-tst__media--video:hover img {
	transform: scale(1.04);
	filter: brightness(.8);
}

.rsi-tst__play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.rsi-tst__play svg {
	width: 64px;
	height: 64px;
	filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .35));
}

.rsi-tst__play circle {
	fill: rgba(0, 0, 0, .45);
}

.rsi-tst__play path {
	fill: #fff;
}

.rsi-tst__quote {
	font-family: 'Roboto', sans-serif;
	font-weight: 700;
	font-size: 24px;
	line-height: 34px;
	color: #0a0a0a;
	margin: 0 0 32px;
	/* Kill Woodmart's default blockquote border / padding / quote mark. */
	border: 0 !important;
	padding: 0 !important;
	background: none !important;
	quotes: none;
}

.rsi-tst__quote::before,
.rsi-tst__quote::after {
	content: none !important;
	display: none !important;
}

.rsi-tst__name {
	font-family: 'Roboto', sans-serif;
	font-weight: 600;
	font-size: 16px;
	color: #0a0a0a;
}

.rsi-tst__role {
	font-family: 'Alexandria', sans-serif;
	font-weight: 500;
	font-size: 12px;
	letter-spacing: .4px;
	color: #5b5b5b;
	margin-top: 4px;
}

.rsi-tst__controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 48px;
}

.rsi-tst__dots {
	display: flex;
	align-items: center;
	gap: 8px;
}

.rsi-tst__dot {
	-webkit-appearance: none;
	appearance: none;
	flex: 0 0 auto;
	width: 8px !important;
	height: 8px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	line-height: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: #cfcfcf !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: width .2s, background .2s;
}

.rsi-tst__dot.is-active {
	width: 28px !important;
	height: 8px !important;
	border-radius: 4px !important;
	background: #bf0031 !important;
}

.rsi-tst__arrows {
	display: flex;
	gap: 16px;
}

.rsi-tst__arrow {
	-webkit-appearance: none;
	appearance: none;
	width: 56px;
	height: 56px;
	min-height: 0;
	padding: 0 !important;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #0a0a0a !important;
	border-radius: 50% !important;
	background: #fff !important;
	color: #0a0a0a;
	box-shadow: none !important;
	cursor: pointer;
	transition: border-color .2s, color .2s, background .2s;
}

.rsi-tst__arrow:hover {
	background: #0a0a0a !important;
	color: #fff;
}

.rsi-tst__arrow svg {
	width: 22px;
	height: 22px;
	display: block;
}

/*
 * Arabic: the arrows row mirrors, so "previous" sits on the RIGHT — but the
 * chevrons are drawn for English and kept pointing left/right respectively,
 * i.e. inwards at each other. Flip them so each points the way it goes.
 * Same technique as .rsi-galaxy__arrow.
 */
[dir="rtl"] .rsi-tst__arrow svg {
	transform: scaleX(-1);
}

/* -------- Lightbox -------- */
.rsi-tst__lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
}

.rsi-tst__lightbox.is-open {
	display: flex;
}

.rsi-tst__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .85);
}

.rsi-tst__dialog {
	position: relative;
	width: min(1100px, 92vw);
	aspect-ratio: 16 / 9;
	z-index: 1;
}

.rsi-tst__frame,
.rsi-tst__frame iframe {
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: 8px;
	display: block;
	background: #000;
}

.rsi-tst__close {
	position: absolute;
	top: -44px;
	right: 0;
	width: 36px;
	height: 36px;
	background: none;
	border: 0;
	color: #fff;
	font-size: 34px;
	line-height: 1;
	cursor: pointer;
}

@media (max-width: 1024px) {
	.rsi-tst__slide {
		flex-direction: column;
		gap: 40px;
		align-items: stretch;
	}

	.rsi-tst__media {
		flex: none;
		width: 100%;
		height: 360px;
	}
}

@media (max-width: 767px) {
	.rsi-tst__media {
		height: 250px;
	}

	.rsi-tst__quote {
		font-size: 22px;
		line-height: 32px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rsi-tst__slide,
	.rsi-tst__slide.is-active,
	.rsi-tst__slide .rsi-tst__media img,
	.rsi-tst__slide .rsi-tst__quote,
	.rsi-tst__slide .rsi-tst__who {
		transition: none;
		transform: none;
	}
}
