/* Hover effects for photo cards. Add one ashv-card-fx-<name> class to .ashv-card. Every effect lifts the card, deepens its shadow, opens the description and turns the arrow; the name says what the photo does. The card's ::before belongs to these effects. See docs/cards.md. */
[class*="ashv-card-fx-"] {
	--card-s: var(--ashv-hover-speed, 1);
	--card-ease: var(--ashv-ease, cubic-bezier(0.23, 1, 0.32, 1));
	--card-in-out: var(--ashv-ease-in-out, cubic-bezier(0.77, 0, 0.175, 1));
	--card-back: var(--ashv-ease-back, cubic-bezier(0.34, 1.56, 0.64, 1));
	--card-accent: var(--wp--preset--color--ember);
	--card-lift: -4px;
	position: relative;
	overflow: hidden;
	isolation: isolate;
	-webkit-tap-highlight-color: transparent;
	transition:
		translate calc(400ms * var(--card-s)) var(--card-ease),
		box-shadow calc(400ms * var(--card-s)) var(--card-ease),
		background-color calc(400ms * var(--card-s)) var(--card-ease),
		transform calc(350ms * var(--card-s)) var(--card-ease);
}

[class*="ashv-card-fx-"]:active { transform: scale(0.985); }

[class*="ashv-card-fx-"] .ashv-card__img {
	transition:
		transform calc(900ms * var(--card-s)) var(--card-ease),
		translate calc(500ms * var(--card-s)) var(--card-ease),
		opacity calc(600ms * var(--card-s)) var(--card-ease),
		filter calc(600ms * var(--card-s)) var(--card-ease),
		clip-path calc(700ms * var(--card-s)) var(--card-in-out);
}

[class*="ashv-card-fx-"] .ashv-card__img--b { opacity: 0; clip-path: inset(0); }

[class*="ashv-card-fx-"] .ashv-card__desc {
	display: grid;
	grid-template-rows: 1fr;
	transition: grid-template-rows calc(450ms * var(--card-s)) var(--card-ease), opacity calc(350ms * var(--card-s)) var(--card-ease);
}

[class*="ashv-card-fx-"] .ashv-card__desc > * { overflow: hidden; min-height: 0; }

[class*="ashv-card-fx-"] .ashv-card__body {
	transition: translate calc(400ms * var(--card-s)) var(--card-ease), background-color calc(300ms * var(--card-s)) var(--card-ease), color calc(300ms * var(--card-s)) var(--card-ease);
}

[class*="ashv-card-fx-"] .ashv-card__arrow svg { transition: rotate calc(400ms * var(--card-s)) var(--card-back); }

[class*="ashv-card-fx-"] .ashv-card__arrow {
	transition:
		translate calc(400ms * var(--card-s)) var(--card-ease),
		background-color calc(300ms * var(--card-s)) var(--card-ease),
		color calc(300ms * var(--card-s)) var(--card-ease);
}

[class*="ashv-card-fx-"]::before {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	transition: opacity calc(400ms * var(--card-s)) var(--card-ease), transform calc(600ms * var(--card-s)) var(--card-ease);
}

/* Photo swaps: the second photo is clipped away at rest. */
:is(.ashv-card-fx-wipe-swap, .ashv-card-fx-wipe-down, .ashv-card-fx-slant-swap, .ashv-card-fx-door-swap, .ashv-card-fx-circle-swap, .ashv-card-fx-iris-swap) .ashv-card__img--b {
	opacity: 1;
	transform: scale(1.12);
}

.ashv-card-fx-wipe-swap .ashv-card__img--b { clip-path: inset(100% 0 0 0); }
.ashv-card-fx-wipe-down .ashv-card__img--b { clip-path: inset(0 0 100% 0); }
.ashv-card-fx-slant-swap .ashv-card__img--b { clip-path: polygon(0 0, 0 0, -30% 100%, -30% 100%); }
.ashv-card-fx-door-swap .ashv-card__img--b { clip-path: inset(0 50%); }
.ashv-card-fx-circle-swap .ashv-card__img--b { clip-path: circle(0% at var(--card-x, 50%) var(--card-y, 50%)); }
.ashv-card-fx-iris-swap .ashv-card__img--b { clip-path: circle(0% at calc(100% - 40px) 40px); }
.ashv-card-fx-fade-swap .ashv-card__img--b { transform: scale(1.08); }
.ashv-card-fx-focus-swap .ashv-card__img--b { filter: blur(14px); transform: scale(1.06); }

.ashv-card-fx-slide-swap .ashv-card__img { transition: transform calc(700ms * var(--card-s)) var(--card-in-out); }
.ashv-card-fx-slide-swap .ashv-card__img--b { opacity: 1; transform: translateY(100%); }

