/**
 * KIU Hero Slider — стили.
 * Всё скоупится под .kiu-hero, чтобы не конфликтовать с Astra/Elementor.
 */

.kiu-hero {
	--kiu-red: #dd183b;
	--kiu-red-dark: #cc1939;
	--kiu-dark: #0f172a;
	--kiu-cream: #ffede6;
	--kiu-terracotta-1: #9a433c;
	--kiu-terracotta-2: #b05f56;
	--kiu-height: 690px;
	--kiu-overlay: 0.35;
	--kiu-radius: 4px;
	--kiu-ease: cubic-bezier(0.4, 0, 0.2, 1);
	--kiu-container: 1240px;
	--kiu-gutter: clamp(20px, 4vw, 40px);

	position: relative;
	display: block;
	width: 100%;
	margin: 0;
	background: var(--kiu-terracotta-1);
	color: #fff;
	font-family: inherit;
	isolation: isolate;
	overflow: hidden;
}

.kiu-hero--bleed {
	width: auto;
	max-width: none;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.kiu-hero *,
.kiu-hero *::before,
.kiu-hero *::after {
	box-sizing: border-box;
}

/* -------------------------------------------------------------------------
 * Сцена и слайды
 * ---------------------------------------------------------------------- */

.kiu-hero__viewport {
	position: relative;
	overflow: hidden;
}

.kiu-hero__track {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	will-change: transform;
}

.kiu-hero[data-effect="slide"] .kiu-hero__track {
	transition: transform 0.75s var(--kiu-ease);
}

.kiu-hero__slide {
	position: relative;
	display: flex;
	align-items: flex-end;
	flex: 0 0 100%;
	width: 100%;
	min-height: var(--kiu-height);
	margin: 0;
	padding: 0;
	overflow: hidden;
	background: linear-gradient(135deg, var(--kiu-terracotta-1) 0%, var(--kiu-terracotta-2) 100%);
	list-style: none;
}

/* Режим «шторка»: слайды лежат друг на друге в grid-ячейке. */
.kiu-hero[data-effect="fade"] .kiu-hero__track {
	display: grid;
}

.kiu-hero[data-effect="fade"] .kiu-hero__slide {
	grid-area: 1 / 1;
	transition: opacity 0.8s var(--kiu-ease), visibility 0.8s;
}

.kiu-hero[data-effect="fade"][data-kiu-ready] .kiu-hero__slide {
	opacity: 0;
	visibility: hidden;
	z-index: 1;
}

.kiu-hero[data-effect="fade"][data-kiu-ready] .kiu-hero__slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 2;
}

/* Без JS: показываем только первый слайд, чтобы не было «каши». */
.kiu-hero[data-effect="fade"]:not([data-kiu-ready]) .kiu-hero__slide:not(:first-child) {
	display: none;
}

/* -------------------------------------------------------------------------
 * Фон
 * ---------------------------------------------------------------------- */

.kiu-hero__media {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	background: inherit;
}

/* Тёплый дуотон: фото перекрашивается в пару #9a433c → #b05f56,
   сохраняя светотень. Так цвет фона не зависит от исходного фото. */
.kiu-hero__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(105deg, var(--kiu-terracotta-1) 0%, var(--kiu-terracotta-2) 100%);
	opacity: 0.45;
	pointer-events: none;
}

@supports (mix-blend-mode: color) {
	.kiu-hero__media::after {
		mix-blend-mode: color;
		opacity: 1;
	}
}

/* Режим «без подложки»: оригинальное фото, читаемость только за счёт тени. */
.kiu-hero[data-tint="none"] .kiu-hero__media::after,
.kiu-hero[data-tint="none"] .kiu-hero__scrim {
	display: none;
}

.kiu-hero:is([data-tint="none"], [data-tint="veil"]) .kiu-hero__kicker,
.kiu-hero:is([data-tint="none"], [data-tint="veil"]) .kiu-hero__title,
.kiu-hero:is([data-tint="none"], [data-tint="veil"]) .kiu-hero__text {
	text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5), 0 12px 36px rgba(0, 0, 0, 0.45);
}

