/* ProWP Car — Desktop motion layer.
 *
 * Premium, restrained motion for the On4Car front end. Every effect here is
 * gated to the exact condition the brief asks for:
 *
 *   min-width: 1024px  AND  (hover: hover)  AND  (prefers-reduced-motion: no-preference)
 *
 * and is switched off entirely when the body carries `pwc-motion-off`
 * (ProWP Car -> Settings -> Motion & Developer Credit -> Enable animations).
 *
 * Only opacity and transform are animated, so nothing shifts the layout.
 * Colours come from the --pwc-* token sheet (brand-tokens.css).
 */

@media (min-width: 1024px) and (hover: hover) and (prefers-reduced-motion: no-preference) {

	/* ----------------------------------------------------------------------
	   1. Scroll reveal — one-shot fade + lift for section blocks
	   ---------------------------------------------------------------------- */
	body:not(.pwc-motion-off) [data-pwc-reveal] {
		transition:
			opacity .72s var(--pwc-ease, cubic-bezier(.16, 1, .3, 1)),
			transform .72s var(--pwc-ease, cubic-bezier(.16, 1, .3, 1));
	}

	body:not(.pwc-motion-off) [data-pwc-reveal="pending"] {
		opacity: 0;
		transform: translate3d(0, 1.25rem, 0);
	}

	body:not(.pwc-motion-off) [data-pwc-reveal="done"] {
		opacity: 1;
		transform: none;
	}

	/* ----------------------------------------------------------------------
	   2. Card hover lift + depth
	   ---------------------------------------------------------------------- */
	body:not(.pwc-motion-off) .pwc-sec-card:hover {
		transform: translateY(-8px);
		box-shadow: var(--pwc-shadow-lg, 0 24px 64px rgba(21, 19, 20, .16));
	}

	body:not(.pwc-motion-off) .pwc-sec-card:hover .pwc-sec-card__img {
		transform: scale(1.06);
	}

	body:not(.pwc-motion-off) .pwc-sec-cov__card:hover {
		transform: translateY(-6px);
	}

	/* ----------------------------------------------------------------------
	   3. Button micro-interactions
	   ---------------------------------------------------------------------- */
	body:not(.pwc-motion-off) .pwc-sec-btn:hover {
		transform: translateY(-2px);
	}

	body:not(.pwc-motion-off) .pwc-sec-btn:active {
		transform: translateY(0) scale(.985);
	}

	body:not(.pwc-motion-off) .pwc-sec-btn--primary:hover {
		box-shadow:
			var(--pwc-shadow-brand, 0 12px 32px rgba(215, 25, 38, .26)),
			0 10px 22px rgba(21, 19, 20, .14);
	}

	body:not(.pwc-motion-off) .pwc-sec-carousel-btn:hover {
		transform: translateY(-2px);
	}

	/* ----------------------------------------------------------------------
	   4. Hero — subtle ken-burns + parallax
	   ---------------------------------------------------------------------- */
	body:not(.pwc-motion-off) .pwc-sec-hero__media,
	body:not(.pwc-motion-off) .pwc-sec-hero__slider {
		transform: translate3d(0, var(--pwc-parallax-y, 0px), 0) scale(1.05);
		will-change: transform;
	}

	body:not(.pwc-motion-off) .pwc-sec-hero__media-el {
		animation: pwc-ken-burns 30s var(--pwc-ease, cubic-bezier(.16, 1, .3, 1)) infinite alternate;
		transform-origin: center center;
	}
}

/* Ken-burns keyframes (shared by every breakpoint that opts in). */
@keyframes pwc-ken-burns {
	from {
		transform: scale(1.005);
	}

	to {
		transform: scale(1.05);
	}
}

/* ----------------------------------------------------------------------
   Motion fully disabled from the plugin settings.
   ---------------------------------------------------------------------- */
body.pwc-motion-off .pwc-sec-card,
body.pwc-motion-off .pwc-sec-card__img,
body.pwc-motion-off .pwc-sec-btn,
body.pwc-motion-off .pwc-sec-carousel-btn,
body.pwc-motion-off .pwc-sec-carousel-dot {
	transition: none;
}

body.pwc-motion-off .pwc-sec-card:hover {
	transform: none;
}

body.pwc-motion-off .pwc-sec-card:hover .pwc-sec-card__img {
	transform: none;
}

body.pwc-motion-off .pwc-sec-hero__media,
body.pwc-motion-off .pwc-sec-hero__slider {
	transform: none;
	will-change: auto;
}

body.pwc-motion-off .pwc-sec-hero__media-el {
	animation: none;
	transform: none;
}

/* ----------------------------------------------------------------------
   Safety net: never let a reveal leave content invisible.
   ---------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	body:not(.pwc-motion-off) [data-pwc-reveal] {
		opacity: 1 !important;
		transform: none !important;
	}
}
