/**
 * Línea de Tiempo | Heraldos — estilos del frontend.
 * Los colores se controlan con variables CSS que Elementor rellena desde el
 * panel de Estilo. Los valores aquí son sólo respaldos (paleta de heraldos.pe).
 */

.hw-tl {
	--hw-tl-heading: #ac1b2f;
	--hw-tl-line: #e0e0e0;
	--hw-tl-year: #7a7a7a;
	--hw-tl-year-active: #ac1b2f;
	--hw-tl-dot: #5a5a5a;
	--hw-tl-dot-active: #ac1b2f;
	--hw-tl-panel-bg: transparent;
	--hw-tl-panel-year: #ac1b2f;
	--hw-tl-panel-title: #7a7a7a;
	--hw-tl-panel-desc: #333333;
	--hw-tl-link: #ac1b2f;
	--hw-tl-arrow: #5a5a5a;
	--hw-tl-arrow-hover: #ac1b2f;

	width: 100%;
	box-sizing: border-box;
}

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

/* Título global */
.hw-tl__heading {
	color: var(--hw-tl-heading);
	font-size: 2.6em;
	font-weight: 400;
	margin: 0 0 0.6em;
	line-height: 1.1;
}

/* Barra: años sobre la línea */
.hw-tl__track {
	position: relative;
	padding: 0 10px;
	margin-bottom: 30px;
	overflow: hidden;
}

.hw-tl__line {
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 9px;
	height: 2px;
	background: var(--hw-tl-line);
}

.hw-tl__years {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	position: relative;
	will-change: transform;
	transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Reparto uniforme cuando caben todos los años. */
.hw-tl__year-item {
	flex: 1 1 0;
	display: flex;
	justify-content: center;
	min-width: 0;
}

/* Ventana deslizante: cuando hay más años que los visibles, cada año ocupa
   una fracción fija del ancho y la barra se desplaza. */
.hw-tl.is-windowed .hw-tl__year-item {
	flex: 0 0 calc(100% / var(--hw-tl-visible-eff, 6));
}

.hw-tl__year {
	appearance: none;
	-webkit-appearance: none;
	background: none !important;
	background-color: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none;
	padding: 4px 4px 6px;
	margin: 0;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	font-family: inherit;
	-webkit-tap-highlight-color: transparent;
	-webkit-user-select: none;
	user-select: none;
}

/* Neutraliza estilos de botón que algunos temas aplican al hacer clic/enfocar. */
.hw-tl__year:hover,
.hw-tl__year:focus,
.hw-tl__year:active,
.hw-tl__year.is-active {
	background: none !important;
	background-color: transparent !important;
	box-shadow: none !important;
	outline: none;
}

/* Accesibilidad: contorno sólo con teclado. */
.hw-tl__year:focus-visible {
	outline: 2px solid var(--hw-tl-year-active);
	outline-offset: 3px;
	border-radius: 4px;
}

.hw-tl__year-label {
	color: var(--hw-tl-year);
	font-size: 1.6em;
	font-weight: 400;
	line-height: 1;
	transition: color 0.2s ease;
	white-space: nowrap;
}

.hw-tl__dot {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--hw-tl-dot);
	transition: background 0.2s ease, transform 0.2s ease;
}

.hw-tl__year:hover .hw-tl__year-label {
	color: var(--hw-tl-year-active);
}

.hw-tl__year.is-active .hw-tl__year-label {
	color: var(--hw-tl-year-active);
}

.hw-tl__year.is-active .hw-tl__dot {
	background: var(--hw-tl-dot-active);
	transform: scale(1.05);
}

/* Escenario: flechas + contenido */
.hw-tl__stage {
	display: flex;
	align-items: center;
	gap: 10px;
}

.hw-tl__nav {
	appearance: none;
	-webkit-appearance: none;
	background: none !important;
	background-color: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	color: var(--hw-tl-arrow);
	font-size: 3em;
	line-height: 1;
	padding: 10px;
	transition: color 0.2s ease, transform 0.2s ease;
	font-family: inherit;
	-webkit-tap-highlight-color: transparent;
	-webkit-user-select: none;
	user-select: none;
}

