/**
 * Testimonial post cards: clamp long quotes and show the full review in a dialog.
 * Applies to every Post Cards element that lists the Testimonial CPT; no layout changes needed.
 * Paired with testimonial-read-more.js, which adds the button only to quotes that are actually cut off.
 */
.fusion-post-cards[data-post-type-label="testimonials"] .fusion-content-tb {
	--fd-testi-lines: 6;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--fd-testi-lines);
	line-clamp: var(--fd-testi-lines);
	overflow: hidden;
}

/*
 * The carousel clips at its own edges (overflow: hidden), which cut off the cards' box shadow (blur 24, y 6).
 * Pad it so the shadow has room, and pull it back out by the same amount so the cards don't move or shrink.
 * Slides sit 40px apart, so the 24px gutter never shows a neighbouring card.
 */
.fusion-post-cards.awb-swiper[data-post-type-label="testimonials"] {
	width: calc(100% + 48px);
	/* Avada's carousel JS writes an inline max-width (the column width) on smaller screens. */
	max-width: none !important;
	padding: 0 24px 8px;
	margin-left: -24px;
	margin-right: -24px;
}

@media (max-width: 640px) {
	.fusion-post-cards[data-post-type-label="testimonials"] .fusion-content-tb {
		--fd-testi-lines: 8;
	}
}

.fd-testi-more {
	display: inline-block;
	align-self: flex-start;
	margin: -1vh 0 1.5vh;
	padding: 0;
	border: 0;
	background: none;
	color: var(--awb-color4);
	font: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
}

.fd-testi-more:hover,
.fd-testi-more:focus-visible {
	color: var(--awb-color5);
	text-decoration: underline;
}

.fd-testi-dialog {
	width: min(640px, calc(100vw - 32px));
	max-height: calc(100vh - 48px);
	padding: 32px 36px 24px;
	border: 0;
	border-radius: 12px;
	background: var(--awb-color1, #fff);
	box-shadow: 0 6px 24px rgba(0, 40, 64, 0.2);
	overflow: auto;
}

.fd-testi-dialog::backdrop {
	background: rgba(6, 37, 72, 0.6);
}

.fd-testi-dialog .fusion-layout-column {
	width: 100% !important;
	margin: 0 !important;
}

.fd-testi-dialog .fusion-column-wrapper {
	padding: 0 !important;
	border: 0 !important;
	box-shadow: none !important;
}

@media (max-width: 640px) {
	.fd-testi-dialog {
		padding: 28px 20px 20px;
	}
}

.fd-testi-dialog .fusion-content-tb {
	display: block;
	overflow: visible;
	-webkit-line-clamp: unset;
	line-clamp: unset;
}

.fd-testi-dialog .fusion-content-tb > * + * {
	margin-top: 1em;
}

/* Sticky so it stays reachable while a long review scrolls inside the dialog. */
.fd-testi-close {
	position: sticky;
	top: 0;
	float: right;
	margin: -22px -26px 0 8px;
	z-index: 2;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(16, 55, 120, 0.08);
	color: var(--awb-color8);
	font-size: 24px;
	line-height: 36px;
	cursor: pointer;
}

.fd-testi-close:hover,
.fd-testi-close:focus-visible {
	background: rgba(16, 55, 120, 0.16);
}

@media (max-width: 640px) {
	.fd-testi-close {
		margin: -16px 0 0 8px;
	}
}
