/**
 * Testimonial Grid styles.
 * Matches Figma Testimonial Section slider — desktop (823:11787); ≤768px (823:11816).
 */

.testimonial-grid {
	--testimonial-arrow-size: 2.25rem; /* 36px */
	--testimonial-arrow-gap: clamp(1rem, 2.5vw, 1.5rem); /* 24px — space between arrow and slide */
	--testimonial-track-padding: calc(
		var(--testimonial-arrow-size) + clamp(2.5rem, 6vw, 3.75rem)
	); /* reserves slide area — unchanged */
	box-sizing: border-box;
	color: var(--wp--preset--color--coffee, #3c1f10);
	overflow: visible;
	padding-bottom: clamp(1.25rem, 3vw, 1.25rem); /* 20px */
	padding-top: clamp(3.5rem, 8vw, 5rem); /* 80px */
	width: 100%;
}

.testimonial-grid:not(.has-background) {
	background-color: var(--wp--preset--color--butter-yellow, #f5e29e);
}

.testimonial-grid:not(.has-text-color) {
	color: var(--wp--preset--color--coffee, #3c1f10);
}

.testimonial-grid *,
.testimonial-grid *::before,
.testimonial-grid *::after {
	box-sizing: border-box;
}

.testimonial-grid__inner {
	margin-left: auto;
	margin-right: auto;
	max-width: 89.5rem; /* 1432px */
	padding-left: clamp(1.25rem, 4vw, 2.5rem); /* 40px */
	padding-right: clamp(1.25rem, 4vw, 2.5rem);
	width: 100%;
}

/* -------------------------------------------------------------------------
   Slider shell — Figma node 823:11787
   Track spans edge-to-edge; arrows sit outside in the viewport margins.
   ------------------------------------------------------------------------- */

.testimonial-grid__slider {
	overflow: visible;
	padding-inline: var(--testimonial-track-padding);
	position: relative;
	width: 100%;
}

.testimonial-grid__track {
	min-width: 0;
	overflow: hidden;
	width: 100%;
}

.testimonial-grid__swiper {
	min-width: 0;
	overflow: hidden;
	width: 100%;
}

.testimonial-grid__swiper .swiper-wrapper {
	align-items: stretch;
}

.testimonial-grid__slide.swiper-slide {
	height: auto;
	min-width: 0;
}

/* -------------------------------------------------------------------------
   Prev / next navigation
   ------------------------------------------------------------------------- */

.testimonial-grid__arrow {
	align-items: center;
	background: transparent;
	border: 1.5px solid currentColor;
	border-radius: 2rem;
	color: inherit;
	cursor: pointer;
	display: inline-flex;
	flex-shrink: 0;
	height: var(--testimonial-arrow-size);
	justify-content: center;
	margin: 0;
	padding: 0;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	transition: opacity 0.2s ease;
	width: var(--testimonial-arrow-size);
	z-index: 2;
}

.testimonial-grid__arrow--prev {
	left: calc(
		var(--testimonial-track-padding) - var(--testimonial-arrow-size) -
			var(--testimonial-arrow-gap)
	);
}

.testimonial-grid__arrow--next {
	right: calc(
		var(--testimonial-track-padding) - var(--testimonial-arrow-size) -
			var(--testimonial-arrow-gap)
	);
}

.testimonial-grid__arrow::before {
	background: url(../../assets/images/pagination-arrow.svg) center / contain no-repeat;
	content: "";
	display: block;
	height: 0.875rem; /* 14px */
	width: 0.75rem; /* 12px */
}

.testimonial-grid__arrow--prev::before {
	transform: rotate(90deg);
}

.testimonial-grid__arrow--next::before {
	transform: rotate(-90deg);
}

.testimonial-grid__arrow:hover,
.testimonial-grid__arrow:focus-visible {
	opacity: 0.85;
}

.testimonial-grid__arrow:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.testimonial-grid__arrow--disabled,
.testimonial-grid__arrow.swiper-button-disabled {
	cursor: default;
	opacity: 0.35;
	pointer-events: none;
}

/* -------------------------------------------------------------------------
   Editor — slide cards with inline fields
   ------------------------------------------------------------------------- */

.editor-styles-wrapper .testimonial-grid__slider--editor {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 1.5rem;
	width: 100%;
}

.editor-styles-wrapper .testimonial-grid__slide-editor {
	flex: 0 0 min(100%, 25.625rem);
	max-width: min(100%, 25.625rem);
	min-width: 0;
}

.editor-styles-wrapper .testimonial-grid__slide-header {
	align-items: center;
	display: flex;
	gap: 0.5rem;
	justify-content: space-between;
	margin-bottom: 0.75rem;
}

.editor-styles-wrapper .testimonial-grid__slide-label {
	font-family: var(
		--wp--preset--font-family--gt-maru-mono,
		ui-monospace,
		Consolas,
		Menlo,
		monospace
	);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.editor-styles-wrapper .testimonial-grid__remove-slide {
	flex-shrink: 0;
}

.editor-styles-wrapper .testimonial-grid__add-slide {
	margin-top: 1rem;
	width: 100%;
}

.editor-styles-wrapper .testimonial-grid__add-slide .components-button {
	justify-content: center;
	width: 100%;
}

.editor-styles-wrapper .testimonial__stars--editable {
	gap: 0.25rem;
}

.editor-styles-wrapper .testimonial__star--btn {
	background: transparent url(./assets/rating-star.svg) center / contain no-repeat;
	border: 0;
	cursor: pointer;
	display: block;
	flex-shrink: 0;
	height: 1.25rem;
	opacity: 0.25;
	padding: 0;
	width: 1.25rem;
}

.editor-styles-wrapper .testimonial__star--btn.is-active {
	opacity: 1;
}

.editor-styles-wrapper .testimonial__star--btn:hover,
.editor-styles-wrapper .testimonial__star--btn:focus-visible {
	opacity: 0.85;
}

.editor-styles-wrapper .testimonial-grid__slide-editor .components-base-control {
	margin-bottom: 0;
}

.editor-styles-wrapper .testimonial-grid__slide-editor .components-base-control__label {
	font-size: 11px;
	font-weight: 500;
	margin-bottom: 4px;
	text-transform: uppercase;
}

.editor-styles-wrapper .testimonial-grid__sidebar-slide {
	border: 1px solid #ddd;
	border-radius: 4px;
	margin-bottom: 12px;
	padding: 12px;
}

.editor-styles-wrapper .testimonial-grid__sidebar-slide-title {
	font-weight: 600;
	margin: 0 0 8px;
}

.editor-styles-wrapper .testimonial-grid__sidebar-slide-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 8px;
}

/* -------------------------------------------------------------------------
   Single testimonial card
   ------------------------------------------------------------------------- */

.testimonial-grid .testimonial,
.testimonial-grid .wp-block-cwp-testimonial {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin: 0;
	min-width: 0;
	width: 100%;
}

.testimonial__rating {
	display: flex;
	flex-direction: column;
	gap: 0.75rem; /* 12px */
	width: 100%;
}

.testimonial__stars {
	align-items: center;
	display: flex;
	flex-wrap: nowrap;
	gap: 0.125rem;
	height: 1.25rem; /* 20px */
}

.testimonial__star {
	background: transparent url(./assets/rating-star.svg) center / contain no-repeat;
	display: block;
	flex-shrink: 0;
	height: 1.25rem;
	width: 1.25rem;
}

/* Hairline rules */
.testimonial__rule {
	background-color: currentColor;
	border: 0;
	display: block;
	height: 1px;
	margin: 0.75rem 0 0; /* 12px under stars / before bottom edge */
	padding: 0;
	width: 100%;
}

.testimonial__rule--top {
	margin-bottom: 0.75rem; /* 12px above quote */
}

.testimonial__rule--bottom {
	margin-top: 1.5rem; /* 24px under attribution */
}

.testimonial__quote-wrap {
	display: flex;
	flex-direction: column;
	gap: 1.5rem; /* 24px — Figma spacing before attribution */
	width: 100%;
}

/* Quote body */
.testimonial-grid .testimonial__quote-text,
.testimonial-grid p.testimonial__quote-text,
.testimonial-grid .wp-block-quote p,
.testimonial-grid .testimonial__quote p {
	color: inherit;
	font-family: var(
		--wp--preset--font-family--pp-neue-montreal,
		"PP Neue Montreal",
		sans-serif
	);
	font-size: var(--wp--preset--font-size--paragraph-m, 1rem); /* 16px */
	font-weight: 400;
	letter-spacing: 0.02em;
	line-height: 1.4;
	margin: 0;
}

/* Attribution / name */
.testimonial-grid .testimonial__attribution,
.testimonial-grid p.testimonial__attribution,
.testimonial-grid .wp-block-quote cite,
.testimonial-grid .testimonial__quote cite,
.testimonial-grid .wp-block-quote .wp-block-quote__citation,
.testimonial-grid .testimonial__quote .wp-block-quote__citation {
	color: inherit;
	display: block;
	font-family: var(
		--wp--preset--font-family--gt-maru-mono,
		ui-monospace,
		Consolas,
		Menlo,
		monospace
	);
	font-size: var(--wp--preset--font-size--text-button-l, 1.125rem); /* 18px */
	font-style: normal;
	font-weight: 500;
	letter-spacing: -0.04em;
	line-height: 0.9;
	margin: 0;
	text-align: left;
	text-transform: uppercase;
}

/* Legacy core/quote slides — keep editable and styled. */
.testimonial-grid .wp-block-quote,
.testimonial-grid .testimonial__quote,
.testimonial-grid blockquote {
	border: 0;
	margin: 0;
	padding: 0;
	position: relative;
}

.testimonial-grid .wp-block-quote::before,
.testimonial-grid .wp-block-quote.has-text-align-right p::before,
.testimonial-grid .testimonial__quote::before {
	content: none !important;
	display: none !important;
}

.testimonial-grid .wp-block-quote p,
.testimonial-grid .wp-block-quote cite,
.testimonial-grid .testimonial__quote p,
.testimonial-grid .testimonial__quote cite {
	margin-left: 0 !important;
	margin-right: 0;
}

.testimonial-grid .wp-block-quote cite,
.testimonial-grid .testimonial__quote cite,
.testimonial-grid .wp-block-quote .wp-block-quote__citation,
.testimonial-grid .testimonial__quote .wp-block-quote__citation {
	margin-top: 1.5rem;
}

/* Editor: quote fields in slide cards. */
.editor-styles-wrapper .testimonial-grid__slide-editor .testimonial__quote-wrap {
	gap: 1rem;
}

.editor-styles-wrapper .testimonial-grid__slide-editor .testimonial__quote-wrap textarea {
	font-family: var(
		--wp--preset--font-family--pp-neue-montreal,
		"PP Neue Montreal",
		sans-serif
	);
	font-size: var(--wp--preset--font-size--paragraph-m, 1rem);
	line-height: 1.4;
	min-height: 6rem;
}

.editor-styles-wrapper .testimonial-grid__slide-editor .testimonial__quote-wrap input[type="text"] {
	font-family: var(
		--wp--preset--font-family--gt-maru-mono,
		ui-monospace,
		Consolas,
		Menlo,
		monospace
	);
	font-size: var(--wp--preset--font-size--text-button-l, 1.125rem);
	font-weight: 500;
	letter-spacing: -0.04em;
	text-transform: uppercase;
}

.testimonial-grid .screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/* ≤768px — Figma Testimonial Section (node 823:11816).
   Full-bleed peek on both sides; loop fills the edges. */
@media (max-width: 48rem) {
	.testimonial-grid {
		overflow: hidden;
		padding: 1.25rem 0;
	}

	.testimonial-grid__slider {
		overflow: visible;
		padding-inline: 0;
	}

	.testimonial-grid__track,
	.testimonial-grid__swiper {
		overflow: hidden;
	}

	.testimonial-grid__slide.swiper-slide {
		width: 16.875rem; /* 270px — Figma */
	}

	.testimonial-grid__arrow {
		background: var(--wp--preset--color--parchment, #faf9f4);
	}

	.testimonial-grid__arrow--prev {
		left: calc(50% - 11.21875rem); /* 359px pagination / 2 */
	}

	.testimonial-grid__arrow--next {
		right: calc(50% - 11.21875rem);
	}

	.testimonial-grid__arrow--disabled,
	.testimonial-grid__arrow.swiper-button-disabled {
		cursor: pointer;
		opacity: 1;
		pointer-events: auto;
	}
}
