/*
 * sd/testimonials — owns the review cards' look as well as the grid: sd/testimonial-card renders
 * inside it. Card rules moved here from src/css/primitives/client-voices.css. Words set in bold in a
 * quote get the highlighter strip.
 */
.sd-testimonials {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50);
}
@media (min-width: 768px) { .sd-testimonials { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .sd-testimonials:not(.sd-testimonials--two) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .sd-testimonials { column-gap: var(--wp--preset--spacing--60); } }

/* Breathing room under the section heading the reviews answer. */
.wp-block-heading + .sd-testimonials { margin-block-start: var(--wp--preset--spacing--60); }
@media (min-width: 768px) { .wp-block-heading + .sd-testimonials { margin-block-start: 5rem; } }

/* In a stack the heading is a step away already (the stack's gap); this makes up the rest. */
.wp-block-stronger-stack > .sd-testimonials { margin-block-start: var(--wp--preset--spacing--30); }
@media (min-width: 768px) { .wp-block-stronger-stack > .sd-testimonials { margin-block-start: var(--wp--preset--spacing--50); } }

.sd-testimonial-card .client-voices__stars { margin: 0; }
.sd-testimonial-card .client-voices__stars img { width: 116px; height: auto; }

/*
 * Client voices — short reviews in left-aligned columns (centred is an option), each with its stars, the quote and who
 * said it (Figma 321:17030, the `sd26/strong-client-voices` pattern).
 *
 * The words that matter are set in bold and drawn as a swipe of highlighter with a darker band along
 * its foot. `box-decoration-break: clone` gives every wrapped line its own swipe, so a phrase can
 * break wherever the column needs it to.
 *
 * The review's parts are selected as its direct children: the composition style sets paragraph
 * type with `.is-style-composition :is(p, li)`, and one more class is what outranks it.
 */
.client-voices__review {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--v-5-3);
	max-width: 28rem;
	text-align: left;
	color: var(--wp--preset--color--sd-deep-midnight);
}

.client-voices__review > * {
	margin: 0;
}

.client-voices__review > .client-voices__stars img {
	display: block;
	width: 7.25rem;
	height: auto;
	aspect-ratio: 76.8 / 12.25; /* the artwork's own box, so its space is held before it loads */
}

.client-voices__review > .client-voices__quote {
	margin: 0;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--fixed-18);
	font-style: italic;
	font-weight: 500;
	line-height: var(--wp--custom--line-height--editorial);
	text-wrap: pretty;
	/* The opening quote mark hangs in the margin, so the first word lines up with the stars above
	   and the name below. */
	text-indent: -0.44em;
}

.sd-testimonials--center .client-voices__quote {
	text-indent: 0;
}

