/* ==========================================================================
   Makarios Fortune — motion layer (Phase 10)
   "Motion should make the interface feel premium, not busy." Loaded after the page styles; only transform,
   opacity, box-shadow and colours move, using the tokens in main.css §1 (--mf-motion-*, --mf-ease-*, --mf-lift,
   --mf-zoom). Hover effects only on hover-capable pointers, mirrored by :focus-visible / :focus-within so keyboard
   users get the same state; touch gets a short press feedback. Nothing is hidden behind hover.
   Reduced motion: the tokens collapse to "no movement" and transitions become instant (§9).
   ========================================================================== */

/* ---------- 1. Buttons --------------------------------------------------- */
.mf-button {
	transition:
		background-color var(--mf-motion-standard) var(--mf-ease-standard),
		color var(--mf-motion-standard) var(--mf-ease-standard),
		border-color var(--mf-motion-standard) var(--mf-ease-standard),
		box-shadow var(--mf-motion-standard) var(--mf-ease-standard),
		transform var(--mf-motion-fast) var(--mf-ease-standard);
}

@media (hover: hover) and (pointer: fine) {
	.mf-button:hover {
		transform: translateY(var(--mf-lift-sm));
	}

	.mf-button--secondary:hover,
	.mf-button--gold:hover {
		box-shadow: var(--mf-shadow-soft);
	}

	.mf-button--primary:hover {
		box-shadow: inset 0 -2px 0 0 var(--mf-gold), var(--mf-shadow-soft);
	}
}

.mf-button:active {
	transform: translateY(0) scale(0.98);
	transition-duration: 80ms;
}

/* ---------- 2. Navigation underline -------------------------------------- */
.mf-nav__list a {
	transition:
		background-size var(--mf-motion-standard) var(--mf-ease-emphasis),
		color var(--mf-motion-fast) var(--mf-ease-standard);
}

.mf-nav__list a:focus-visible {
	background-size: 100% 1px;
}

/* ---------- 3. Entity cards (Fortune, Collection, Story) and symbols ------ */
.mf-card__media {
	transition:
		transform var(--mf-motion-standard) var(--mf-ease-emphasis),
		box-shadow var(--mf-motion-standard) var(--mf-ease-emphasis);
}

.mf-card__media img,
.mf-card__seal svg {
	transition: transform var(--mf-motion-slow) var(--mf-ease-emphasis);
}

.mf-card__title a,
.mf-symbol__name a {
	background: linear-gradient(currentColor, currentColor) no-repeat left 100% / 0 1px;
	transition:
		background-size var(--mf-motion-standard) var(--mf-ease-emphasis),
		color var(--mf-motion-fast) var(--mf-ease-standard);
}

.mf-symbol__medallion {
	transition: transform var(--mf-motion-standard) var(--mf-ease-emphasis);
}

.mf-card:focus-within .mf-card__title a,
.mf-symbol:focus-within .mf-symbol__name a {
	background-size: 100% 1px;
}

@media (hover: hover) and (pointer: fine) {
	.mf-card:hover .mf-card__media,
	.mf-card:focus-within .mf-card__media {
		transform: translateY(var(--mf-lift));
		box-shadow: var(--mf-shadow-hover);
	}

	.mf-card:hover .mf-card__media img,
	.mf-card:focus-within .mf-card__media img {
		transform: scale(var(--mf-zoom));
	}

	.mf-card:hover .mf-card__seal svg {
		transform: scale(1.04) rotate(4deg);
	}

	.mf-card:hover .mf-card__title a,
	.mf-symbol:hover .mf-symbol__name a {
		background-size: 100% 1px;
		color: var(--mf-gold-ink);
	}

	.mf-symbol:hover .mf-symbol__medallion,
	.mf-symbol:focus-within .mf-symbol__medallion {
		transform: translateY(var(--mf-lift));
	}
}

/* ---------- 4. Gallery / artwork cards ----------------------------------- */
/* The mat lifts and the artwork inside it zooms within the mat (overflow hidden) — card dimensions never change. */
.mf-gcard__mat {
	transition:
		transform var(--mf-motion-standard) var(--mf-ease-emphasis),
		box-shadow var(--mf-motion-standard) var(--mf-ease-emphasis),
		border-color var(--mf-motion-standard) var(--mf-ease-standard);
}

.mf-gcard__img {
	transition: transform var(--mf-motion-slow) var(--mf-ease-emphasis);
}

.mf-gcard__title a {
	transition: color var(--mf-motion-fast) var(--mf-ease-standard);
}

.mf-gcard__action {
	transition:
		opacity var(--mf-motion-standard) var(--mf-ease-standard),
		background-color var(--mf-motion-fast) var(--mf-ease-standard),
		transform var(--mf-motion-fast) var(--mf-ease-standard);
}

.mf-gcard__action:active {
	transform: scale(0.92);
}

@media (hover: hover) and (pointer: fine) {
	.mf-gcard:hover .mf-gcard__mat,
	.mf-gcard:focus-within .mf-gcard__mat {
		transform: translateY(var(--mf-lift));
		box-shadow: var(--mf-shadow-hover);
		border-color: rgb(176 138 69 / 0.45);
	}

	.mf-gcard:hover .mf-gcard__img,
	.mf-gcard:focus-within .mf-gcard__img {
		transform: scale(var(--mf-zoom));
	}

	.mf-gcard:focus-within .mf-gcard__title a {
		color: var(--mf-gold-ink);
	}
}