.hw-tl__nav:hover,
.hw-tl__nav:focus,
.hw-tl__nav:active {
	background: none !important;
	background-color: transparent !important;
	box-shadow: none !important;
	outline: none;
}

.hw-tl__nav:hover {
	color: var(--hw-tl-arrow-hover);
	transform: scale(1.15);
}

.hw-tl__nav:focus-visible {
	outline: 2px solid var(--hw-tl-arrow-hover);
	outline-offset: 2px;
	border-radius: 4px;
}

.hw-tl__panels {
	flex: 1 1 auto;
	min-width: 0;
	background: var(--hw-tl-panel-bg);
	position: relative;
}

.hw-tl__panel {
	display: flex;
	align-items: center;
	gap: 30px;
}

.hw-tl__panel[hidden] {
	display: none;
}

/* Transición al cambiar de año: aparece con un ligero desplazamiento. */
.hw-tl__panel.is-active {
	animation: hw-tl-in 0.5s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

@keyframes hw-tl-in {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.hw-tl__years,
	.hw-tl__nav,
	.hw-tl__dot {
		transition: none;
	}
	.hw-tl__panel.is-active {
		animation: none;
	}
}

.hw-tl__media {
	flex: 0 0 auto;
	max-width: 320px;
}

.hw-tl__media img {
	display: block;
	max-width: 100%;
	height: auto;
}

.hw-tl__body {
	flex: 1 1 auto;
	min-width: 0;
}

.hw-tl__panel-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.15em 0.4em;
	margin-bottom: 0.4em;
	line-height: 1.1;
}

.hw-tl__panel-year {
	color: var(--hw-tl-panel-year);
	font-size: 2.8em;
	font-weight: 400;
	line-height: 1;
}

.hw-tl__panel-title {
	color: var(--hw-tl-panel-title);
	font-size: 1.7em;
	font-weight: 400;
}

.hw-tl__panel-desc {
	color: var(--hw-tl-panel-desc);
	font-size: 1.1em;
	line-height: 1.55;
}

.hw-tl__link {
	display: inline-block;
	margin-top: 0.9em;
	color: var(--hw-tl-link);
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px solid currentColor;
}

.hw-tl__link:hover {
	opacity: 0.8;
}

/* Responsive: tablet */
@media (max-width: 1024px) {
	.hw-tl__year-label {
		font-size: 1.3em;
	}

	.hw-tl__media {
		max-width: 260px;
	}

	.hw-tl__panel {
		gap: 22px;
	}

	.hw-tl__panel-year {
		font-size: 2.4em;
	}

	.hw-tl__panel-title {
		font-size: 1.5em;
	}
}

/* Responsive: móvil */
@media (max-width: 767px) {
	.hw-tl__heading {
		font-size: 2em;
		text-align: center;
	}

	.hw-tl__track {
		margin-bottom: 22px;
	}

	.hw-tl__year-label {
		font-size: 1.05em;
	}

	.hw-tl__year {
		gap: 9px;
	}

	.hw-tl__dot {
		width: 11px;
		height: 11px;
	}

	/* La imagen y el texto se apilan; las flechas quedan compactas a los lados. */
	.hw-tl__stage {
		gap: 2px;
	}

	.hw-tl__panel {
		flex-direction: column;
		text-align: center;
		gap: 16px;
	}

	.hw-tl__media {
		max-width: 100%;
		width: 100%;
	}

	.hw-tl__panel-head {
		flex-direction: column;
		align-items: center;
		gap: 0.05em;
	}

	.hw-tl__nav {
		font-size: 2em;
		padding: 4px;
		align-self: flex-start;
		margin-top: 30px;
	}

	.hw-tl__panel-year {
		font-size: 2.4em;
	}

	.hw-tl__panel-title {
		font-size: 1.35em;
	}

	.hw-tl__panel-desc {
		font-size: 1em;
	}
}

/* Pantallas muy pequeñas: flechas debajo, contenido a todo el ancho. */
@media (max-width: 480px) {
	.hw-tl__stage {
		flex-wrap: wrap;
		justify-content: center;
	}

	.hw-tl__panels {
		order: -1;
		flex: 1 1 100%;
	}

	.hw-tl__nav {
		align-self: center;
		margin-top: 6px;
		font-size: 2.4em;
	}
}
