/**
 * Elephanta Review Slider – frontend styles.
 *
 * @package Elephanta\ReviewSlider
 */

.elrs-reviews {
	--elrs-desktop: 3;
	--elrs-tablet: 2;
	--elrs-mobile: 1;
	--elrs-gap: 30px;
	--elrs-bg: #fff;
	--elrs-border: #e5e5e5;
	--elrs-border-width: 1px;
	--elrs-radius: 20px;
	--elrs-padding: 30px;
	--elrs-rating: #ffb822;
	--elrs-name: #172b4c;
	--elrs-text: #5f6368;
	position: relative;
	width: 100%;
	box-sizing: border-box;
	font-family: inherit;
}

.elrs-reviews *,
.elrs-reviews *::before,
.elrs-reviews *::after {
	box-sizing: border-box;
}

.elrs-screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Heading */
.elrs-heading {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	margin: 0 0 40px;
}

.elrs-title {
	width: 100%;
	margin: 0;
	color: var(--elrs-name);
	font-size: clamp(28px, 4vw, 48px);
	line-height: 1.2;
}

.elrs-description {
	max-width: 100%;
	color: var(--elrs-text);
	font-size: 18px;
	line-height: 1.5;
}
.elrs-heading.elrs-summary-wrap--center .elrs-title,
.elrs-heading.elrs-summary-wrap--center .elrs-description {
	text-align: center;
}
.elrs-heading.elrs-summary-wrap--left .elrs-title,
.elrs-heading.elrs-summary-wrap--left .elrs-description {
	text-align: left;
}
.elrs-heading.elrs-summary-wrap--right .elrs-title,
.elrs-heading.elrs-summary-wrap--right .elrs-description {
	text-align: right;
}
.elrs-description p {
	margin: 0 0 10px;
}

.elrs-description p:last-child {
	margin-bottom: 0;
}

/* Slider */
.elrs-slider {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
}

.elrs-viewport {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	touch-action: pan-y;
}

/* Without JavaScript (or in the editor preview) the cards scroll natively. */
.elrs-reviews:not(.is-ready) .elrs-viewport {
	overflow-x: auto;
}

.elrs-track {
	display: flex;
	align-items: stretch;
	gap: var(--elrs-gap);
	transition: transform 450ms ease;
	will-change: transform;
	cursor: grab;
	user-select: none;
	padding: 20px !important;
}

.elrs-track.is-dragging {
	cursor: grabbing;
	transition: none;
}

.elrs-slide {
	display: flex;
	flex: 0 0 calc((100% - (var(--elrs-gap) * (var(--elrs-desktop) - 1))) / var(--elrs-desktop));
	min-width: 0;
}

/* Card */
.elrs-card {
	display: flex;
	flex-direction: column;
	gap: 18px;
	width: 100%;
	height: 100%;
	padding: var(--elrs-padding);
	color: var(--elrs-text);
	background: var(--elrs-bg);
	border: var(--elrs-border-width) solid var(--elrs-border);
	border-radius: var(--elrs-radius);
}

.elrs-card--shadow {
	box-shadow: 0 0px 20px rgba(0, 0, 0, 0.1);
}

.elrs-rating {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	color: var(--elrs-rating);
	font-size: 20px;
	line-height: 1;
}

.elrs-rating .is-empty {
	opacity: 0.25;
}

.elrs-text {
	color: var(--elrs-text);
	font-size: 17px;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.elrs-text p {
	margin: 0 0 0.75em;
}

.elrs-text p:last-child {
	margin-bottom: 0;
}

.elrs-text--clamped {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--elrs-lines, 4);
	line-clamp: var(--elrs-lines, 4);
}

.elrs-text--clamped.is-expanded {
	display: block;
	overflow: visible;
}

.elrs-reviews .elrs-read-more {
	align-self: flex-start;
	margin: -8px 0 0;
	padding: 0;
	color: var(--elrs-name);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	background: transparent;
	border: 0;
	box-shadow: none;
	cursor: pointer;
}

.elrs-reviews .elrs-read-more:hover,
.elrs-reviews .elrs-read-more:focus {
	color: var(--elrs-text);
	background: transparent;
}

/* Profile */
.elrs-profile {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	margin-top: auto;
	padding-top: 18px;
	border-top: 1px solid rgba(23, 43, 76, 0.1);
}

