/* ==========================================================================
   LS Elementor Widgets — LS Línea de tiempo
   Este archivo tiene la disposición HORIZONTAL y todo lo común. La vertical la
   genera el widget en un <style> propio con el ancho de cambio elegido
   (ver Timeline::vertical_css()), así cada widget cambia donde se le diga.
   ========================================================================== */

.lsew-tl {
	--tl-m: 40px;
	--tl-dot: 16px;
	--tl-line-w: 2px;
	--tl-line-style: solid;
	--tl-line-color: #d5dae4;
	--tl-progress: var(--e-global-color-accent, #ff01d2);
	--tl-gap: 20px;
	--tl-hspace: 10px;
	--tl-vspace: 36px;
	--tl-moff: 0px;
	--tl-visible: 3;
	--tl-arrow: 18px;
	--tl-chev-gap: 6px;
	--tl-pico: 10px;
	--tl-dur: 600ms;

	position: relative;
	box-sizing: border-box;
}

.lsew-tl *,
.lsew-tl *::before,
.lsew-tl *::after {
	box-sizing: border-box;
}

.lsew-tl--milestones {
	--tl-m: 64px;
}

/* ---------------------------------------------------------- Lista (horizontal) */

.lsew-tl__viewport {
	position: relative;
}

.lsew-tl .lsew-tl__list {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(0, 1fr);
	grid-template-rows: auto auto auto;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lsew-tl .lsew-tl__item {
	position: relative;
	display: grid;
	grid-row: 1 / span 3;
	grid-template-rows: subgrid;
	grid-template-columns: var(--tl-hspace) minmax(0, 1fr) var(--tl-hspace);
	margin: 0;
	padding: 0;
	list-style: none;
}

.lsew-tl .lsew-tl__item::before,
.lsew-tl .lsew-tl__item::marker {
	content: none;
}

/* ------------------------------------------------------------------- Línea */

.lsew-tl__track {
	position: relative;
	grid-row: 2;
	grid-column: 1 / -1;
	align-self: center;
	justify-self: stretch;
	height: 0;
	border-top: var(--tl-line-w) var(--tl-line-style) var(--tl-line-color);
	pointer-events: none;
}

.lsew-tl__item:first-child > .lsew-tl__track {
	margin-left: 50%;
}

.lsew-tl__item:last-child > .lsew-tl__track {
	margin-right: 50%;
}

.lsew-tl--edges .lsew-tl__item:first-child > .lsew-tl__track,
.lsew-tl--edges .lsew-tl__item:last-child > .lsew-tl__track {
	margin-left: 0;
	margin-right: 0;
}

.lsew-tl__item:first-child:last-child > .lsew-tl__track {
	visibility: hidden;
}

.lsew-tl__fill {
	position: absolute;
	top: calc(var(--tl-line-w) * -1);
	left: 0;
	width: var(--tl-fill, 0px);
	max-width: 100%;
	height: 0;
	border-top: var(--tl-line-w) var(--tl-line-style) var(--tl-progress);
	transition: width 250ms linear, height 250ms linear;
}

/* Progreso según el estado: hasta el hito "actual". */
.lsew-tl--progress-state .lsew-tl__item.is-done {
	--tl-fill: 100%;
}

.lsew-tl--progress-state .lsew-tl__item.is-current {
	--tl-fill: 50%;
}

.lsew-tl--progress-state .lsew-tl__item.is-current:first-child {
	--tl-fill: 0px;
}

.lsew-tl--progress-state .lsew-tl__item.is-current:last-child {
	--tl-fill: 100%;
}

.lsew-tl--edges.lsew-tl--progress-state .lsew-tl__item.is-current:first-child {
	--tl-fill: 50%;
}

.lsew-tl--edges.lsew-tl--progress-state .lsew-tl__item.is-current:last-child {
	--tl-fill: 50%;
}

.lsew-tl--no-line .lsew-tl__track,
.lsew-tl--process .lsew-tl__track {
	display: none;
}

/* ------------------------------------------------------------------ Marcador */

.lsew-tl__marker {
	position: relative;
	z-index: 1;
	grid-row: 2;
	grid-column: 2;
	align-self: center;
	justify-self: center;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--tl-m);
	height: var(--tl-m);
	overflow: hidden;
	color: var(--tl-mi-color, var(--tl-m-color, #ffffff));
	background: var(--tl-mi-bg, var(--tl-m-bg, var(--e-global-color-primary, #001742)));
	border-radius: 50%;
	font-size: calc(var(--tl-m) * 0.32);
	font-weight: 700;
	line-height: 1.05;
	text-align: center;
	transition: background-color 300ms ease, color 300ms ease, border-color 300ms ease, transform 300ms ease, box-shadow 300ms ease;
}

.lsew-tl__marker--dot {
	width: var(--tl-dot);
	height: var(--tl-dot);
}

.lsew-tl__marker--none {
	display: none;
}

.lsew-tl__marker-icon {
	display: inline-flex;
	font-size: var(--tl-icon, calc(var(--tl-m) * 0.45));
	line-height: 1;
}

.lsew-tl__marker-icon i {
	font-size: inherit;
	line-height: 1;
}

.lsew-tl__marker-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.lsew-tl__marker img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lsew-tl__marker-text {
	padding: 0 0.2em;
	white-space: nowrap;
}

.lsew-tl--milestones .lsew-tl__marker {
	font-size: calc(var(--tl-m) * 0.27);
}

/* Formas */
.lsew-tl--shape-square .lsew-tl__marker {
	border-radius: 0;
}

.lsew-tl--shape-rounded .lsew-tl__marker {
	border-radius: var(--tl-m-radius, 10px);
}

.lsew-tl--shape-diamond .lsew-tl__marker {
	border-radius: 0;
	clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.lsew-tl--shape-hexagon .lsew-tl__marker {
	border-radius: 0;
	clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
}

/* Estados: alcanzado (progreso) y actual */
.lsew-tl__item.is-reached .lsew-tl__marker,
.lsew-tl--progress-state .lsew-tl__item.is-done .lsew-tl__marker,
.lsew-tl--progress-state .lsew-tl__item.is-current .lsew-tl__marker {
	color: var(--tl-mr-color, var(--tl-mi-color, var(--tl-m-color, #ffffff)));
	background: var(--tl-mr-bg, var(--tl-progress));
	border-color: var(--tl-mr-border, var(--tl-progress));
}

.lsew-tl__item.is-current .lsew-tl__marker {
	transform: scale(var(--tl-current-scale, 1.15));
	box-shadow: 0 0 0 var(--tl-halo, 6px) var(--tl-halo-color, rgba(255, 1, 210, 0.18));
}

.lsew-tl--shape-diamond .lsew-tl__item.is-current .lsew-tl__marker,
.lsew-tl--shape-hexagon .lsew-tl__item.is-current .lsew-tl__marker {
	box-shadow: none;
}

/* Hitos pendientes, algo más apagados (opcional) */
.lsew-tl--dim-pending .lsew-tl__item.is-pending {
	opacity: var(--tl-pending-opacity, 0.55);
}

/* ------------------------------------------------------------------ Tarjeta */

.lsew-tl__card {
	position: relative;
	grid-column: 2;
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: visible;
	padding: var(--tl-pt, 18px) var(--tl-pr, 20px) var(--tl-pb, 18px) var(--tl-pl, 20px);
	color: var(--tl-text, inherit);
	background-color: #ffffff;
	border: 1px solid #e3e7f0;
	border-radius: 6px;
	transition: transform 300ms ease, box-shadow 300ms ease, opacity var(--tl-dur) ease;
}

.lsew-tl__item.is-bottom > .lsew-tl__card {
	grid-row: 3;
	align-self: start;
	margin-top: var(--tl-gap);
}

.lsew-tl__item.is-top > .lsew-tl__card {
	grid-row: 1;
	align-self: end;
	margin-bottom: var(--tl-gap);
}

:where(.lsew-tl--milestones, .lsew-tl--process) .lsew-tl__card {
	text-align: center;
	background-color: transparent;
	border-color: transparent;
}

.lsew-tl--hover-lift .lsew-tl__card:hover {
	transform: translateY(-4px);
}

/* Pico que apunta a la línea */
.lsew-tl--pico .lsew-tl__card::before {
	content: "";
	position: absolute;
	z-index: 1;
	width: var(--tl-pico);
	height: var(--tl-pico);
	background: inherit;
	border: inherit;
	border-radius: 0;
	pointer-events: none;
}

.lsew-tl--pico .lsew-tl__item.is-bottom > .lsew-tl__card::before {
	top: 0;
	left: 50%;
	transform: translate(-50%, -50%) rotate(45deg);
	clip-path: polygon(0 0, 100% 0, 0 100%);
}

.lsew-tl--pico .lsew-tl__item.is-top > .lsew-tl__card::before {
	bottom: 0;
	left: 50%;
	transform: translate(-50%, 50%) rotate(45deg);
	clip-path: polygon(100% 100%, 100% 0, 0 100%);
}

.lsew-tl__media {
	margin: calc(var(--tl-pt, 18px) * -1) calc(var(--tl-pr, 20px) * -1) 14px calc(var(--tl-pl, 20px) * -1);
	overflow: hidden;
	border-radius: inherit;
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
}

.lsew-tl__media img {
	display: block;
	width: 100%;
	height: var(--tl-img-h, auto);
	object-fit: cover;
}

.lsew-tl--img-left .lsew-tl__card.has-media {
	flex-direction: row;
	gap: 14px;
}

.lsew-tl--img-left .lsew-tl__media {
	flex: 0 0 var(--tl-img-w, 38%);
	margin: calc(var(--tl-pt, 18px) * -1) 0 calc(var(--tl-pb, 18px) * -1) calc(var(--tl-pl, 20px) * -1);
	border-radius: inherit;
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}

.lsew-tl--img-left .lsew-tl__media img {
	height: 100%;
}

.lsew-tl__body {
	display: flex;
	flex-direction: column;
	gap: 0.35em;
	min-width: 0;
}

.lsew-tl__date {
	color: var(--tl-date-color, var(--tl-progress));
	font-size: 0.85em;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* Fecha al otro lado de la línea */
.lsew-tl__item > .lsew-tl__date {
	grid-column: 2;
	align-self: center;
	text-align: center;
}

.lsew-tl__item.is-bottom > .lsew-tl__date {
	grid-row: 1;
	align-self: end;
	margin-bottom: var(--tl-gap);
}

.lsew-tl__item.is-top > .lsew-tl__date {
	grid-row: 3;
	align-self: start;
	margin-top: var(--tl-gap);
}

.lsew-tl .lsew-tl__title {
	margin: 0;
	padding: 0;
	color: var(--tl-title-color, inherit);
	font-size: 1.15em;
	line-height: 1.25;
}

.lsew-tl .lsew-tl__title a {
	color: inherit;
	text-decoration: none;
}

.lsew-tl--link-card .lsew-tl__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
}

.lsew-tl .lsew-tl__title a:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.lsew-tl__subtitle {
	margin: 0;
	color: var(--tl-sub-color, inherit);
	font-size: 0.9em;
	opacity: 0.8;
}

.lsew-tl__desc {
	color: var(--tl-desc-color, inherit);
	line-height: 1.55;
}

.lsew-tl__desc > :first-child {
	margin-top: 0;
}

.lsew-tl__desc > :last-child {
	margin-bottom: 0;
}

.lsew-tl__button {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: 0.5em;
	margin-top: 0.6em;
	text-decoration: none;
}

.lsew-tl--milestones .lsew-tl__button,
.lsew-tl--process .lsew-tl__button {
	align-self: center;
}

.lsew-tl .lsew-tl__button:not(.elementor-button) {
	padding: 0.6em 1.1em;
	color: var(--tl-btn-color, #ffffff);
	background-color: var(--tl-btn-bg, var(--e-global-color-primary, #001742));
	border-radius: var(--tl-btn-radius, 4px);
	font-size: 0.9em;
	font-weight: 600;
	line-height: 1.2;
	transition: color 200ms ease, background-color 200ms ease;
}

.lsew-tl a.lsew-tl__button:not(.elementor-button):hover,
.lsew-tl a.lsew-tl__button:not(.elementor-button):focus-visible {
	color: var(--tl-btn-color-h, var(--tl-btn-color, #ffffff));
	background-color: var(--tl-btn-bg-h, var(--tl-progress));
}

.lsew-tl__button-icon {
	display: inline-flex;
	line-height: 0;
}

.lsew-tl__button-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

/* --------------------------------------------- Flechas de proceso (horizontal) */

.lsew-tl--process .lsew-tl__marker {
	grid-column: 1 / -1;
	justify-self: stretch;
	width: auto;
	margin-right: calc(var(--tl-arrow) * -1 + var(--tl-chev-gap));
	border-radius: 0;
	clip-path: polygon(0 0, calc(100% - var(--tl-arrow)) 0, 100% 50%, calc(100% - var(--tl-arrow)) 100%, 0 100%, var(--tl-arrow) 50%);
}

.lsew-tl--process .lsew-tl__item:first-child .lsew-tl__marker {
	clip-path: polygon(0 0, calc(100% - var(--tl-arrow)) 0, 100% 50%, calc(100% - var(--tl-arrow)) 100%, 0 100%);
}

.lsew-tl--process .lsew-tl__item:last-child .lsew-tl__marker {
	margin-right: 0;
}

.lsew-tl--process .lsew-tl__item.is-current .lsew-tl__marker {
	transform: none;
	box-shadow: none;
}

.lsew-tl--process .lsew-tl__marker-text,
.lsew-tl--process .lsew-tl__marker-icon {
	padding-left: var(--tl-arrow);
}

/* ------------------------------------------------------------ Carrusel */

.lsew-tl--carousel .lsew-tl__viewport {
	container-type: inline-size;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
	padding-bottom: 6px;
	cursor: grab;
}

.lsew-tl--carousel .lsew-tl__viewport::-webkit-scrollbar {
	display: none;
}

.lsew-tl--carousel .lsew-tl__viewport.is-dragging {
	cursor: grabbing;
	scroll-snap-type: none;
	scroll-behavior: auto;
}

.lsew-tl--carousel .lsew-tl__viewport.is-dragging * {
	pointer-events: none;
	user-select: none;
}

.lsew-tl--carousel .lsew-tl__list {
	grid-auto-columns: calc(100cqw / var(--tl-visible));
	width: max-content;
	min-width: 100%;
}

.lsew-tl--carousel .lsew-tl__item {
	scroll-snap-align: start;
}

.lsew-tl__nav {
	display: flex;
	justify-content: var(--tl-nav-justify, flex-end);
	gap: 8px;
	margin-bottom: var(--tl-nav-space, 14px);
}

.lsew-tl--nav-sides .lsew-tl__nav {
	position: absolute;
	top: 50%;
	right: calc(var(--tl-nav-out, 0px) * -1);
	left: calc(var(--tl-nav-out, 0px) * -1);
	z-index: 5;
	justify-content: space-between;
	margin: 0;
	transform: translateY(-50%);
	pointer-events: none;
}

.lsew-tl .lsew-tl__arrow,
.lsew-tl .lsew-tl__arrow:hover,
.lsew-tl .lsew-tl__arrow:focus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--tl-nav-size, 40px);
	height: var(--tl-nav-size, 40px);
	margin: 0;
	padding: 0;
	color: var(--tl-nav-color, #ffffff);
	background: var(--tl-nav-bg, var(--e-global-color-primary, #001742));
	border: 0;
	border-radius: var(--tl-nav-radius, 50%);
	box-shadow: none;
	cursor: pointer;
	pointer-events: auto;
	transition: opacity 200ms ease, background-color 200ms ease;
}

.lsew-tl .lsew-tl__arrow:hover,
.lsew-tl .lsew-tl__arrow:focus-visible {
	color: var(--tl-nav-color-h, var(--tl-nav-color, #ffffff));
	background: var(--tl-nav-bg-h, var(--tl-progress));
}

.lsew-tl .lsew-tl__arrow:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.lsew-tl .lsew-tl__arrow[disabled] {
	opacity: 0.35;
	cursor: default;
}

.lsew-tl__arrow svg {
	width: 45%;
	height: 45%;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Sin JavaScript (o mientras carga) los botones no hacen nada: se ocultan. */
.lsew-tl:not(.lsew-tl--js) .lsew-tl__nav {
	display: none;
}

/* ---------------------------------------------------------- Animación de entrada */

.lsew-tl--ready .lsew-tl__item > .lsew-tl__card,
.lsew-tl--ready .lsew-tl__item > .lsew-tl__date {
	transition-property: transform, opacity, box-shadow;
	transition-duration: var(--tl-dur), var(--tl-dur), 300ms;
	transition-timing-function: cubic-bezier(0.22, 0.7, 0.18, 1);
	transition-delay: var(--tl-delay, 0ms);
}

.lsew-tl--ready .lsew-tl__item > .lsew-tl__marker {
	transition: background-color 300ms ease, color 300ms ease, border-color 300ms ease, box-shadow 300ms ease, transform var(--tl-dur) cubic-bezier(0.34, 1.56, 0.64, 1) var(--tl-delay, 0ms), opacity var(--tl-dur) ease var(--tl-delay, 0ms);
}

.lsew-tl--ready .lsew-tl__item:not(.is-in) > .lsew-tl__card,
.lsew-tl--ready .lsew-tl__item:not(.is-in) > .lsew-tl__date {
	opacity: 0;
}

.lsew-tl--ready .lsew-tl__item:not(.is-in) > .lsew-tl__marker {
	opacity: 0;
	transform: scale(0.4);
}

.lsew-tl--ready.lsew-tl--anim-up .lsew-tl__item:not(.is-in) > .lsew-tl__card,
.lsew-tl--ready.lsew-tl--anim-up .lsew-tl__item:not(.is-in) > .lsew-tl__date {
	transform: translateY(30px);
}

.lsew-tl--ready.lsew-tl--anim-zoom .lsew-tl__item:not(.is-in) > .lsew-tl__card {
	transform: scale(0.88);
}

.lsew-tl--ready.lsew-tl--anim-side .lsew-tl__item.is-bottom:not(.is-in) > .lsew-tl__card,
.lsew-tl--ready.lsew-tl--anim-side .lsew-tl__item.is-top:not(.is-in) > .lsew-tl__date {
	transform: translateY(28px);
}

.lsew-tl--ready.lsew-tl--anim-side .lsew-tl__item.is-top:not(.is-in) > .lsew-tl__card,
.lsew-tl--ready.lsew-tl--anim-side .lsew-tl__item.is-bottom:not(.is-in) > .lsew-tl__date {
	transform: translateY(-28px);
}

.lsew-tl--process.lsew-tl--ready .lsew-tl__item:not(.is-in) > .lsew-tl__marker {
	transform: translateX(-20px);
}

@media (prefers-reduced-motion: reduce) {
	.lsew-tl__fill,
	.lsew-tl__card,
	.lsew-tl__marker {
		transition: none !important;
	}
}

.lsew-tl .lsew-sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}
