/**
 * Testimonial (default and compact), testimonial slider, the reviews
 * page grid and the homepage testimonials section (also on the about
 * page). Markup in inc/testimonials.php, inc/reviews.php and
 * inc/front-page.php, behaviour in assets/js/slider.js. Loaded only on
 * pages with a slider (front page, reviews page, about page). See
 * "Testimonial", "Testimonial slider", "Reviews page" and "About page"
 * in docs/design-system.md.
 *
 * No backgrounds here: each section sets its own.
 */

/* Testimonial: centered, limited line length. */
.bst-testimonial {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 40em;
	margin: 0 auto;
	text-align: center;
}

.bst-testimonial__mark {
	display: block;
	height: 0.55em;
	color: var(--color-accent);
	font-family: var(--font-heading);
	font-size: calc(var(--text-h1) * 1.5);
	line-height: 1;
}

/* Resets the GeneratePress blockquote border, padding and size. */
.bst-testimonial__quote {
	margin: 0 0 1.5em;
	padding: 0;
	border: 0;
	color: var(--color-forest);
	font-family: var(--font-heading);
	font-size: var(--text-h3);
	font-style: italic;
	line-height: 1.6;
}

.bst-testimonial__quote p {
	margin: 0;
}

.bst-testimonial__author {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.bst-testimonial__avatar {
	display: block;
	width: 5rem;
	height: 5rem;
	margin-bottom: 1em;
	object-fit: cover;
	background-color: var(--color-border);
}

/* Name: menu type style in --color-text. */
.bst-testimonial__name {
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--text-menu);
	font-weight: 500;
	letter-spacing: 0.15em;
	text-transform: uppercase;
}

/* Role: the site-wide date style. */
.bst-testimonial__role {
	color: var(--color-accent);
	font-family: var(--font-heading);
	font-size: var(--text-body);
	font-style: italic;
	line-height: 1.4;
}

/*
 * Compact variant (reviews page grid): left aligned, small quote mark,
 * quote at --text-link, small avatar with the name and role next to it.
 */
.bst-testimonial--compact {
	align-items: flex-start;
	max-width: none;
	margin: 0;
	text-align: left;
}

.bst-testimonial--compact .bst-testimonial__mark {
	font-size: var(--text-h1);
}

.bst-testimonial--compact .bst-testimonial__quote {
	margin-bottom: 1.25em;
	font-size: var(--text-link);
	line-height: 1.7;
}

/* Avatar over both rows; name above, role below, next to it. */
.bst-testimonial--compact .bst-testimonial__author {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	column-gap: 1em;
	align-items: center;
}

.bst-testimonial--compact .bst-testimonial__avatar {
	grid-row: 1 / 3;
	width: 3rem;
	height: 3rem;
	margin-bottom: 0;
}

.bst-testimonial--compact .bst-testimonial__name {
	align-self: end;
}

.bst-testimonial--compact .bst-testimonial__role {
	align-self: start;
}

/*
 * Slider: CSS scroll snap, one slide per view. Usable without JS (swipe,
 * scrollbar, keyboard on the focusable region); slider.js adds
 * `is-enhanced`, shows the buttons and hides the scrollbar.
 */
.bst-slider {
	position: relative;
}

.bst-slider__track {
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
}

.bst-slider.is-enhanced .bst-slider__track {
	scrollbar-width: none;
}

.bst-slider.is-enhanced .bst-slider__track::-webkit-scrollbar {
	display: none;
}

.bst-slider__list {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bst-slider__slide {
	display: flex;
	flex: 0 0 100%;
	justify-content: center;
	margin: 0;
	scroll-snap-align: center;
	scroll-snap-stop: always;
}

/* Buttons: below the slide on small screens. */
.bst-slider__nav:not([hidden]) {
	display: flex;
	justify-content: center;
	gap: 1em;
	margin-top: var(--gap);
}

button.bst-slider__button,
button.bst-slider__button:hover,
button.bst-slider__button:focus {
	background-color: transparent;
	color: var(--color-forest);
}

button.bst-slider__button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	cursor: pointer;
	transition: opacity var(--motion-fast) ease;
}

button.bst-slider__button svg {
	width: 28px;
	height: 28px;
}

button.bst-slider__button[aria-disabled="true"] {
	opacity: 0.35;
	cursor: default;
}

/* From 1024px: buttons at the left and right edges, centered on the slide. */
@media (min-width: 1024px) {

	.bst-slider__nav:not([hidden]) {
		position: absolute;
		inset: 0;
		align-items: center;
		justify-content: space-between;
		margin: 0;
		pointer-events: none;
	}

	button.bst-slider__button {
		pointer-events: auto;
	}
}

/*
 * Reviews page grid (ivory): one column, two from 768px. Rows stretch,
 * items start at the same top.
 */
.bst-reviews-grid__list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: calc(var(--gap) * 2);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {

	.bst-reviews-grid__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.bst-reviews-grid__item {
	margin: 0;
}

/* Editor content right after the ivory grid: one section gap, not two. */
.bst-reviews-grid + .bst-reviews-content {
	padding-top: 0;
}

/* Homepage testimonials section (front page, about page): button below the slider. */
.bst-home-testimonials__more {
	margin: calc(var(--section-y) / 2) 0 0;
	text-align: center;
}
