/*
 * rooster/media, variant track, sideways (the multi-look demo, 20 Nov 2026; rooster-admin docs/multi-demo/PLAN.md
 * section 5, B2): loaded only where a track renders and the page's skin allows it (variants/track.php). From 1,024 px
 * and with motion allowed, the track reserves below its pin the room the strip travels (the count of figures, from
 * the server's `--rooster-track-n`, times a figure and its gap, less the strip's own width: the variant's figures are
 * min(880px, 86 %) of the strip, 1.5rem apart), so the page is as tall as it will be before the script comes and
 * nothing shifts; the pin (the strip and its controls) stays under the sticky header (`--rooster-sticky-top`, the
 * theme's) while the page scrolls through that room, and the store (track-sideways.js) moves the figures by
 * `--rooster-track-x`, a transform only. The strip clips rather than scrolls there, so the buttons' and the keys'
 * own scrolling has nothing to move and the store takes them. Narrower, or with less motion asked: the strip.
 *
 * The figures take the screen's height there (the owner, 20 Nov 2026, of a pinned strip of small screenshots: "ought
 * to take much larger part of the screen (even in the vertical space)"): each picture is as tall as the pinned room
 * under the sticky header less the caption and the controls (`--rooster-track-h`), as wide as its own shape makes it
 * and never wider than the strip; the reserved room counts a figure as 1.6 times that height (a screenshot's shape),
 * and the store measures the real travel, so a strip of other shapes only moves a little faster or slower.
 */

@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
	.rooster-track.is-sideways {
		--rooster-track-h: max(18rem, calc(100svh - var(--rooster-sticky-top, 0px) - 2 * var(--wp--preset--spacing--4, 1rem) - 9rem));
		container-type: inline-size;
	}

	.rooster-track.is-sideways .rooster-track__pin {
		position: sticky;
		top: calc(var(--rooster-sticky-top, 0px) + var(--wp--preset--spacing--4, 1rem));
	}

	.rooster-track.is-sideways .rooster-track__strip {
		overflow: clip;
		scroll-snap-type: none;
		scroll-behavior: auto;
	}

	.rooster-track.is-sideways .rooster-track__slide {
		flex-basis: auto;
		max-width: 100cqw;
		transform: translate3d(var(--rooster-track-x, 0px), 0, 0);
		will-change: transform;
	}

	.rooster-track.is-sideways .rooster-track__image {
		width: auto;
		max-width: 100cqw;
		height: var(--rooster-track-h);
		object-fit: contain;
	}

	.rooster-track.is-sideways::after {
		content: "";
		display: block;
		height: max(0px, calc(var(--rooster-track-n, 1) * (min(100cqw, 1.6 * var(--rooster-track-h)) + 1.5rem) - 1.5rem - 100cqw));
	}
}
