/**
 * Tavasanbar Video Testimonials
 *
 * Mobile-first. Logical properties (inline-start/end) are used throughout so
 * the layout works in RTL without a mirrored stylesheet.
 */

.tava-vt {
	--tava-vt-accent: #00d3f3;
	--tava-vt-gold: #fbbf24;
	--tava-vt-overlay: 0.95;
	--tava-vt-hover-lift: -8px;

	position: relative;
	overflow: hidden;
	background-color: #0f172a;
	padding: 56px 0;
}

.tava-vt *,
.tava-vt *::before,
.tava-vt *::after {
	box-sizing: border-box;
}

.tava-vt__container {
	max-width: 1280px;
	margin-inline: auto;
	padding-inline: 1.25rem;
}

/* Visually hidden but available to screen readers. Scoped so it works even
   if the theme does not define .screen-reader-text. */
.tava-vt .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ============================= Header ============================= */

.tava-vt__header {
	text-align: center;
	margin-bottom: 2rem;
}

.tava-vt__divider {
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 28rem;
	margin: 0 auto 1.25rem;
}

.tava-vt__divider::before,
.tava-vt__divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--tava-vt-accent) 50%, transparent), transparent);
}

.tava-vt__diamond {
	width: 12px;
	height: 12px;
	margin: 0 1rem;
	background: var(--tava-vt-accent);
	transform: rotate(45deg);
	box-shadow: 0 0 15px var(--tava-vt-accent);
}

.tava-vt__title {
	margin: 0 0 0.75rem;
	font-size: 1.55rem;
	font-weight: 900;
	line-height: 1.35;
	color: #fff;
}

/* Gradient text. -webkit-text-fill-color is what actually clips in Safari;
   `color: transparent` alone leaves the text invisible in some engines when
   background-clip is unsupported, so the fallback color stays declared first. */
.tava-vt--gradient-title .tava-vt__title {
	background: linear-gradient(135deg, #5ce1f5 0%, var(--tava-vt-accent) 50%, #00a8c4 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

@supports not ((background-clip: text) or (-webkit-background-clip: text)) {
	.tava-vt--gradient-title .tava-vt__title {
		background: none;
		-webkit-text-fill-color: currentColor;
	}
}

.tava-vt__subtitle {
	margin: 0;
	font-size: 0.9rem;
	color: rgba(255, 255, 255, 0.6);
}

/* ============================ Carousel ============================ */

.tava-vt__carousel-wrap {
	position: relative;
}

/* From desktop up the arrows get their own gutter outside the slides, so they
   never sit on top of a card's play button. Below that they overlay the edges,
   which is fine because they are hidden on mobile by default. */
@media (min-width: 1025px) {
	.tava-vt__carousel-wrap {
		padding-inline: 64px;
	}
}

/* Let cards breathe so the hover lift and focus ring are not clipped. */
.tava-vt__swiper {
	padding-block: 0.5rem;
}

/* Swiper sets its own display; this only matters before JS initialises. */
.tava-vt__swiper:not(.swiper-initialized) .swiper-wrapper {
	display: flex;
	gap: 1rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.tava-vt__swiper:not(.swiper-initialized) .swiper-wrapper::-webkit-scrollbar {
	display: none;
}

.tava-vt__swiper:not(.swiper-initialized) .tava-vt__slide {
	flex: 0 0 78%;
	scroll-snap-align: center;
}

/* ============================== Card ============================== */

.tava-vt__slide {
	height: auto;
}

.tava-vt__card {
	position: relative;
	overflow: hidden;
	width: 100%;
	/* aspect-ratio instead of a fixed height: the box is reserved before the
	   poster loads, so the carousel does not shift (CLS). */
	aspect-ratio: 9 / 16;
	border-radius: 24px;
	background-color: #000;
	transition: transform 0.3s ease, border-color 0.3s ease;
}

.tava-vt__card--playable {
	cursor: pointer;
}

@media (hover: hover) {
	.tava-vt__card--playable:hover {
		transform: translateY(var(--tava-vt-hover-lift));
		border-color: color-mix(in srgb, var(--tava-vt-accent) 40%, transparent);
	}
}

/* Keyboard focus must be clearly visible. */
.tava-vt__card--playable:focus-visible {
	outline: 3px solid var(--tava-vt-accent);
	outline-offset: 3px;
}

.tava-vt__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tava-vt__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, var(--tava-vt-overlay)) 0%,
		rgba(0, 10, 20, 0.3) 60%,
		rgba(0, 0, 0, 0.1) 100%
	);
	transition: opacity 0.25s ease;
}

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

