/*
 * Light motion, sitewide (2026-11-21).
 *
 * 1. Cards fade up a little the first time they scroll into view.
 *    assets/js/motion.js adds html.cul-mo, marks only cards that start
 *    below the screen with .mo-wait, and adds .mo-in when they arrive.
 *    Without the script nothing here hides anything, so content always
 *    shows. The rise uses the `translate` property so it never fights
 *    the hover lift (which uses `transform`). No layout shift: only
 *    opacity and translate change.
 * 2. Clickable cards and buttons lift 2px with a soft shadow on hover
 *    (mouse only, never on phones).
 * 3. Pop-ups ease in (fade and a small rise) each time they open. CSS
 *    animations replay whenever an element goes from hidden to shown,
 *    so no pop-up markup or script changes.
 *
 * Reduced motion: everything sits inside prefers-reduced-motion:
 * no-preference, so people who ask for less motion get none.
 */

@keyframes cul-mo-rise { from { opacity: 0; translate: 0 10px; } }
@keyframes cul-mo-pop  { from { opacity: 0; translate: 0 10px; scale: .98; } }
@keyframes cul-mo-fade { from { opacity: 0; } }

@media (prefers-reduced-motion: no-preference) {

	/* 1. Fade up on scroll */
	html.cul-mo .mo-wait {
		transition: opacity .35s ease-out var(--mo-d, 0s), translate .35s ease-out var(--mo-d, 0s), transform .15s ease, border-color .15s ease, box-shadow .15s ease;
	}
	html.cul-mo .mo-wait:not(.mo-in) {
		opacity: 0;
		translate: 0 10px;
	}

	/* Home page blocks already rise in as a whole (home-v4.css, .hm-rise).
	   Same gentle size and speed as the cards. */
	html .cul-home4 .hm-rise {
		animation-name: cul-mo-rise;
		animation-duration: .38s;
		animation-timing-function: ease-out;
	}

	/* 2. Hover lift (mouse only) */
	@media (hover: hover) {
		/* Clickable cards: offers, businesses, events */
		html :is(.cul-ofx-card, .cul-br__card, .cul-ev__card):not(.cul-ob__pvcard *) {
			transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
		}
		html :is(.cul-ofx-card, .cul-br__card, .cul-ev__card):not(.cul-ob__pvcard *):hover {
			transform: translateY(-2px);
			box-shadow: 0 8px 22px rgba(27, 58, 92, .10);
		}

		/* Buttons (the sitewide button list in buttons.css, plus .ui-btn) */
		html :is(
			.ui-btn, .cul-ofx-claim,
			.cul-offer-card__btn, .cul-rv__btn, .cul-hc-offer__claim, .cul-ev__btn-o,
			.cul-offerstrip__btn, .cul-post__offer-btn, .cul-claim-card__btn,
			.cul-offer-claim-btn, .cul-fx-btn, .cul-m5-card__go, .cul-findus__dirs,
			.cul-set__btn, .cul-pv__btn, .cul-pv__seeall, .cul-bv__btn, .cul-ev__btn-g
		):not(:disabled, [aria-disabled="true"]) {
			transition-property: background-color, border-color, color, box-shadow, translate;
			transition-duration: .15s;
			transition-timing-function: ease;
		}
		html :is(
			.ui-btn, .cul-ofx-claim,
			.cul-offer-card__btn, .cul-rv__btn, .cul-hc-offer__claim, .cul-ev__btn-o,
			.cul-offerstrip__btn, .cul-post__offer-btn, .cul-claim-card__btn,
			.cul-offer-claim-btn, .cul-fx-btn, .cul-m5-card__go, .cul-findus__dirs,
			.cul-set__btn, .cul-pv__btn, .cul-pv__seeall, .cul-bv__btn, .cul-ev__btn-g
		):not(:disabled, [aria-disabled="true"]):hover {
			translate: 0 -2px;
			box-shadow: 0 6px 16px rgba(27, 58, 92, .14);
		}
	}

	/* 3. Pop-ups ease in */
	/* Business page approve box (includes/claim-quick.php) */
	html .cul-ap { animation: cul-mo-pop .3s ease-out both; }
	/* Offer details pop-up (offers page and home) */
	html .cul-ofx-pop:not([hidden]) { animation: cul-mo-fade .2s ease-out both; }
	html .cul-ofx-pop:not([hidden]) .cul-ofx-pop__box { animation: cul-mo-pop .25s ease-out both; }
	/* Claim pop-up (offer-claim.css) */
	html .culoc:not([hidden]) .culoc__backdrop { animation: cul-mo-fade .2s ease-out both; }
	html .culoc:not([hidden]) .culoc__box { animation: cul-mo-pop .25s ease-out both; }
	/* Quote request pop-up */
	html .cul-quote-modal:not([hidden]) .cul-quote-modal__bg { animation: cul-mo-fade .2s ease-out both; }
	html .cul-quote-modal:not([hidden]) .cul-quote-modal__box { animation: cul-mo-pop .25s ease-out both; }
	/* Offer terms pop-up (a <dialog>) */
	html .cul-terms-modal[open] { animation: cul-mo-pop .25s ease-out both; }
	html .cul-terms-modal[open]::backdrop { animation: cul-mo-fade .2s ease-out both; }
	/* Business page question sign-in pop-up */
	html .cul-faq-modal__backdrop { animation: cul-mo-fade .2s ease-out both; }
	html .cul-faq-modal__box { animation: cul-mo-pop .25s ease-out both; }
	/* The Weekly sign-up pop-up (.cul-m5) already eases in (m5-promo.css). */
}

@media print {
	html.cul-mo .mo-wait { opacity: 1 !important; translate: none !important; }
}
