/**
 * Lefevre Timeline Widget - Estilos
 * Timeline vertical con navegación por años y flechas.
 *
 * @package Lefevre_Core
 */

.lefevre-timeline {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

/* Un contenedor, dos hijos al 50%: izquierda = timeline + texto, derecha = imagen */
.lefevre-timeline__inner {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
	min-height: 400px;
	align-items: stretch;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

/* Hijo 1 (50%): timeline + texto en fila */
.lefevre-timeline__left {
	display: flex;
	gap: 24px;
	padding: 3rem;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
}

/* Hijo 2 (50%): imagen ocupa todo el espacio */
.lefevre-timeline__right {
	position: relative;
	min-width: 0;
	min-height: 280px;
}

/* --- Navegación lateral: línea y años (dentro del 50% izquierdo) --- */
.lefevre-timeline__nav {
	position: relative;
	display: flex;
	flex-direction: column;
	padding-right: 0;
	min-width: 0;
	flex-shrink: 0;
}

.lefevre-timeline__line {
	position: absolute;
	left: 6px;
	top: 0;
	bottom: 0;
	width: 2px;
	border-radius: 1px;
	pointer-events: none;
}

.lefevre-timeline__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
	position: relative;
	z-index: 1;
}

.lefevre-timeline__item {
	margin: 0;
	padding: 0;
}

.lefevre-timeline__trigger {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 6px 0;
	border: 0;
	background: none;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
	font-size: 0.95rem;
	transition: color 0.2s ease;
}

.lefevre-timeline__trigger:hover .lefevre-timeline__year {
	opacity: 0.9;
}

.lefevre-timeline__dot {
	width: 14px;
	height: 14px;
	min-width: 14px;
	min-height: 14px;
	border-radius: 50%;
	transition: transform 0.2s ease, background-color 0.2s ease;
}

.lefevre-timeline__item.is-active .lefevre-timeline__dot {
	transform: scale(1.2);
	background-color: currentColor;
}

.lefevre-timeline__year {
	display: block;
	font-weight: 600;
	transition: color 0.2s ease;
}

.lefevre-timeline__item.is-active .lefevre-timeline__year {
	font-size: 1.05rem;
}

/* Contenido de texto (dentro del 50% izquierdo, junto al nav) */
.lefevre-timeline__content-wrap {
	position: relative;
	flex: 1;
	min-width: 0;
	min-height: 280px;
}

/* Paneles de contenido (solo uno visible) */
.lefevre-timeline__panel {
	position: absolute;

	left: 0;
	right: 0;
	bottom: 0;
	opacity: 0;
	visibility: hidden;
	top: 50%;
    transform: translate(0px, -50%);
	pointer-events: none;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	overflow-y: auto;
}

.lefevre-timeline__panel.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;

	position: relative;
}

.lefevre-timeline__content {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding-right: 16px;
}

.lefevre-timeline__content-year {
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 8px 0;
}

.lefevre-timeline__content-title {
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.25;
	margin: 0 0 30px 0;
}

.lefevre-timeline__content-subtitle {
	font-size: 1rem;
	margin: 10px 0 16px 0;
	line-height: 1.4;
}

.lefevre-timeline__content-text {
	flex: 1;
	font-size: 0.95rem;
	line-height: 1.6;
	margin: 1rem 0 1rem 0;
}

.lefevre-timeline__content-text p:last-child {
	margin-bottom: 0;
}

/* Flechas de navegación */
.lefevre-timeline__arrows {
	display: flex;
	gap: 8px;
	margin-top: 30px;
}

.lefevre-timeline__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.lefevre-timeline__arrow:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.lefevre-timeline__arrow svg {
	display: block;
}

/* Paneles de imagen (solo uno visible) — ocupan todo .lefevre-timeline__right */
.lefevre-timeline__image-panel {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lefevre-timeline__image-panel.is-active {
	opacity: 1;
	visibility: visible;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: 100%;
}

.lefevre-timeline__img {
	width: 100%;
	height: 100% !important;
	object-fit: cover;
	display: block;
}

.lefevre-timeline__img-placeholder {
	width: 100%;
	height: 100%;
	min-height: 280px;
	background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}


/* ========== TABLET: todo en vertical — imagen arriba, luego timeline + texto ========== */
@media (max-width: 1024px) {
	.lefevre-timeline__inner {
		display: flex;
		flex-direction: column-reverse;
		gap: 32px;
		min-height: 0;
	}

	/* Primero: imagen a ancho completo */
	.lefevre-timeline__right {
		order: -1;
		width: 100%;
		padding:0 3rem 3rem 3rem;
		height: auto;

	}

	.lefevre-timeline__right .lefevre-timeline__image-panel.is-active {
		position: relative;
		inset: 0;

	}

	.lefevre-timeline__img {
		width: 100%;
		height: 100%;
		min-height: 280px;
		object-fit: cover;
	}

	/* Segundo: bloque timeline (vertical) + texto — misma estructura que desktop pero en una columna */
	.lefevre-timeline__left {
		display: flex;
		flex-direction: row;
		gap: 24px;
		width: 100%;
		min-width: 0;
	}

	/* Timeline: se conserva vertical (línea y años en columna) */
	.lefevre-timeline__nav {
		width: auto;
		padding-right: 0;
		flex-shrink: 0;
	}

	.lefevre-timeline__content-wrap {
		min-height: 0;
		flex: 1;
		min-width: 0;
	}

	.lefevre-timeline__content {
		padding-right: 0;
	}
}

/* ========== MOBILE: mismo vertical, tamaños más compactos ========== */
@media (max-width: 767px) {
	.lefevre-timeline__inner {
		gap: 24px;
	}

	
	.lefevre-timeline__left {
		gap: 16px;
	}

	.lefevre-timeline__content-year {
		font-size: 1.5rem;
	}

	.lefevre-timeline__content-title {
		font-size: 1.25rem;
	}

	.lefevre-timeline__content-subtitle {
		font-size: 0.9375rem;
	}

	.lefevre-timeline__list {
		gap: 4px;
	}

	.lefevre-timeline__trigger {
		padding: 4px 0;
	}

	.lefevre-timeline__year {
		font-size: 0.875rem;
	}

	.lefevre-timeline__item.is-active .lefevre-timeline__year {
		font-size: 0.9rem;
	}
}