.elrs-card > .elrs-profile:first-child,
.elrs-profile--name-only {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.elrs-avatar {
	display: flex;
	flex: 0 0 54px;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	overflow: hidden;
	color: var(--elrs-name);
	font-weight: 600;
	background: #eef2f5;
	border-radius: 50%;
}

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

.elrs-profile-copy {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.elrs-author {
	color: var(--elrs-name);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.25;
	text-decoration: none;
	overflow-wrap: anywhere;
}

a.elrs-author:hover,
a.elrs-author:focus {
	color: var(--elrs-name);
	text-decoration: underline;
}

.elrs-date {
	color: var(--elrs-text);
	font-size: 14px;
	line-height: 1.35;
}

/* Navigation */
.elrs-reviews .elrs-nav {
	display: inline-flex;
	flex: 0 0 46px;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	color: var(--elrs-name);
	line-height: 1;
	background: var(--elrs-bg);
	border: 1px solid var(--elrs-border);
	border-radius: 50%;
	box-shadow: none;
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.elrs-reviews .elrs-nav:hover:not(:disabled) {
	transform: translateY(-1px);
}

.elrs-reviews .elrs-nav:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.elrs-reviews .elrs-nav[hidden],
.elrs-reviews .elrs-toggle[hidden],
.elrs-reviews .elrs-dots[hidden],
.elrs-reviews .elrs-read-more[hidden] {
	display: none;
}

[dir="rtl"] .elrs-nav svg {
	transform: scaleX(-1);
}

.elrs-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin-top: 24px;
}

.elrs-reviews .elrs-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	color: var(--elrs-name);
	background: transparent;
	border: 1px solid var(--elrs-border);
	border-radius: 50%;
	cursor: pointer;
}

.elrs-toggle .elrs-icon-play,
.elrs-toggle.is-paused .elrs-icon-pause {
	display: none;
}

.elrs-toggle.is-paused .elrs-icon-play {
	display: block;
}

.elrs-dots {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.elrs-reviews .elrs-dot {
	width: 8px;
	height: 8px;
	padding: 0;
	background: var(--elrs-text);
	border: 0;
	border-radius: 999px;
	opacity: 0.35;
	cursor: pointer;
	transition: width 250ms ease, opacity 250ms ease;
}

.elrs-reviews .elrs-dot:hover {
	opacity: 0.7;
}

.elrs-reviews .elrs-dot.is-active {
	width: 24px;
	background: var(--elrs-name);
	opacity: 1;
}

.elrs-reviews button:focus-visible,
.elrs-reviews a:focus-visible {
	outline: 2px solid var(--elrs-name);
	outline-offset: 3px;
}

/* Summary */
.elrs-summary-wrap {
	display: flex;
	justify-content: center;
	margin: 0 0 28px;
}

.elrs-summary-wrap--left {
	justify-content: flex-start;
}

.elrs-summary-wrap--right {
	justify-content: flex-end;
}

.elrs-summary-wrap--bottom {
	margin: 28px 0 0;
}

.elrs-summary {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px 16px;
	max-width: 100%;
	padding: 12px 20px;
	color: var(--elrs-text);
	font-size: 15px;
	line-height: 1.4;
	background: var(--elrs-bg);
	border: var(--elrs-border-width) solid var(--elrs-border);
	border-radius: var(--elrs-radius);
}

.elrs-summary-name {
	color: var(--elrs-name);
	font-weight: 600;
}

.elrs-summary-rating {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
}

.elrs-summary-rating strong {
	color: var(--elrs-name);
	font-size: 1.5em;
	font-weight: 700;
	line-height: 1;
}

.elrs-summary-stars {
	position: relative;
	display: inline-block;
	color: rgba(0, 0, 0, 0.15);
	font-size: 18px;
	line-height: 1;
	letter-spacing: 2px;
	white-space: nowrap;
}

.elrs-summary-stars-fill {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	color: var(--elrs-rating);
}

[dir="rtl"] .elrs-summary-stars-fill {
	right: 0;
	left: auto;
}

.elrs-summary-count {
	white-space: nowrap;
}

/* Google Maps attribution */
.elrs-attribution {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--elrs-text);
	font-size: 14px;
	text-decoration: none;
	white-space: nowrap;
}

a.elrs-attribution:hover .elrs-attribution-text,
a.elrs-attribution:focus .elrs-attribution-text {
	text-decoration: underline;
}

.elrs-attribution-icon {
	flex: 0 0 auto;
}

.elrs-attribution-brand {
	color: var(--elrs-name);
	font-weight: 600;
}

.elrs-reviews > .elrs-attribution {
	display: flex;
	justify-content: center;
	margin-top: 20px;
}

.elrs-message {
	margin: 20px 0;
	padding: 12px 16px;
	background: #fff8e5;
	border-left: 4px solid #dba617;
}

/* Responsive */
@media (max-width: 991px) {
	.elrs-slide {
		flex-basis: calc((100% - (var(--elrs-gap) * (var(--elrs-tablet) - 1))) / var(--elrs-tablet));
	}
}

@media (max-width: 767px) {
	.elrs-heading {
		margin-bottom: 25px;
	}

	.elrs-description,
	.elrs-text {
		font-size: 16px;
	}

	.elrs-slide {
		flex-basis: calc((100% - (var(--elrs-gap) * (var(--elrs-mobile) - 1))) / var(--elrs-mobile));
	}

	.elrs-slider {
		gap: 0px;
	}

	.elrs-reviews .elrs-nav {
		flex-basis: 30px;
		width: 30px;
		height: 30px;
	}
	.elrs-track{
		padding:10px !important;
	}
	.elrs-card {
		padding: max(18px, calc(var(--elrs-padding) * 0.75));
	}
	.elrs-card--shadow {
	  box-shadow: 0 0px 10px rgba(0, 0, 0, 0.1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.elrs-track,
	.elrs-reviews .elrs-nav,
	.elrs-reviews .elrs-dot {
		transition: none;
	}
}
