/* =========================
DESKTOP TIMELINE
========================= */

.timeline {
	position: relative;
	display: flex;
	justify-content: space-between;
	align-items: center;
	/*max-width: 900px;*/
	width: 100%;

	/* Creates room for the details panel without affecting line position */
	/*margin: 0 auto 180px auto;*/
	margin-block-end: 2rem;
}

/* Horizontal timeline line aligned with year boxes */
.timeline::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: 4px;
	background: #cccccc;
	transform: translateY(-50%);
	z-index: 0;
}

.timeline-item {
	position: relative;
	z-index: 1;
	cursor: pointer;
}

.year-box {
	display: inline-block;
	padding: 8px 16px;
	background: #ffffff;
	border: 2px solid var(--clr-primary);
	border-radius: 12px;
	font-weight: bold;
	color: #333333;
	transition: all 0.3s ease;
}

.timeline-item:hover .year-box {
	background: var(--clr-secondary);
	border-color: var(--clr-secondary);
	color: #ffffff;
	/*transform: translateY(-3px);*/
	transform: scale(1.1);
}

/* Full-width details panels */
.details {
	position: absolute;
	top: 70px;
	left: 0;

	/*
	width: 900px;
	max-width: 900px;
	*/
	width: 650px;
	box-sizing: border-box;

	padding: 16px;
	background: #ffffff;
	border-radius: 10px;
	border: 1px solid #eee;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);

	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
}

.timeline-item:hover .details {
	opacity: 1;
	visibility: visible;
}

.timeline-item .details h2 {
	margin-top: 0;
}



/* =========================
MOBILE TIMELINE
========================= */

@media (max-width: 850px) {

	.timeline {
		width: unset;
		flex-direction: column;
		align-items: flex-start;
		gap: 24px;
		padding-left: 40px;
		margin-bottom: 0;
	}

	/* Vertical timeline line */
	.timeline::before {
		top: 0;
		left: 20px;
		width: 4px;
		height: 100%;
		transform: none;
	}

	.timeline-item {
		/*display: flex;*/
		align-items: center;
		gap: 16px;
		width: 100%;
		cursor: default;
	}

	.year-box {
		flex-shrink: 0;
		background: var(--clr-secondary);
		border-color: var(--clr-secondary);
		color: #ffffff;
	}

	.timeline-item:hover .year-box {
		transform: none;
	}

	/* Mobile details remain unchanged */
	.details {
		position: static;
		transform: none;
		width: auto;
		/*max-width: 500px;*/
		opacity: 1;
		visibility: visible;
		margin-left: 0;
		margin-top: 1rem;
		margin-bottom: 2rem;
		margin-right: 3rem;
		padding: 12px;
	}
}
