/* Link Slideshow */

.link-slideshow {
	--ls-speed: 900ms;
	--ls-interval: 6s;
	--ls-controls-offset: 32px;
	--ls-ease: cubic-bezier(0.65, 0, 0.35, 1);
	position: relative;
	display: block;
	width: 100%;
	height: 640px;
	overflow: hidden;
	border-radius: 16px;
	isolation: isolate;
	outline: none;
}

@media (max-width: 767px) {
	.link-slideshow {
		height: 560px;
	}
}

.link-slideshow__slides {
	position: absolute;
	inset: 0;
}

/* Cada hijo directo es una diapositiva apilada */
.link-slideshow__slides > * {
	position: absolute !important;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0 !important;
	visibility: hidden;
	z-index: 0;
	background-size: cover;
	background-position: center;
}

.link-slideshow__slides > .is-active {
	visibility: visible;
	z-index: 2;
}

.link-slideshow__slides > .is-leaving {
	visibility: visible;
	z-index: 1;
}

/* Antes de que arranque el script (y en el editor mientras se cargan los hijos) se ve la primera */
.link-slideshow:not(.is-ready) .link-slideshow__slides > :first-child {
	visibility: visible;
	z-index: 2;
}

/* Capa de imagen propia para poder hacer zoom sin mover los textos */
.link-slideshow__slides > .has-ls-media {
	background-image: none !important;
	isolation: isolate;
	overflow: hidden;
}

.link-slideshow__media {
	position: absolute;
	inset: 0;
	z-index: -1;
	background-repeat: no-repeat;
	background-size: cover;
	background-position: center;
	pointer-events: none;
	transform-origin: center;
	backface-visibility: hidden;
}

.link-slideshow__slides > .is-zooming .link-slideshow__media {
	animation: ls-zoom calc(var(--ls-speed) * 2.4) cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes ls-zoom {
	from { transform: scale(1.18); }
	to { transform: scale(1); }
}

/* Fondo ambiental: la foto activa desenfocada detrás de la sección */
.has-ls-ambient {
	position: relative;
	isolation: isolate;
	overflow: hidden;
}

.link-slideshow-ambient {
	position: absolute;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	pointer-events: none;
	background: #0e0f13;
}

.link-slideshow-ambient__layer {
	position: absolute;
	inset: -10%;
	background-size: cover;
	background-position: center;
	opacity: 0;
	transform: scale(1.15);
	transition: opacity 1.2s ease;
}

.link-slideshow-ambient__layer.is-visible {
	opacity: 1;
}

.link-slideshow-ambient::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.05) 40%, rgba(0, 0, 0, 0.35) 100%);
}

/* Barrido: la nueva entra recortada desde el costado */
.link-slideshow--sweep .link-slideshow__slides > .is-entering-next {
	animation: ls-sweep-next var(--ls-speed) var(--ls-ease) both;
}

.link-slideshow--sweep .link-slideshow__slides > .is-entering-prev {
	animation: ls-sweep-prev var(--ls-speed) var(--ls-ease) both;
}

@keyframes ls-sweep-next {
	from { clip-path: inset(0 0 0 100%); }
	to { clip-path: inset(0 0 0 0); }
}

@keyframes ls-sweep-prev {
	from { clip-path: inset(0 100% 0 0); }
	to { clip-path: inset(0 0 0 0); }
}

/* Fundido */
.link-slideshow--fade .link-slideshow__slides > .is-entering-next,
.link-slideshow--fade .link-slideshow__slides > .is-entering-prev {
	animation: ls-fade-in var(--ls-speed) ease both;
}

@keyframes ls-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* Textos que entran escalonados */
.link-slideshow[data-text-reveal="true"] .ls-reveal {
	opacity: 0;
	transform: translateY(28px);
	transition:
		opacity 700ms ease,
		transform 800ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.link-slideshow[data-text-reveal="true"] .is-active .ls-reveal.is-shown {
	opacity: 1;
	transform: none;
	transition-delay: calc(var(--ls-reveal-base, 250ms) + var(--ls-delay, 0ms));
}

/* Títulos palabra por palabra */
.link-slideshow .ls-word {
	display: inline-block;
	overflow: hidden;
	vertical-align: top;
	padding-bottom: 0.12em;
	margin-bottom: -0.12em;
}

.link-slideshow .ls-word__inner {
	display: inline-block;
}

.link-slideshow[data-text-reveal="true"] .ls-split .ls-word__inner {
	transform: translateY(110%);
	transition: transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.link-slideshow[data-text-reveal="true"] .is-active .ls-split.is-shown .ls-word__inner {
	transform: none;
	transition-delay: calc(var(--ls-reveal-base, 250ms) + var(--ls-delay, 0ms));
}

/* Controles numerados con anillo de progreso */
.link-slideshow__controls {
	position: absolute;
	bottom: var(--ls-controls-offset);
	z-index: 5;
	display: flex;
	gap: 4px;
	color: #fff;
}

@media (max-width: 767px) {
	.link-slideshow__controls {
		gap: 6px;
	}

	.link-slideshow .link-slideshow__dot {
		width: 32px;
		height: 32px;
		font-size: 12px;
	}
}

.link-slideshow__controls--right { right: var(--ls-controls-offset); }
.link-slideshow__controls--left { left: var(--ls-controls-offset); }
.link-slideshow__controls--center { left: 50%; transform: translateX(-50%); }

.link-slideshow__dot {
	position: relative;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 0.2s ease;
}

.link-slideshow__dot:hover,
.link-slideshow__dot.is-active {
	opacity: 1;
}

.link-slideshow__dot.is-active {
	font-weight: 700;
}

.link-slideshow__dot:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.link-slideshow__dot svg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
}

.link-slideshow__dot circle:first-child {
	opacity: 0.3;
}

.link-slideshow__dot circle:last-child {
	stroke-dasharray: 94.25;
	stroke-dashoffset: 94.25;
}

.link-slideshow__dot.is-active circle {
	stroke-width: 2.5;
}

.link-slideshow__dot.is-active circle:last-child {
	stroke-dashoffset: 0;
}

.link-slideshow.is-autoplay .link-slideshow__dot.is-active circle:last-child {
	animation: ls-progress var(--ls-interval) linear both;
}

.link-slideshow.is-paused .link-slideshow__dot.is-active circle:last-child {
	animation-play-state: paused;
}

@keyframes ls-progress {
	from { stroke-dashoffset: 94.25; }
	to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.link-slideshow .link-slideshow__slides > *,
	.link-slideshow .link-slideshow__media {
		animation: none !important;
	}

	.link-slideshow[data-text-reveal="true"] .ls-reveal,
	.link-slideshow[data-text-reveal="true"] .ls-split .ls-word__inner {
		opacity: 1;
		transform: none;
		transition: none;
	}
}
