/* Jonah's Music Coaching hero motion and the hero under the transparent header (content.json layout.header.over_hero and
   layout.hero.entrance, tools/build-site.py). Loaded only on pages with a hero. Motion: transform and opacity only,
   once on load, `backwards` fill (the finished state is the page's own state, so nothing hides if animations do not
   run), nothing under prefers-reduced-motion, never in the editor. Tokens only. */

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

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

/* ---------- entrance (jmc-anim--<name> on the hero) ---------- */
@keyframes jmc-fade { from { opacity: 0; } }
@keyframes jmc-rise { from { opacity: 0; translate: 0 var(--wp--custom--motion--rise); } }

@media (prefers-reduced-motion: no-preference) {
	:where(body:not(.editor-styles-wrapper)) .jmc-anim--fade { animation: jmc-fade var(--wp--custom--transition--reveal) backwards; }
	/* rise: the copy's blocks one after another, then the picture */
	:where(body:not(.editor-styles-wrapper)) .jmc-anim--rise .jmc-hero__copy > * { animation: jmc-rise var(--wp--custom--transition--reveal) backwards; }
	:where(body:not(.editor-styles-wrapper)) .jmc-anim--rise .jmc-hero__copy > :nth-child(2) { animation-delay: var(--wp--custom--transition--reveal-step); }
	:where(body:not(.editor-styles-wrapper)) .jmc-anim--rise .jmc-hero__copy > :nth-child(3) { animation-delay: calc(var(--wp--custom--transition--reveal-step) * 2); }
	:where(body:not(.editor-styles-wrapper)) .jmc-anim--rise .jmc-hero__copy > :nth-child(n + 4) { animation-delay: calc(var(--wp--custom--transition--reveal-step) * 3); }
	:where(body:not(.editor-styles-wrapper)) .jmc-anim--rise .jmc-hero__media { animation: jmc-fade var(--wp--custom--transition--reveal) calc(var(--wp--custom--transition--reveal-step) * 2) backwards; }
}
