/**
 * Inoforest Testimonial Slider
 *
 * Contents
 * 1. Variables (card style, then the large quote style)
 * 2. Slider and slides, grid
 * 3. Card
 * 4. Quote icon
 * 5. Stars
 * 6. Text, highlight
 * 7. Author, photo, initials, name, role
 * 8. Navigation: arrows and dots
 * 9. Editor hint
 * 10. Media queries, reduced motion
 *
 * Colours read the Design System (--inoforest-color-*) with the Travel26 design as fallback. Every value that differs
 * between the two styles is a variable set inside :where() (no specificity), so a value picked in the panel, written
 * on the widget root by Elementor, always wins.
 */

/* 1. Variables -------------------------------------------------------------- */
:where(.inoforest-testimonials) {
	--ino-ts-accent: var(--inoforest-color-accent, #ff6a3d);
	--ino-ts-heading: var(--inoforest-color-heading, #0d1b2a);
	--ino-ts-body: var(--inoforest-color-text, #5a6a79);
	--ino-ts-border: var(--inoforest-color-border, #e5ebef);
	--ino-ts-slides: 3;
	--ino-ts-gap: 30px;
	--ino-ts-max: none;
	--ino-ts-align: start;
	--ino-ts-justify: flex-start;
	--ino-ts-ml: 0;
	--ino-ts-mr: auto;
	--ino-ts-card-bg: var(--inoforest-color-background, #fff);
	--ino-ts-card-padding: 40px 36px 34px;
	--ino-ts-card-border: 1px solid var(--ino-ts-border);
	--ino-ts-card-radius: 24px;
	--ino-ts-quote-size: 64px;
	--ino-ts-quote-color: color-mix(in srgb, var(--inoforest-color-primary, #0b7a75) 10%, #fff);
	--ino-ts-quote-bg: transparent;
	--ino-ts-quote-box: auto;
	--ino-ts-quote-space: 10px;
	--ino-ts-quote-top: 28px;
	--ino-ts-quote-side: 30px;
	--ino-ts-quote-flip: none;
	--ino-ts-star: #ffb422;
	--ino-ts-star-empty: color-mix(in srgb, var(--ino-ts-star) 25%, transparent);
	--ino-ts-star-size: 15px;
	--ino-ts-star-gap: 2px;
	--ino-ts-star-space: 18px;
	--ino-ts-star-top: 7px;
	--ino-ts-text-size: 1.05rem;
	--ino-ts-text-weight: 400;
	--ino-ts-text-line: 1.8;
	--ino-ts-text-spacing: normal;
	--ino-ts-text-space: 26px;
	--ino-ts-author-gap: 14px;
	--ino-ts-author-pad: 24px;
	--ino-ts-author-display: flex;
	--ino-ts-divider-width: 1px;
	--ino-ts-divider: var(--ino-ts-border);
	--ino-ts-photo: 58px;
	--ino-ts-photo-radius: 50%;
	--ino-ts-name-size: 1.05rem;
	--ino-ts-name-line: 1.2;
	--ino-ts-name-space: 2px;
	--ino-ts-role-size: 0.875rem;
	--ino-ts-nav-space: 44px;
	--ino-ts-nav-gap: 24px;
	--ino-ts-arrow: 54px;
	--ino-ts-arrow-icon: 22px;
	--ino-ts-arrow-offset: 27px;
	--ino-ts-dot: 10px;
	--ino-ts-dot-active-width: 30px;
	--ino-ts-dot-gap: 12px;
	--ino-ts-dot-color: var(--inoforest-color-muted, #8b99a6);
	--ino-ts-dot-opacity: 0.5;
	--ino-ts-dot-active: var(--ino-ts-accent);
	--ino-ts-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* The large centred quote (Travel26 Home Modern). */
:where(.inoforest-testimonials[data-style="quote"]) {
	--ino-ts-max: 940px;
	--ino-ts-align: center;
	--ino-ts-justify: center;
	--ino-ts-ml: auto;
	--ino-ts-mr: auto;
	--ino-ts-card-bg: transparent;
	--ino-ts-card-padding: 0 80px;
	--ino-ts-card-border: 0;
	--ino-ts-card-radius: 0;
	--ino-ts-quote-size: 36px;
	--ino-ts-quote-color: #fff;
	--ino-ts-quote-bg: var(--ino-ts-accent);
	--ino-ts-quote-box: 76px;
	--ino-ts-quote-space: 24px;
	--ino-ts-quote-flip: rotate(180deg);
	--ino-ts-star-size: 18px;
	--ino-ts-star-space: 20px;
	--ino-ts-star-top: 0px;
	--ino-ts-text-size: clamp(1.2rem, 2.2vw, 1.7rem);
	--ino-ts-text-weight: 600;
	--ino-ts-text-line: 1.55;
	--ino-ts-text-spacing: -0.01em;
	--ino-ts-text-space: 34px;
	--ino-ts-author-gap: 16px;
	--ino-ts-author-pad: 0px;
	--ino-ts-divider-width: 0px;
	--ino-ts-photo: 64px;
	--ino-ts-name-size: 1.1rem;
	--ino-ts-name-line: 1.75;
	--ino-ts-name-space: 0px;
	--ino-ts-role-size: 0.9rem;
	--ino-ts-nav-space: 44px;
}

/* 2. Slider and slides --------------------------------------------------------- */
.inoforest-testimonials {
	position: relative;
}

.inoforest-testimonials__body {
	position: relative;
	max-width: var(--ino-ts-max);
	margin-inline: auto;
}

.inoforest-testimonials__slide {
	height: auto;
}

/* Before Swiper starts (and without JavaScript): the slides already sit side by side at their final width. */
.inoforest-testimonials__slider:not(.swiper-initialized) .swiper-wrapper {
	gap: var(--ino-ts-gap);
}

.inoforest-testimonials__slider:not(.swiper-initialized) .inoforest-testimonials__slide {
	width: calc((100% - (var(--ino-ts-slides) - 1) * var(--ino-ts-gap)) / var(--ino-ts-slides));
}

/* The grid layout (1.1.0): the columns and gap of the carousel's slides per view and gap, no Swiper. */
.inoforest-testimonials[data-layout="grid"] .inoforest-testimonials__grid {
	display: grid;
	grid-template-columns: repeat(var(--ino-ts-slides), minmax(0, 1fr));
	gap: var(--ino-ts-gap);
}

.inoforest-testimonials[data-layout="grid"] .inoforest-testimonials__slide {
	min-width: 0;
}

/* In a grid each card is a column, so the authors line up at the bottom of cards of different lengths. */
.inoforest-testimonials[data-layout="grid"] .inoforest-testimonials__card {
	display: flex;
	flex-direction: column;
}

.inoforest-testimonials[data-layout="grid"] .inoforest-testimonials__quote {
	align-self: var(--ino-ts-justify);
}

.inoforest-testimonials[data-layout="grid"] .inoforest-testimonials__author {
	margin-top: auto;
}

/* 3. Card ----------------------------------------------------------------------- */
.inoforest-testimonials__card {
	position: relative;
	box-sizing: border-box;
	height: 100%;
	margin: 0;
	padding: var(--ino-ts-card-padding);
	text-align: var(--ino-ts-align);
	background: var(--ino-ts-card-bg);
	border: var(--ino-ts-card-border);
	border-radius: var(--ino-ts-card-radius);
}

/* 4. Quote icon ------------------------------------------------------------------ */
.inoforest-testimonials__quote {
	display: grid;
	place-items: center;
	box-sizing: border-box;
	width: var(--ino-ts-quote-box);
	height: var(--ino-ts-quote-box);
	font-size: var(--ino-ts-quote-size);
	line-height: 1;
	color: var(--ino-ts-quote-color);
	background: var(--ino-ts-quote-bg);
	border-radius: 50%;
}

:where(.inoforest-testimonials[data-style="quote"]) .inoforest-testimonials__quote {
	box-shadow: 0 16px 30px -12px color-mix(in srgb, var(--ino-ts-accent) 70%, transparent);
}

.inoforest-testimonials__quote svg {
	display: block;
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.inoforest-testimonials__quote .inoforest-testimonials__quote-mark {
	transform: var(--ino-ts-quote-flip);
}

.inoforest-testimonials[data-quote="corner"] .inoforest-testimonials__quote {
	position: absolute;
	top: var(--ino-ts-quote-top);
	inset-inline-end: var(--ino-ts-quote-side);
}

.inoforest-testimonials[data-quote="above"] .inoforest-testimonials__quote {
	margin-block: 0 var(--ino-ts-quote-space);
	margin-inline: var(--ino-ts-ml) var(--ino-ts-mr); /* start, end */
}

/* 5. Stars ------------------------------------------------------------------------ */
.inoforest-testimonials__rating {
	position: relative;
	display: flex;
	justify-content: var(--ino-ts-justify);
	gap: var(--ino-ts-star-gap);
	margin: var(--ino-ts-star-top) 0 var(--ino-ts-star-space);
	line-height: 1;
	color: var(--ino-ts-star);
}

.inoforest-testimonials__rating svg {
	width: var(--ino-ts-star-size);
	height: var(--ino-ts-star-size);
	fill: currentColor;
}

.inoforest-testimonials__rating .is-empty {
	fill: var(--ino-ts-star-empty);
}

.inoforest-testimonials__rating .is-half {
	-webkit-mask-image: linear-gradient(90deg, #000 50%, rgba(0, 0, 0, 0.25) 50%);
	mask-image: linear-gradient(90deg, #000 50%, rgba(0, 0, 0, 0.25) 50%);
}

/* 6. Text ------------------------------------------------------------------------- */
.inoforest-testimonials__text {
	margin: 0 0 var(--ino-ts-text-space);
	padding: 0;
	font-size: var(--ino-ts-text-size);
	font-weight: var(--ino-ts-text-weight);
	font-style: normal;
	line-height: var(--ino-ts-text-line);
	letter-spacing: var(--ino-ts-text-spacing);
	color: var(--ino-ts-heading);
	background: none;
	border: 0;
}

.inoforest-testimonials__text p {
	margin: 0;
	font: inherit;
	letter-spacing: inherit;
	color: inherit;
}

/* A result in a pill under the text (1.1.0). */
.inoforest-testimonials__card .inoforest-testimonials__highlight {
	display: flex;
	align-items: center;
	gap: 8px;
	box-sizing: border-box;
	width: fit-content;
	max-width: 100%;
	margin-block: 0 var(--ino-ts-text-space);
	margin-inline: var(--ino-ts-ml) var(--ino-ts-mr); /* start, end */
	padding: 6px 14px;
	font-size: 0.875rem;
	font-weight: 700;
	line-height: var(--inoforest-font-body-line-height, 1.7);
	color: var(--ino-ts-accent);
	background-color: color-mix(in srgb, var(--ino-ts-accent) 12%, #fff);
	border-radius: 999px;
}

.inoforest-testimonials__highlight-icon {
	display: inline-flex;
}

.inoforest-testimonials__highlight-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

/* 7. Author ------------------------------------------------------------------------ */
.inoforest-testimonials__author {
	display: flex;
	align-items: center;
	justify-content: var(--ino-ts-justify);
	gap: var(--ino-ts-author-gap);
	margin: 0;
	padding-top: var(--ino-ts-author-pad);
	border-top: var(--ino-ts-divider-width) solid var(--ino-ts-divider);
}

/* Two classes to beat Elementor's `.elementor img` reset. */
.inoforest-testimonials__author .inoforest-testimonials__photo {
	flex: 0 0 auto;
	box-sizing: border-box;
	width: var(--ino-ts-photo);
	max-width: none;
	height: var(--ino-ts-photo);
	object-fit: cover;
	border-radius: var(--ino-ts-photo-radius);
}

/* Initials in place of a photo (1.1.0): the photo's size and corner radius. */
.inoforest-testimonials__author .inoforest-testimonials__initials {
	display: grid;
	flex: 0 0 auto;
	place-items: center;
	box-sizing: border-box;
	width: var(--ino-ts-photo);
	height: var(--ino-ts-photo);
	font-family: var(--inoforest-font-heading-family, inherit);
	font-weight: 700;
	line-height: 1;
	color: var(--inoforest-color-primary, #0b7a75);
	background-color: color-mix(in srgb, var(--inoforest-color-primary, #0b7a75) 12%, #fff);
	border-radius: var(--ino-ts-photo-radius);
}

:where(.inoforest-testimonials[data-style="quote"]) .inoforest-testimonials__author .inoforest-testimonials__photo {
	border: 3px solid #fff;
	box-shadow: 0 6px 20px rgba(13, 27, 42, 0.07);
}

/* Elementor's e-swiper CSS sets line-height 0 on figures inside slides; the parts set their own. */
.inoforest-testimonials__who {
	min-width: 0;
	line-height: 1.75;
	text-align: start;
}

.inoforest-testimonials__name {
	display: block;
	margin: 0 0 var(--ino-ts-name-space);
	font-size: var(--ino-ts-name-size);
	font-weight: 800;
	font-style: normal;
	line-height: var(--ino-ts-name-line);
	letter-spacing: -0.02em;
	color: var(--ino-ts-heading);
}

.inoforest-testimonials__role {
	font-size: var(--ino-ts-role-size);
	color: var(--ino-ts-body);
}

/* 8. Navigation --------------------------------------------------------------------- */
.inoforest-testimonials__nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--ino-ts-nav-gap);
	margin-top: var(--ino-ts-nav-space);
}

.inoforest-testimonials .inoforest-testimonials__arrow {
	display: grid;
	flex: 0 0 auto;
	place-items: center;
	box-sizing: border-box;
	width: var(--ino-ts-arrow);
	height: var(--ino-ts-arrow);
	margin: 0;
	padding: 0;
	font-size: var(--ino-ts-arrow-icon);
	line-height: 1;
	color: var(--ino-ts-heading);
	cursor: pointer;
	background: #fff;
	border: 1px solid var(--ino-ts-border);
	border-radius: 50%;
	transition: background-color 0.35s var(--ino-ts-ease), color 0.35s var(--ino-ts-ease), border-color 0.35s var(--ino-ts-ease);
}

.inoforest-testimonials .inoforest-testimonials__arrow:hover,
.inoforest-testimonials .inoforest-testimonials__arrow:focus-visible {
	color: #fff;
	background: var(--ino-ts-accent);
	border-color: var(--ino-ts-accent);
}

.inoforest-testimonials .inoforest-testimonials__arrow:focus-visible {
	outline: 2px solid var(--ino-ts-accent);
	outline-offset: 3px;
}

.inoforest-testimonials .inoforest-testimonials__arrow svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.inoforest-testimonials .inoforest-testimonials__arrow.swiper-button-disabled {
	opacity: 0.4;
	pointer-events: none;
}

.inoforest-testimonials .inoforest-testimonials__arrow.swiper-button-lock {
	display: none;
}

/* Arrows at the sides of the slider (moved below it under 1360 px, section 10). */
.inoforest-testimonials[data-nav="sides"] .inoforest-testimonials__arrow {
	position: absolute;
	top: calc(50% - 50px);
	z-index: 5;
	box-shadow: 0 6px 20px rgba(13, 27, 42, 0.07);
}

.inoforest-testimonials[data-nav="sides"] .inoforest-testimonials__prev {
	left: calc(var(--ino-ts-arrow-offset) * -1);
}

.inoforest-testimonials[data-nav="sides"] .inoforest-testimonials__next {
	right: calc(var(--ino-ts-arrow-offset) * -1);
}

/* Out-rank Elementor's e-swiper pagination rules (absolute position, bottom offset, bullet margins). */
.inoforest-testimonials .inoforest-testimonials__nav .inoforest-testimonials__dots.swiper-pagination {
	position: static;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--ino-ts-dot-gap);
	width: auto;
	margin: 0;
	transform: none;
}

.inoforest-testimonials .inoforest-testimonials__nav .inoforest-testimonials__dots .swiper-pagination-bullet {
	width: var(--ino-ts-dot);
	height: var(--ino-ts-dot);
	margin: 0;
	background: var(--ino-ts-dot-color);
	border-radius: var(--ino-ts-dot);
	opacity: var(--ino-ts-dot-opacity);
	transition: width 0.35s var(--ino-ts-ease), background-color 0.35s var(--ino-ts-ease);
}

.inoforest-testimonials .inoforest-testimonials__nav .inoforest-testimonials__dots .swiper-pagination-bullet-active {
	width: var(--ino-ts-dot-active-width);
	background: var(--ino-ts-dot-active);
	opacity: 1;
}

.inoforest-testimonials .inoforest-testimonials__nav .inoforest-testimonials__dots .swiper-pagination-bullet:focus-visible {
	outline: 2px solid var(--ino-ts-dot-active);
	outline-offset: 3px;
}

.inoforest-testimonials .inoforest-testimonials__dots.swiper-pagination-lock {
	display: none;
}

/* 9. Editor hint -------------------------------------------------------------------- */
.inoforest-testimonials__hint {
	margin: 0;
	padding: 12px 16px;
	font-size: 13px;
	color: #6d4c00;
	background: #fff8e1;
	border: 1px dashed #e0b84c;
	border-radius: 6px;
}

/* 10. Media queries ---------------------------------------------------------------- */
@media (max-width: 1360px) {
	.inoforest-testimonials[data-nav="sides"] .inoforest-testimonials__arrow {
		position: static;
	}
}

@media (max-width: 991px) {
	:where(.inoforest-testimonials[data-style="quote"]) {
		--ino-ts-card-padding: 0 40px;
	}
}

@media (max-width: 767px) {
	:where(.inoforest-testimonials[data-style="quote"]) {
		--ino-ts-card-padding: 0;
		--ino-ts-quote-box: 62px;
		--ino-ts-quote-size: 28px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.inoforest-testimonials .inoforest-testimonials__arrow,
	.inoforest-testimonials .inoforest-testimonials__dots .swiper-pagination-bullet {
		transition: none;
	}
}