.tava-vt__duration {
	position: absolute;
	top: 1rem;
	inset-inline-end: 1rem;
	z-index: 3;
	padding: 4px 10px;
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 0.85rem;
	font-weight: 700;
	transition: opacity 0.25s ease;
}

.tava-vt__play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 4rem;
	height: 4rem;
	margin: -2rem 0 0 -2rem;
	border-radius: 50%;
	background: color-mix(in srgb, var(--tava-vt-gold) 20%, transparent);
	animation: tava-vt-pulse 2s infinite;
	transition: opacity 0.25s ease;
}

.tava-vt__play svg {
	width: 2rem;
	height: 2rem;
	margin-inline-start: 3px;
	fill: var(--tava-vt-gold);
}

@keyframes tava-vt-pulse {
	0% {
		box-shadow: 0 0 0 0 color-mix(in srgb, var(--tava-vt-gold) 40%, transparent);
	}
	70% {
		box-shadow: 0 0 0 15px transparent;
	}
	100% {
		box-shadow: 0 0 0 0 transparent;
	}
}

.tava-vt__info {
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	z-index: 3;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 1.25rem;
	transition: opacity 0.25s ease;
}

.tava-vt__text {
	min-width: 0;
	text-align: start;
}

.tava-vt__name {
	margin: 0 0 0.25rem;
	font-size: 1.1rem;
	font-weight: 800;
	line-height: 1.4;
	color: #fff;
}

.tava-vt__project {
	margin: 0;
	font-size: 0.82rem;
	font-weight: 500;
	color: var(--tava-vt-gold);
}

.tava-vt__quote {
	margin: 0.5rem 0 0;
	font-size: 0.8rem;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.75);
	/* Keep long quotes from swallowing the card. */
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tava-vt__rating {
	display: flex;
	flex-shrink: 0;
	gap: 2px;
}

.tava-vt__rating svg {
	width: 11px;
	height: 11px;
	fill: var(--tava-vt-gold);
}

/* --------------------------- Playing state ------------------------ */

.tava-vt__video {
	position: absolute;
	inset: 0;
	z-index: 5;
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: #000;
	border: 0;
}

/* Hide the poster chrome while the video plays, but keep it in the layout so
   nothing reflows. visibility+opacity rather than display:none. */
