/*
 * ALAN Testimonials — self-contained, scoped frontend styles.
 *
 * Every selector is scoped to .alan-testimonials so the plugin can be used on
 * any WordPress page without changing unrelated content. CSS custom properties
 * fall back to the approved ALAN values, so the same file matches the ALAN
 * cards and still works on themes that do not define ALAN's variables.
 */

.alan-testimonials {
	--alan-testimonials-line: var(--line, #e24d8f);
	--alan-testimonials-pink: var(--pink, #e24d8f);
	--alan-testimonials-radius: var(--radius, 16px);
	--alan-testimonials-ink: var(--ink, #0b0701);
	--alan-testimonials-container: var(--container, 1280px);
	--alan-testimonials-gutter: var(--gutter, clamp(1.25rem, 5.55vw, 5rem));
	--alan-testimonials-section-space: var(--section, clamp(4.5rem, 8vw, 8rem));
	position: relative;
	isolation: isolate;
	padding-block: var(--alan-testimonials-section-space);
	overflow: clip;
	color: var(--alan-testimonials-ink);
}

.alan-testimonials *,
.alan-testimonials *::before,
.alan-testimonials *::after {
	box-sizing: border-box;
}

.alan-testimonials .container {
	width: min(var(--alan-testimonials-container), calc(100% - (2 * var(--alan-testimonials-gutter))));
	max-width: none;
	margin-inline: auto;
}

.alan-testimonials .section-heading {
	margin: 0 0 1rem;
	font-family: inherit;
	font-size: clamp(2rem, 4.2vw, 3.75rem);
	font-weight: 300;
	line-height: 1.15;
	letter-spacing: -.025em;
	text-align: center;
}

.alan-testimonials .testimonial-grid {
	display: grid;
	gap: 1.5rem;
	margin-top: 3rem;
}

.alan-testimonials--cols-1 .testimonial-grid {
	grid-template-columns: 1fr;
}

.alan-testimonials--cols-2 .testimonial-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.alan-testimonials--cols-3 .testimonial-grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.alan-testimonials .testimonial {
	display: flex;
	min-width: 0;
	min-height: 19rem;
	flex-direction: column;
	padding: 2rem;
	border: 1px solid var(--alan-testimonials-line);
	border-radius: var(--alan-testimonials-radius);
	background: #fff;
	font-family: inherit;
	line-height: inherit;
	overflow-wrap: anywhere;
}

/* Reset any theme rule that makes the last testimonial span the grid. Only
   the approved three-column layout does that below 1024px. */
.alan-testimonials .testimonial-grid .testimonial {
	grid-column: auto;
}

.alan-testimonials .stars {
	color: var(--alan-testimonials-pink);
	letter-spacing: .15em;
	line-height: 1.2;
}

.alan-testimonials .stars__empty {
	color: #d5d5d5;
}

.alan-testimonials .testimonial blockquote {
	margin: 1rem 0 auto;
	padding: 0;
	border: 0;
	font: inherit;
	quotes: none;
	overflow-wrap: anywhere;
}

.alan-testimonials .testimonial blockquote p {
	margin: 0 0 .75rem;
}

.alan-testimonials .testimonial blockquote p:last-child {
	margin-bottom: 0;
}

.alan-testimonials .person {
	display: flex;
	align-items: center;
	gap: .8rem;
	margin-top: 1.5rem;
}

.alan-testimonials .person img,
.alan-testimonials .person__avatar {
	display: block;
	width: 48px;
	height: 48px;
	flex: 0 0 48px;
	border-radius: 50%;
	object-fit: cover;
}

.alan-testimonials .person__avatar--placeholder {
	background: #e3e3e3;
}

.alan-testimonials .person p {
	margin: 0;
	line-height: 1.45;
}

.alan-testimonials .person strong {
	font-weight: 700;
}

/* Editor preview helpers. These do not appear on the frontend. */
.alan-testimonials-block-editor .alan-testimonials {
	min-height: 4rem;
}

.alan-testimonials-editor-empty,
.alan-testimonials-editor-error,
.alan-testimonials-editor-loading {
	padding: 1.25rem;
	border: 1px dashed #c3c4c7;
	border-radius: 4px;
	background: #fff;
}

.alan-testimonials-editor-empty p,
.alan-testimonials-editor-error p {
	margin: 0 0 .5rem;
}

.alan-testimonials-editor-empty p:last-child,
.alan-testimonials-editor-error p:last-child {
	margin-bottom: 0;
}

.alan-testimonials-manual__list {
	margin: .75rem 0 0;
	padding: 0;
	list-style: none;
}

.alan-testimonials-manual__list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	padding: .5rem 0;
	border-bottom: 1px solid #f0f0f1;
}

.alan-testimonials-manual__list li:last-child {
	border-bottom: 0;
}

@media (max-width: 1024px) {
	.alan-testimonials--cols-3 .testimonial-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.alan-testimonials--cols-3 .testimonial-grid .testimonial:last-child {
		grid-column: 1 / -1;
	}
}

@media (max-width: 720px) {
	.alan-testimonials--cols-2 .testimonial-grid {
		grid-template-columns: 1fr;
	}

	.alan-testimonials--cols-3 .testimonial-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.alan-testimonials--cols-3 .testimonial-grid .testimonial:last-child {
		grid-column: auto;
	}

	.alan-testimonials .section-heading {
		font-size: clamp(1.8rem, 8vw, 2.6rem);
	}

	.alan-testimonials .testimonial {
		padding: 1.5rem;
	}
}
