/*
 * Egyptian Fire Art — Lightweight Floating Gallery Perspective Hero & Smooth Coverflow (v1.2.1)
 * Pure CSS GPU-composited motion; zero Three.js overhead. Enqueued only on is_front_page().
 */

/* --- 1. Split-Screen Hero Floating Gallery Perspective Stage --- */
.efa-hero--stage {
	min-height: clamp(560px, 76svh, 760px);
}

.efa-hero__shell {
	position: relative;
	z-index: 10;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: clamp(560px, 76svh, 760px);
	padding-block: clamp(2.5rem, 5vw, 4rem) clamp(1.75rem, 3.5vw, 2.5rem);
	gap: clamp(1.5rem, 3vw, 2.5rem);
}

.efa-hero__split {
	display: grid;
	grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
	align-items: center;
	gap: clamp(2rem, 4.5vw, 4.25rem);
}

.efa-hero__copy-col {
	min-width: 0;
}

.efa-hero--stage .efa-hero__slide {
	min-height: auto;
	padding-block: 0;
	display: block;
}

.efa-hero--stage .efa-hero__controls {
	position: relative;
	left: auto;
	right: auto;
	bottom: auto;
	padding-inline: 0;
	pointer-events: auto;
}

.efa-hero__stage-col {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 0;
}

.efa-hero__stage {
	position: relative;
	width: 100%;
	height: clamp(320px, 48vh, 470px);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	perspective: 1100px;
	border-radius: var(--efa-radius-lg);
	background: radial-gradient(
		circle at 50% 48%,
		rgba(158, 27, 36, 0.14) 0%,
		rgba(11, 11, 13, 0.18) 54%,
		transparent 78%
	);
}

.efa-hero__tilt-plane {
	position: relative;
	width: 100%;
	height: calc(100% - 28px);
	display: flex;
	align-items: center;
	justify-content: center;
	transform-style: preserve-3d;
	transform: rotateX(var(--hero-tilt-x, 0deg)) rotateY(var(--hero-tilt-y, 0deg));
	transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
	will-change: transform;
}

.efa-hero__float-wrap {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: efaHeroLevitate 5.5s ease-in-out infinite;
	will-change: transform;
}

@keyframes efaHeroLevitate {
	0%,
	100% {
		transform: translate3d(0, 0, 0);
	}
	50% {
		transform: translate3d(0, -18px, 0);
	}
}

.efa-hero__artwork-slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transform: scale(0.93) rotateY(8deg) translateZ(-22px);
	transition:
		opacity 620ms cubic-bezier(0.22, 1, 0.36, 1),
		transform 740ms cubic-bezier(0.22, 1, 0.36, 1);
	will-change: transform, opacity;
}

.efa-hero__artwork-slide.is-from-prev {
	transform: scale(0.93) rotateY(-8deg) translateZ(-22px);
}

.efa-hero__artwork-slide.is-active {
	opacity: 1;
	pointer-events: auto;
	transform: scale(1) rotateY(0deg) translateZ(0);
}

.efa-hero__artwork-img {
	display: block;
	width: auto;
	height: auto;
	max-width: 94%;
	max-height: 96%;
	object-fit: contain;
	border: 0;
	border-radius: 2px;
	filter: drop-shadow(0 24px 44px rgba(0, 0, 0, 0.72));
}

@media (min-width: 992px) {
	.efa-hero__stage {
		height: clamp(420px, 60vh, 560px);
	}

	.efa-hero__tilt-plane {
		height: calc(100% - 22px);
	}

	.efa-hero__artwork-slide--framed .efa-hero__artwork-img,
	.efa-hero__artwork-slide[data-slide-index="0"] .efa-hero__artwork-img,
	.efa-hero__artwork-slide[data-slide-index="1"] .efa-hero__artwork-img,
	.efa-hero__artwork-slide[data-slide-index="2"] .efa-hero__artwork-img {
		height: 100%;
		max-height: 100%;
		width: auto;
		max-width: 100%;
	}
}

/* Diffused Gallery Floor / Wall Shadow */
.efa-hero__floor-shadow {
	width: 62%;
	height: 22px;
	margin-top: 6px;
	border-radius: 50%;
	background: radial-gradient(
		ellipse at center,
		rgba(0, 0, 0, 0.72) 0%,
		rgba(158, 27, 36, 0.14) 45%,
		transparent 74%
	);
	filter: blur(10px);
	animation: efaShadowBreathe 5.5s ease-in-out infinite;
	pointer-events: none;
}

@keyframes efaShadowBreathe {
	0%,
	100% {
		transform: scaleX(1) scaleY(1);
		opacity: 0.85;
	}
	50% {
		transform: scaleX(0.86) scaleY(0.88);
		opacity: 0.52;
	}
}

@media (max-width: 960px) {
	.efa-hero__split {
		grid-template-columns: 1fr;
		gap: 1.75rem;
	}

	.efa-hero__stage {
		height: clamp(275px, 42vh, 360px);
	}
}

@media (max-width: 768px) {
	.efa-hero--stage,
	.efa-hero__shell {
		min-height: auto;
	}

	.efa-hero__shell {
		padding-block: 2rem 2rem;
	}

	.efa-hero__stage {
		height: clamp(260px, 38vh, 330px);
	}
}

/* --- 2. Mobile 3D Coverflow Carousel for Featured Masterpieces (Zero Stutter) --- */
.efa-featured-section {
	overflow-x: hidden;
}

.efa-featured-swiper.is-coverflow {
	overflow: visible;
	padding-block: 0.65rem 1.35rem;
}

.efa-featured-swiper.is-coverflow .swiper-slide {
	will-change: transform;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	opacity: 0.7;
	transition: opacity 280ms ease;
}

.efa-featured-swiper.is-coverflow .swiper-slide-active {
	opacity: 1;
	z-index: 3;
}

.efa-featured-swiper.is-coverflow .efa-card {
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.42);
	transition: border-color 240ms ease;
}

.efa-featured-swiper.is-coverflow .swiper-slide-active .efa-card {
	border-color: var(--efa-crimson-border);
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

.efa-featured-swiper.is-coverflow .efa-card__dims {
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	background: rgba(11, 11, 13, 0.92);
}

.efa-featured-swiper.is-coverflow .efa-card__img {
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}

.efa-featured-swiper.is-coverflow .efa-card__frame::before {
	display: none !important;
}

/* --- 3. Mobile Scroll-Linked Chiaroscuro Sheen (Non-Coverflow Cards Only) --- */
@media (max-width: 991px) {
	.efa-collection-card__media::before,
	.efa-featured-swiper:not(.is-coverflow) .efa-card__frame::before,
	.efa-gallery-grid .efa-card__frame::before {
		content: "";
		position: absolute;
		inset: -12% -25%;
		pointer-events: none;
		z-index: 4;
		opacity: var(--mobile-sheen-opacity, 0);
		transform: translateX(var(--mobile-sheen-pos, -120%));
		background: linear-gradient(
			118deg,
			transparent 22%,
			rgba(245, 242, 235, 0.16) 46%,
			rgba(158, 27, 36, 0.1) 54%,
			transparent 76%
		);
		mix-blend-mode: screen;
		will-change: transform, opacity;
	}
}

/* --- 4. Reduced Motion Guard --- */
@media (prefers-reduced-motion: reduce) {
	.efa-hero__tilt-plane,
	.efa-hero__float-wrap,
	.efa-hero__floor-shadow {
		animation: none !important;
		transform: none !important;
	}

	.efa-hero__artwork-slide {
		transform: none !important;
	}

	.efa-collection-card__media::before,
	.efa-card__frame::before {
		display: none !important;
	}
}
