/* Vuelta heroes (design-system/content/layout.json hero, tools/build-home-specs.py): the hero types blocks alone
   cannot draw (a hero under a transparent header, the two parallax heroes) and the entrance animations. Overlay, split
   and text heroes are blocks and named styles; their CSS is in home.css or none. Motion: transform and opacity only,
   individual `translate` / `scale` so the entrance composes with the parallax transform of assets/js/hero-motion.js;
   nothing moves under prefers-reduced-motion, and the editor shows the finished state. Tokens only. */

:root { --vt-header-h: var(--wp--custom--layout--header-height-mobile); }
@media (min-width: 1024px) {
	:root { --vt-header-h: var(--wp--custom--layout--header-height); }
}

/* ---------- a hero under the transparent header ---------- */
/* doubled class: outranks the hero types' own margin resets (core's alignfull margins, the stage's margin-block) */
.vt-hero--under-header { --vt-header-offset: var(--vt-header-h); }
.vt-hero--under-header.vt-hero--under-header { margin-top: calc(-1 * var(--vt-header-h)) !important; }
.wp-block-cover.vt-hero--under-header,
.vt-hero--split.vt-hero--under-header,
.vt-hero--text.vt-hero--under-header { padding-top: calc(var(--vt-header-h) + var(--wp--preset--spacing--60)) !important; }
@media (max-width: 781px) {
	.wp-block-cover.is-style-hero.vt-hero--under-header { padding-top: 0 !important; }
	.wp-block-cover.is-style-hero.vt-hero--under-header .wp-block-cover__inner-container { padding-top: calc(var(--vt-header-h) + var(--wp--preset--spacing--50)); }
}

/* ---------- parallax photo: a Hero cover whose photo scrolls slower than the page ---------- */
.vt-hero--parallax-photo .wp-block-cover__image-background { will-change: transform; }

/* ---------- parallax stage: background, headline, floor and product layers in one scene ---------- */
/* The stage is a size container, so the headline and the products scale with the scene, not the viewport. The three
   layer images share one size and crop; the products image is a cut-out (transparent PNG) whose base sits on the
   floor's horizon. Layer order in the markup is the stacking order: background, headline, floor, products. */
.vt-hero-px { position: relative; isolation: isolate; overflow: hidden; margin-block: 0 !important; padding: 0 !important; }
.vt-hero-px > * { margin-block: 0 !important; }
.vt-hero-px__stage { position: relative; width: 100%; max-width: none !important; height: calc(min(100vw * 9 / 16, 86svh) + var(--vt-header-offset, 0px)); min-height: var(--wp--custom--layout--hero-min); container-type: size; overflow: hidden; }
.vt-hero-px__stage > * { margin: 0 !important; }
.vt-hero-px__layer { position: absolute; inset: 0; will-change: transform; }
.vt-hero-px__layer img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; border-radius: 0; }
.vt-hero-px__stage > .vt-hero-px__products { inset: auto 0 10cqh 0; height: 46cqh; }
.vt-hero-px__products img { object-fit: contain; }
.vt-hero-px__title { position: absolute; inset-inline: 0; top: calc(var(--vt-header-offset, 0px) + 4cqh); padding-inline: var(--wp--custom--layout--gutter); text-align: center; font-size: min(15cqw, 26cqh); line-height: var(--wp--custom--line-height--display); letter-spacing: var(--wp--custom--letter-spacing--display); text-wrap: balance; will-change: transform, opacity; }
.vt-hero-px__body { position: relative; z-index: 1; }
@media (max-width: 599px) {
	.vt-hero-px__stage { height: calc(125vw + var(--vt-header-offset, 0px)); }
	.vt-hero-px__stage > .vt-hero-px__products { height: 40cqh; bottom: 12cqh; }
	.vt-hero-px__title { font-size: min(17cqw, 22cqh); }
}

/* ---------- entrance animations (layout.json hero.entrance: vt-anim--<name> on the hero) ---------- */
@keyframes vt-fade { from { opacity: 0; } }
@keyframes vt-rise { from { opacity: 0; translate: 0 var(--wp--custom--motion--rise); } }
@keyframes vt-lights { from { opacity: 0; scale: var(--wp--custom--motion--zoom); } }

