/* Northern Sky - Testimonials
   Structural / layout CSS only. Colors, typography, spacing and the
   dim/scale amounts are controlled per-instance from the Elementor Style
   tab (see the widget's "selectors" in class-testimonials-widget.php).

   Mechanic: every testimonial is laid out in one flex row (.nsm-testi-track)
   inside an overflow:hidden viewport. JS centers the active card by
   translating the track, so only the active card plus its immediate
   neighbors are visible - everything further away is simply clipped by
   the viewport, matching the reference design. */

.nsm-testimonials,
.nsm-testimonials *,
.nsm-testimonials *::before,
.nsm-testimonials *::after {
	box-sizing: border-box;
}

.nsm-testimonials {
	position: relative;
	width: 100%;
}

.nsm-testimonials-empty {
	padding: 40px;
	text-align: center;
	opacity: 0.6;
}

.nsm-testi-viewport {
	position: relative;
	overflow: hidden;
	width: 100%;
	/* Sized to fit exactly "Visible Cards" cards (default 3) so nothing
	   extra peeks in at the edges - matches the reference design, whatever
	   the surrounding column/section width actually is. */
	max-width: calc( var(--nsm-testi-card-width, 340px) * var(--nsm-testi-visible, 3) + var(--nsm-testi-gap, 20px) * ( var(--nsm-testi-visible, 3) - 1 ) );
	margin-left: auto;
	margin-right: auto;
}

.nsm-testimonials[data-drag="1"] .nsm-testi-viewport {
	cursor: grab;
	touch-action: pan-y;
}

.nsm-testimonials.is-dragging .nsm-testi-viewport {
	cursor: grabbing;
}

.nsm-testi-track {
	display: flex;
	align-items: stretch;
	transition: transform var(--nsm-testi-duration, 0.5s) cubic-bezier(0.65, 0, 0.35, 1);
	will-change: transform;
}

.nsm-testimonials.is-dragging .nsm-testi-track {
	transition: none;
}

.nsm-testi-card {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform: scale(1);
	transition: transform var(--nsm-testi-duration, 0.5s) ease;
	user-select: none;
}

.nsm-testi-card:not(.is-active) {
	transform: scale(var(--nsm-testi-side-scale, 1));
	cursor: pointer;
}

.nsm-testimonials[data-side-click="0"] .nsm-testi-card:not(.is-active) {
	cursor: default;
}

.nsm-testimonials[data-drag="1"] .nsm-testi-card:not(.is-active) {
	cursor: grab;
}

.nsm-testi-image-wrap {
	width: 100%;
	overflow: hidden;
	flex-shrink: 0;
	opacity: 1;
	transition: opacity var(--nsm-testi-duration, 0.5s) ease;
}

.nsm-testi-card:not(.is-active) .nsm-testi-image-wrap {
	opacity: var(--nsm-testi-side-image-opacity, 0.7);
}

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

.nsm-testi-body {
	flex: 1 1 auto;
	opacity: 1;
	transition: opacity var(--nsm-testi-duration, 0.5s) ease;
}

.nsm-testi-card:not(.is-active) .nsm-testi-body {
	opacity: var(--nsm-testi-side-text-opacity, 0.25);
}

.nsm-testi-quote {
	margin: 0;
}

.nsm-testi-name-row {
	margin-top: 20px;
}

.nsm-testi-name {
	margin: 0;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.nsm-testi-name-dash {
	display: inline-block;
}

.nsm-testi-designation {
	margin: 4px 0 0;
}

/* Grayscale on side cards is opt-in (Style > Photo > "Grayscale on Side
   Cards"), scoped to this class rather than baked into the base rule so
   it stays off unless explicitly enabled. */
.nsm-testi-grayscale .nsm-testi-card:not(.is-active) .nsm-testi-image {
	filter: grayscale(1);
}

/* Soft fade over the cropped side-card edges instead of a hard clip -
   sits above the track, doesn't intercept clicks/drags. */
.nsm-testi-edge-fade {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 90px;
	pointer-events: none;
	z-index: 3;
}

.nsm-testi-edge-fade-left {
	left: 0;
	background: linear-gradient(to right, var(--nsm-testi-edge-color, #ffffff) 0%, transparent 100%);
}

.nsm-testi-edge-fade-right {
	right: 0;
	background: linear-gradient(to left, var(--nsm-testi-edge-color, #ffffff) 0%, transparent 100%);
}

.nsm-testi-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	padding: 0;
	font-family: inherit;
	transition: background-color 0.25s ease, color 0.25s ease;
	z-index: 4;
}

.nsm-testi-arrow.is-disabled {
	opacity: 0.35;
	pointer-events: none;
}

.nsm-testi-arrow-prev {
	left: 0;
}

.nsm-testi-arrow-next {
	right: 0;
}

.nsm-testi-arrow svg,
.nsm-testi-arrow i {
	width: 1em;
	font-size: 16px;
}

@media (prefers-reduced-motion: reduce) {
	.nsm-testi-track,
	.nsm-testi-card,
	.nsm-testi-image-wrap,
	.nsm-testi-body {
		transition: none !important;
	}
}

/* Mobile - shrink the arrow offset in from the edge so it doesn't sit on
   top of the dimmed side cards, and give the active card a touch more
   room. */
@media (max-width: 767px) {
	.nsm-testi-arrow-prev {
		left: 4px;
	}

	.nsm-testi-arrow-next {
		right: 4px;
	}
}