.kiu-hero:is([data-tint="none"], [data-tint="veil"]) .kiu-hero__dot {
	background: rgba(255, 255, 255, 0.6);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.kiu-hero:is([data-tint="none"], [data-tint="veil"]) .kiu-hero__btn--ghost {
	background: rgba(0, 0, 0, 0.18);
	border-color: rgba(255, 255, 255, 0.75);
}

/* Режим «вуаль»: фото оригинальное, мягкое затемнение только в зоне текста. */
.kiu-hero[data-tint="veil"] .kiu-hero__media::after {
	display: none;
}

.kiu-hero[data-tint="veil"] .kiu-hero__scrim {
	background: linear-gradient(
		32deg,
		rgba(8, 7, 7, 0.86) 0%,
		rgba(8, 7, 7, 0.7) 28%,
		rgba(8, 7, 7, 0.32) 52%,
		rgba(8, 7, 7, 0) 72%
	);
}

.kiu-hero[data-tint="veil"] .kiu-hero__scrim::after {
	background: transparent;
}

.kiu-hero .kiu-hero__media img,
.kiu-hero .kiu-hero__img {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	object-position: center;
	transition: transform 9s linear;
	transform: scale(1.001);
}

.kiu-hero__slide.is-active .kiu-hero__media img {
	transform: scale(1.07);
}

.kiu-hero__scrim {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background:
		linear-gradient(
			105deg,
			rgba(88, 30, 25, 0.62) 0%,
			rgba(88, 30, 25, 0.48) 38%,
			rgba(88, 30, 25, 0.2) 72%,
			rgba(88, 30, 25, 0.06) 100%
		),
		linear-gradient(0deg, rgba(70, 22, 18, 0.32) 0%, rgba(70, 22, 18, 0) 56%);
}

.kiu-hero__scrim::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(120, 44, 39, var(--kiu-overlay));
}

/* -------------------------------------------------------------------------
 * Контент
 * ---------------------------------------------------------------------- */

.kiu-hero__inner {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: var(--kiu-container);
	margin: 0 auto;
	padding: clamp(64px, 8vw, 110px) var(--kiu-gutter) clamp(96px, 10vw, 130px);
}

.kiu-hero__content {
	max-width: 660px;
}

.kiu-hero__kicker,
.kiu-hero__title,
.kiu-hero__text {
	color: #fff;
	text-shadow: 0 1px 2px rgba(74, 24, 20, 0.38), 0 12px 34px rgba(74, 24, 20, 0.34);
}

.kiu-hero__kicker {
	display: inline-block;
	margin: 0 0 14px;
	padding: 0;
	font-family: inherit;
	font-size: clamp(11px, 1vw, 13px);
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.kiu-hero__title {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: clamp(2.25rem, 5.2vw, 5rem);
	font-weight: 600;
	line-height: 1.08;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

.kiu-hero__rule {
	display: block;
	width: 64px;
	height: 3px;
	margin: 22px 0 24px;
	background: #fff;
	border-radius: 2px;
}

.kiu-hero__text {
	max-width: 52ch;
	font-family: inherit;
	font-size: clamp(1rem, 0.5vw + 0.9rem, 1.125rem);
	line-height: 1.65;
}

.kiu-hero__text > *:first-child {
	margin-top: 0;
}

.kiu-hero__text > *:last-child {
	margin-bottom: 0;
}

.kiu-hero__text p {
	margin: 0 0 1em;
}

.kiu-hero__text a {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.kiu-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 34px;
}

.kiu-hero__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 15px 26px;
	border: 1px solid transparent;
	border-radius: var(--kiu-radius);
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	text-align: center;
	text-decoration: none;
	box-shadow: none;
	transition: background-color 0.25s var(--kiu-ease), border-color 0.25s var(--kiu-ease),
		color 0.25s var(--kiu-ease), transform 0.25s var(--kiu-ease);
}

.kiu-hero__btn:hover {
	transform: translateY(-1px);
}

.kiu-hero__btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.kiu-hero__btn--primary {
	background: #fff;
	border-color: #fff;
	color: var(--kiu-dark);
}

.kiu-hero__btn--primary:hover,
.kiu-hero__btn--primary:focus-visible {
	background: var(--kiu-red);
	border-color: var(--kiu-red);
	color: #fff;
}

.kiu-hero__btn--ghost {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.55);
	color: #fff;
}

.kiu-hero__btn--ghost:hover,
.kiu-hero__btn--ghost:focus-visible {
	background: rgba(255, 255, 255, 0.16);
	border-color: #fff;
	color: #fff;
}

/* -------------------------------------------------------------------------
 * Навигация
 * ---------------------------------------------------------------------- */

.kiu-hero__footer {
	position: absolute;
	left: 0;
	right: 0;
	bottom: clamp(16px, 2.4vw, 30px);
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	max-width: var(--kiu-container);
	margin: 0 auto;
	padding: 0 var(--kiu-gutter);
	pointer-events: none;
}

.kiu-hero__footer > * {
	pointer-events: auto;
}

.kiu-hero__dots {
	display: flex;
	align-items: center;
	gap: 8px;
}

.kiu-hero__dot {
	width: 9px;
	min-width: 9px;
	height: 9px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.45);
	cursor: pointer;
	transition: width 0.3s var(--kiu-ease), background-color 0.3s var(--kiu-ease);
}

