/* =============================================================================
   ampeco/tw-video-testimonials  (brain tasks/testimonials-2026)
   -----------------------------------------------------------------------------
   Geometry Tailwind cannot express: the translate-driven centre-focus track, the
   scrim gradient, and the absolutely-positioned play disc / caption over a
   poster. Everything that IS a utility (type colour, heading font) stays in
   render.php.

   Raw CSS uses `--p-*` / `--c-*`, never `--color-*`: the semantic names are
   `@theme inline` and do not exist at runtime (brain design/tailwind.md).
   Radii are the NDS scale's literal values (16px = radius-lg) — note the scale
   is NOT stock Tailwind's, which is why they are written out here.
   ============================================================================= */

.tw-video-testimonials { --twvt-card-w: 378px; --twvt-gap: 20px; }

/* ---- the card ---------------------------------------------------------- */
.tw-video-testimonials__card {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	overflow: hidden;
	padding: 32px;
	border: 0;
	border-radius: 16px;
	background: linear-gradient(223.28deg, var(--p-midnight-500, #233D63) 0%, var(--p-midnight-800, #0E1828) 100%);
	color: var(--p-frost-100, #F5FAFF);
	text-align: left;
	cursor: pointer;
	appearance: none;
	font: inherit;
}

.tw-video-testimonials__card:focus-visible {
	outline: 4px solid var(--p-primary-500, #0E60C3);
	outline-offset: 2px;
}

.tw-video-testimonials__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
}

/* Keeps the caption legible over an arbitrary photo. */
.tw-video-testimonials__scrim {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.85) 100%);
}

.tw-video-testimonials__play {
	position: absolute;
	top: 32px;
	right: 32px;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.7);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
	display: grid;
	place-items: center;
	color: var(--p-raven-200, #454F59);
}

.tw-video-testimonials__play svg { margin-left: 2px; }

.tw-video-testimonials__caption {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.tw-video-testimonials__person { font-size: 14px; font-weight: 300; }
.tw-video-testimonials__line { font-size: 22px; font-weight: 500; line-height: 1.4; }

/* ---- grid layout -------------------------------------------------------- */
.tw-video-testimonials--grid {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 48px;
}

.tw-video-testimonials__head {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
	align-items: start;
	width: 100%;
}

.tw-video-testimonials__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 32px;
	width: 100%;
}

.tw-video-testimonials--grid .tw-video-testimonials__card { height: 480px; }
.tw-video-testimonials__card--feature { grid-column: span 2; }
.tw-video-testimonials__card--feature .tw-video-testimonials__line { font-size: 32px; line-height: 1.2; }
.tw-video-testimonials__card[hidden] { display: none; }

/* ---- carousel layout ---------------------------------------------------- */
.tw-video-testimonials--carousel {
	display: flex;
	flex-direction: column;
	gap: 32px;
	align-items: center;
}

/* Scrollable by default, NOT clipped: without JS the track is never translated,
   so `overflow:hidden` would leave cards 4+ permanently unreachable — present in
   the HTML for crawlers but invisible and unscrollable for a person. A native
   horizontal scroller is the honest fallback, and it costs nothing with JS on:
   view.js adds `is-enhanced` and takes over, since its own transform would
   otherwise fight the scroll position. */
.tw-video-testimonials__viewport {
	width: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.tw-video-testimonials__viewport::-webkit-scrollbar { display: none; }

.tw-video-testimonials__viewport.is-enhanced { overflow-x: hidden; }

.tw-video-testimonials__track {
	display: flex;
	width: max-content;
	will-change: transform;
}

.tw-video-testimonials--carousel .tw-video-testimonials__card {
	flex: 0 0 var(--twvt-card-w);
	height: 480px;
	margin-right: var(--twvt-gap);
	opacity: .8;
	transition: opacity .3s ease;
}

.tw-video-testimonials--carousel .tw-video-testimonials__card.is-center,
.tw-video-testimonials--carousel .tw-video-testimonials__card:hover { opacity: 1; }

.tw-video-testimonials__dots { display: flex; gap: 8px; }

.tw-video-testimonials__dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.35);
	cursor: pointer;
	transition: background .2s ease, width .2s ease;
}

