/**
 * Emmaus Church — premium motion (CSS only where possible).
 * Scroll reveals are activated by .is-inview from IntersectionObserver.
 */

/* -------------------------------------------------------------------------
   Non-blocking branded intro (critical styles also inlined in wp_head)
--------------------------------------------------------------------------- */
.emmaus-preloader {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	background: var(--wp--preset--color--purple, #4b1f7a);
	pointer-events: none;
	transition: opacity 0.45s ease, visibility 0.45s ease;
}

.emmaus-preloader.is-done {
	opacity: 0;
	visibility: hidden;
}

.emmaus-preloader__mark {
	width: 3.25rem;
	height: 3.25rem;
	animation: emmaus-preloader-pulse 0.9s ease-in-out infinite alternate;
}

.emmaus-preloader__mark svg {
	width: 100%;
	height: 100%;
	display: block;
}

@keyframes emmaus-preloader-pulse {
	from { transform: scale(0.96); opacity: 0.85; }
	to { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.emmaus-preloader {
		transition: none;
	}

	.emmaus-preloader__mark {
		animation: none;
	}
}

/* -------------------------------------------------------------------------
   Scroll reveals — only when JS enables motion (no-JS stays visible)
--------------------------------------------------------------------------- */
html.emmaus-motion .emmaus-reveal {
	opacity: 0;
	transform: translate3d(0, 1.25rem, 0);
	transition:
		opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: opacity, transform;
}

html.emmaus-motion .emmaus-reveal.is-inview {
	opacity: 1;
	transform: none;
	will-change: auto;
}

html.emmaus-motion .emmaus-reveal--delay-1 { transition-delay: 0.08s; }
html.emmaus-motion .emmaus-reveal--delay-2 { transition-delay: 0.16s; }
html.emmaus-motion .emmaus-reveal--delay-3 { transition-delay: 0.24s; }

/* -------------------------------------------------------------------------
   Hero entrance
--------------------------------------------------------------------------- */
html.emmaus-motion .emmaus-hero__walking,
html.emmaus-motion .emmaus-hero__together,
html.emmaus-motion .emmaus-hero__with {
	opacity: 0;
	transform: translate3d(0, 0.85rem, 0);
	transition:
		opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

html.emmaus-motion .emmaus-hero.is-ready .emmaus-hero__walking {
	opacity: 1;
	transform: none;
	transition-delay: 0.12s;
}

html.emmaus-motion .emmaus-hero.is-ready .emmaus-hero__together {
	opacity: 1;
	transform: none;
	transition-delay: 0.28s;
}

html.emmaus-motion .emmaus-hero.is-ready .emmaus-hero__with {
	opacity: 1;
	transform: none;
	transition-delay: 0.42s;
}

html.emmaus-motion .emmaus-hero__media img {
	transform: scale(1.04);
	transition: transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

html.emmaus-motion .emmaus-hero.is-ready .emmaus-hero__media img {
	transform: scale(1);
}

/* -------------------------------------------------------------------------
   Buttons & links — refined press feedback
--------------------------------------------------------------------------- */
.wp-block-button__link:active,
.emmaus-btn:active,
.emmaus-newsletter__submit:active,
.emmaus-contact__send:active {
	transform: translateY(1px) scale(0.98);
}

.emmaus-link-more {
	transition: color 0.2s ease, letter-spacing 0.2s ease;
}

.emmaus-link-more:hover {
	letter-spacing: 0.02em;
}

/* -------------------------------------------------------------------------
   Cards — soft lift + image zoom
--------------------------------------------------------------------------- */
.emmaus-event-card,
.emmaus-blog-card,
.emmaus-program-card,
.emmaus-service-card,
.emmaus-leader {
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.emmaus-event-card:hover,
.emmaus-blog-card:hover,
.emmaus-program-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 16px 36px rgba(17, 17, 17, 0.14);
}

.emmaus-event-card__media img,
.emmaus-blog-card__media img,
.emmaus-program-card__media img {
	transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.emmaus-event-card:hover .emmaus-event-card__media img,
.emmaus-blog-card:hover .emmaus-blog-card__media img,
.emmaus-program-card:hover .emmaus-program-card__media img {
	transform: scale(1.04);
}

/* -------------------------------------------------------------------------
   Form focus polish
--------------------------------------------------------------------------- */
.emmaus-newsletter__field,
.emmaus-contact__fields input,
.emmaus-contact__message textarea {
	transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

.emmaus-form-notice {
	animation: emmaus-notice-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes emmaus-notice-in {
	from {
		opacity: 0;
		transform: translateY(-0.4rem);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* -------------------------------------------------------------------------
   Mobile menu overlay fade
--------------------------------------------------------------------------- */
.emmaus-header .wp-block-navigation__responsive-container {
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* -------------------------------------------------------------------------
   Reduced motion — content always visible, no delayed reveals
--------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.emmaus-reveal,
	.emmaus-reveal.is-inview,
	.emmaus-hero__walking,
	.emmaus-hero__together,
	.emmaus-hero__with,
	.emmaus-hero.is-ready .emmaus-hero__walking,
	.emmaus-hero.is-ready .emmaus-hero__together,
	.emmaus-hero.is-ready .emmaus-hero__with {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}

	.emmaus-hero__media img,
	.emmaus-hero.is-ready .emmaus-hero__media img {
		transform: none !important;
		transition: none !important;
	}

	.emmaus-event-card:hover,
	.emmaus-blog-card:hover,
	.emmaus-program-card:hover,
	.wp-block-button__link:hover,
	.emmaus-btn:hover,
	.wp-block-button__link:active,
	.emmaus-btn:active {
		transform: none !important;
	}

	.emmaus-form-notice {
		animation: none !important;
	}
}

/* No hover lifts on coarse pointers */
@media (hover: none) {
	.emmaus-event-card:hover,
	.emmaus-blog-card:hover,
	.emmaus-program-card:hover {
		transform: none;
		box-shadow: inherit;
	}

	.emmaus-event-card:hover .emmaus-event-card__media img,
	.emmaus-blog-card:hover .emmaus-blog-card__media img,
	.emmaus-program-card:hover .emmaus-program-card__media img {
		transform: none;
	}
}