.kiu-hero__dot:hover {
	background: rgba(255, 255, 255, 0.8);
}

.kiu-hero__dot[aria-current="true"] {
	width: 30px;
	background: #fff;
}

.kiu-hero__dot:focus-visible,
.kiu-hero__arrow:focus-visible,
.kiu-hero__toggle:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.kiu-hero__nav {
	display: flex;
	align-items: center;
	gap: 10px;
}

.kiu-hero__arrow,
.kiu-hero__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 999px;
	background: rgba(10, 15, 28, 0.35);
	color: #fff;
	line-height: 1;
	cursor: pointer;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	transition: background-color 0.25s var(--kiu-ease), border-color 0.25s var(--kiu-ease),
		color 0.25s var(--kiu-ease);
}

.kiu-hero__arrow {
	width: 46px;
	height: 46px;
}

.kiu-hero__toggle {
	width: 38px;
	height: 38px;
	margin-right: 4px;
}

.kiu-hero__arrow:hover,
.kiu-hero__toggle:hover {
	background: #fff;
	border-color: #fff;
	color: var(--kiu-dark);
}

.kiu-hero__icon-play {
	display: none;
}

.kiu-hero__toggle[aria-pressed="true"] .kiu-hero__icon-pause {
	display: none;
}

.kiu-hero__toggle[aria-pressed="true"] .kiu-hero__icon-play {
	display: block;
}

/* -------------------------------------------------------------------------
 * Появление контента при смене слайда
 * ---------------------------------------------------------------------- */

.kiu-hero[data-kiu-ready] .kiu-hero__slide .kiu-hero__content > * {
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.55s var(--kiu-ease), transform 0.55s var(--kiu-ease);
}

.kiu-hero[data-kiu-ready] .kiu-hero__slide.is-active .kiu-hero__content > * {
	opacity: 1;
	transform: none;
}

.kiu-hero[data-kiu-ready] .kiu-hero__slide.is-active .kiu-hero__content > :nth-child(2) {
	transition-delay: 0.06s;
}

.kiu-hero[data-kiu-ready] .kiu-hero__slide.is-active .kiu-hero__content > :nth-child(3) {
	transition-delay: 0.12s;
}

.kiu-hero[data-kiu-ready] .kiu-hero__slide.is-active .kiu-hero__content > :nth-child(4) {
	transition-delay: 0.18s;
}

.kiu-hero[data-kiu-ready] .kiu-hero__slide.is-active .kiu-hero__content > :nth-child(5) {
	transition-delay: 0.24s;
}

/* -------------------------------------------------------------------------
 * Мобильные
 * ---------------------------------------------------------------------- */

@media (max-width: 782px) {
	.kiu-hero__slide {
		min-height: min(var(--kiu-height), 82svh);
	}

	/* На мобильном текст занимает всю ширину — затемняем низ, а не только левый край. */
	.kiu-hero__scrim {
		background: linear-gradient(
			180deg,
			rgba(70, 22, 18, 0.18) 0%,
			rgba(70, 22, 18, 0.45) 45%,
			rgba(70, 22, 18, 0.72) 100%
		);
	}

	.kiu-hero[data-tint="veil"] .kiu-hero__scrim {
		background: linear-gradient(
			180deg,
			rgba(8, 7, 7, 0.18) 0%,
			rgba(8, 7, 7, 0.55) 50%,
			rgba(8, 7, 7, 0.78) 100%
		);
	}

	.kiu-hero__inner {
		padding-top: 72px;
		padding-bottom: 110px;
	}

	.kiu-hero__text {
		max-width: none;
	}

	.kiu-hero__actions {
		margin-top: 26px;
	}
}

@media (max-width: 600px) {
	/* На телефоне кнопки удобнее на всю ширину; на планшете — обычные. */
	.kiu-hero__btn {
		flex: 1 1 auto;
	}
}

@media (max-width: 480px) {
	.kiu-hero__arrow {
		width: 42px;
		height: 42px;
	}

	.kiu-hero__toggle {
		width: 34px;
		height: 34px;
	}

	.kiu-hero__dot {
		width: 7px;
		min-width: 7px;
		height: 7px;
	}

	.kiu-hero__dot[aria-current="true"] {
		width: 22px;
	}
}

/* -------------------------------------------------------------------------
 * Доступность и печать
 * ---------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.kiu-hero,
	.kiu-hero *,
	.kiu-hero *::before,
	.kiu-hero *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.kiu-hero__media img,
	.kiu-hero__slide.is-active .kiu-hero__media img {
		transform: none !important;
	}
}

@media print {
	.kiu-hero__footer {
		display: none;
	}

	.kiu-hero__slide {
		min-height: auto;
	}
}
