/* TDG timeline. The tdg-timeline-* global classes in Elementor set the type, sizes and colours; this adds what
   Elementor's style controls can't: the horizontal scroller, the faded edges, the focus effect, the side arrows
   and the year navigation. Without JavaScript the row is a plain swipeable scroller. */

/* The row starts in line with the section heading (the script measures it exactly; this is the fallback). */
.elementor .tdg-timeline {
	--tl-fade: 160px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	padding-inline: max(48px, calc((100vw - 1320px) / 2 + 48px));
}

.elementor .tdg-timeline::-webkit-scrollbar {
	display: none;
}

.elementor .tdg-timeline > .e-con {
	scroll-snap-align: center;
}

@media (max-width: 1024px) {
	.elementor .tdg-timeline {
		--tl-fade: 64px;
		padding-inline: 32px;
	}
}

@media (max-width: 767px) {
	.elementor .tdg-timeline {
		--tl-fade: 40px;
		padding-inline: 20px;
	}
}

/* Faded edges, only on a side that has more milestones beyond it. */
.elementor .tdg-timeline.fade-left.fade-right {
	-webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--tl-fade), #000 calc(100% - var(--tl-fade)), transparent 100%);
	mask-image: linear-gradient(to right, transparent 0, #000 var(--tl-fade), #000 calc(100% - var(--tl-fade)), transparent 100%);
}

.elementor .tdg-timeline.fade-left:not(.fade-right) {
	-webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--tl-fade));
	mask-image: linear-gradient(to right, transparent 0, #000 var(--tl-fade));
}