@media (prefers-reduced-motion: no-preference) {
	/* `backwards`: the animation only fills before it starts, so the finished state is the page's own state */
	:where(body:not(.editor-styles-wrapper)) .vt-anim--fade { animation: vt-fade var(--wp--custom--transition--reveal) backwards; }
	:where(body:not(.editor-styles-wrapper)) .vt-anim--rise .vt-hero__copy { animation: vt-rise var(--wp--custom--transition--reveal) backwards; }

	/* stagger: the copy's blocks one after another, then the picture */
	:where(body:not(.editor-styles-wrapper)) .vt-anim--stagger .vt-hero__copy > * { animation: vt-rise var(--wp--custom--transition--reveal) backwards; }
	:where(body:not(.editor-styles-wrapper)) .vt-anim--stagger .vt-hero__copy > :nth-child(2) { animation-delay: calc(var(--wp--custom--transition--reveal-step) * 1); }
	:where(body:not(.editor-styles-wrapper)) .vt-anim--stagger .vt-hero__copy > :nth-child(3) { animation-delay: calc(var(--wp--custom--transition--reveal-step) * 2); }
	:where(body:not(.editor-styles-wrapper)) .vt-anim--stagger .vt-hero__copy > :nth-child(4) { animation-delay: calc(var(--wp--custom--transition--reveal-step) * 3); }
	:where(body:not(.editor-styles-wrapper)) .vt-anim--stagger .vt-hero__copy > :nth-child(n + 5) { animation-delay: calc(var(--wp--custom--transition--reveal-step) * 4); }
	:where(body:not(.editor-styles-wrapper)) .vt-anim--stagger .vt-hero__media { animation: vt-fade var(--wp--custom--transition--reveal) calc(var(--wp--custom--transition--reveal-step) * 2) backwards; }
	:where(body:not(.editor-styles-wrapper)) .vt-anim--stagger .vt-hero-px__title { animation: vt-rise var(--wp--custom--transition--reveal) backwards; }

	/* scene (parallax stage): the lights come up, the headline rises, the products land, then the copy follows */
	:where(body:not(.editor-styles-wrapper)) .vt-anim--scene :is(.vt-hero-px__bg, .vt-hero-px__floor) { animation: vt-lights var(--wp--custom--transition--reveal) backwards; }
	:where(body:not(.editor-styles-wrapper)) .vt-anim--scene .vt-hero-px__title { animation: vt-rise var(--wp--custom--transition--reveal) calc(var(--wp--custom--transition--reveal-step) * 2) backwards; }
	:where(body:not(.editor-styles-wrapper)) .vt-anim--scene .vt-hero-px__products img { animation: vt-rise var(--wp--custom--transition--reveal) calc(var(--wp--custom--transition--reveal-step) * 4) backwards; }
	:where(body:not(.editor-styles-wrapper)) .vt-anim--scene .vt-hero__copy > * { animation: vt-rise var(--wp--custom--transition--reveal) calc(var(--wp--custom--transition--reveal-step) * 6) backwards; }
	:where(body:not(.editor-styles-wrapper)) .vt-anim--scene .vt-hero__copy > :nth-child(n + 2) { animation-delay: calc(var(--wp--custom--transition--reveal-step) * 7); }
}

/* ---------- hero slider (blocks/hero-slider, blocks/hero-slide): a scroll-snap row of slides, each a full Hero; the
   controls sit on the dark hero card, bottom centre. Swipe is native; view.js adds the dots and autoplay. ---------- */
.vt-slider { position: relative; margin-block: 0 !important; }
.vt-slider__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.vt-slider__track::-webkit-scrollbar { display: none; }
/* height cap (owner, 2026-11-25): on desktop the slider is at most 40% of the screen height; phones and tablets and
   the editor keep the full height (the stacked slide would be cut) */