.tava-vt__card.is-playing .tava-vt__overlay,
.tava-vt__card.is-playing .tava-vt__info,
.tava-vt__card.is-playing .tava-vt__play,
.tava-vt__card.is-playing .tava-vt__duration {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.tava-vt__card.is-loading .tava-vt__play {
	animation: none;
	opacity: 0.5;
}

/* =========================== Navigation =========================== */

.tava-vt__arrow {
	position: absolute;
	top: 50%;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin-top: -24px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.12);
	color: #fff;
	cursor: pointer;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	transition: background-color 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.tava-vt__arrow svg {
	width: 22px;
	height: 22px;
}

.tava-vt__arrow:hover {
	background-color: color-mix(in srgb, var(--tava-vt-accent) 85%, transparent);
	color: #04121f;
}

.tava-vt__arrow:focus-visible {
	outline: 3px solid var(--tava-vt-accent);
	outline-offset: 2px;
}

/* Disabled at the ends when loop is off. */
.tava-vt__arrow[disabled],
.tava-vt__arrow.is-disabled {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

.tava-vt__arrow--prev {
	inset-inline-start: -4px;
}

.tava-vt__arrow--next {
	inset-inline-end: -4px;
}

@media (min-width: 1025px) {
	.tava-vt__arrow--prev {
		inset-inline-start: 4px;
	}

	.tava-vt__arrow--next {
		inset-inline-end: 4px;
	}
}

.tava-vt--hide-arrows-mobile .tava-vt__arrow {
	display: none;
}

@media (min-width: 768px) {
	.tava-vt--hide-arrows-mobile .tava-vt__arrow {
		display: flex;
	}
}

/* =========================== Pagination =========================== */

.tava-vt__pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 1.25rem;
	/* Swiper writes inline positioning for its own layouts; we place it in flow. */
	position: static;
}

.tava-vt__pagination .swiper-pagination-bullet {
	width: 8px;
	height: 8px;
	margin: 0 !important;
	background: rgba(255, 255, 255, 0.3);
	opacity: 1;
	transition: width 0.25s ease, background-color 0.25s ease;
}

.tava-vt__pagination .swiper-pagination-bullet-active {
	width: 24px;
	border-radius: 4px;
	background: var(--tava-vt-accent);
}

.tava-vt__pagination .swiper-pagination-bullet:focus-visible {
	outline: 2px solid var(--tava-vt-accent);
	outline-offset: 2px;
}

/* =========================== Swipe hint =========================== */

.tava-vt__swipe-hint {
	position: absolute;
	bottom: 12%;
	left: 50%;
	z-index: 20;
	display: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin-left: -20px;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	opacity: 0;
	pointer-events: none;
	-webkit-backdrop-filter: blur(5px);
	backdrop-filter: blur(5px);
}

.tava-vt__swipe-hint svg {
	width: 24px;
	height: 24px;
	fill: #fff;
}

/* Only runs on touch-ish viewports, and only once JS adds .is-visible. */
@media (max-width: 1024px) {
	.tava-vt__swipe-hint {
		display: flex;
	}

	.tava-vt__swipe-hint.is-visible {
		animation: tava-vt-swipe 2.5s ease-in-out 2;
	}
}

@keyframes tava-vt-swipe {
	0% {
		opacity: 0;
		transform: translateX(40px);
	}
	20% {
		opacity: 1;
		transform: translateX(40px);
	}
	60% {
		opacity: 1;
		transform: translateX(-40px);
	}
	80% {
		opacity: 0;
		transform: translateX(-40px);
	}
	100% {
		opacity: 0;
	}
}

/* ============================== CTA =============================== */

.tava-vt__cta {
	margin-top: 1.75rem;
	text-align: center;
}

.tava-vt__trust {
	margin: 0 0 1.25rem;
	font-size: 1rem;
	color: rgba(255, 255, 255, 0.6);
}

.tava-vt__trust-num {
	font-size: 1.2rem;
	font-weight: 800;
	color: var(--tava-vt-accent);
}

.tava-vt__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	/* >=48px tall: comfortable tap target on mobile. */
	min-height: 48px;
	padding: 0.85rem 1.5rem;
	border-radius: 14px;
	background-color: var(--tava-vt-accent);
	color: #04121f;
	font-size: 1rem;
	font-weight: 800;
	text-decoration: none;
	box-shadow: 0 10px 30px color-mix(in srgb, var(--tava-vt-accent) 20%, transparent);
	transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.tava-vt__btn:hover,
.tava-vt__btn:focus {
	color: #04121f;
	transform: translateY(-3px);
	box-shadow: 0 15px 40px color-mix(in srgb, var(--tava-vt-accent) 35%, transparent);
}

.tava-vt__btn:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

.tava-vt__btn-arrow {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

/* The arrow points "forward"; in RTL that is visually leftward. */
[dir="rtl"] .tava-vt__btn-arrow {
	transform: scaleX(-1);
}

/* ====================== Motion / a11y preferences ====================== */

@media (prefers-reduced-motion: reduce) {
	.tava-vt *,
	.tava-vt *::before,
	.tava-vt *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}

	.tava-vt__card--playable:hover {
		transform: none;
	}
}

@media (forced-colors: active) {
	.tava-vt__card {
		border: 1px solid CanvasText;
	}

	.tava-vt__arrow {
		border: 1px solid ButtonText;
	}
}

/* ============================ Breakpoints ============================ */

@media (min-width: 768px) {
	.tava-vt {
		padding: 72px 0;
	}

	.tava-vt__container {
		padding-inline: 1.5rem;
	}

	.tava-vt__title {
		font-size: 1.9rem;
	}

	.tava-vt__header {
		margin-bottom: 2.5rem;
	}
}

@media (min-width: 1025px) {
	.tava-vt__title {
		font-size: 2.1rem;
	}

	.tava-vt__header {
		margin-bottom: 3rem;
	}

	.tava-vt__trust {
		font-size: 1.1rem;
	}
}
