/* =========================================================
   Testimonial Widget Pro — Base styles
   Cards NEVER get a fixed height. .twe-content uses height:auto
   and flex-grow so every card naturally sizes to its own text.
   ========================================================= */

.twe-testimonials {
	position: relative;
	box-sizing: border-box;
}
.twe-testimonials *,
.twe-testimonials *::before,
.twe-testimonials *::after {
	box-sizing: border-box;
}

/* ---- Grid mode ---- */
.twe-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 30px;
	align-items: start; /* each card keeps its own natural height */
}

/* ---- Card shell ---- */
.twe-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 18px;
	height: auto;
	background: #fff;
	border-radius: 16px;
	padding: 40px 35px 35px;
	box-shadow: 0 10px 30px rgba(20, 20, 43, 0.06);
	overflow: hidden;
	text-align: left;
}

.twe-card-body {
	display: flex;
	flex-direction: column;
	gap: 18px;
	flex: 1 1 auto;
	min-height: 0;
}

/* ---- Testimonial text: fully fluid height ---- */
.twe-content {
	height: auto;
	flex: 1 1 auto;
	font-size: 16px;
	line-height: 1.7;
	color: #4a4a58;
}
.twe-content p {
	margin: 0 0 0.8em;
}
.twe-content p:last-child {
	margin-bottom: 0;
}

/* Optional truncation — only applied when the user explicitly sets a line limit */
.twe-content-clamped {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--twe-clamp-lines, 4);
	overflow: hidden;
}

/* ---- Quote icon ---- */
.twe-quote-icon {
	color: rgba(99, 102, 241, 0.18);
	font-size: 48px;
	line-height: 1;
}

/* ---- Rating ---- */
.twe-rating {
	display: flex;
	gap: 3px;
	color: #f5a623;
	font-size: 14px;
	line-height: 1;
}
.twe-star { font-style: normal; }
.twe-star-half { opacity: 0.55; }
.twe-star-empty { opacity: 0.28; }

/* ---- Footer: avatar + name/position ---- */
.twe-footer {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: auto; /* pin to bottom when a row is stretched to equal height */
}

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

.twe-author { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.twe-name { font-size: 16px; font-weight: 600; color: #1c1c28; }
.twe-position { font-size: 13px; color: #8a8a99; }

/* =========================================================
   LAYOUT: Modern Card (default)
   ========================================================= */
.twe-layout-modern-card .twe-quote-icon {
	position: absolute;
	top: 20px;
	right: 24px;
	font-size: 56px;
}
.twe-layout-modern-card .twe-card {
	border-top: 3px solid #6366f1;
}

/* =========================================================
   LAYOUT: Minimal Quote — centered, oversized quote mark
   ========================================================= */
.twe-layout-minimal-quote .twe-card {
	text-align: center;
	align-items: center;
	background: transparent;
	box-shadow: none;
	border: none;
	padding: 20px 20px 0;
}
.twe-layout-minimal-quote .twe-card-body { align-items: center; }
.twe-layout-minimal-quote .twe-quote-icon {
	font-size: 64px;
	color: rgba(99, 102, 241, 0.22);
}
.twe-layout-minimal-quote .twe-content {
	font-size: 19px;
	font-style: italic;
	max-width: 640px;
}
.twe-layout-minimal-quote .twe-footer {
	flex-direction: column;
	gap: 10px;
	margin-top: 6px;
}
.twe-layout-minimal-quote .twe-footer::before {
	content: "";
	display: block;
	width: 40px;
	height: 2px;
	background: #d7d7e0;
	margin-bottom: 6px;
}
.twe-layout-minimal-quote .twe-author { align-items: center; }

/* =========================================================
   LAYOUT: Split Image Left
   ========================================================= */
.twe-layout-image-left .twe-card {
	flex-direction: row;
	align-items: stretch;
	padding: 0;
	overflow: hidden;
	gap: 0;
}
.twe-layout-image-left .twe-avatar-block {
	flex: 0 0 38%;
	min-height: 220px;
}
.twe-layout-image-left .twe-avatar-block img {
	width: 100%;
	height: 100%;
	border-radius: 0;
	object-fit: cover;
}
.twe-layout-image-left .twe-card-body {
	padding: 32px 30px;
	justify-content: center;
}
.twe-layout-image-left .twe-footer .twe-avatar { display: none; }
@media (max-width: 767px) {
	.twe-layout-image-left .twe-card { flex-direction: column; }
	.twe-layout-image-left .twe-avatar-block { min-height: 180px; }
}

/* =========================================================
   LAYOUT: Elegant Avatar Overlay
   ========================================================= */
.twe-layout-elegant-overlay .twe-card {
	text-align: center;
	align-items: center;
	padding-top: 55px;
}
.twe-layout-elegant-overlay .twe-card-body { align-items: center; }
.twe-layout-elegant-overlay .twe-footer {
	flex-direction: column;
	gap: 6px;
	order: -1;
	margin-top: -85px;
	margin-bottom: 6px;
}
.twe-layout-elegant-overlay .twe-avatar img {
	width: 84px;
	height: 84px;
	border: 4px solid #fff;
	box-shadow: 0 6px 16px rgba(20, 20, 43, 0.12);
}
.twe-layout-elegant-overlay .twe-author { align-items: center; }
.twe-layout-elegant-overlay .twe-quote-icon { margin-top: 6px; }

/* =========================================================
   CAROUSEL (Swiper) mode
   ========================================================= */
.twe-mode-carousel { padding: 0 8px; }
.twe-swiper { overflow: hidden; padding-bottom: 46px; }
.twe-swiper .swiper-wrapper { align-items: stretch; }
.twe-swiper .swiper-slide {
	height: auto; /* let autoHeight / natural content define slide height */
	display: flex;
}
.twe-swiper .swiper-slide .twe-card { width: 100%; }

.twe-swiper .swiper-pagination {
	position: absolute;
	bottom: 6px;
}
.twe-swiper .swiper-pagination-bullet {
	background: #d7d7e0;
	opacity: 1;
	width: 8px;
	height: 8px;
}
.twe-swiper .swiper-pagination-bullet-active {
	background: #6366f1;
	width: 22px;
	border-radius: 4px;
}

.twe-nav-arrow {
	position: absolute;
	top: 40%;
	transform: translateY(-50%);
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 1px solid #e2e2ea;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	line-height: 1;
	color: #1c1c28;
	background: #fff;
	cursor: pointer;
	z-index: 5;
	user-select: none;
	transition: background 0.2s ease, color 0.2s ease;
}
.twe-nav-arrow:hover { background: #6366f1; color: #fff; }
.twe-nav-prev { left: -18px; }
.twe-nav-next { right: -18px; }

@media (max-width: 767px) {
	.twe-nav-arrow { display: none; }
}

/* =========================================================
   Responsive grid breakpoints (Elementor breakpoints applied
   via the responsive "Columns" control; these are safety nets)
   ========================================================= */
@media (max-width: 1024px) {
	.twe-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.twe-grid { grid-template-columns: 1fr; }
	.twe-card { padding: 30px 24px 26px; }
}