.tw-video-testimonials__dot.is-active { width: 24px; border-radius: 4px; background: var(--p-frost-100, #F5FAFF); }
.tw-video-testimonials__dot:focus-visible { outline: 3px solid var(--p-primary-500, #0E60C3); outline-offset: 2px; }

/* ---- show-more ---------------------------------------------------------- */
.tw-video-testimonials__more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 56px;
	padding: 0 24px;
	border-radius: 12px;
	border: 0;
	box-shadow: inset 0 0 0 1px var(--p-midnight-200, #A7B1C1);
	background: transparent;
	color: var(--c-ink, #1A1E22);
	font-size: 16px;
	font-weight: 500;
	cursor: pointer;
	transition: background .2s ease;
}

.tw-video-testimonials__more:hover { background: rgba(0, 0, 0, 0.04); }
.tw-video-testimonials__more:focus-visible { outline: 4px solid var(--p-primary-500, #0E60C3); outline-offset: 2px; }

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 1100px) {
	.tw-video-testimonials__grid { grid-template-columns: repeat(2, 1fr); }
	.tw-video-testimonials__card--feature { grid-column: span 2; }
}

@media (max-width: 720px) {
	.tw-video-testimonials__head { grid-template-columns: 1fr; gap: 16px; }
	.tw-video-testimonials__grid { grid-template-columns: 1fr; max-width: 420px; }
	.tw-video-testimonials__card--feature { grid-column: span 1; }
	.tw-video-testimonials--grid .tw-video-testimonials__card { height: 420px; }
	.tw-video-testimonials__card { padding: 24px; }
	.tw-video-testimonials__play { top: 24px; right: 24px; }
	.tw-video-testimonials { --twvt-card-w: 280px; }
	.tw-video-testimonials--carousel .tw-video-testimonials__card { height: 400px; }
	.tw-video-testimonials__card--feature .tw-video-testimonials__line { font-size: 24px; }
	/* The feature poster is a landscape montage. In a 420px-tall single column
	   `cover` keeps only a vertical strip of it and cuts the faces. On mobile the
	   poster sits uncropped at 16:9 across the top, and the caption + play button
	   move below it onto the card's own gradient — overlaid, they would land on
	   the montage's built-in title and on a face. The padding-top percentage
	   resolves against the grid column, which is the card's own width here. */
	/* The caption strip shows the card's own background here, so it takes the
	   page's metric-card blue (the Ocean Dive preset) instead of the midnight
	   base, which only ever sits under a poster elsewhere. */
	.tw-video-testimonials--grid .tw-video-testimonials__card--feature {
		height: auto;
		padding-top: calc(56.25% + 20px);
		padding-right: 88px;
		background: var(--wp--preset--gradient--ocean-dive, linear-gradient(223deg, #50A4FA -6.97%, #0E60C3 52.71%, #15253B 112.4%));
	}
	.tw-video-testimonials__card--feature .tw-video-testimonials__poster { bottom: auto; height: auto; aspect-ratio: 16 / 9; }
	.tw-video-testimonials__card--feature .tw-video-testimonials__scrim { display: none; }
	.tw-video-testimonials__card--feature .tw-video-testimonials__play { top: auto; bottom: 24px; }
	.tw-video-testimonials__card--feature .tw-video-testimonials__line { font-size: 22px; }
}

/* Lightbox loading spinner. The lightbox is built in view.js and appended to
   <body>, so this is not scoped under the block's root class. */
.frx-video-spinner {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 3px solid rgba(245, 250, 255, 0.3);
	border-top-color: var(--p-frost-100, #F5FAFF);
	animation: frx-video-spin .8s linear infinite;
}

@keyframes frx-video-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
	.tw-video-testimonials__track { transition: none !important; }
	.frx-video-spinner { animation-duration: 2.4s; }
}