.ashv-card-fx-pan .ashv-card__img--a { transform: scale(1.12) translateX(3%); transition-duration: calc(1400ms * var(--card-s)); }
.ashv-card-fx-parallax .ashv-card__img--a { transform: scale(1.1); translate: var(--card-px, 0%) var(--card-py, 0%); }

/* Overlays drawn on the card's ::before. */
:is(.ashv-card-fx-tilt, .ashv-card-fx-sheen, .ashv-card-fx-torch, .ashv-card-fx-darken, .ashv-card-fx-ember-wash, .ashv-card-fx-rise-fill, .ashv-card-fx-flood, .ashv-card-fx-frame, .ashv-card-fx-hazard-edge)::before { content: ""; }

:is(.ashv-card-fx-tilt, .ashv-card-fx-sheen)::before {
	z-index: 3;
	background: radial-gradient(circle 280px at var(--card-x, 50%) var(--card-y, 0%), rgb(255 255 255 / 0.3), transparent 65%);
	opacity: 0;
}

.ashv-card-fx-tilt { transform: perspective(900px) rotateX(var(--card-rx, 0deg)) rotateY(var(--card-ry, 0deg)); }
.ashv-card-fx-tilt:active { transform: perspective(900px) rotateX(var(--card-rx, 0deg)) rotateY(var(--card-ry, 0deg)) scale(0.985); }

.ashv-card-fx-torch::before {
	background: radial-gradient(circle 150px at var(--card-x, 50%) var(--card-y, 40%), transparent 0, transparent 35%, color-mix(in srgb, var(--wp--preset--color--charcoal) 78%, transparent) 100%);
	opacity: 0;
}

.ashv-card-fx-darken::before { background: color-mix(in srgb, var(--wp--preset--color--charcoal) 55%, transparent); opacity: 0; }

.ashv-card-fx-ember-wash::before {
	background: linear-gradient(0deg, var(--card-accent) 0%, color-mix(in srgb, var(--card-accent) 80%, transparent) 45%, transparent 100%);
	transform: translateY(101%);
}

.ashv-card-fx-rise-fill::before { background: var(--card-accent); transform: translateY(101%); transition-timing-function: var(--card-in-out); }

.ashv-card-fx-flood::before {
	inset: auto;
	left: calc(100% - 40px);
	top: 40px;
	width: 320%;
	aspect-ratio: 1;
	border-radius: 50%;
	background: var(--card-accent);
	transform: translate(-50%, -50%) scale(0);
	transition-duration: calc(750ms * var(--card-s));
}

.ashv-card-fx-frame::before {
	inset: 12px;
	z-index: 3;
	border: 1.5px solid color-mix(in srgb, var(--wp--preset--color--limestone) 75%, transparent);
	border-radius: calc(var(--wp--custom--radius--card, 16px) - 6px);
	opacity: 0;
	transform: scale(1.05);
}

.ashv-card-fx-hazard-edge::before {
	inset: auto 0 0;
	z-index: 3;
	height: 8px;
	background: repeating-linear-gradient(-45deg, var(--wp--preset--color--flame) 0 8px, var(--wp--preset--color--charcoal) 8px 16px);
	transform: translateY(101%);
}

.ashv-card-fx-inset .ashv-card__img--a { clip-path: inset(0 round 0px); }

.ashv-card-fx-plate .ashv-card__body {
	left: 12px;
	right: 12px;
	bottom: 12px;
	padding: 14px 16px;
	border-radius: var(--wp--custom--radius--inner, 12px);
	background-color: color-mix(in srgb, var(--wp--preset--color--limestone) 95%, transparent);
	color: var(--wp--preset--color--charcoal);
}

.ashv-card-fx-signal > .ashv-fx__mark {
	right: -6%;
	bottom: -4%;
	z-index: 1;
	width: 62%;
	height: auto;
	color: var(--card-accent);
	opacity: 0.9;
}

.ashv-card-fx-signal > .ashv-fx__mark path { transition-duration: calc(600ms * var(--card-s)); }