.client-voices__quote :is(mark, strong) {
	padding: 0.05em 0.36em;
	/* Pulled back by part of its own padding: far enough that a highlight opening or closing the
	   quote sits close to the quote mark, not so far that its slanted end runs under the mark. */
	margin-inline: -0.13em;
	color: inherit;
	font-weight: 700;
	/* The same swipe as the page-copy placeholders (mark.sd-todo): flat highlighter with a darker
	   band along its foot. Its two ends are cut on the slant of the italic it sits behind; the cut
	   is a mask, so the band is cut with it, and every wrapped line gets its own swipe. */
	background: var(--wp--preset--color--highlighter);
	box-shadow: inset 0 -0.18em 0 rgb(240 200 60 / 0.35);
	-webkit-mask-image: linear-gradient(101deg, transparent 0.2em, #000 0.2em, #000 calc(100% - 0.2em), transparent calc(100% - 0.2em));
	mask-image: linear-gradient(101deg, transparent 0.2em, #000 0.2em, #000 calc(100% - 0.2em), transparent calc(100% - 0.2em));
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}

/* Name and company read as one attribution, so the company sits straight under the name. */
.client-voices__review > .client-voices__name,
.client-voices__review > .client-voices__org,
.sd-testimonial-card__who > .client-voices__name,
.sd-testimonial-card__who > .client-voices__org {
	margin: 0;
	font-family: var(--wp--preset--font-family--sans);
	line-height: var(--wp--custom--line-height--body);
}

.client-voices__review > .client-voices__name,
.sd-testimonial-card__who > .client-voices__name {
	margin-top: var(--wp--preset--spacing--v-5-1);
	font-size: var(--wp--preset--font-size--fixed-16);
	font-weight: 600;
}

.client-voices__review > .client-voices__org,
.sd-testimonial-card__who > .client-voices__org {
	margin-top: calc(-1 * var(--wp--preset--spacing--v-5-3));
	font-size: var(--wp--preset--font-size--fixed-12);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: color-mix(in srgb, var(--wp--preset--color--sd-deep-midnight) 72%, transparent);
}

/* With client logo (a style of the card): name and business as above, the client's logo in ink at
   the right of the same row. The row takes the space the name had above it; inside it the two
   lines sit together with nothing between them. */
.sd-testimonial-card__credit {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--30);
	align-self: stretch;
	margin-top: var(--wp--preset--spacing--v-5-1);
}

.sd-testimonials--center .sd-testimonial-card__credit {
	justify-content: center;
}

.sd-testimonial-card__who {
	min-width: 0;
}

.sd-testimonial-card__who > .client-voices__name,
.sd-testimonial-card__who > .client-voices__org {
	margin-top: 0;
}

.sd-testimonial-card__logo {
	flex: none;
	width: auto;
	height: 34px;
	max-width: 7.5rem;
	object-fit: contain;
	object-position: right center;
	opacity: 0.8;
}

/* Logos differ in shape, so a few are nudged to carry the same weight as the rest. */
.sd-testimonial-card__logo--lonepine,
.sd-testimonial-card__logo--virtus {
	height: 42px;
}

.sd-testimonial-card__logo--blueprint-data {
	height: 26px;
}

/* Pull quote (a style of the block): one review on its own, set large. One column at every width,
   a wider measure, and the quote at heading size; the stars, the credit and the highlighter are
   the card's own. */
.sd-testimonials.sd-testimonials--pull {
	grid-template-columns: minmax(0, 1fr);
}

.sd-testimonials--pull .client-voices__review {
	gap: var(--wp--preset--spacing--30);
	max-width: 52rem;
}

.sd-testimonials--pull .client-voices__review > .client-voices__quote {
	font-size: var(--wp--preset--font-size--heading-4);
	line-height: 1.32;
	letter-spacing: -0.01em;
}

.sd-testimonials--pull .client-voices__name {
	font-size: var(--wp--preset--font-size--fixed-18);
}

.sd-testimonials--pull .sd-testimonial-card__credit {
	justify-content: flex-start;
	gap: var(--wp--preset--spacing--40);
}

.sd-testimonials--pull .sd-testimonial-card__logo {
	order: -1;
	object-position: left center;
}

.sd-testimonials--center.sd-testimonials--pull .client-voices__review {
	max-width: 52rem;
}

.sd-testimonials--center.sd-testimonials--pull .sd-testimonial-card__credit {
	justify-content: center;
}

/* Centred, as an option: the columns and everything in them sit on the centre line. */
.sd-testimonials--center .client-voices__review {
	align-items: center;
	max-width: 26rem;
	margin-inline: auto;
	text-align: center;
}


/*
 * The read-more cell: the last cell of the grid. It is a way out, not a seventh review, so it is
 * quiet, and it matches the "more" band under the work tiles (content kit, card style More): the same
 * near-white rounded ground with no edge or shadow, the same hand-written line in the page's ink, and
 * the site's quiet button.
 */
.sd-testimonials__more {
	display: grid;
	align-content: center;
	justify-items: center;
	gap: var(--wp--preset--spacing--30);
	align-self: stretch;
	max-width: 28rem;
	min-height: 11rem;
	padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
	border-radius: 1.375rem;
	background: color-mix(in srgb, var(--wp--preset--color--paper-edge) 8%, var(--wp--preset--color--white));
	text-align: center;
}

/* The same five stars as the reviews, a little smaller, to say what is behind the link. */
.sd-testimonials__more-stars {
	display: block;
	width: 6rem;
	height: auto;
}

.sd-testimonials .sd-testimonials__more-note {
	max-width: 13em;
	margin: 0;
	font-family: var(--wp--preset--font-family--script);
	font-size: var(--wp--preset--font-size--fixed-18);
	font-weight: 500;
	line-height: 1.25;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-wrap: balance;
	color: var(--wp--preset--color--sd-deep-midnight);
}

.sd-testimonials .sd-testimonials__more-action {
	justify-content: center;
	margin: 0;
}

/* Words and arrow key stay on one line (the key itself is drawn in the content kit). */
.sd-testimonials .sd-testimonials__more-action .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
	white-space: nowrap;
}

.sd-testimonials--center .sd-testimonials__more {
	margin-inline: auto;
}

