/* ==========================================================================
   Vendavo Testimonial Grid Widget

   Dynamic post-type grid that renders testimonial cards. The card design
   mirrors vendavo-testimonial-carousel.css — top section (image OR solid
   color with company + headline overlay) and bottom section (avatar +
   name/role + quote + tags). Layout is a responsive CSS grid with an AJAX
   Load More button (same UX as vendavo-card-grid.css).
   ========================================================================== */

.vtg {
	--vtg-transition: 250ms;
}

/* ── Outer wrap ─────────────────────────────────────────────────────────── */
.vtg-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	width: 100%;
}

.vtg-empty {
	grid-column: 1 / -1;
	text-align: center;
	color: #5F6173;
	padding: 24px 0;
}

/* ── Card ───────────────────────────────────────────────────────────────── */
.vtg-card {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	text-decoration: none;
	color: inherit;
	overflow: hidden;
	background: transparent;
}

a.vtg-card { color: inherit; }

/* ── Top section (image or solid color with overlay text) ───────────────── */
.vtg-testi-top {
	position: relative;
	min-height: 220px;
	padding: 24px 28px 28px;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	color: #FFFFFF;
	overflow: hidden;
	isolation: isolate;
}

/* Readability overlay — only on image backgrounds */
.vtg-testi-top.is-image::before {
	content: "";
	position: absolute;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.25);
	z-index: 0;
	pointer-events: none;
}

.vtg-testi-top > * {
	position: relative;
	z-index: 1;
}

.vtg-testi-company {
	display: block;
	font-size: 14px;
	line-height: 1.3;
	font-weight: 400;
	color: #FFFFFF;
	margin-bottom: 12px;
	letter-spacing: 0.01em;
}

.vtg-testi-headline {
	margin: 0;
	font-size: 20px;
	line-height: 1.35;
	font-weight: 700;
	color: #FFFFFF;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 5;
	line-clamp: 5;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ── Bottom section ─────────────────────────────────────────────────────── */
.vtg-testi-bottom {
	background-color: #FFFFFF;
	padding: 24px 4px 8px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	flex: 1 1 auto;
}

/* ── Person row (avatar + name/role) ────────────────────────────────────── */
.vtg-testi-person {
	display: flex;
	align-items: center;
	gap: 12px;
}

.vtg-testi-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	display: block;
}

.vtg-testi-person-text {
	display: flex;
	flex-direction: column;
	line-height: 1.3;
	min-width: 0;
}

.vtg-testi-person-name {
	font-weight: 700;
	font-size: 15px;
	color: #0B0B26;
}

.vtg-testi-person-role {
	font-weight: 400;
	font-size: 13px;
	color: #5F6173;
}

/* ── Testimonial quote ──────────────────────────────────────────────────── */
.vtg-testi-quote {
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
	color: #2C2E3D;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 6;
	line-clamp: 6;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ── Tags ───────────────────────────────────────────────────────────────── */
.vtg-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: auto;
}

.vtg-tag {
	display: inline-flex;
	align-items: center;
	font-size: 12px;
	line-height: 1;
	padding: 6px 12px;
	border: 1px solid #D7D2EA;
	border-radius: 999px;
	color: #1A1440;
	background: transparent;
}

/* ── Load more button ───────────────────────────────────────────────────── */
.vtg-loadmore-wrap {
	display: flex;
	justify-content: center;
	margin-top: 32px;
}

.vtg-loadmore {
	appearance: none;
	display: inline-block;
	text-align: center;
	text-decoration: none;
	background: transparent;
	border: 1px solid #1A1440;
	color: #1A1440;
	padding: 10px 28px;
	border-radius: 999px;
	font-size: .95rem;
	cursor: pointer;
	transition: background var(--vtg-transition) ease,
	            color var(--vtg-transition) ease,
	            border-color var(--vtg-transition) ease;
}

.vtg-loadmore:focus { text-decoration: none; }

.vtg-loadmore:hover {
	background: #1A1440;
	color: #FFFFFF;
}

.vtg-fx-button-no .vtg-loadmore:hover {
	background: inherit;
	color: inherit;
	border-color: inherit;
}

.vtg-loadmore.is-loading {
	opacity: .6;
	pointer-events: none;
}

.vtg-lm-glass-yes .vtg-loadmore {
	border: 1px solid rgba(255, 255, 255, 0.8);
	color: #1A1440;
	-webkit-backdrop-filter: blur(14px) saturate(140%);
	backdrop-filter: blur(14px) saturate(140%);
	background: rgba(245, 245, 245, 0.2);
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.vtg-lm-glass-yes .vtg-loadmore:hover {
	background: rgba(255, 255, 255, 0.7);
	color: #1A1440;
}

.vtg.is-fetching .vtg-grid {
	opacity: .6;
	transition: opacity .2s ease;
}

.vtg-fx-trans-no .vtg-card,
.vtg-fx-trans-no .vtg-loadmore,
.vtg-fx-trans-no .vtg-tag {
	transition: none !important;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
	.vtg-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.vtg-testi-headline { font-size: 18px; }
}

@media (max-width: 767px) {
	.vtg-grid {
		grid-template-columns: 1fr;
	}
	.vtg-testi-top { min-height: 200px; padding: 20px 22px 22px; }
	.vtg-testi-headline { font-size: 17px; }
}
