/**
 * Widget Addon – Horizontal Timeline
 * Class prefix: .wa-htl (Widget Addon – Horizontal TimeLine)
 */

.wa-htl {
	--wa-htl-gap: 24px;
	--wa-htl-line-thickness: 2px;
	--wa-htl-line-color: #e2e8f0;
	--wa-htl-dot-size: 44px;
	--wa-htl-dot-color: #cbd5e1;
	--wa-htl-dot-active-color: #3b82f6;
	--wa-htl-dot-icon-color: #ffffff;
	--wa-htl-items-desktop: 3;
	--wa-htl-items-tablet: 2;
	--wa-htl-items-mobile: 1;
	--wa-htl-transition: 500ms;

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

.wa-htl *,
.wa-htl *::before,
.wa-htl *::after {
	box-sizing: border-box;
}

/* Viewport hides overflow; track is translated horizontally. */
.wa-htl__viewport {
	position: relative;
	overflow: hidden;
	width: 100%;
	padding-block: 8px;
}

.wa-htl__track {
	display: flex;
	gap: var(--wa-htl-gap);
	will-change: transform;
	transition: transform var(--wa-htl-transition) cubic-bezier(0.22, 0.61, 0.36, 1);
	align-items: stretch;
}

/* Per-item width based on items-per-view. */
.wa-htl__item {
	flex: 0 0 calc(
		(100% - (var(--wa-htl-gap) * (var(--wa-htl-items-desktop) - 1)))
		/ var(--wa-htl-items-desktop)
	);
	display: flex;
	flex-direction: column;
	align-items: stretch;
	min-width: 0;
	position: relative;
}

@media (max-width: 1024px) {
	.wa-htl__item {
		flex-basis: calc(
			(100% - (var(--wa-htl-gap) * (var(--wa-htl-items-tablet) - 1)))
			/ var(--wa-htl-items-tablet)
		);
	}
}

@media (max-width: 600px) {
	.wa-htl__item {
		flex-basis: calc(
			(100% - (var(--wa-htl-gap) * (var(--wa-htl-items-mobile) - 1)))
			/ var(--wa-htl-items-mobile)
		);
	}
}

/* Card */
.wa-htl__card {
	background: #ffffff;
	border-radius: 14px;
	padding: 24px 20px;
	box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
	transition: transform var(--wa-htl-transition) ease, box-shadow var(--wa-htl-transition) ease, opacity var(--wa-htl-transition) ease;
	opacity: 0.75;
}

.wa-htl__item.is-active .wa-htl__card {
	opacity: 1;
	transform: translateY(-4px);
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.wa-htl__date {
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	margin-bottom: 6px;
}

.wa-htl__title {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
	margin: 0 0 8px;
	overflow-wrap: anywhere;
}

.wa-htl__desc {
	font-size: 15px;
	line-height: 1.55;
	overflow-wrap: anywhere;
}

.wa-htl__btn {
	display: inline-block;
	margin-top: 14px;
	padding: 10px 18px;
	background: #3b82f6;
	color: #ffffff;
	text-decoration: none;
	font-weight: 600;
	border-radius: 8px;
	transition: background-color 200ms ease, color 200ms ease, transform 200ms ease;
}

.wa-htl__btn:hover,
.wa-htl__btn:focus-visible {
	background: #1d4ed8;
	color: #ffffff;
	transform: translateY(-1px);
}

.wa-htl__btn:focus-visible {
	outline: 2px solid var(--wa-htl-dot-active-color);
	outline-offset: 2px;
}

/* Connector (vertical line between card and dot) */
.wa-htl__connector {
	width: var(--wa-htl-line-thickness);
	background: var(--wa-htl-line-color);
	height: 28px;
	align-self: center;
	margin: 6px 0;
}

/* Dot */
.wa-htl__dot {
	width: var(--wa-htl-dot-size);
	height: var(--wa-htl-dot-size);
	border-radius: 50%;
	background: var(--wa-htl-dot-color);
	color: var(--wa-htl-dot-icon-color);
	display: flex;
	align-items: center;
	justify-content: center;
	align-self: center;
	position: relative;
	z-index: 2;
	transition: background-color var(--wa-htl-transition) ease, transform var(--wa-htl-transition) ease;
	box-shadow: 0 0 0 4px #ffffff;
	flex-shrink: 0;
}

.wa-htl__item.is-active .wa-htl__dot {
	background: var(--wa-htl-dot-active-color);
	transform: scale(1.08);
}

.wa-htl__dot-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: inherit;
}

.wa-htl__dot-inner svg,
.wa-htl__dot-inner i {
	font-size: calc(var(--wa-htl-dot-size) * 0.45);
	width: calc(var(--wa-htl-dot-size) * 0.45);
	height: calc(var(--wa-htl-dot-size) * 0.45);
	color: inherit;
}

.wa-htl__dot-inner img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.wa-htl__dot-bullet {
	width: 30%;
	height: 30%;
	border-radius: 50%;
	background: currentColor;
}

/* Horizontal line — positioned through the row of dots */
.wa-htl__line {
	position: absolute;
	left: 0;
	right: 0;
	height: var(--wa-htl-line-thickness);
	background: var(--wa-htl-line-color);
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
	z-index: 1;
}

/* Position variants control where the line sits */
.wa-htl--pos-top .wa-htl__line {
	/* dots are at the BOTTOM of each item => line near the bottom of viewport */
	top: auto;
	bottom: calc(var(--wa-htl-dot-size) / 2 + 8px);
	transform: none;
}

.wa-htl--pos-bottom .wa-htl__line {
	/* dots are at the TOP of each item => line near the top of viewport */
	top: calc(var(--wa-htl-dot-size) / 2 + 8px);
	transform: none;
}

.wa-htl--pos-top .wa-htl__item {
	justify-content: flex-end;
}

.wa-htl--pos-bottom .wa-htl__item {
	justify-content: flex-start;
}

.wa-htl--pos-alternate .wa-htl__item--top {
	justify-content: flex-end;
}

.wa-htl--pos-alternate .wa-htl__item--bottom {
	justify-content: flex-start;
}

/* Arrows */
.wa-htl__arrows {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-top: 18px;
}

.wa-htl__arrow {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 1px solid #e2e8f0;
	background: #ffffff;
	color: #0f172a;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.wa-htl__arrow:hover,
.wa-htl__arrow:focus-visible {
	background: var(--wa-htl-dot-active-color);
	border-color: var(--wa-htl-dot-active-color);
	color: #ffffff;
}

.wa-htl__arrow:focus-visible {
	outline: 2px solid var(--wa-htl-dot-active-color);
	outline-offset: 2px;
}

.wa-htl__arrow[disabled] {
	opacity: 0.45;
	cursor: not-allowed;
}

/* Pager dots */
.wa-htl__dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 14px;
}

.wa-htl__pager-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 0;
	background: var(--wa-htl-dot-color);
	cursor: pointer;
	padding: 0;
	transition: background-color 200ms ease, transform 200ms ease;
}

.wa-htl__pager-dot.is-active {
	background: var(--wa-htl-dot-active-color);
	transform: scale(1.25);
}

.wa-htl__pager-dot:focus-visible {
	outline: 2px solid var(--wa-htl-dot-active-color);
	outline-offset: 2px;
}

/* Dragging state */
.wa-htl.is-dragging .wa-htl__track {
	transition: none;
	cursor: grabbing;
}

.wa-htl[data-wa-htl-draggable="true"] .wa-htl__track {
	cursor: grab;
}
