/* Structure only.
 *
 * Colour, type, border, shadow and decorative treatment were stripped when
 * this became the blank starter. The design comes from the build's own
 * Figma / Claude Design work, not from here.
 *
 * Spacing and sizing are exposed as --fw-<selector>-<property> tokens that
 * default to 0, so the starter asserts nothing and the design layer sets
 * them. Everything left is layout mechanics the block needs to function.
 */

/* Block: framework/testimonials */

.fw-testimonials {
	padding: var(--fw-section-py, 48px) 20px;
}

.fw-testimonials__inner {
	max-width: var(--fw-testimonials-inner-max-width, 0);
	margin: var(--fw-testimonials-inner-margin, 0);
	display: grid;
	grid-template-columns: 1fr 1fr 1.2fr;
	grid-template-rows: auto;
	gap: 0;
	align-items: stretch;
}

/* Intro group sits in column 1, row 1 */
.fw-testimonials__intro {
	grid-column: 1;
	grid-row: 1;
	padding: var(--fw-testimonials-intro-padding, 0);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.fw-testimonials__intro :is(h1, h2) {
	margin: var(--fw-testimonials-intro-margin, 0);
}

.fw-testimonials__intro p {
	margin: 0;
}

.fw-testimonials__nav-fe {
	display: flex;
	gap: var(--fw-testimonials-nav-fe-gap, 0);
	margin-top: var(--fw-testimonials-nav-fe-margin-top, 0);
}

.fw-testimonials__nav-btn {
	width: var(--fw-testimonials-nav-btn-width, 0);
	height: var(--fw-testimonials-nav-btn-height, 0);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: border-color 0.2s ease;
	padding: 0;
}

/* Hover = the arrow slides (not a turquoise fill), per Figma. */
.fw-testimonials__nav-btn svg {
	transition: transform 0.25s ease;
}
.fw-testimonials__nav-btn[data-direction="prev"]:hover svg {
	transform: translateX(-4px);
}
.fw-testimonials__nav-btn[data-direction="next"]:hover svg {
	transform: translateX(4px);
}

/* Each testimonial child uses display: contents to escape into the parent
   grid; its image and quote land in columns 2 & 3 of row 1, all stacked. */
.fw-testimonial {
	display: contents;
}

.fw-testimonial__image {
	grid-column: 2;
	grid-row: 1;
	min-width: var(--fw-testimonial-image-min-width, 0);
	min-height: var(--fw-testimonial-image-min-height, 0);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.4s ease;
}

.fw-testimonial__quote {
	grid-column: 3;
	grid-row: 1;
	padding: var(--fw-testimonial-quote-padding, 0);
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.4s ease;
}

.fw-testimonial.is-active .fw-testimonial__image,
.fw-testimonial.is-active .fw-testimonial__quote {
	opacity: 1;
	pointer-events: auto;
}

/* Text-only testimonial (no image) — quote spans the media + quote columns
   instead of leaving a grey placeholder where the image would be. */
.fw-testimonial--textonly .fw-testimonial__quote {
	grid-column: 2 / -1;
}

.fw-testimonial__stars {
	display: flex;
	gap: var(--fw-testimonial-stars-gap, 0);
	margin-bottom: var(--fw-testimonial-stars-margin-bottom, 0);
}

.fw-testimonial__quote-text {
	margin: var(--fw-testimonial-quote-text-margin, 0);
}

.fw-testimonial__quote-text.is-clamped {
	display: -webkit-box;
	-webkit-line-clamp: 5;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.fw-testimonial__readmore {
	display: inline-block;
	margin: var(--fw-testimonial-readmore-margin, 0);
	padding: 0;
	cursor: pointer;
	align-self: flex-start;
}
/* Author (role) + company grouped at the bottom of the quote panel. */
.fw-testimonial__author {
	margin: var(--fw-testimonial-author-margin, 0);
}

.fw-testimonial__company {
	margin: 0;
}

.fw-testimonial__date {
	margin: var(--fw-testimonial-date-margin, 0);
}

/* Pause autoplay when the inner blocks are interacted with on the front-end */
.fw-testimonials:hover .fw-testimonial.is-active .fw-testimonial__image,
.fw-testimonials:hover .fw-testimonial.is-active .fw-testimonial__quote {
	transition-duration: 0s;
}

/* ---- Responsive ----------------------------------------------------------
 * From 1080 down: the title + intro + nav controls move ABOVE the slider, and
 * the image/quote sit side by side beneath. From 768 down they stack fully
 * (intro → image → quote). The `display: contents` testimonials keep stacking
 * their image/quote into the same cells, so the crossfade slider still works.
 * ------------------------------------------------------------------------- */
@media (max-width: 1080px) {
	.fw-testimonials__inner {
	grid-template-columns: 1fr 1fr;
}
	.fw-testimonials__intro {
	grid-column: 1 / -1;
	grid-row: 1;
	padding: var(--fw-testimonials-intro-padding, 0);
}
	.fw-testimonials__nav-fe {
	margin-top: var(--fw-testimonials-nav-fe-margin-top, 0);
}
	.fw-testimonial__image {
	grid-column: 1;
	grid-row: 2;
}
	.fw-testimonial__quote {
	grid-column: 2;
	grid-row: 2;
}
	.fw-testimonial--textonly .fw-testimonial__quote {
	grid-column: 1 / -1;
	grid-row: 2;
}
}
@media (max-width: 768px) {
	.fw-testimonials__inner {
	grid-template-columns: 1fr;
}
	.fw-testimonial__image {
	grid-column: 1;
	grid-row: 2;
}
	.fw-testimonial__quote,
	.fw-testimonial--textonly .fw-testimonial__quote {
	grid-column: 1;
	grid-row: 3;
}
}

/* --- Grid layout ------------------------------------------------------
   Every card visible, in columns; prev/next scroll the row. Undoes the
   slider's overlapping-grid mechanics above. Design values come from the
   build stylesheet. */
.fw-testimonials--grid .fw-testimonials__inner {
	display: block;
	grid-template-columns: none;
}
.fw-testimonials--grid .fw-testimonials__intro {
	grid-column: auto;
	grid-row: auto;
	max-width: none;
}
.fw-testimonials--grid .fw-testimonials__grid {
	display: grid;
	/* Fixed-width tracks (not 1fr): fr tracks shrink to make room for the
	   overflow columns, which is exactly what must not happen. */
	--fw-testimonials-col: calc((100% - (var(--fw-testimonials-cols-eff, var(--fw-testimonials-cols, 3)) - 1) * var(--fw-testimonials-grid-gap, 0)) / var(--fw-testimonials-cols-eff, var(--fw-testimonials-cols, 3)));
	grid-template-columns: repeat(var(--fw-testimonials-cols-eff, var(--fw-testimonials-cols, 3)), var(--fw-testimonials-col));
	/* More cards than columns flow into further columns of the same width and
	   scroll sideways (the arrows step them), rather than wrapping into rows. */
	grid-auto-flow: column;
	grid-auto-columns: var(--fw-testimonials-col);
	gap: var(--fw-testimonials-grid-gap, 0);
	align-items: stretch;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
}
.fw-testimonials--grid .fw-testimonials__grid::-webkit-scrollbar { display: none; }
.fw-testimonials--grid .fw-testimonial {
	display: flex;
	flex-direction: column;
	position: relative;
	scroll-snap-align: start;
}
.fw-testimonials--grid .fw-testimonial__image,
.fw-testimonials--grid .fw-testimonial__quote {
	grid-column: auto;
	grid-row: auto;
	opacity: 1;
	pointer-events: auto;
	transition: none;
}
.fw-testimonials--grid .fw-testimonials__nav-fe { justify-content: center; }
/* The column count is an inline custom property from the block, which a media
   query cannot override, so the breakpoints set a second property that the
   grid prefers when present. */
@media (max-width: 1024px) { .fw-testimonials--grid { --fw-testimonials-cols-eff: 2; } }
@media (max-width: 640px)  { .fw-testimonials--grid { --fw-testimonials-cols-eff: 1; } }

/* ---- r79: dynamic height at phone width -----------------------------------
   Owen, 12 Oct: "height should be dynamic on Mobile. Gaps are caused by the
   matched height columns on desktop."

   The cards are one grid row with grid-auto-flow: column, so align-items
   stretch makes every card as tall as the tallest. In a 3-up desktop grid that
   is right - the columns should line up. At phone width you see one card at a
   time, so a short testimonial was padded out to someone else's length: the
   block measured 954px on an 844px screen and the arrows sat below the fold.

   align-items: start stops the stretch; view.js then sets the row's height to
   whichever card is snapped into view. */

@media (max-width: 782px) {
	.fw-testimonials--grid .fw-testimonials__grid {
		align-items: start;
	}
}

/* ---- Phone width: paged, not scrolled (Owen, 13 Oct 2026) -----------------
   On a real iPhone the arrows jumped or skipped because iOS's scroll-snap
   engine re-decided where each scroll should stop. view.js now pages the row
   at 782px and below (.is-paged): the row never scrolls, the cards move by
   a measured offset, swipes are read by the script and vertical page
   scrolling stays native. */
@media (max-width: 782px) {
	.fw-testimonials--grid .fw-testimonials__grid.is-paged {
		overflow: hidden !important;
		scroll-snap-type: none !important;
		touch-action: pan-y;
	}
	.fw-testimonials--grid .fw-testimonials__grid.is-paged .fw-testimonial { will-change: translate; }
	.fw-testimonials--grid .fw-testimonials__nav-btn[disabled] { opacity: 0.4; cursor: default; }
}
