/* =========================================================================
   PP History Timeline
   Desktop / tablet (>768px): alternating cards on a horizontal center line,
   whole track scrolls horizontally.
   Mobile (<=768px): single vertical column, line + dots down the left.
   ========================================================================= */

.pp-htl {
	/* Tunable via Elementor controls (CSS custom properties) */
	--pphtl-card-w: 300px;
	--pphtl-track-h: 540px;
	--pphtl-gap: 24px;
	--pphtl-line: #d9d9d9;
	--pphtl-dot: #E5001D;
	--pphtl-dot-size: 14px;
	--pphtl-card-bg: #ffffff;
	--pphtl-card-offset: 28px; /* space between card edge and the line */

	position: relative;
}

/* ---- Scroll container -------------------------------------------------- */
.pp-htl__track {
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	/* Hide the horizontal scrollbar (scroll/drag still works) */
	scrollbar-width: none;      /* Firefox */
	-ms-overflow-style: none;   /* legacy Edge/IE */
}
/* Chrome, Safari, Edge (Chromium) */
.pp-htl__track::-webkit-scrollbar {
	width: 0;
	height: 0;
	display: none;
}

.pp-htl__track.is-dragging {
	cursor: grabbing;
	scroll-behavior: auto;
	user-select: none;
}

/* Inner sizes to the full content width so the line spans every item. */
.pp-htl__inner {
	position: relative;
	display: flex;
	align-items: stretch;
	width: -webkit-max-content;
	width: max-content;
	min-width: 100%;
	min-height: var(--pphtl-track-h);
}

/* ---- The horizontal center line --------------------------------------- */
.pp-htl__line {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 2px;
	background: var(--pphtl-line);
	transform: translateY(-50%);
	z-index: 0;
}

/* ---- Each milestone ---------------------------------------------------- */
.pp-htl__item {
	position: relative;
	flex: 0 0 var(--pphtl-card-w);
	width: var(--pphtl-card-w);
	display: grid;
	grid-template-rows: 1fr 0 1fr; /* top half | axis | bottom half */
	padding: 0 calc(var(--pphtl-gap) / 2);
	box-sizing: border-box;
}

/* Red dot, centered on the line */
.pp-htl__dot {
	grid-row: 2;
	justify-self: center;
	width: var(--pphtl-dot-size);
	height: var(--pphtl-dot-size);
	border-radius: 50%;
	background: var(--pphtl-dot);
	transform: translateY(-50%);
	z-index: 2;
}

/* Card */
.pp-htl__card {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	background: var(--pphtl-card-bg);
	border: 1px solid #e3e3e3;
	border-radius: 2px;
	padding: 20px;
	box-sizing: border-box;
}

/* Alternate above / below the line.
   align-self:stretch makes each card fill its half of the (equal-height) item,
   and because the flex row stretches all items to the tallest one, every card
   ends up the same height. */
.pp-htl__item--up .pp-htl__card {
	grid-row: 1;
	align-self: stretch;
	margin-bottom: var(--pphtl-card-offset);
}
.pp-htl__item--down .pp-htl__card {
	grid-row: 3;
	align-self: stretch;
	margin-top: var(--pphtl-card-offset);
}

/* Card content */
.pp-htl__year {
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: #6b7280;
	margin-bottom: 0.5rem;
}
.pp-htl__title {
	font-size: 1.1rem;
	line-height: 1.25;
	font-weight: 700;
	color: #111827;
	margin: 0 0 0.6rem;
}
.pp-htl__text {
	font-size: 0.95rem;
	line-height: 1.5;
	color: #4b5563;
}
.pp-htl__text :last-child { margin-bottom: 0; }

.pp-htl__media {
	margin-top: 1rem;
	text-align: center; /* image alignment when width < 100% (Elementor control overrides) */
}
.pp-htl__media img {
	display: inline-block;
	max-width: 100%;
	width: 100%;
	height: auto;
	border-radius: 2px;
	vertical-align: middle;
}

/* =========================================================================
   MOBILE — single vertical column (<=767px)
   ========================================================================= */
@media (max-width: 768px) {
	.pp-htl__track {
		overflow: visible;
	}

	.pp-htl__inner {
		display: block;
		width: auto;
		min-width: 0;
		min-height: 0;
		padding-left: 28px; /* room for the vertical line + dots */
	}

	/* Line becomes vertical, down the left edge */
	.pp-htl__line {
		left: 6px;
		right: auto;
		top: 0;
		bottom: 0;
		width: 2px;
		height: auto;
		transform: none;
	}

	.pp-htl__item {
		display: block;
		width: auto;
		padding: 0;
		margin-bottom: var(--pphtl-gap);
	}
	.pp-htl__item:last-child { margin-bottom: 0; }

	/* Dot sits on the vertical line, near the top of each card */
	.pp-htl__dot {
		position: absolute;
		left: calc(-28px + 6px); /* align to the line in the padded inner */
		top: 22px;
		transform: translateX(-50%);
	}

	.pp-htl__item--up .pp-htl__card,
	.pp-htl__item--down .pp-htl__card {
		grid-row: auto;
		align-self: auto;
		margin: 0;
	}
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
	.pp-htl__track { scroll-behavior: auto; }
}
