/*
 * TEST-3: testimonial with photo.
 * One testimonial at a time in the kit carousel. On wide screens a portrait
 * stands beside the quote. On small screens, and for a testimonial without a
 * picture, everything is centred. The arrows and dots under the slides come
 * from carousel.css and carousel.js.
 */

/*
 * The label is the section's heading, so the names under it have a parent and
 * the carousel has a name to announce. It is set small, like every other label.
 */
.wprk-test-3 .wprk-test-3__label {
	color: var(--wprk-accent-text);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	font-stretch: normal;
	font-weight: 600;
	letter-spacing: 0.09em;
	line-height: 1.3;
	margin-block: 0 var(--wp--preset--spacing--50);
	text-transform: uppercase;
}

.wprk-test-3 > .wp-block-query {
	margin-block-start: 0;
}

/* ---------- One slide ---------- */

/* Slides share the height of the tallest. Shorter ones sit in the middle. */
.wprk-test-3 .wp-block-post-template > li {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* Small screens: the portrait above the quote, all centred. */
.wprk-test-3 .wprk-test-3__slide {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
	margin-inline: auto;
	max-width: 62rem;
	text-align: center;
	width: 100%;
}

.wprk-test-3 .wprk-test-3__slide > * {
	margin: 0;
}

/* Stacked, the portrait keeps a modest size, so the quote is soon in view. */
.wprk-test-3 .wprk-test-3__slide > .wp-block-post-featured-image {
	margin-inline: auto;
	max-width: 10rem;
	width: 100%;
}

.wprk-test-3 .wprk-test-3__body {
	min-width: 0;
}

.wprk-test-3 .wprk-test-3__body > * {
	margin-block: 0;
}

/* ---------- The quote ---------- */

/*
 * The opening mark is decoration, drawn from the heading typeface in the accent
 * colour. Its empty text alternative keeps it away from screen readers.
 */
.wprk-test-3 .wprk-test-3__body::before {
	color: var(--wprk-accent);
	content: "\201C";
	content: "\201C" / "";
	display: block;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--huge);
	font-weight: var(--wp--custom--heading--weight);
	height: 0.5em;
	line-height: 1;
}

/* Heading typeface at a regular weight, so a long quote stays calm. */
.wprk-test-3 .wprk-test-3__body > .wp-block-post-excerpt {
	color: var(--wprk-heading);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-large);
	font-stretch: var(--wp--custom--heading--stretch, normal);
	font-weight: 400;
	letter-spacing: var(--wp--custom--heading--tracking);
	line-height: 1.4;
	margin-block-start: var(--wp--preset--spacing--20);
	overflow-wrap: break-word;
}

.wprk-test-3 .wprk-test-3__body > .wp-block-post-excerpt > p {
	margin-block: 0;
}

/* ---------- The person ---------- */

/* The name is a heading for structure, but reads as bold body text. */
.wprk-test-3 .wprk-test-3__body > .wp-block-post-title {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
	font-stretch: normal;
	font-weight: 600;
	letter-spacing: normal;
	line-height: 1.35;
	margin-block-start: var(--wp--preset--spacing--40);
	overflow-wrap: break-word;
}

/* A short accent rule stands between the quote and the name. */
.wprk-test-3 .wprk-test-3__body > .wp-block-post-title::before {
	background-color: var(--wprk-accent);
	content: "";
	display: block;
	height: 2px;
	margin-block-end: var(--wp--preset--spacing--30);
	margin-inline: auto;
	width: 3rem;
}

.wprk-test-3 .wprk-test-3__body > p {
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.4;
	margin-block-start: 0.125rem;
	overflow-wrap: break-word;
}

/*
 * Front end only: a testimonial without a designation leaves no gap.
 * In the editor the empty field stays in place, so it can still be reached.
 */
.wprk-test-3 .wprk-test-3__body > p:not(.block-editor-block-list__block):empty {
	display: none;
}

/* ---------- Without a picture ---------- */

/*
 * A testimonial without a picture has the text as the first thing in its
 * slide. It stays centred on every screen, at a comfortable reading length.
 * (In the editor an empty picture frame is shown instead, ready to be filled.)
 */
.wprk-test-3 .wprk-test-3__slide > .wprk-test-3__body:first-child {
	margin-inline: auto;
	max-width: 46rem;
	text-align: center;
	width: 100%;
}

.wprk-test-3 .wprk-test-3__slide > .wprk-test-3__body:first-child > .wp-block-post-excerpt > p {
	text-wrap: balance;
}

.wprk-test-3 .wprk-test-3__slide > .wprk-test-3__body:first-child > .wp-block-post-title::before {
	margin-inline: auto;
}

/* ---------- Wide screens: portrait beside the quote ---------- */

@media (min-width: 782px) {
	.wprk-test-3 .wprk-test-3__slide {
		align-items: center;
		flex-direction: row;
		gap: var(--wp--preset--spacing--60);
		text-align: start;
	}

	.wprk-test-3 .wprk-test-3__slide > .wp-block-post-featured-image {
		flex: 0 0 30%;
		margin-inline: 0;
		max-width: 18rem;
	}

	.wprk-test-3 .wprk-test-3__body {
		flex: 1 1 0%;
	}

	.wprk-test-3 .wprk-test-3__body > .wp-block-post-title::before {
		margin-inline: 0;
	}
}
