/*
 * Карусель первого экрана — inc/kjt-hero.php.
 *
 * Размеры и положения сняты с Revolution #119 (22.09.2026):
 *   ≥ 1120   карточка 1120×670, по центру
 *   480–1119 карточка во всю ширину, 1120:670, всё внутри масштабируется
 *   < 480    карточка 270×500
 *
 * Внутри карточки в режиме «десктоп» всё задано в долях её ширины (cqw):
 * при 1120 px значения совпадают с макетом Revolution, на меньших — уменьшаются
 * пропорционально, как делает сам Revolution.
 */

/* --- Минимум от Swiper: его CSS не подключаем, чтобы ничего не ждать --- */
.kjt-hero .swiper { position: relative; overflow: hidden; z-index: 1; }
.kjt-hero .swiper-wrapper {
	position: relative; z-index: 1; display: flex; box-sizing: content-box;
	transition-property: transform;
	/* power3.inOut в Revolution = easeInOutQuart */
	transition-timing-function: cubic-bezier(.76, 0, .24, 1);
}
.kjt-hero .swiper-slide { flex-shrink: 0; position: relative; transition-property: transform, opacity; }

/* --- Каркас ---
 * Правила карточки — с префиксом .kjt-hero: CSS Swiper из настроек темы
 * (`.swiper-slide { width: 100%; height: 100% }`) грузится позже и при равной
 * специфичности перебил бы размеры. */
.kjt-hero { position: relative; --kjt-card-w: 1120px; }

.kjt-hero .kjt-hero__card {
	width: 1120px;
	height: 670px;
	container-type: inline-size;
	opacity: 0;
	-webkit-tap-highlight-color: transparent;
}
.kjt-hero .kjt-hero__card.is-active { opacity: 1; }

/* До запуска Swiper видна только первая карточка (она же LCP), соседние
   появляются уже с 3D-наклоном. Если показать соседнюю сразу, при запуске
   наклон поменяет её прямоугольник — это сдвиг вёрстки: 0,114 CLS
   в замере через Cloudflare 22.09.2026. Появление элемента сдвигом
   не считается. Revolution поступает строже — прячет слайдер целиком. */
.kjt-hero:not(.is-ready) .kjt-hero__card:not(.is-active) { visibility: hidden; }

/* До запуска Swiper раскладка та же, что после: первая карточка по центру. */
.kjt-hero:not(.is-ready) .kjt-hero__track {
	gap: 0;
	transform: translateX(calc(50% - var(--kjt-card-w) / 2));
}

@media (max-width: 1119px) {
	.kjt-hero { --kjt-card-w: 100%; }
	.kjt-hero .kjt-hero__card { width: 100%; height: auto; aspect-ratio: 1120 / 670; }
	.kjt-hero:not(.is-ready) .kjt-hero__track { transform: none; }
}
@media (max-width: 479px) {
	.kjt-hero { --kjt-card-w: 270px; }
	.kjt-hero .kjt-hero__card { width: 270px; height: 500px; aspect-ratio: auto; }
	.kjt-hero:not(.is-ready) .kjt-hero__track { transform: translateX(calc(50% - 135px)); }
}

/* --- Постер и видео ---
 * Как у Revolution: слот карточки — 1120×670 (он задаёт шаг карусели),
 * а видна рамка с отступом 10 px со всех сторон и радиусом 10 px.
 * Постер и видео лежат в «сцене» размером со слот, прижатой к левому
 * верхнему углу рамки, — справа и снизу они обрезаются на 20 px.
 * Снято по пикселям 22.09.2026. */
.kjt-hero__media {
	position: absolute; inset: 10px;
	border-radius: 10px;
	overflow: hidden;
	transform: translateZ(0);     /* обрезка iframe по радиусу в Safari */
}
.kjt-hero__stage {
	position: absolute; left: 0; top: 0;
	width: calc(100% + 20px);
	height: calc(100% + 20px);
}
.kjt-hero__poster {
	position: absolute; inset: 0;
	width: 100%; height: 100%;
	object-fit: cover; object-position: center;
	max-width: none;
}
.kjt-hero .kjt-hero__video {
	/* Стили темы ограничивают iframe шириной контейнера — ролику нужно
	   выйти за край, чтобы закрыть карточку «на обрез». */
	max-width: none !important;
	max-height: none !important;
	position: absolute; left: 50%; top: 50%;
	transform: translate(-50%, -50%);
	opacity: 0;
	transition: opacity .3s ease;
	pointer-events: none;
	border: 0;
}
.kjt-hero .kjt-hero__card.is-playing .kjt-hero__video { opacity: 1; }

