/* ── Container ──────────────────────────────────────────────────────────── */

.ic-timeline {
	position: relative;
	box-sizing: border-box;
}

.ic-timeline--empty {
	min-height: 0;
	padding: 16px;
	opacity: .5;
}

/* ── Centre track line ───────────────────────────────────────────────────── */

.ic-timeline__track {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	transform: translateY(-50%);
	height: 2px;             /* overridden by Elementor line_height control */
	background-color: #2d607a; /* overridden by Elementor line_color control */
	z-index: 0;
}

/* ── Items row ───────────────────────────────────────────────────────────── */

/* 3-row shared grid: all items share the same 1fr / auto / 1fr tracks so dots
   stay vertically aligned regardless of content height differences. */
.ic-timeline__items {
	display: grid;
	grid-template-rows: 1fr auto 1fr;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
	column-gap: 12px;
}

/* ── Single item column ──────────────────────────────────────────────────── */

/* Each item spans all 3 parent rows and mirrors them via subgrid.
   DOM order is fixed as label-side → mid → title-side; grid-row on each child
   controls which row it occupies, so visual order is CSS-driven not DOM-driven. */
.ic-timeline__item {
	display: grid;
	grid-row: 1 / 4;
	grid-template-rows: subgrid;
}

/* ── Title-side cell (always holds the box) ──────────────────────────────── */

.ic-timeline__item-title-side {
	display: flex;
	flex-direction: column;
	align-items: center;
	position: relative;
	z-index: 1;
}

/* Above: title lives in row 1, box aligns to bottom edge (near dot) */
.ic-timeline__item--above .ic-timeline__item-title-side {
	grid-row: 1;
	justify-content: flex-end;
	padding-bottom: var(--ic-connector-size, 20px);
}

/* Below: title lives in row 3, box aligns to top edge (near dot) */
.ic-timeline__item--below .ic-timeline__item-title-side {
	grid-row: 3;
	justify-content: flex-start;
	padding-top: var(--ic-connector-size, 20px);
}

/* ── Label-side cell (always holds the label) ────────────────────────────── */

.ic-timeline__item-label-side {
	display: flex;
	flex-direction: column;
	align-items: center;
	position: relative;
	z-index: 1;
}

/* Above: label lives in row 3, aligns to top edge (near dot) */
.ic-timeline__item--above .ic-timeline__item-label-side {
	grid-row: 3;
	justify-content: flex-start;
	padding-top: var(--ic-label-spacing, 12px);
}

/* Below: label lives in row 1, aligns to bottom edge (near dot) */
.ic-timeline__item--below .ic-timeline__item-label-side {
	grid-row: 1;
	justify-content: flex-end;
	padding-bottom: var(--ic-label-spacing, 12px);
}

/* ── Mid zone — holds only the dot ──────────────────────────────────────── */

.ic-timeline__item-mid {
	grid-row: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	z-index: 2;
}

/* ── Dot ─────────────────────────────────────────────────────────────────── */

.ic-timeline__dot {
	width: var(--ic-dot-size, 14px);
	height: var(--ic-dot-size, 14px);
	border-radius: 50%;
	background-color: #2d607a; /* overridden by past/future colour controls */
	flex-shrink: 0;
	position: relative;
	z-index: 2;
}

/* ── Title box ───────────────────────────────────────────────────────────── */

.ic-timeline__box {
	position: relative;
	background-color: black; /* overridden by past/future colour controls */
	color: #ffffff;
	text-align: center;
	border-radius: 6px;
	padding: 10px 14px;
	width: 100%;
	box-sizing: border-box;
	word-break: break-word;
	text-wrap: balance;
}

/* ── Connector pseudo-element: box → dot ─────────────────────────────────── */

/* Inherits background-color from the box so it automatically matches
   past / future colour controls without additional selectors. */
.ic-timeline__box::after {
	content: '';
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	width: var(--ic-connector-width, 2px);
	background-color: inherit;
}

.ic-timeline__item--above .ic-timeline__box::after {
	top: 100%;
	height: calc(var(--ic-connector-size, 20px) + var(--ic-dot-size, 14px) / 2);
}

.ic-timeline__item--below .ic-timeline__box::after {
	bottom: 100%;
	height: calc(var(--ic-connector-size, 20px) + var(--ic-dot-size, 14px) / 2);
}

/* ── Label (date/plain text) ─────────────────────────────────────────────── */

.ic-timeline__label {
	text-align: center;
	padding: 6px 4px;
	word-break: break-word;
}

/* ── Gap (spacer) item ───────────────────────────────────────────────────── */

/* Gap items span all 3 rows (same as point items) so they integrate cleanly
   into the shared row grid. grid-column: span N is set via inline style. */
.ic-timeline__item--gap {
	grid-row: 1 / 4;
}

/* ── Tooltip ─────────────────────────────────────────────────────────────── */

.ic-timeline__tooltip-tpl {
	display: none; /* hidden template — content is cloned into a body-level tooltip by JS */
}

.ic-timeline__box--has-tooltip {
	cursor: pointer;
}

.ic-timeline-tooltip {
	position: fixed;
	z-index: 9999;
	background-color: var(--ic-tt-bg, #333333);
	color: var(--ic-tt-color, #ffffff);
	font-size: 14px;
	font-weight: normal;
	line-height: 1.5;
	letter-spacing: normal;
	padding: var(--ic-tt-padding, 10px 14px);
	border-radius: var(--ic-tt-radius, 4px);
	max-width: var(--ic-tt-max-width, 260px);
	word-break: break-word;
	pointer-events: none; /* hover-only — don't intercept mouseleave */
	box-shadow: 0 4px 12px rgba(0, 0, 0, .2);

}
.ic-timeline-tooltip .ic-timeline-tooltip__inner > * {
	margin: 0;
}
.ic-timeline-tooltip .ic-timeline-tooltip__inner > * + * {
	margin-top: 0.75em;
}
.ic-timeline-tooltip ul {
	list-style-image: none;
	padding-left: 1.5em;
}
.ic-timeline-tooltip li {
	padding: 0;
}
.ic-timeline-tooltip li + li {
	margin-top: 0.125em;
}

/* Touch devices need pointer-events so the user can interact with content */
.ic-timeline-tooltip.is-touch {
	pointer-events: auto;
}

.ic-timeline-tooltip__arrow {
	position: absolute;
	width: 8px;
	height: 8px;
	background-color: var(--ic-tt-bg, #333333);
	transform: rotate(45deg);
}

/* ── Past / Future colour overrides ─────────────────────────────────────── */
/* The ::after connector inherits background-color from the box automatically. */

.ic-timeline__item--past .ic-timeline__dot,
.ic-timeline__item--past .ic-timeline__box {
	background-color: #2d607a;
}

.ic-timeline__item--future .ic-timeline__dot,
.ic-timeline__item--future .ic-timeline__box {
	background-color: #3d7a3b;
}