/* Touch: a short press response instead of hover. */
@media (hover: none) {
	.mf-gcard__mat,
	.mf-card__media {
		transition-duration: var(--mf-motion-fast);
	}

	.mf-gcard__inner:active .mf-gcard__mat,
	.mf-card:active .mf-card__media {
		transform: scale(0.985);
	}
}

/* ---------- 5. Filters ---------------------------------------------------- */
.mf-chip,
.mf-facet__option,
.mf-tag {
	transition:
		background-color var(--mf-motion-fast) var(--mf-ease-standard),
		border-color var(--mf-motion-fast) var(--mf-ease-standard),
		color var(--mf-motion-fast) var(--mf-ease-standard);
}

.mf-gallery__results .mf-gallery-grid {
	transition: opacity var(--mf-motion-standard) var(--mf-ease-standard);
}

/* ---------- 6. Dialogs: quick view and artwork zoom ----------------------- */
.mf-quickview[open],
.mf-zoom[open] {
	animation: mf-dialog-in var(--mf-motion-standard) var(--mf-ease-emphasis);
}

.mf-quickview[open]::backdrop,
.mf-zoom[open]::backdrop {
	animation: mf-fade-in var(--mf-motion-standard) var(--mf-ease-standard);
}

@keyframes mf-dialog-in {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.98);
	}
}

@keyframes mf-fade-in {
	from {
		opacity: 0;
	}
}

/* ---------- 7. Artwork page ----------------------------------------------- */
.mf-art__figure {
	transition: box-shadow var(--mf-motion-slow) var(--mf-ease-emphasis);
}

.mf-art__img {
	transition: transform var(--mf-motion-slow) var(--mf-ease-emphasis);
}

.mf-choice {
	transition:
		border-color var(--mf-motion-fast) var(--mf-ease-standard),
		box-shadow var(--mf-motion-fast) var(--mf-ease-standard),
		background-color var(--mf-motion-fast) var(--mf-ease-standard);
}

@media (hover: hover) and (pointer: fine) {
	.mf-art__figure:hover {
		box-shadow: var(--mf-shadow-hover);
	}

	.mf-art__figure:hover .mf-art__img {
		transform: scale(1.015);
	}

	.mf-choice:hover {
		border-color: var(--mf-gold);
	}
}

/* ---------- 8. Footer links and Discover choices -------------------------- */
.mf-footer__list a,
.mf-footer__legal a {
	background: linear-gradient(currentColor, currentColor) no-repeat left calc(50% + 0.75em) / 0 1px;
	transition:
		background-size var(--mf-motion-standard) var(--mf-ease-emphasis),
		color var(--mf-motion-fast) var(--mf-ease-standard),
		transform var(--mf-motion-standard) var(--mf-ease-emphasis);
}

.mf-footer__list a:hover,
.mf-footer__legal a:hover,
.mf-footer__list a:focus-visible,
.mf-footer__legal a:focus-visible {
	background-size: 100% 1px;
	text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
	.mf-footer__list a:hover {
		transform: translateX(2px);
	}
}

.mf-dchoice__label {
	transition:
		border-color var(--mf-motion-standard) var(--mf-ease-standard),
		box-shadow var(--mf-motion-standard) var(--mf-ease-standard),
		background-color var(--mf-motion-standard) var(--mf-ease-standard),
		transform var(--mf-motion-standard) var(--mf-ease-emphasis),
		opacity var(--mf-motion-standard) var(--mf-ease-standard);
}

.mf-dchoice__input:checked {
	animation: mf-check-pop var(--mf-motion-standard) var(--mf-ease-emphasis);
}

@keyframes mf-check-pop {
	50% {
		transform: scale(1.2);
	}
}

@media (hover: hover) and (pointer: fine) {
	.mf-dchoice:not(.is-disabled) .mf-dchoice__label:hover {
		transform: translateY(var(--mf-lift-sm));
		box-shadow: var(--mf-shadow-soft);
	}
}

/* ---------- 9. Scroll reveal (assets/js/motion.js) ------------------------ */
/* Only content groups that start below the fold get .mf-reveal, and only when JS runs and motion is allowed — so
   nothing is ever hidden without JavaScript, and keyboard focus inside a group reveals it at once. */
.mf-reveal {
	opacity: 0;
	transform: translateY(var(--mf-reveal-shift));
	transition:
		opacity var(--mf-motion-slow) var(--mf-ease-standard),
		transform calc(var(--mf-motion-slow) * 1.5) var(--mf-ease-emphasis);
}

.mf-reveal.is-revealed,
.mf-reveal:focus-within {
	opacity: 1;
	transform: none;
}

@media print {
	.mf-reveal {
		opacity: 1 !important;
		transform: none !important;
	}
}

/* ---------- 10. Reduced motion -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	:root {
		--mf-lift: 0px;
		--mf-lift-sm: 0px;
		--mf-zoom: 1;
		--mf-reveal-shift: 0px;
	}

	.mf-reveal {
		opacity: 1;
		transform: none;
	}

	.mf-button:active,
	.mf-gcard__action:active,
	.mf-gcard__inner:active .mf-gcard__mat,
	.mf-card:active .mf-card__media,
	.mf-card:hover .mf-card__seal svg,
	.mf-art__figure:hover .mf-art__img,
	.mf-footer__list a:hover {
		transform: none;
	}

	.mf-quickview[open],
	.mf-zoom[open],
	.mf-quickview[open]::backdrop,
	.mf-zoom[open]::backdrop,
	.mf-dchoice__input:checked {
		animation: none;
	}
}