.elementor .tdg-timeline.fade-right:not(.fade-left) {
	-webkit-mask-image: linear-gradient(to left, transparent 0, #000 var(--tl-fade));
	mask-image: linear-gradient(to left, transparent 0, #000 var(--tl-fade));
}

/* Highlight: the selected milestone is at full strength; the others recede with distance. --tl-focus runs 0 to 1. */
.tdg-timeline.is-ready > .e-con {
	--tl-focus: 1;
	opacity: calc(0.3 + 0.7 * var(--tl-focus));
	transition: opacity 320ms ease;
}

.tdg-timeline.is-ready > .e-con .tdg-timeline-photo-frame {
	transform: scale(calc(0.92 + 0.08 * var(--tl-focus)));
	transform-origin: 50% 50%;
	transition: transform 320ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.tdg-timeline.is-ready .tdg-timeline-dot {
	transition: transform 240ms cubic-bezier(0.2, 0.7, 0.2, 1), background-color 240ms;
}

.tdg-timeline.is-ready > .is-active .tdg-timeline-dot {
	transform: scale(1.6);
}

/* Wrappers added by the script: wrap > window (holds the track and the side arrows) + nav. */
.tdg-timeline-wrap {
	width: 100%;
}

.tdg-timeline-window {
	position: relative;
	width: 100%;
}

/* Side arrows, centred on the photos. They sit in the faded margins either side of the centred milestone. */
.tdg-timeline-window .tdg-timeline-arrow {
	position: absolute;
	top: 304px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin: 0;
	padding: 0;
	font-family: var(--font-body, "Montserrat"), Arial, sans-serif;
	font-size: 20px;
	line-height: 1;
	color: var(--color-text, #1E1D1A);
	background: var(--color-bg, #FFFFFF);
	border: 1px solid var(--color-text, #1E1D1A);
	border-radius: 999px;
	box-shadow: none;
	cursor: pointer;
	transform: translateY(-50%);
	transition: background-color 160ms, color 160ms, opacity 160ms;
}

.tdg-timeline-window .tdg-timeline-arrow--prev {
	left: max(24px, calc((100vw - 1320px) / 2 + 24px));
}

.tdg-timeline-window .tdg-timeline-arrow--next {
	right: max(24px, calc((100vw - 1320px) / 2 + 24px));
}

.tdg-timeline-window .tdg-timeline-arrow:hover:not(:disabled) {
	color: var(--color-bg, #FFFFFF);
	background: var(--color-text, #1E1D1A);
}

/* At either end the arrow that has nowhere to go steps out of the way. */
.tdg-timeline-window .tdg-timeline-arrow:disabled {
	cursor: default;
	opacity: 0;
	visibility: hidden;
	transition: opacity 160ms, visibility 0s 160ms;
}

.tdg-timeline-window .tdg-timeline-arrow:focus-visible {
	outline: 2px solid var(--color-accent, #00843D);
	outline-offset: 2px;
}

@media (max-width: 1024px) {
	.tdg-timeline-window .tdg-timeline-arrow {
		top: 268px;
		width: 44px;
		height: 44px;
		font-size: 18px;
	}

	.tdg-timeline-window .tdg-timeline-arrow--prev {
		left: 16px;
	}

	.tdg-timeline-window .tdg-timeline-arrow--next {
		right: 16px;
	}
}

@media (max-width: 767px) {
	.tdg-timeline-window .tdg-timeline-arrow {
		top: 224px;
		width: 36px;
		height: 36px;
		font-size: 16px;
	}

	.tdg-timeline-window .tdg-timeline-arrow--prev {
		left: 2px;
	}

	.tdg-timeline-window .tdg-timeline-arrow--next {
		right: 2px;
	}
}

/* Video milestones: the photo is a poster with a play button, and the script swaps in the Vimeo player on click. */
.tdg-timeline-video {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
}

.tdg-timeline-video__play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 72px;
	height: 72px;
	margin: -36px 0 0 -36px;
	background: rgba(255, 255, 255, 0.92);
	border-radius: 50%;
	box-shadow: 0 8px 24px rgba(30, 29, 26, 0.25);
	transition: transform 160ms ease, background-color 160ms ease;
}

/* The play triangle, nudged right of centre so it looks centred. */
.tdg-timeline-video__play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	margin: -12px 0 0 -7px;
	border-style: solid;
	border-width: 12px 0 12px 20px;
	border-color: transparent transparent transparent var(--color-text, #1E1D1A);
}

.tdg-timeline-video:hover .tdg-timeline-video__play,
.tdg-timeline-video:focus-visible .tdg-timeline-video__play {
	background: var(--color-bg, #FFFFFF);
	transform: scale(1.08);
}

.tdg-timeline-video:focus-visible {
	outline: 2px solid var(--color-accent, #00843D);
	outline-offset: -4px;
}

.tdg-timeline-video__player {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

@media (max-width: 767px) {
	.tdg-timeline-video__play {
		width: 56px;
		height: 56px;
		margin: -28px 0 0 -28px;
	}

	.tdg-timeline-video__play::after {
		margin: -10px 0 0 -6px;
		border-width: 10px 0 10px 16px;
	}
}

/* Year navigation and progress, added by the script under the timeline. */
.tdg-timeline-nav {
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 100%;
	max-width: 1320px;
	margin: 40px auto 0;
	padding: 0 48px;
	box-sizing: border-box;
}

.tdg-timeline-progress {
	position: relative;
	height: 2px;
	background: var(--color-line, #DCD5C8);
	border-radius: 2px;
	overflow: hidden;
}

.tdg-timeline-progress span {
	position: absolute;
	inset: 0;
	background: var(--color-accent, #00843D);
	transform-origin: 0 50%;
	transform: scaleX(0);
}

.tdg-timeline-years {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tdg-timeline-years li {
	margin: 0;
}

/* The theme styles every button, so each property is set here. */
.tdg-timeline-years button {
	margin: 0;
	padding: 6px 10px;
	font-family: var(--font-body, "Montserrat"), Arial, sans-serif;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.4;
	text-transform: uppercase;
	color: var(--color-text-muted, #4D4943);
	background: transparent;
	border: 1px solid transparent;
	border-radius: 999px;
	box-shadow: none;
	cursor: pointer;
	transition: color 160ms, background-color 160ms, border-color 160ms;
}

.tdg-timeline-years button:hover {
	color: var(--color-text, #1E1D1A);
	background: var(--color-surface, #F5F3EE);
}

.tdg-timeline-years button[aria-current="true"] {
	color: var(--color-text, #1E1D1A);
	border-color: var(--color-text, #1E1D1A);
	background: transparent;
}

.tdg-timeline-years button:focus-visible {
	outline: 2px solid var(--color-accent, #00843D);
	outline-offset: 2px;
}

@media (max-width: 1024px) {
	.tdg-timeline-nav {
		padding: 0 32px;
		margin-top: 32px;
	}
}

@media (max-width: 767px) {
	.tdg-timeline-nav {
		padding: 0 20px;
		margin-top: 24px;
	}

	.tdg-timeline-years {
		justify-content: flex-start;
	}

	.tdg-timeline-years button {
		padding: 6px 8px;
		font-size: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tdg-timeline.is-ready > .e-con,
	.tdg-timeline.is-ready > .e-con .tdg-timeline-photo-frame,
	.tdg-timeline.is-ready .tdg-timeline-dot,
	.tdg-timeline-video__play {
		transition: none;
	}
}
