/**
 * Reviews & Endorsements for Elementor — frontend styles.
 *
 * All custom properties can be overridden by the widget's Elementor style
 * controls, so the defaults only need to look finished on their own.
 */

.epre-endorsements {
	--epre-columns: 3;
	--epre-gap: 24px;
	--epre-text-align: left;
	--epre-card-bg: #ffffff;
	--epre-card-border: rgba(17, 24, 39, 0.1);
	--epre-card-radius: 10px;
	--epre-quote-color: #1f2937;
	--epre-muted-color: #6b7280;
	--epre-accent-color: #1d4ed8;
	--epre-star-color: #f59e0b;
	--epre-star-empty-color: rgba(107, 114, 128, 0.3);
	--epre-star-size: 18px;
	--epre-avatar-size: 52px;
	--epre-arrow-size: 44px;
	--epre-dot-size: 8px;
	--epre-dot-color: rgba(107, 114, 128, 0.4);
	--epre-dot-active-color: #1d4ed8;

	color: var(--epre-quote-color);
}

.epre-endorsements *,
.epre-endorsements *::before,
.epre-endorsements *::after {
	box-sizing: border-box;
}

/* Layout ------------------------------------------------------------------ */

.epre-grid {
	display: grid;
	grid-template-columns: repeat(var(--epre-columns), minmax(0, 1fr));
	gap: var(--epre-gap);
	margin: 0;
	padding: 0;
}

.epre-layout--featured .epre-grid {
	--epre-columns: 1;
}

.epre-item {
	display: flex;
	flex-direction: column;
	align-items: var(--epre-align-items, flex-start);
	margin: 0;
	padding: 24px;
	text-align: var(--epre-text-align, left);
	background-color: var(--epre-card-bg);
	border: 1px solid var(--epre-card-border);
	border-radius: var(--epre-card-radius);
}

.epre-layout--featured .epre-item {
	padding: 32px;
}

/* Rating ------------------------------------------------------------------ */

.epre-rating {
	display: flex;
	gap: 2px;
	margin: 0 0 12px;
	line-height: 1;
}

.epre-star {
	display: inline-flex;
	width: var(--epre-star-size);
	height: var(--epre-star-size);
	color: var(--epre-star-empty-color);
}

.epre-star.is-filled {
	color: var(--epre-star-color);
}

.epre-star svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

/* Quotation --------------------------------------------------------------- */

.epre-quote {
	flex: 1 1 auto;
	margin: 0 0 16px;
	padding: 0;
	border: 0;
	font-size: 1rem;
	line-height: 1.65;
	quotes: none;
}

.epre-quote p {
	margin: 0 0 0.75em;
}

.epre-quote p:last-child {
	margin-bottom: 0;
}

