/* =========================================================
   Cinematic Banner - Core Styles
   عرض کامل صفحه + حداقل ارتفاع ریسپانسیو + جلوه‌های سینمایی
   ========================================================= */

/*
 * جلوگیری از اسکرول افقی ناخواسته که ممکن است تکنیک width:100vw
 * (برای تمام‌عرض کردن بنر خارج از کانتینر تم/المنتور) ایجاد کند.
 * :has() در مرورگرهای مدرن پشتیبانی می‌شود؛ به‌عنوان fallback ایمن،
 * یک کلاس روی body نیز از طریق جاوااسکریپت اضافه می‌شود.
 */
html:has(.cb-banner),
body:has(.cb-banner) {
	overflow-x: hidden;
}

body.cb-has-banner {
	overflow-x: hidden;
}

.cb-banner {
	position: relative;
	width: 100vw;
	max-width: 100vw;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
	overflow: hidden;
	min-height: var(--cb-mh-mobile, 300px);
	display: flex;
	align-items: center;
	justify-content: center;
	background: #0a0a0c;
	isolation: isolate;
}

@media (min-width: 600px) {
	.cb-banner {
		min-height: var(--cb-mh-tablet, 420px);
	}
}

@media (min-width: 1024px) {
	.cb-banner {
		min-height: var(--cb-mh-desktop, 560px);
	}
}

/* لایه‌ی تصویر */
.cb-image-wrap {
	position: absolute;
	inset: 0;
	overflow: hidden;
	z-index: 1;
}

.cb-image {
	position: absolute;
	inset: -5%;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	will-change: transform;
}

/* افکت Ken Burns - زوم آرام و پیوسته */
.cb-fx-kenburns .cb-image {
	animation: cb-kenburns 24s ease-in-out infinite alternate;
}

@keyframes cb-kenburns {
	0% {
		transform: scale(1) translate(0, 0);
	}
	100% {
		transform: scale(1.12) translate(-1.5%, -1.5%);
	}
}

/* پارالاکس با اسکرول (fallback ساده با CSS، تقویت‌شده با JS) */
.cb-fx-parallax .cb-image {
	transform: translateY(var(--cb-parallax-offset, 0px));
}

/* گرادیان تیره برای خوانایی متن */
.cb-layer {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.cb-gradient-overlay {
	z-index: 2;
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0.15) 0%,
		var(--cb-overlay-color, rgba(0, 0, 0, 0.45)) 65%,
		rgba(0, 0, 0, 0.65) 100%
	);
}

/* وینیت - تیرگی گوشه‌ها برای تمرکز بصری */
.cb-vignette-overlay {
	z-index: 3;
	background: radial-gradient(
		ellipse at center,
		rgba(0, 0, 0, 0) 40%,
		rgba(0, 0, 0, 0.55) 100%
	);
}

/* پرتوهای نور متحرک */
.cb-rays-overlay {
	z-index: 4;
	overflow: hidden;
	mix-blend-mode: screen;
	opacity: 0.55;
}

.cb-ray {
	position: absolute;
	top: -50%;
	width: 140px;
	height: 250%;
	background: linear-gradient(
		to bottom,
		rgba(255, 255, 255, 0) 0%,
		rgba(255, 244, 214, 0.35) 45%,
		rgba(255, 244, 214, 0) 100%
	);
	transform-origin: top center;
	filter: blur(6px);
	animation: cb-ray-sweep 12s ease-in-out infinite;
}

.cb-ray-1 { left: -10%; transform: rotate(18deg); animation-delay: 0s; }
.cb-ray-2 { left: 25%; transform: rotate(12deg); animation-delay: 3s; width: 90px; }
.cb-ray-3 { left: 55%; transform: rotate(-8deg); animation-delay: 6s; width: 110px; }
.cb-ray-4 { left: 80%; transform: rotate(-16deg); animation-delay: 9s; width: 70px; }

@keyframes cb-ray-sweep {
	0%, 100% {
		opacity: 0.25;
		transform: rotate(var(--rot, 15deg)) translateX(0);
	}
	50% {
		opacity: 0.7;
		transform: rotate(var(--rot, 15deg)) translateX(40px);
	}
}

/* بوم فرکتال‌های نوری (ذرات متحرک با JS ترسیم می‌شوند) */
.cb-particles-canvas {
	z-index: 5;
	width: 100%;
	height: 100%;
	mix-blend-mode: screen;
}

/* محتوای متنی روی بنر */
.cb-content {
	position: relative;
	z-index: 10;
	text-align: center;
	padding: 24px;
	max-width: 800px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
}

.cb-title {
	color: #ffffff;
	font-size: clamp(1.5rem, 4vw, 3rem);
	font-weight: 700;
	margin: 0;
	line-height: 1.3;
	text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
	letter-spacing: 0.5px;
	animation: cb-fade-up 1.2s ease both;
}

.cb-button {
	display: inline-block;
	padding: 14px 36px;
	background: rgba(255, 255, 255, 0.12);
	border: 1.5px solid rgba(255, 255, 255, 0.75);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	color: #ffffff;
	text-decoration: none;
	font-size: clamp(0.9rem, 1.5vw, 1.1rem);
	font-weight: 600;
	border-radius: 999px;
	transition: all 0.35s ease;
	animation: cb-fade-up 1.2s ease 0.2s both;
}

.cb-button:hover {
	background: #ffffff;
	color: #0a0a0c;
	transform: translateY(-2px);
	box-shadow: 0 10px 30px rgba(255, 255, 255, 0.25);
}

@keyframes cb-fade-up {
	from {
		opacity: 0;
		transform: translateY(24px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* حالت کاهش حرکت برای دسترسی‌پذیری */
@media (prefers-reduced-motion: reduce) {
	.cb-image,
	.cb-ray,
	.cb-title,
	.cb-button {
		animation: none !important;
	}
}

/* ریسپانسیو موبایل: کوچک‌تر کردن پدینگ و فاصله‌ها */
@media (max-width: 599px) {
	.cb-content {
		padding: 16px;
		gap: 14px;
	}
	.cb-ray {
		width: 60px;
	}
}