@media (hover: hover) and (pointer: fine) {
	[class*="ashv-card-fx-"] .ashv-card__desc { grid-template-rows: 0fr; opacity: 0; }
	[class*="ashv-card-fx-"] .ashv-card__arrow svg { rotate: 45deg; }
	.ashv-card-fx-colour .ashv-card__img--a { filter: grayscale(1); }
	.ashv-card-fx-zoom-out .ashv-card__img--a { transform: scale(1.12); }

	[class*="ashv-card-fx-"]:is(:hover, :focus-visible) {
		translate: 0 var(--card-lift);
		box-shadow: var(--wp--custom--shadow--deep-hover);
	}

	[class*="ashv-card-fx-"]:is(:hover, :focus-visible) .ashv-card__desc { grid-template-rows: 1fr; opacity: 1; }

	[class*="ashv-card-fx-"]:is(:hover, :focus-visible) .ashv-card__arrow svg { rotate: 0deg; }

	[class*="ashv-card-fx-"]:is(:hover, :focus-visible) .ashv-card__arrow {
		background-color: var(--card-accent);
		color: var(--wp--preset--color--white);
	}

	:is(.ashv-card-fx-rise-fill, .ashv-card-fx-flood, .ashv-card-fx-inset, .ashv-card-fx-ember-wash):is(:hover, :focus-visible) .ashv-card__arrow {
		background-color: var(--wp--preset--color--white);
		color: var(--card-accent);
	}

	:is(.ashv-card-fx-wipe-swap, .ashv-card-fx-wipe-down, .ashv-card-fx-slant-swap, .ashv-card-fx-door-swap, .ashv-card-fx-circle-swap, .ashv-card-fx-iris-swap, .ashv-card-fx-zoom, .ashv-card-fx-frame, .ashv-card-fx-plate, .ashv-card-fx-hazard-edge, .ashv-card-fx-signal, .ashv-card-fx-colour, .ashv-card-fx-darken, .ashv-card-fx-ember-wash):is(:hover, :focus-visible) .ashv-card__img--a { transform: scale(1.06); }

	:is(.ashv-card-fx-wipe-swap, .ashv-card-fx-wipe-down, .ashv-card-fx-slant-swap, .ashv-card-fx-door-swap, .ashv-card-fx-circle-swap, .ashv-card-fx-iris-swap, .ashv-card-fx-fade-swap, .ashv-card-fx-focus-swap, .ashv-card-fx-slide-swap):is(:hover, :focus-visible) .ashv-card__img--b { transform: none; }

	:is(.ashv-card-fx-wipe-swap, .ashv-card-fx-wipe-down):is(:hover, :focus-visible) .ashv-card__img--b { clip-path: inset(0); }
	.ashv-card-fx-slant-swap:is(:hover, :focus-visible) .ashv-card__img--b { clip-path: polygon(0 0, 130% 0, 100% 100%, -30% 100%); }
	.ashv-card-fx-door-swap:is(:hover, :focus-visible) .ashv-card__img--b { clip-path: inset(0 0%); }
	.ashv-card-fx-circle-swap:is(:hover, :focus-visible) .ashv-card__img--b { clip-path: circle(150% at var(--card-x, 50%) var(--card-y, 50%)); }
	.ashv-card-fx-iris-swap:is(:hover, :focus-visible) .ashv-card__img--b { clip-path: circle(150% at calc(100% - 40px) 40px); }
	:is(.ashv-card-fx-fade-swap, .ashv-card-fx-focus-swap):is(:hover, :focus-visible) .ashv-card__img--b { opacity: 1; filter: none; }
	.ashv-card-fx-focus-swap:is(:hover, :focus-visible) .ashv-card__img--a { filter: blur(14px); }
	.ashv-card-fx-slide-swap:is(:hover, :focus-visible) .ashv-card__img--a { transform: translateY(-30%); }

	.ashv-card-fx-zoom-out:is(:hover, :focus-visible) .ashv-card__img--a { transform: none; }
	.ashv-card-fx-pan:is(:hover, :focus-visible) .ashv-card__img--a { transform: scale(1.12) translateX(-3%); }
	.ashv-card-fx-colour:is(:hover, :focus-visible) .ashv-card__img--a { filter: none; }

	:is(.ashv-card-fx-tilt, .ashv-card-fx-sheen, .ashv-card-fx-torch, .ashv-card-fx-darken):is(:hover, :focus-visible)::before { opacity: 1; }
	:is(.ashv-card-fx-ember-wash, .ashv-card-fx-rise-fill, .ashv-card-fx-hazard-edge):is(:hover, :focus-visible)::before { transform: none; }
	.ashv-card-fx-flood:is(:hover, :focus-visible)::before { transform: translate(-50%, -50%) scale(1); }
	.ashv-card-fx-frame:is(:hover, :focus-visible)::before { opacity: 1; transform: none; }
	.ashv-card-fx-darken:is(:hover, :focus-visible) .ashv-card__body { translate: 0 -6px; }

	.ashv-card-fx-inset:is(:hover, :focus-visible) { background-color: var(--card-accent); }
	.ashv-card-fx-inset:is(:hover, :focus-visible) .ashv-card__img--a { clip-path: inset(10px round 10px); }

	.ashv-card-fx-plate:is(:hover, :focus-visible) .ashv-card__body { background-color: var(--card-accent); color: var(--wp--preset--color--white); }
	.ashv-card-fx-signal:is(:hover, :focus-visible) > .ashv-fx__mark path { clip-path: inset(0); }
}

@media (prefers-reduced-motion: reduce) {
	[class*="ashv-card-fx-"],
	[class*="ashv-card-fx-"] *,
	[class*="ashv-card-fx-"]::before {
		transition-duration: 0.01ms !important;
		transition-delay: 0s !important;
		translate: none !important;
	}

	.ashv-card-fx-tilt { transform: none; }
}