.epre-toggle {
	display: inline-block;
	margin: 0 0 16px;
	padding: 0;
	font: inherit;
	font-size: 0.875em;
	font-weight: 600;
	color: var(--epre-accent-color);
	background: none;
	border: 0;
	border-radius: 4px;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.epre-toggle:hover {
	text-decoration-thickness: 2px;
}

.epre-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* Citation ---------------------------------------------------------------- */

.epre-cite {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	margin-top: auto;
	text-align: left;
}

.epre-avatar {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: var(--epre-avatar-size);
	height: var(--epre-avatar-size);
	overflow: hidden;
	border-radius: 50%;
	background-color: rgba(29, 78, 216, 0.1);
	color: var(--epre-accent-color);
	font-size: calc(var(--epre-avatar-size) * 0.38);
	font-weight: 600;
	line-height: 1;
}

.epre-avatar-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.epre-avatar--generic svg {
	width: 62%;
	height: 62%;
	fill: currentColor;
}

.epre-identity {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.epre-name {
	font-weight: 600;
	line-height: 1.35;
}

.epre-role,
.epre-org,
.epre-date,
.epre-source {
	font-size: 0.85em;
	line-height: 1.4;
	color: var(--epre-muted-color);
}

.epre-source {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: baseline;
}

.epre-source-link {
	color: var(--epre-accent-color);
	text-underline-offset: 3px;
}

.epre-source-link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Carousel ---------------------------------------------------------------- */

.epre-carousel-shell {
	position: relative;
}

.epre-carousel {
	overflow: hidden;
	width: 100%;
}

.epre-carousel .swiper-wrapper {
	display: flex;
	align-items: stretch;
	box-sizing: content-box;
}

.epre-slide {
	display: flex;
	height: auto;
	flex: 0 0 auto;
}

.epre-slide > .epre-item {
	width: 100%;
}

/* Readable list before Swiper initializes, and when JavaScript is disabled. */
.epre-carousel:not(.swiper-initialized) .swiper-wrapper {
	gap: var(--epre-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
}

.epre-carousel:not(.swiper-initialized) .epre-slide {
	flex: 0 0 min(340px, 85%);
	scroll-snap-align: start;
}

.epre-arrows {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin-top: 16px;
}

/*
 * Arrow buttons are hardened against host theme and Elementor button styles,
 * which otherwise stretch them into oversized pills and shrink the chevron to
 * nothing. Geometry and typography inheritance are pinned with !important,
 * scoped to the plugin's own arrows; colors and borders are left at normal
 * weight so the widget's Elementor style controls keep working.
 */
.epre-endorsements .epre-arrow {
	-webkit-appearance: none;
	appearance: none !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	position: relative;
	box-sizing: border-box !important;
	width: var(--epre-arrow-size) !important;
	height: var(--epre-arrow-size) !important;
	min-width: var(--epre-arrow-size) !important;
	max-width: var(--epre-arrow-size) !important;
	min-height: var(--epre-arrow-size) !important;
	max-height: var(--epre-arrow-size) !important;
	flex: 0 0 var(--epre-arrow-size) !important;
	aspect-ratio: 1 !important;
	padding: 0 !important;
	margin: 0 !important;
	font-size: 0 !important;
	line-height: 0 !important;
	letter-spacing: normal !important;
	word-spacing: normal !important;
	text-indent: 0 !important;
	text-transform: none !important;
	text-decoration: none !important;
	text-shadow: none !important;
	box-shadow: none !important;
	background-image: none !important;
	overflow: visible;
	isolation: isolate;
	color: var(--epre-quote-color);
	background-color: transparent;
	border: 1px solid var(--epre-card-border);
	border-radius: 50%;
	cursor: pointer;
}

/* Theme button decorations must never sit on top of the chevron. */
.epre-endorsements .epre-arrow::before {
	content: none !important;
}

/*
 * Guarantees a 44x44 CSS pixel hit target even when an editor picks a smaller
 * visual size. Transparent, and behind the icon.
 */
.epre-endorsements .epre-arrow::after {
	content: "" !important;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: max(100%, 44px);
	height: max(100%, 44px);
	background: none !important;
	border: 0 !important;
	box-shadow: none !important;
	border-radius: inherit;
	z-index: 0;
}

.epre-endorsements .epre-arrow > svg {
	display: block !important;
	position: relative;
	z-index: 1;
	flex: 0 0 auto !important;
	width: max(calc(var(--epre-arrow-size) * 0.45), 16px) !important;
	height: max(calc(var(--epre-arrow-size) * 0.45), 16px) !important;
	margin: 0 !important;
	padding: 0 !important;
	max-width: none !important;
	fill: none !important;
	stroke: currentColor !important;
	stroke-width: 2;
	overflow: visible;
	pointer-events: none;
}

.epre-endorsements .epre-arrow:hover {
	color: var(--epre-accent-color);
	border-color: currentColor;
}

.epre-endorsements .epre-arrow:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
	color: var(--epre-accent-color);
}

.epre-endorsements .epre-arrow[disabled] {
	opacity: 0.4;
	cursor: default;
}

.epre-endorsements .epre-arrow[hidden],
.epre-endorsements .epre-dots[hidden] {
	display: none !important;
}

.epre-carousel--static .epre-arrows,
.epre-carousel--static .epre-dots {
	display: none;
}

.epre-arrows--sides .epre-arrows {
	margin-top: 0;
}

.epre-arrows--sides .epre-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	background-color: var(--epre-card-bg);
}

.epre-arrows--sides .epre-arrow--prev {
	left: calc(var(--epre-arrow-size) * -0.5);
}

.epre-arrows--sides .epre-arrow--next {
	right: calc(var(--epre-arrow-size) * -0.5);
}

.epre-dots {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin-top: 16px;
	position: static;
}

.epre-dots .swiper-pagination-bullet {
	width: var(--epre-dot-size);
	height: var(--epre-dot-size);
	background-color: var(--epre-dot-color);
	border-radius: 50%;
	opacity: 1;
	cursor: pointer;
}

.epre-dots .swiper-pagination-bullet-active {
	background-color: var(--epre-dot-active-color);
}

/* Editor placeholder ------------------------------------------------------- */

.epre-placeholder {
	padding: 20px;
	border: 1px dashed var(--epre-card-border, rgba(17, 24, 39, 0.25));
	border-radius: 8px;
	color: #6b7280;
	font-size: 0.9rem;
	text-align: center;
}

/* Responsive fallbacks ----------------------------------------------------- */

@media (max-width: 1024px) {
	.epre-grid {
		grid-template-columns: repeat(var(--epre-columns), minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.epre-arrows--sides .epre-arrow--prev,
	.epre-arrows--sides .epre-arrow--next {
		position: static;
		transform: none;
	}

	.epre-arrows--sides .epre-arrows {
		margin-top: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.epre-carousel .swiper-wrapper {
		transition-duration: 0ms !important;
	}
}
