/* ==========================================================================
   Bloque: Hero — carrusel de fotos/videos a pantalla completa.
   Desktop: N por vista (Customizer, default 3). Tablet: 2. Móvil: 1.
   ========================================================================== */

.ko-hero {
	--ko-pv: 1;
	position: relative;
	height: var(--ko-hero-h, 100svh);
	min-height: 480px;
	overflow: hidden;
	background: var(--ko-ink);
	color: var(--ko-cream);
}

@media (min-width: 600px) {
	.ko-hero {
		--ko-pv: min(2, var(--ko-hero-per-view, 3));
	}
}

@media (min-width: 1024px) {
	.ko-hero {
		--ko-pv: var(--ko-hero-per-view, 3);
	}
}

/* Sin JS: fila con scroll horizontal y snap. Con JS: pista animada. */
.ko-hero__viewport {
	height: 100%;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.ko-hero.is-ready .ko-hero__viewport {
	overflow: hidden;
	cursor: grab;
	touch-action: pan-y;
	user-select: none;
}

.ko-hero.is-dragging .ko-hero__viewport {
	cursor: grabbing;
}

.ko-hero__track {
	display: flex;
	height: 100%;
}

.ko-hero.is-ready .ko-hero__track {
	will-change: transform;
}

.ko-hero__slide {
	position: relative;
	flex: 0 0 calc(100% / var(--ko-pv));
	height: 100%;
	overflow: hidden;
	scroll-snap-align: start;
}

/* Media ------------------------------------------------------------------ */

.ko-hero__media,
.ko-hero__img,
.ko-hero__video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.ko-hero__img,
.ko-hero__video {
	object-fit: cover;
	transform: scale(1.001);
	transition: transform 1.2s var(--ko-ease-out);
	-webkit-user-drag: none;
}

@media (hover: hover) {
	.ko-hero__slide:hover .ko-hero__img,
	.ko-hero__slide:hover .ko-hero__video {
		transform: scale(1.06);
	}
}

/* Sombras: abajo para los captions, arriba para el header claro. */
.ko-hero__slide::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(to top, rgb(0 0 0 / var(--ko-hero-shade, 0.45)) 0%, transparent 50%);
}

.ko-header-on-dark .ko-hero__slide::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	z-index: 1;
	height: 200px;
	pointer-events: none;
	background: linear-gradient(to bottom, rgb(0 0 0 / 0.4), transparent);
}

/* Caption ---------------------------------------------------------------- */

.ko-hero__caption {
	position: absolute;
	inset: auto 0 0;
	z-index: 2;
	padding: clamp(24px, 4vw, 56px) clamp(24px, 4.2vw, 60px);
	pointer-events: none;
}

.ko-hero__label {
	margin: 0 0 4px;
	font-size: 13px;
	font-style: italic;
	line-height: 1.4;
	opacity: 0.85;
}

.ko-hero__title {
	margin: 0 0 16px;
	font-size: clamp(22px, 1.9vw, 30px);
	line-height: 1.05;
	color: inherit;
}

.ko-hero__more {
	display: inline-flex;
	align-items: center;
	height: 34px;
	padding: 0 7px;
	border: 1px solid currentColor;
	border-radius: 999px;
}

.ko-hero__more .ko-icon {
	width: 18px;
	height: 18px;
}

/* El "View" se despliega en hover, como el read more de la referencia. */
.ko-hero__more-text {
	max-width: 0;
	overflow: hidden;
	font-family: var(--ko-font-display);
	font-weight: 700;
	font-size: 13px;
	text-transform: uppercase;
	white-space: nowrap;
	transition: max-width 0.45s var(--ko-ease), padding 0.45s var(--ko-ease);
}

.ko-hero__slide:hover .ko-hero__more-text,
.ko-hero__link:focus-visible ~ .ko-hero__caption .ko-hero__more-text {
	max-width: 64px;
	padding-left: 8px;
}

.ko-hero__link {
	position: absolute;
	inset: 0;
	z-index: 3;
}

.ko-hero__link:focus-visible {
	outline: 2px solid var(--ko-cream);
	outline-offset: -10px;
}

/* Controles -------------------------------------------------------------- */

.ko-hero__controls {
	position: absolute;
	right: var(--ko-gutter);
	bottom: clamp(24px, 4vw, 56px);
	z-index: 4;
	display: flex;
	gap: 8px;
}

.ko-hero__btn {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 1px solid rgb(255 250 238 / 0.6);
	border-radius: 50%;
	background: rgb(0 0 0 / 0.25);
	color: var(--ko-cream);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	transition: background-color 0.25s ease, color 0.25s ease;
}

.ko-hero__btn:hover,
.ko-hero__btn:focus-visible {
	background: var(--ko-cream);
	color: var(--ko-ink);
}

.ko-hero__btn .ko-icon--play,
.ko-hero.is-paused .ko-hero__btn .ko-icon--pause {
	display: none;
}

.ko-hero.is-paused .ko-hero__btn .ko-icon--play {
	display: block;
}

/* En móvil el caption deja espacio a los controles. */
@media (max-width: 599px) {
	.ko-hero:has(.ko-hero__controls) .ko-hero__caption {
		padding-right: 168px;
	}
}

/* Estado vacío (solo administradores) ------------------------------------ */

.ko-hero__empty {
	display: grid;
	place-items: center;
	height: 100%;
	padding: var(--ko-gutter);
	text-align: center;
	border: 1px dashed rgb(255 250 238 / 0.3);
}

.ko-hero__empty p {
	max-width: 32ch;
	margin: 0;
	font-family: var(--ko-font-display);
	font-weight: 700;
	text-transform: uppercase;
}

/* Header claro mientras está sobre el hero -------------------------------- */

.ko-header-on-dark .ko-header:not(.is-fixed) {
	color: var(--ko-cream);
}

@media (prefers-reduced-motion: reduce) {
	.ko-hero *,
	.ko-hero *::after {
		transition-duration: 0.01ms !important;
	}

	.ko-hero__slide:hover .ko-hero__img,
	.ko-hero__slide:hover .ko-hero__video {
		transform: none;
	}
}
