/*------------------------------------------------------------------
[ AB Hero — hero секция с процедурен пушек ]

Променливите (--ab-hr-*) идват inline от шорткода. Редът на слоевете
в .ab-hr__stage е: фон → затъмняване → пушек (зад) → сияние → бутилка
→ пушек (колона) → пушек (пред) → лъчи → винятка, а текстът е над тях.
------------------------------------------------------------------*/

.ab-hr {
	position: relative;
	width: 100%;
	height: var(--ab-hr-height, 100vh);
	min-height: var(--ab-hr-min-height, 620px);
	overflow: hidden;
	background: var(--ab-hr-bg, #241D1D);
	color: var(--ab-hr-text-color, #fff);
}

/* ── Слоеве ────────────────────────────────────────────────────── */

.ab-hr__stage {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.ab-hr__layer {
	position: absolute;
	pointer-events: none;
}
.ab-hr__layer img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	will-change: transform;
}

/* Фонът е леко по-голям от секцията, за да има запас за паралакса */
.ab-hr__bg {
	inset: -6% 0;
	z-index: 1;
}

.ab-hr__overlay {
	position: absolute;
	inset: 0;
	z-index: 2;
	background: var(--ab-hr-overlay, #000);
	opacity: var(--ab-hr-overlay-op, 0);
	pointer-events: none;
}

/* Бутилката: височина в % от секцията, центърът ѝ се позиционира в % */
.ab-hr__bottle {
	left: var(--ab-hr-bottle-left, 51%);
	bottom: var(--ab-hr-bottle-bottom, 8%);
	height: var(--ab-hr-bottle-size, 78%);
	width: auto;
	aspect-ratio: auto;
	transform: translateX(-50%);
	z-index: 5;
}
.ab-hr__bottle img {
	width: auto;
	height: 100%;
	object-fit: contain;
}

/* ── Пушек ─────────────────────────────────────────────────────── */

.ab-hr__smoke {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: 70%;
	pointer-events: none;
	/* Стопява се нагоре и към страните, за да няма видим ръб на canvas-а */
	-webkit-mask-image: linear-gradient(to top, #000 0%, #000 45%, transparent 100%),
		linear-gradient(to right, transparent 0%, #000 10%, #000 90%, transparent 100%);
	mask-image: linear-gradient(to top, #000 0%, #000 45%, transparent 100%),
		linear-gradient(to right, transparent 0%, #000 10%, #000 90%, transparent 100%);
	-webkit-mask-composite: source-in;
	mask-composite: intersect;
	will-change: transform;
}
.ab-hr__smoke--back   { z-index: 3; }
.ab-hr__smoke--column { z-index: 6; }
.ab-hr__smoke--front  { z-index: 7; }

/* Колоната се стопява по-плавно нагоре — тя е тази, която стига високо */
.ab-hr__smoke--column {
	-webkit-mask-image: linear-gradient(to top, #000 0%, #000 20%, transparent 95%),
		linear-gradient(to right, transparent 0%, #000 20%, #000 80%, transparent 100%);
	mask-image: linear-gradient(to top, #000 0%, #000 20%, transparent 95%),
		linear-gradient(to right, transparent 0%, #000 20%, #000 80%, transparent 100%);
}

/* ── Сияние зад бутилката ──────────────────────────────────────── */

.ab-hr__glow {
	position: absolute;
	left: var(--ab-hr-bottle-left, 51%);
	bottom: var(--ab-hr-bottle-bottom, 8%);
	width: var(--ab-hr-glow-size, 46%);
	height: var(--ab-hr-glow-size, 46%);
	z-index: 4;
	margin-bottom: calc(var(--ab-hr-bottle-size, 78%) * 0.25);
	transform: translate(-50%, 50%);
	pointer-events: none;
	opacity: var(--ab-hr-glow-op, 0.35);
	background: radial-gradient(
		ellipse at center,
		rgba(var(--ab-hr-glow-rgb, 255, 169, 77), 0.9) 0%,
		rgba(var(--ab-hr-glow-rgb, 255, 169, 77), 0.35) 35%,
		rgba(var(--ab-hr-glow-rgb, 255, 169, 77), 0) 70%
	);
	filter: blur(18px);
}
.ab-hr__glow.is-breathing {
	animation: ab-hr-breathe 7s ease-in-out infinite;
}
@keyframes ab-hr-breathe {
	0%, 100% { transform: translate(-50%, 50%) scale(1);    opacity: var(--ab-hr-glow-op, 0.35); }
	50%      { transform: translate(-50%, 50%) scale(1.12); opacity: calc(var(--ab-hr-glow-op, 0.35) * 1.35); }
}

/* ── Светлинни лъчи ────────────────────────────────────────────── */

.ab-hr__rays {
	position: absolute;
	left: -30%;
	top: -60%;
	width: 160%;
	height: 180%;
	z-index: 8;
	pointer-events: none;
	opacity: var(--ab-hr-rays-op, 0.16);
	mix-blend-mode: screen;
	transform: rotate(var(--ab-hr-rays-angle, 18deg));
	background: repeating-linear-gradient(
		90deg,
		rgba(255, 244, 224, 0) 0px,
		rgba(255, 244, 224, 0.55) 30px,
		rgba(255, 244, 224, 0) 80px,
		rgba(255, 244, 224, 0) 140px,
		rgba(255, 244, 224, 0.3) 190px,
		rgba(255, 244, 224, 0) 250px
	);
	-webkit-mask-image: radial-gradient(ellipse 60% 55% at 32% 8%, #000 0%, rgba(0, 0, 0, 0.5) 45%, transparent 78%);
	mask-image: radial-gradient(ellipse 60% 55% at 32% 8%, #000 0%, rgba(0, 0, 0, 0.5) 45%, transparent 78%);
	animation: ab-hr-rays 18s ease-in-out infinite;
}
@keyframes ab-hr-rays {
	0%, 100% { transform: rotate(var(--ab-hr-rays-angle, 18deg)) translateX(0);     opacity: var(--ab-hr-rays-op, 0.16); }
	50%      { transform: rotate(var(--ab-hr-rays-angle, 18deg)) translateX(-26px); opacity: calc(var(--ab-hr-rays-op, 0.16) * 0.65); }
}

/* ── Винятка ───────────────────────────────────────────────────── */

.ab-hr__vignette {
	position: absolute;
	inset: 0;
	z-index: 9;
	pointer-events: none;
	background: radial-gradient(
		ellipse 78% 72% at 50% 46%,
		rgba(0, 0, 0, 0) 40%,
		rgba(0, 0, 0, calc(var(--ab-hr-vignette, 0.55) * 0.55)) 78%,
		rgba(0, 0, 0, var(--ab-hr-vignette, 0.55)) 100%
	);
}

/* ── Градиенти към фона на сайта ───────────────────────────────── */

/* Над всичко в секцията — снимка, пушек, бутилка, лъчи, винятка, текст и
   индикатор — за да прелива към съседната секция без рязък ръб. Нарочно е
   с по-висок z-index от съдържанието (10) и индикатора (11), а не само
   по-късно в DOM: паралаксът слага трансформации по слоевете, а те правят
   собствен контекст на наслагване. */
.ab-hr__fade {
	position: absolute;
	left: 0;
	right: 0;
	z-index: 12;
	pointer-events: none;
}
.ab-hr__fade--top {
	top: 0;
	height: var(--ab-hr-fade-top-h, 180px);
	background: linear-gradient(to bottom, var(--ab-hr-fade, #241D1D) 0%, rgba(0, 0, 0, 0) 100%);
}
.ab-hr__fade--bottom {
	bottom: 0;
	height: var(--ab-hr-fade-bottom-h, 180px);
	background: linear-gradient(to top, var(--ab-hr-fade, #241D1D) 0%, rgba(0, 0, 0, 0) 100%);
}

/* ── Текст ─────────────────────────────────────────────────────── */

.ab-hr__content {
	position: absolute;
	inset: 0;
	z-index: 10;
	width: 100%;
	max-width: var(--ab-hr-container, 1600px);
	margin: 0 auto;
	padding: 0 15px;
	pointer-events: none;
}
.ab-hr__zone {
	position: absolute;
	pointer-events: auto;
	will-change: transform;
}
.ab-hr__zone--a {
	top: var(--ab-hr-a-top, 36%);
	left: var(--ab-hr-a-left, 10%);
	width: var(--ab-hr-a-width, 34%);
}
.ab-hr__zone--b {
	top: var(--ab-hr-b-top, 56%);
	left: var(--ab-hr-b-left, 62%);
	width: var(--ab-hr-b-width, 30%);
}

.ab-hr__title {
	margin: 0;
	font-family: "Bona Nova", Georgia, serif;
	font-weight: 700;
	font-size: var(--ab-hr-title-size, 86px);
	line-height: 1.05;
	letter-spacing: 0.01em;
	text-transform: none;
	color: var(--ab-hr-title-color, #fff);
	/* Сияние като в AB Story, но в цвета на самото заглавие; тъмната сянка
	   отдолу остава за четимост върху светли места от снимката. */
	text-shadow:
		0 0 18px rgba(var(--ab-hr-title-rgb, 255, 255, 255), calc(0.5 * var(--ab-hr-text-glow, 1))),
		0 0 48px rgba(var(--ab-hr-title-rgb, 255, 255, 255), calc(0.2 * var(--ab-hr-text-glow, 1))),
		0 2px 22px rgba(0, 0, 0, 0.45);

	text-shadow: 14px -12px 18px rgba(var(--ab-hr-title-rgb), calc(0.5 * var(--ab-hr-text-glow, 1))), 0 0 48px rgba(var(--ab-hr-title-rgb), calc(0.2 * var(--ab-hr-text-glow, 1))), 0 2px 22px rgba(0, 0, 0, 0.45);
}

.ab-hr__subtitle {
	margin-top: 6px;
	margin-left: var(--ab-hr-sub-indent, 22px);
	font-family: "Bona Nova", Georgia, serif;
	font-weight: 700;
	/* font-style: italic; */
	font-size: var(--ab-hr-sub-size, 44px);
	line-height: 1.1;
	color: var(--ab-hr-sub-color, #C39B63);
	text-shadow:
		0 0 18px rgba(var(--ab-hr-sub-rgb, 195, 155, 99), calc(0.45 * var(--ab-hr-text-glow, 1))),
		0 0 48px rgba(var(--ab-hr-sub-rgb, 195, 155, 99), calc(0.2 * var(--ab-hr-text-glow, 1))),
		0 2px 20px rgba(0, 0, 0, 0.4);
}

.ab-hr__text {
	font-size: var(--ab-hr-text-size, 19px);
	line-height: 1.6;
	color: var(--ab-hr-text-color, #fff);
	text-shadow: 0 0px 9px rgba(255, 255, 255, 0.8);
	font-family: "Bona Nova", Georgia, serif;
	letter-spacing: 0;
}
.ab-hr__text p {
	margin: 0 0 1em;
}
.ab-hr__text p:last-child {
	margin-bottom: 0;
}

.ab-hr--dropcap .ab-hr__text > p:first-of-type::first-letter {
	/* float: left;
	margin: 0.04em 0.08em 0 0;
	font-family: "Bona Nova", Georgia, serif;
	font-weight: 700;
	font-size: 3.1em;
	line-height: 0.82;
	color: var(--ab-hr-dropcap-color, #C39B63); */

	initial-letter: 2;       /* буквата заема точно 3 реда */
    -webkit-initial-letter: 2;
    margin-right: 0.35em;
    color: #B58753;
    font-family: "Bona Nova", serif;
        text-shadow: 0px 0px 12px rgb(181 135 83 / 60%);
}

/* ── Поява ─────────────────────────────────────────────────────── */

/* Видимото състояние е по подразбиране — .ab-hr--anim се слага от JS,
   така че без JS (или при спрял ticker) текстът пак се вижда. */
.ab-hr--anim .ab-hr__title,
.ab-hr--anim .ab-hr__subtitle,
.ab-hr--anim .ab-hr__text {
	opacity: 0;
	transform: translateY(30px);
}
.ab-hr--anim.ab-hr--in .ab-hr__title,
.ab-hr--anim.ab-hr--in .ab-hr__subtitle,
.ab-hr--anim.ab-hr--in .ab-hr__text {
	opacity: 1;
	transform: none;
	transition: opacity 2.1s cubic-bezier(0.2, 0.7, 0.2, 1), transform 2.1s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.ab-hr--anim.ab-hr--in .ab-hr__title    { transition-delay: 0.65s; }
.ab-hr--anim.ab-hr--in .ab-hr__subtitle { transition-delay: 1.00s; }
.ab-hr--anim.ab-hr--in .ab-hr__text     { transition-delay: 1.40s; }

/* ── „Scroll“ индикатор ────────────────────────────────────────── */

.ab-hr__hint {
	position: absolute;
	left: 50%;
	bottom: 28px;
	z-index: 80;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	transform: translateX(-50%);
	transition: opacity 0.6s ease, transform 0.6s ease;
	pointer-events: none;
	font-family: "Bona Nova", Georgia, serif;
}
.ab-hr__hint.is-hidden {
	opacity: 0;
	transform: translateX(-50%) translateY(14px);
}
.ab-hr__hint-text {
	font-size: 12px;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--ab-hr-sub-color, #C39B63);
}
.ab-hr__hint-line {
	position: relative;
	width: 1px;
	height: 46px;
	overflow: hidden;
	background: rgba(195, 155, 99, 0.25);
}
.ab-hr__hint-line::after {
	content: "";
	position: absolute;
	left: 0;
	top: -50%;
	width: 100%;
	height: 50%;
	background: var(--ab-hr-sub-color, #C39B63);
	animation: ab-hr-hint 2.4s ease-in-out infinite;
}
@keyframes ab-hr-hint {
	0%   { top: -50%; }
	60%  { top: 100%; }
	100% { top: 100%; }
}

/* ── Таблет / мобилно ──────────────────────────────────────────── */

@media (max-width: 991px) {
	.ab-hr__title {
		font-size: calc(var(--ab-hr-title-size, 86px) * 0.6);
	}
	.ab-hr__subtitle {
		font-size: calc(var(--ab-hr-sub-size, 44px) * 0.72);
	}
}

@media (max-width: 767px) {
	/* На телефон зоните минават една под друга и се разгъват по ширина */
	.ab-hr__zone--a,
	.ab-hr__zone--b {
		left: 6%;
		width: 88%;
		text-align: left !important;
		position: relative;
		left: auto;
		right: auto;
		
	}
	.ab-hr__zone--a {
		top: 14%;
		top: auto;
		bottom: auto;
		margin-top: 130px;
		width: 100%;
	}
	.ab-hr__zone--b {
		top: auto;
		bottom: 14%;
		top: auto;
		bottom: auto;
		width: 100%;
	}
	.ab-hr__title {
		font-size: calc(var(--ab-hr-title-size, 86px) * 0.66);
	}
	.ab-hr__subtitle {
		margin-left: calc(var(--ab-hr-sub-indent, 22px) * 0.5);
		font-size: calc(var(--ab-hr-sub-size, 44px) * 0.52);
		margin-top: 0;
        margin-left: 0;
		margin-bottom: 15px;
	}
	.ab-hr__text {
		font-size: calc(var(--ab-hr-text-size, 16px) * 0.92);
		font-size:16px;
	}
	.ab-hr__bottle {
		height: calc(var(--ab-hr-bottle-size, 78%) * 0.62);
	}
	.ab-hr__hint {
		bottom: 16px;
	}
	.ab-hr{
		min-height: 850px;
	}
}

/* ── Без анимации ──────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.ab-hr__glow.is-breathing,
	.ab-hr__rays,
	.ab-hr__hint-line::after {
		animation: none;
	}
	.ab-hr__smoke {
		display: none;
	}
}
