/*
 * Testimonial Carousel Pro — Frontend Styles
 * Version: 1.0.0
 */

/* =========================================================
   CSS Custom Properties (defaults; overridden per-instance)
   ========================================================= */
:root {
	--tcp-arrow-padding: 10px;
	--tcp-arrow-border: 1px solid #ddd;
	--tcp-arrow-border-radius: 50%;
	--tcp-arrow-border-color: #ddd;
	--tcp-dot-size: 10px;
	--tcp-dot-color: #cccccc;
	--tcp-dot-active-color: #333333;
	--tcp-dot-spacing: 5px;
}

/* =========================================================
   Wrapper
   ========================================================= */
.tcp-carousel-wrapper {
	position: relative;
	width: 100%;
	overflow: hidden;
	box-sizing: border-box;
}

/* =========================================================
   Track
   ========================================================= */
.tcp-carousel-track-container {
	overflow: hidden;
	width: 100%;
}

.tcp-carousel-track {
	display: flex;
	transition: transform 0.5s ease;
	will-change: transform;
	align-items: flex-start; /* MUST be flex-start — stretch forces every slide
	                            to match the tallest slide, breaking auto-height */
}

/* =========================================================
   Slide
   ========================================================= */
.tcp-slide {
	min-width: 100%;
	box-sizing: border-box;
	/* Do NOT stretch — height must be driven by content */
	align-self: flex-start;
}

.tcp-slide-inner {
	background: #ffffff;
	padding: 30px;
	border-radius: 8px;
	width: 100%;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* =========================================================
   Rating Stars
   ========================================================= */
.tcp-rating {
	display: flex;
	gap: 4px;
	font-size: 20px;
}

.tcp-star {
	color: #cccccc;
	transition: color 0.2s;
}

.tcp-star--filled {
	color: #f5a623;
}

/* =========================================================
   Content
   ========================================================= */
.tcp-content {
	color: #444444;
	font-size: 1rem;
	line-height: 1.7;
	flex: 1;
}

.tcp-content p:last-child {
	margin-bottom: 0;
}

/* =========================================================
   Author
   ========================================================= */
.tcp-author {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: auto;
}

.tcp-avatar {
	flex-shrink: 0;
}

.tcp-avatar img {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

.tcp-author-info {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.tcp-author-name {
	font-weight: 700;
	font-size: 0.95rem;
	color: #222222;
	display: block;
}

.tcp-author-meta {
	font-size: 0.82rem;
	color: #888888;
	display: block;
}

/* =========================================================
   Controls Row (Dots + Arrows together)
   ========================================================= */
.tcp-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 20px;
	flex-wrap: wrap;
}

/* =========================================================
   Arrows (desktop: sides of carousel)
   ========================================================= */
.tcp-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border: none;
	outline: none;
	background: #ffffff;
	transition: background-color 0.25s, border-color 0.25s, color 0.25s;

	/* CSS-var driven styles */
	padding: var(--tcp-arrow-padding);
	border: var(--tcp-arrow-border);
	border-radius: var(--tcp-arrow-border-radius);
	border-color: var(--tcp-arrow-border-color);
}

.tcp-arrow:focus-visible {
	box-shadow: 0 0 0 3px rgba(0, 100, 200, 0.4);
}

.tcp-arrow svg {
	display: block;
	width: 24px;
	height: 24px;
	fill: #333333;
	pointer-events: none;
}

.tcp-arrow:hover {
	background-color: #333333;
}

.tcp-arrow:hover svg {
	fill: #ffffff;
}

.tcp-arrow-prev {
	left: -20px;
}

.tcp-arrow-next {
	right: -20px;
}

/* Arrows visible only when there is room */
.tcp-carousel-wrapper {
	padding-left: 40px;
	padding-right: 40px;
}

/* =========================================================
   Pagination Dots
   ========================================================= */
.tcp-dots {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: calc(var(--tcp-dot-spacing) * 2);
	margin-top: 20px;
}

.tcp-dot {
	display: inline-block;
	width: var(--tcp-dot-size);
	height: var(--tcp-dot-size);
	border-radius: 50%;
	background-color: var(--tcp-dot-color);
	cursor: pointer;
	border: none;
	padding: 0;
	transition: background-color 0.25s, transform 0.25s;
	outline: none;
}

.tcp-dot:focus-visible {
	box-shadow: 0 0 0 3px rgba(0, 100, 200, 0.4);
}

.tcp-dot--active {
	background-color: var(--tcp-dot-active-color);
	transform: scale(1.3);
}

/* =========================================================
   Mobile Layout
   — Arrows move BELOW pagination dots
   ========================================================= */
@media (max-width: 767px) {
	/* Reset absolute positioning of arrows */
	.tcp-arrow {
		position: static;
		transform: none;
	}

	.tcp-arrow-prev,
	.tcp-arrow-next {
		left: auto;
		right: auto;
	}

	/* Remove side padding — arrows are no longer beside the slide */
	.tcp-carousel-wrapper {
		padding-left: 0;
		padding-right: 0;
	}

	/* Dots sit on top, arrows sit below */
	.tcp-mobile-controls {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 14px;
		margin-top: 20px;
	}

	.tcp-dots {
		margin-top: 0; /* controlled by mobile-controls gap */
	}

	.tcp-mobile-arrows {
		display: flex;
		gap: 16px;
		justify-content: center;
	}
}

/* =========================================================
   Disabled State
   ========================================================= */
.tcp-arrow:disabled,
.tcp-arrow[aria-disabled="true"] {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

/* =========================================================
   Accessibility — screen-reader only helper
   ========================================================= */
.tcp-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* =========================================================
   Auto Height — JS adds this class during transition
   ========================================================= */
.tcp-carousel-track-container {
	transition: height 0.4s ease;
}

/* =========================================================
   Elementor Widget overrides
   ========================================================= */
.elementor-widget-tcp_testimonial_carousel .tcp-carousel-wrapper {
	box-sizing: border-box;
}
