/**
 * JF Resource Templates — Testimonials template.
 *
 * Loaded only on pages using jfrt-testimonials-template.php (see
 * JFRT_Templates::TEMPLATE_STYLES). Hand-written and deliberately kept
 * out of the SCSS build, same as jf-slider.css: nothing here needs a
 * Bootstrap variable or mixin, so there is no source file to compile — edit
 * this file directly.
 *
 * Colours come from the custom properties printed by the Template Styles
 * options page. The one exception is the star colour, which is its own
 * per-page field (--ts-star-color, set inline on the grid) because stars read
 * as gold regardless of a client's brand palette.
 *
 * The hero band at the top of the page is shared with the Case Studies
 * template and lives in jf-hero-pills.css.
 *
 *   1. The grid
 *   2. Card
 *   3. Editor-only empty state
 */

/* ==========================================================================
   1. THE GRID
   --ts-columns is set inline from the "Columns" field. The minmax() floor is
   what keeps a long unbroken word from pushing its own column wider than the
   others, and auto-fit means a row that can't fit the chosen count on a
   narrower screen drops to however many do fit, with no extra breakpoints.
   ========================================================================== */

.jfrt-testimonials .ts-list__items {
	display: grid;
	grid-template-columns: repeat(var(--ts-columns, 3), minmax(0, 1fr));
	gap: var(--ts-row-gap, 3rem) var(--ts-column-gap, 2.5rem);
	align-items: start;
}

@media (max-width: 991.98px) {
	.jfrt-testimonials .ts-list__items {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--ts-row-gap, 2.5rem) var(--ts-column-gap, 2rem);
	}
}

@media (max-width: 575.98px) {
	.jfrt-testimonials .ts-list__items {
		grid-template-columns: minmax(0, 1fr);
		/* Phone gaps from the page's mobile spacing fields, else the desktop ones. */
		gap: var(--ts-row-mobile-gap, var(--ts-row-gap, 2.5rem)) var(--ts-column-mobile-gap, var(--ts-column-gap, 2.5rem));
	}
}

/* ==========================================================================
   2. CARD
   Deliberately unboxed — no border, no panel, no shadow. The stars and the
   name carry the structure, which is what keeps a wall of six quotes from
   reading as a wall of six boxes.
   ========================================================================== */

.jfrt-testimonials .ts-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.jfrt-testimonials .ts-card__stars {
	display: flex;
	gap: 2px;
	margin-bottom: 1rem;
}

.jfrt-testimonials .ts-card .ts-star {
	display: block;
	width: 18px;
	height: 18px;
	/* Stated in CSS rather than as an SVG fill attribute, which any theme rule
	   on svg would override. */
	fill: var(--ts-star-color, #f5b301) !important;
	stroke: none !important;
}

.jfrt-testimonials .ts-card__photo {
	width: 56px;
	height: 56px;
	margin-bottom: 1rem;
	border-radius: 50%;
	object-fit: cover;
}

.jfrt-testimonials .ts-card__quote {
	margin-bottom: 0.5rem;
	/* An explicit line height: the clamp script measures lines with it, and a
	   theme that leaves it at "normal" would otherwise switch the clamp off. */
	line-height: 1.6;
}

.jfrt-testimonials .ts-card__quote p:last-child {
	margin-bottom: 0;
}

/* The clamp toggle is inserted by jf-templates.js as the quote's next sibling,
   so it sits between the quote and the name — which is the order the design
   has. Its base styling comes from jf-slider.css; only the spacing is
   adjusted here. */
.jfrt-testimonials .ts-card .jf-clamp__toggle {
	margin-top: 0;
	margin-bottom: 1rem;
	align-self: flex-start;
}

.jfrt-testimonials .ts-card__name {
	margin-top: auto;
	padding-top: 0.75rem;
	font-weight: 700;
	font-size: 1.0625rem;
	line-height: 1.35;
}

.jfrt-testimonials .ts-card__role {
	margin-top: 0.25rem;
	font-size: 0.9375rem;
}

/* ==========================================================================
   3. EDITOR-ONLY EMPTY STATE
   Same warning styling the logo strip uses when its gallery is empty.
   ========================================================================== */

.jfrt-testimonials .ts-empty-notice {
	padding: 20px;
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 4px;
	color: #856404;
}
