/* ============================================================
 * BIOTA · PRIMITIVE · Slideshow
 * The shared mechanic behind the product picker and the testimonial rail.
 * Card design lives with each rail (_rail.css, testimonials.css); this file
 * only owns the *interaction* — the arrows, the dots, and the scroll states.
 *
 * slideshow.js builds .biota-ss around an existing rail at runtime, so the
 * markup keeps whatever structure it already had:
 *
 *   .biota-ss
 *     .biota-ss__head  > .biota-ss__nav > .biota-ss__btn ×2
 *     .biota-ss__track   the existing rail (.biota-rail / __rail), upgraded
 *     .biota-ss__dots  > .biota-ss__dot ×n
 * ============================================================ */

.biota-ss {
	position: relative;
}

/* Arrows sit right-aligned above the track, so the same row works whether the
   section heading is rendered by the pattern (picker) or by the block itself. */
.biota-ss__head {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 14px;
}
.biota-ss__nav {
	display: flex;
	gap: 8px;
	flex: none;
}
.biota-ss__btn {
	width: 36px;
	height: 36px;
	border-radius: 999px;
	border: 1.5px solid #e2e5ea;
	background: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: var(--wp--preset--color--primary, #102C57);
	padding: 0;
	transition: border-color 0.2s, background 0.2s, opacity 0.2s;
}
.biota-ss__btn:hover {
	border-color: var(--wp--preset--color--primary, #102C57);
	background: #f4f8fe;
}
/* Disabled at the ends so the boundary is felt rather than discovered. */
.biota-ss__btn[disabled] {
	opacity: 0.32;
	cursor: default;
	border-color: #e2e5ea;
	background: #ffffff;
}

/* The rail already supplies display/gap/overflow/snap and its own card widths.
   Only the motion behaviour is added here. */
.biota-ss__track {
	scroll-behavior: smooth;
	cursor: grab;
}
/* DRAGGING: snap off so the track follows the pointer 1:1 and can rest
   mid-card, and behavior auto so each scrollLeft write lands instantly.
   Without this the browser snap-corrects every write and the drag jumps. */
.biota-ss__track.is-grabbing {
	cursor: grabbing;
	scroll-behavior: auto;
	scroll-snap-type: none;
}
/* SETTLING: the rAF easing owns the motion, so snap stays off until it lands. */
.biota-ss__track.is-settling {
	scroll-behavior: auto;
	scroll-snap-type: none;
}
.biota-ss__track:focus-visible {
	outline: 2px solid var(--wp--preset--color--action, #2563EB);
	outline-offset: 4px;
	border-radius: 4px;
}

.biota-ss__dots {
	display: flex;
	gap: 6px;
	justify-content: center;
	margin-top: 16px;
}
.biota-ss__dot {
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: #d5d9e0;
	border: none;
	padding: 0;
	cursor: pointer;
	transition: width 0.25s, background 0.25s;
}
.biota-ss__dot:hover {
	background: #b6bdc7;
}
.biota-ss__dot.is-active {
	width: 20px;
	background: var(--wp--preset--color--primary, #102C57);
}

/* Nothing to scroll (few enough cards to fit): the controls would be inert, so
   drop them rather than showing two disabled arrows and a single dot. */
.biota-ss.is-static .biota-ss__head,
.biota-ss.is-static .biota-ss__dots {
	display: none;
}
.biota-ss.is-static .biota-ss__track {
	cursor: default;
}

@media (max-width: 860px) {
	/* Arrows are redundant where swipe is native — the card peeking off the
	   right edge already carries the affordance. */
	.biota-ss__head {
		display: none;
	}
	.biota-ss__dots {
		margin-top: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.biota-ss__track {
		scroll-behavior: auto;
	}
	.biota-ss__dot {
		transition: none;
	}
}

/* Arrows parked with the heading (see slideshow.js). Absolute rather than a
 * flex row because the header holds a title and a subtitle as separate blocks,
 * and a row would sit them side by side. */
.biota-ss-hasnav {
	position: relative;
	padding-right: 96px;
}
.biota-ss-hasnav .biota-ss__nav {
	position: absolute;
	right: 0;
	/* Sits on the heading block's baseline rather than its middle, so the arrows
	 * finish level with the last line of text above the gallery. Both heading
	 * wrappers have no bottom padding, so their box bottom is that line. */
	bottom: 0;
}
@media (max-width: 599px) {
	/* Too tight beside the heading on a phone: let it fall back under it. */
	.biota-ss-hasnav {
		padding-right: 0;
	}
	.biota-ss-hasnav .biota-ss__nav {
		position: static;
		transform: none;
		justify-content: flex-end;
		margin-top: 12px;
	}
}
