/**
 * Quickstep Testimonials — layout + behaviour only.
 *
 * The plugin ships ZERO visual styling. Colour, backgrounds, borders,
 * typography and the fade gradient all come from the Elementor widget's
 * Style controls or the theme layer (child theme styles.css).
 *
 * Only exceptions are form-element resets on buttons so native browser
 * chrome doesn't bleed through.
 */

.qst {
	--qst-cols-desktop: 3;
	--qst-cols-tablet: 2;
	--qst-cols-mobile: 1;
	--qst-collapsed-height: 15rem;
}

.qst-grid {
	display: grid;
	grid-template-columns: repeat(var(--qst-cols-desktop), minmax(0, 1fr));
	gap: 1.5rem;
	align-items: start;
}

.qst-column {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	min-width: 0;
}

/* At smaller breakpoints, flatten the column wrappers so individual cards
   participate directly in the parent grid. Card order follows DOM — which,
   after the round-robin chunk, reads col1-cards, col2-cards, col3-cards. */
@media (max-width: 1024px) {
	.qst-grid { grid-template-columns: repeat(var(--qst-cols-tablet), minmax(0, 1fr)); }
	.qst-column { display: contents; }
}

@media (max-width: 640px) {
	.qst-grid { grid-template-columns: repeat(var(--qst-cols-mobile), minmax(0, 1fr)); }
}

.qst-card {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 1.5rem;
}

.qst-pullquote {
	margin: 0;
	padding-bottom: 0.75rem;
}

.qst-pullquote + .qst-body {
	padding-top: 1rem;
}

.qst-body {
	position: relative;
}

.qst-body p {
	margin: 0 0 0.75rem;
}

.qst-body p:last-child {
	margin-bottom: 0;
}

.qst-body[data-qst-collapsible="true"] .qst-body-inner {
	max-height: var(--qst-collapsed-height);
	overflow: hidden;
	transition: max-height 100ms ease-out;
}

.qst-body[data-qst-collapsible="true"][data-qst-expanded="true"] .qst-body-inner {
	/* max-height is set inline by JS to the measured scrollHeight so the
	   animation has a concrete pixel target. */
	transition: max-height 400ms ease-out;
}

/* Fade overlay is positioned here; the gradient is supplied by theme/widget. */
.qst-fade {
	display: none;
	pointer-events: none;
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3rem;
}

.qst-body[data-qst-collapsible="true"][data-qst-expanded="false"] .qst-fade {
	display: block;
}

/* Button resets so native browser chrome doesn't leak through. */
.qst-readmore {
	cursor: pointer;
	font: inherit;
	background: transparent;
	border: 0;
	padding: 0;
}

.qst-scan-open {
	cursor: pointer;
	text-decoration: none;
}

.qst-readmore {
	align-self: flex-start;
}

.qst-readmore .qst-readmore-less,
.qst-readmore[aria-expanded="true"] .qst-readmore-more {
	display: none;
}

.qst-readmore[aria-expanded="true"] .qst-readmore-less {
	display: inline;
}

.qst-scan-open {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.5rem 0.75rem;
}

.qst-scan-thumb {
	width: 48px;
	height: 48px;
	object-fit: cover;
	display: block;
}

.qst-meta {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.75rem;
	align-items: center;
	margin-top: auto;
	padding-top: 1rem;
}

.qst-initials {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.qst-identity {
	min-width: 0;
}

.qst-name,
.qst-role,
.qst-date {
	margin: 0;
}

.qst-role {
	margin-top: 0.125rem;
}

.qst-empty {
	padding: 1rem;
}

@media (prefers-reduced-motion: reduce) {
	.qst-body-inner {
		transition: none !important;
	}
}
