/**
 * Testimonial — Common base CSS (loads for every style).
 *
 * Handles the carousel mechanics shared by all styles:
 *   - Slide mode : flex track translated on the X axis.
 *   - Fade mode  : slides stacked in one grid cell, opacity cross-fades.
 * Per-style files paint the card, quote, person, arrows and dots.
 *
 * @package captain-widgets-kit
 * @since   1.3.0
 */

.captwiki-testimonial {
	--captwiki-ts-accent: #6366f1;
	position: relative;
	margin: 0 auto;
	box-sizing: border-box;
}

.captwiki-testimonial *,
.captwiki-testimonial *::before,
.captwiki-testimonial *::after {
	box-sizing: border-box;
}

.captwiki-testimonial__viewport {
	overflow: hidden;
	width: 100%;
}

/* ── Slide mode ────────────────────────────────────────── */
.captwiki-anim-slide .captwiki-testimonial__track {
	display: flex;
	flex-wrap: nowrap;
	transition: transform 0.5s cubic-bezier( 0.22, 0.61, 0.36, 1 );
	will-change: transform;
}

.captwiki-anim-slide .captwiki-testimonial__slide {
	flex: 0 0 100%;
	width: 100%;
}

/* ── Fade mode ─────────────────────────────────────────── */
.captwiki-anim-fade .captwiki-testimonial__track {
	display: grid;
}

.captwiki-anim-fade .captwiki-testimonial__slide {
	grid-area: 1 / 1;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.5s ease, visibility 0.5s ease;
}

.captwiki-anim-fade .captwiki-testimonial__slide.is-active {
	opacity: 1;
	visibility: visible;
}

/* ── Slide content ─────────────────────────────────────── */
.captwiki-testimonial__slide {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.captwiki-testimonial__rating {
	display: inline-flex;
	gap: 2px;
	font-size: 18px;
	line-height: 1;
	margin-bottom: 14px;
}

.captwiki-testimonial__star {
	color: #d8dadf;
}

.captwiki-testimonial__star.is-filled {
	color: #fbbf24;
}

.captwiki-testimonial__content {
	margin: 0 0 22px;
	font-size: 18px;
	line-height: 1.7;
	color: #374151;
}

.captwiki-testimonial__person {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: auto;
}

.captwiki-testimonial__avatar {
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 50%;
	display: block;
}

.captwiki-testimonial__meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.captwiki-testimonial__name {
	font-weight: 700;
	font-size: 16px;
	line-height: 1.3;
	color: #111827;
}

.captwiki-testimonial__role {
	font-size: 14px;
	line-height: 1.4;
	color: #6b7280;
}

/* ── Arrows ────────────────────────────────────────────── */
.captwiki-testimonial__arrows {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-top: 20px;
}

.captwiki-testimonial__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: #ffffff;
	background: var( --captwiki-ts-accent );
	border: none;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.captwiki-testimonial__arrow:hover {
	transform: translateY( -1px );
}

.captwiki-testimonial__arrow:disabled {
	opacity: 0.4;
	cursor: default;
	transform: none;
}

.captwiki-testimonial__arrow svg {
	width: 45%;
	height: 45%;
}

/* ── Dots ──────────────────────────────────────────────── */
.captwiki-testimonial__dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 20px;
}

.captwiki-testimonial__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	background: #d1d5db;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.captwiki-testimonial__dot.is-active {
	background: var( --captwiki-ts-accent );
	transform: scale( 1.25 );
}