/* --- «Learn More» и «Play» --- */
.kjt-hero .kjt-hero__learn,
.kjt-hero .kjt-hero__play {
	all: unset;
	box-sizing: border-box;
	position: absolute;
	z-index: 2;
	cursor: pointer;
	white-space: nowrap;
	font-family: Roboto, Arial, sans-serif;
	letter-spacing: 0;
	text-transform: none;
}
.kjt-hero .kjt-hero__learn:focus-visible,
.kjt-hero .kjt-hero__play:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* Десктоп: 1120×670, значения в долях ширины карточки */
.kjt-hero .kjt-hero__learn {
	left: 20.982cqw;              /* 235 px */
	top: 50.804cqw;               /* 569 px */
	color: #fff;
	font-weight: 400;
	font-size: 1.786cqw;          /* 20 px */
	line-height: 2.232cqw;        /* 25 px */
}
.kjt-hero .kjt-hero__play {
	left: 6.25cqw;                /* 70 px */
	top: 49.732cqw;               /* 557 px */
	padding: 1.071cqw 3.125cqw .536cqw;   /* 12 35 6 */
	border-radius: 30px;
	background: #fff;
	color: #000;
	font-weight: 700;
	font-size: 1.518cqw;          /* 17 px */
	line-height: 1.786cqw;        /* 20 px */
	letter-spacing: .089cqw;      /* 1 px */
}
.kjt-hero__play-icon {
	/* Как у Revolution: иконка в потоке после «Play », но сдвинута
	   на 21 px вправо и на 3 px вверх (position: relative). Иконка
	   у Revolution не масштабируется — на любой ширине 25×25 px, поэтому
	   здесь пиксели, а не cqw. */
	position: relative;
	left: 21px;
	top: -3px;
	vertical-align: top;
	letter-spacing: 0;
	display: inline-block;
	box-sizing: content-box;
	padding: 7px 7px 7px 9px;
	border-radius: 50px;
	background: #000;
	color: #fff;
	font-size: 11px;
	line-height: 1;
}
.kjt-hero__play-icon svg { display: block; width: .786em; height: 1em; }

/* Телефон: 270×500, значения в пикселях, как в мобильной раскладке Revolution */
@media (max-width: 479px) {
	.kjt-hero .kjt-hero__learn { left: 94px; top: 381px; font-size: 20px; line-height: 25px; }
	.kjt-hero .kjt-hero__play {
		left: 95px; top: 425px;
		padding: 7px 22px 2px;
		font-size: 14px;
		line-height: 22px;        /* у Revolution 6 px, но текст там стоит на 10 px от верха — так же */
		letter-spacing: 0;
	}
}

/* --- Точки навигации: 12 px под каруселью --- */
.kjt-hero__dots {
	position: absolute; left: 0; right: 0; top: calc(100% + 12px);
	display: flex; justify-content: center; gap: 8px;
	z-index: 2;
}
.kjt-hero .kjt-hero__dot {
	all: unset;
	width: 8px; height: 8px; border-radius: 50%;
	background: #e5e5e5; cursor: pointer;
	transition: background-color .3s ease;
}
.kjt-hero .kjt-hero__dot:hover,
.kjt-hero .kjt-hero__dot.is-active { background: #595959; }

/* --- Всплывающее окно с роликом --- */
.kjt-hero-modal {
	position: fixed; inset: 0; z-index: 100000;
	display: flex; align-items: center; justify-content: center;
	background: rgba(0, 0, 0, .75);
	opacity: 0; transition: opacity .3s ease;
}
.kjt-hero-modal.is-open { opacity: 1; }
.kjt-hero-modal__box {
	width: min(1240px, 100vw, calc(100vh * 16 / 9));
	aspect-ratio: 16 / 9;
}
.kjt-hero-modal__box iframe { display: block; width: 100%; height: 100%; border: 0; }