@media (min-width: 1024px) {
	.vt-slider:not(.is-editing) .vt-slider__track { max-height: 40vh; }
	/* the slide content fits the cap (owner, 2026-11-25): tighter card padding (the dots sit in the column gap, so no
	   row is kept for them), a wider copy so the title takes two lines, title and image sized by the screen height */
	.vt-slider:not(.is-editing) .vt-slide > .vt-hero > .is-style-hero-card { padding-block: var(--wp--preset--spacing--40) !important; }
	/* a narrower card, centred in the frame (owner, 2026-11-25) */
	.vt-slider:not(.is-editing) .vt-slide > .vt-hero > .is-style-hero-card { width: 100%; max-width: 70%; margin-inline: auto; }
	.vt-slider:not(.is-editing) .vt-slide .vt-hero__copy > * { max-width: none !important; }
	.vt-slider:not(.is-editing) .vt-slide .vt-hero__copy > * + * { margin-block-start: var(--wp--preset--spacing--30); }
	/* a first line hidden on desktop (the editor's hide option) keeps no gap above the title */
	.vt-slider:not(.is-editing) .vt-slide .vt-hero__copy > .wp-block-hidden-desktop:first-child + * { margin-block-start: 0; }
	.vt-slider:not(.is-editing) .vt-slide .is-style-hero-title { font-size: clamp(var(--wp--preset--font-size--x-large), min(5vh, 2.8vw), var(--wp--custom--font-size--hero-display)); }
	.vt-slider:not(.is-editing) .vt-slide .is-style-lead { font-size: clamp(var(--wp--preset--font-size--medium), 2.2vh, var(--wp--preset--font-size--large)); }
	.vt-slider:not(.is-editing) .vt-slide .vt-hero__media img { width: auto; max-width: 100%; height: auto; max-height: calc(40vh - 2 * var(--wp--preset--spacing--60)); margin-inline: auto; object-fit: contain; }
	.vt-slider:not(.is-editing) .vt-slider__controls { bottom: var(--wp--preset--spacing--30); }
}
.vt-slider__track > .vt-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; display: flex; flex-direction: column; }
.vt-slide > .vt-hero { flex: 1; display: flex; flex-direction: column; margin: 0 !important; }
.vt-slide > .vt-hero > .is-style-hero-card { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-bottom: calc(var(--wp--preset--spacing--70) + var(--wp--custom--control--min)) !important; }
.vt-slider__controls { position: absolute; left: 50%; bottom: calc(var(--wp--preset--spacing--30) + var(--wp--preset--spacing--40)); translate: -50% 0; display: flex; align-items: center; gap: var(--wp--preset--spacing--20); color: var(--wp--preset--color--on-accent); }
.vt-slider__dot:focus-visible { outline: var(--wp--custom--border--focus) solid var(--wp--preset--color--focus-inverse); outline-offset: 2px; }
.vt-slider__dots { display: flex; align-items: center; }
/* a 24px target around an 8px dot; the current one stretches into a bar */
.vt-slider__dot { display: grid; place-items: center; width: 24px; height: var(--wp--custom--control--min); padding: 0; border: 0; background: none; cursor: pointer; }
.vt-slider__dot::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--wp--preset--color--on-dark-muted); transition: width var(--wp--custom--transition--fast), background-color var(--wp--custom--transition--fast); }
.vt-slider__dot[aria-current="true"] { width: 36px; }
.vt-slider__dot[aria-current="true"]::before { width: 24px; background: var(--wp--preset--color--signature-2); }
@media (prefers-reduced-motion: reduce) {
	.vt-slider__track { scroll-behavior: auto; }
}

/* editor: slides stacked, each with its number, so every slide can be edited and duplicated */
.vt-slider.is-editing { display: flex; flex-direction: column; gap: var(--wp--preset--spacing--40); }
.vt-slider.is-editing > .vt-slide { position: relative; outline: 1px dashed var(--wp--preset--color--border-strong); }
.vt-slider.is-editing > .vt-slide::before { content: attr(data-slide-label); position: absolute; top: var(--wp--preset--spacing--20); left: var(--wp--preset--spacing--20); z-index: 2; padding: 2px 8px; border-radius: 999px; background: var(--wp--preset--color--accent-1); color: var(--wp--preset--color--on-accent); font-size: 12px; font-weight: 600; pointer-events: none; }
.vt-slider.is-editing .is-style-hero-card { padding-bottom: var(--wp--preset--spacing--70) !important; }
