/**
 * File: assets/css/pages/news/motion.css
 * Description: Motion layer for the Magida Creative Co. News page.
 *
 * Pass 15.1 change:
 * - Adds safe reveal and ambient animations for News-only elements.
 * - Keeps motion separated from base layout and respects reduced-motion preferences.
 */

/* MAGIDA PASS 15.1: News reveal timing stays page-scoped so global scroll behavior remains stable. */
[data-magida-news-reveal] {
	opacity: 0;
	transform: translateY(24px);
	transition:
		opacity 0.7s ease,
		transform 0.7s ease;
}

[data-magida-news-reveal].is-visible {
	opacity: 1;
	transform: translateY(0);
}

.magida-news-visual__panel--back {
	animation: magidaNewsPanelDrift 8s ease-in-out infinite alternate;
}

.magida-news-visual__panel--front {
	animation: magidaNewsFrontFloat 6.5s ease-in-out infinite alternate;
}

.magida-news-visual__orbit--one {
	animation: magidaNewsOrbitPulse 5.5s ease-in-out infinite;
}

.magida-news-visual__orbit--two {
	animation: magidaNewsOrbitPulse 6.5s ease-in-out infinite reverse;
}

.magida-news-visual__signal {
	animation: magidaNewsSignal 2.4s ease-in-out infinite;
}

.magida-news-visual__bars span:nth-child(1) {
	animation: magidaNewsBar 3.4s ease-in-out infinite;
}

.magida-news-visual__bars span:nth-child(2) {
	animation: magidaNewsBar 3.4s ease-in-out 0.18s infinite;
}

.magida-news-visual__bars span:nth-child(3) {
	animation: magidaNewsBar 3.4s ease-in-out 0.36s infinite;
}

.magida-news-card:hover .magida-news-card__glow,
.magida-news-card:focus-within .magida-news-card__glow {
	animation: magidaNewsCardGlow 1.8s ease-in-out infinite alternate;
}

.magida-news-card__fallback::after {
	animation: magidaNewsShine 4.8s ease-in-out infinite;
}

@keyframes magidaNewsPanelDrift {
	from {
		transform: translate3d(-0.5rem, 0.2rem, 0) rotate(-1deg);
	}
	to {
		transform: translate3d(0.5rem, -0.35rem, 0) rotate(1deg);
	}
}

@keyframes magidaNewsFrontFloat {
	from {
		transform: translate3d(0, 0, 0);
	}
	to {
		transform: translate3d(0, -0.6rem, 0);
	}
}

@keyframes magidaNewsOrbitPulse {
	0%,
	100% {
		opacity: 0.5;
		transform: scale(1);
	}
	50% {
		opacity: 0.95;
		transform: scale(1.08);
	}
}

@keyframes magidaNewsSignal {
	0%,
	100% {
		box-shadow:
			0 0 0 0.7rem rgba(0, 221, 255, 0.08),
			0 0 2.5rem rgba(0, 221, 255, 0.55);
	}
	50% {
		box-shadow:
			0 0 0 1.15rem rgba(0, 221, 255, 0.04),
			0 0 3.2rem rgba(0, 221, 255, 0.75);
	}
}

@keyframes magidaNewsBar {
	0%,
	100% {
		transform: scaleX(0.72);
	}
	50% {
		transform: scaleX(1);
	}
}

@keyframes magidaNewsCardGlow {
	from {
		opacity: 0.42;
		transform: scale(0.96);
	}
	to {
		opacity: 0.78;
		transform: scale(1.04);
	}
}

@keyframes magidaNewsShine {
	0%,
	58%,
	100% {
		transform: translateX(0) rotate(16deg);
	}
	78% {
		transform: translateX(310%) rotate(16deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	[data-magida-news-reveal],
	.magida-news-visual__panel--back,
	.magida-news-visual__panel--front,
	.magida-news-visual__orbit--one,
	.magida-news-visual__orbit--two,
	.magida-news-visual__signal,
	.magida-news-visual__bars span,
	.magida-news-card:hover .magida-news-card__glow,
	.magida-news-card:focus-within .magida-news-card__glow,
	.magida-news-card__fallback::after {
		animation: none !important;
		transition: none !important;
	}

	[data-magida-news-reveal] {
		opacity: 1;
		transform: none;
	}
}
