/**
 * GLASS -- Page Morph Engine Styles
 *
 * Transition styles for SPA-style page morphing between
 * morph-enabled Infinite pages.
 *
 * @package AJT_Glass
 * @since   11.6.0
 */

/* ── Progress Bar ─────────────────────────────────────── */
.inf-morph-progress {
	position: fixed;
	top: 0;
	left: 0;
	height: 3px;
	background: var(--inf-plum, #A04398);
	z-index: 9999999;
	transition: width 0.3s ease, opacity 0.3s ease;
	opacity: 0;
	pointer-events: none;
	width: 0%;
}
.inf-morph-progress--active {
	opacity: 1;
}

/* ── Overlay (old page snapshot for crossfade) ────────── */
.inf-morph-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	pointer-events: none;
	overflow: hidden;
}

/* ── Section Transitions ──────────────────────────────── */

/* Departing sections: fade out, slide up, slight scale */
.inf-morph-depart {
	animation: infMorphDepart 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes infMorphDepart {
	from { opacity: 1; transform: translateY(0) scale(1); }
	to   { opacity: 0; transform: translateY(-30px) scale(0.97); }
}

/* Arriving sections: fade in, slide up from below */
.inf-morph-arrive {
	animation: infMorphArrive 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes infMorphArrive {
	from { opacity: 0; transform: translateY(30px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Matched sections: crossfade (old fades out, new fades in) */
.inf-morph-match-old {
	animation: infMorphFadeOut 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes infMorphFadeOut {
	from { opacity: 1; }
	to   { opacity: 0; }
}

.inf-morph-match-new {
	animation: infMorphFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes infMorphFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* Header: no animation, stays stable */
.inf-morph-header-stable {
	animation: none !important;
}

/* During morph: prevent scroll on body */
.inf-morph-active {
	overflow: hidden !important;
}

/* Stagger delay utility (set via JS inline style) */
.inf-morph-stagger {
	animation-delay: var(--inf-morph-delay, 0ms);
}

/* Link highlight on click */
.inf-morph-link-active {
	opacity: 0.7;
	transition: opacity 0.1s;
}
