/* ==========================================================
   Scroll Timeline for WPBakery
   All values come from CSS custom properties set inline
   by the shortcode, with fallbacks here.
   ========================================================== */

.scrolltl-timeline {
	isolation: isolate; /* keeps the line and highlight under sticky headers */
	/* "Theme text color" / "Theme accent color" options.
	   The7 variables first, then WordPress block-theme presets, then safe fallbacks. */
	--scrolltl-theme-text: var(--the7-base-color, var(--wp--preset--color--contrast, currentColor));
	--scrolltl-theme-accent: var(--the7-accent-color, var(--wp--preset--color--primary, #3b82f6));
	--scrolltl-rail: calc(var(--scrolltl-node-size, 18px) * var(--scrolltl-node-active-scale, 1.3) + 32px);
	--scrolltl-node-rotate: 0deg;
	position: relative;
}

.scrolltl-timeline *,
.scrolltl-timeline *::before,
.scrolltl-timeline *::after {
	box-sizing: border-box;
}

/* ---------- Items wrapper ---------- */
.scrolltl-items {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: var(--scrolltl-gap, 40px);
}

.scrolltl-item {
	position: relative;
}

/* ---------- Line ---------- */
.scrolltl-line {
	position: absolute;
	top: var(--scrolltl-node-offset, 28px);
	bottom: 0;
	z-index: 0;
	width: 0;
	border-left: var(--scrolltl-line-width, 2px) var(--scrolltl-line-style, solid) var(--scrolltl-line-color, #e2e2e2);
}

.scrolltl-line-progress {
	position: absolute;
	top: 0;
	left: calc(var(--scrolltl-line-width, 2px) * -1);
	width: var(--scrolltl-line-width, 2px);
	height: 0;
	background: var(--scrolltl-progress-color, #3b82f6);
	border-radius: var(--scrolltl-line-width, 2px);
	transition: height 0.15s linear;
}

/* ---------- Nodes ---------- */
.scrolltl-node {
	position: absolute;
	top: calc(var(--scrolltl-node-offset, 28px) - var(--scrolltl-node-size, 18px) / 2);
	width: var(--scrolltl-node-size, 18px);
	height: var(--scrolltl-node-size, 18px);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background: var(--scrolltl-node-bg, #fff);
	border: var(--scrolltl-node-border-width, 2px) solid var(--scrolltl-node-border, #cbd5e1);
	border-radius: 50%;
	transform: rotate(var(--scrolltl-node-rotate)) scale(var(--scrolltl-node-s, 1));
	transition:
		transform var(--scrolltl-hl-duration, 450ms) var(--scrolltl-hl-easing, ease),
		background-color var(--scrolltl-hl-duration, 450ms) ease,
		border-color var(--scrolltl-hl-duration, 450ms) ease;
}

/* Centered on the card: the item is exactly as tall as its card */
.scrolltl-node-align-center .scrolltl-node {
	top: calc(50% - var(--scrolltl-node-size, 18px) / 2);
}

.scrolltl-shape-square .scrolltl-node  { border-radius: 0; }
.scrolltl-shape-rounded .scrolltl-node { border-radius: 28%; }
.scrolltl-shape-diamond                { --scrolltl-node-rotate: 45deg; }
.scrolltl-shape-diamond .scrolltl-node { border-radius: 2px; }

.scrolltl-item.is-active .scrolltl-node {
	--scrolltl-node-s: var(--scrolltl-node-active-scale, 1.3);
	background: var(--scrolltl-node-active-bg, #3b82f6);
	border-color: var(--scrolltl-node-active-border, #3b82f6);
}

/* Item image / icon shown in the node */
.scrolltl-node > .scrolltl-media {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	transform: rotate(calc(var(--scrolltl-node-rotate) * -1));
}

.scrolltl-node > .scrolltl-media--image .scrolltl-media-frame {
	width: 100%;
	height: 100%;
	border-radius: 0;
}

.scrolltl-node > .scrolltl-media--image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.scrolltl-node > .scrolltl-media--icon {
	font-size: calc(var(--scrolltl-node-size, 18px) * 0.5) !important;
	line-height: 1;
}

/* Node icon class: <i class="scrolltl-node-icon your-class"> */
.scrolltl-node-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-style: normal;
	font-size: calc(var(--scrolltl-node-size, 18px) * 0.55);
	line-height: 1;
	color: var(--scrolltl-icon-color, #3b82f6);
	transform: rotate(calc(var(--scrolltl-node-rotate) * -1));
	rotate: var(--scrolltl-icon-rot, 0deg); /* advanced by timeline.js, always forward */
	transition:
		rotate var(--scrolltl-spin-duration, var(--scrolltl-hl-duration, 450ms)) var(--scrolltl-hl-easing, ease),
		color var(--scrolltl-hl-duration, 450ms) ease;
}

/* Injected SVGs (e.g. the propeller) follow the icon color */
.scrolltl-node-icon > svg {
	width: 70%;
	height: 70%;
	overflow: visible;
}

.scrolltl-node-icon svg,
.scrolltl-node-icon svg * {
	fill: currentColor;
}

.scrolltl-item.is-active .scrolltl-node-icon {
	color: var(--scrolltl-icon-active-color, #fff);
}

/* ---------- Cards ---------- */
.scrolltl-card {
	position: relative;
	padding: var(--scrolltl-card-padding, 24px);
	background: var(--scrolltl-card-bg, #fff);
	border: 1px solid var(--scrolltl-card-border, #eef0f3);
	border-radius: var(--scrolltl-card-radius, 10px);
	color: var(--scrolltl-text-color, #4b5563);
}

.scrolltl-card > .scrolltl-media {
	display: block;
	margin:
		var(--scrolltl-img-mt, 0px)
		var(--scrolltl-img-mr, 0px)
		var(--scrolltl-img-mb, 16px)
		var(--scrolltl-img-ml, 0px);
	line-height: 1;
}

/* Alignment in the card */
.scrolltl-card > .scrolltl-align-left   { text-align: left; }
.scrolltl-card > .scrolltl-align-center { text-align: center; }
.scrolltl-card > .scrolltl-align-right  { text-align: right; }

.scrolltl-card > .scrolltl-align-left .scrolltl-media-frame   { margin-right: auto; }
.scrolltl-card > .scrolltl-align-center .scrolltl-media-frame { margin-left: auto; margin-right: auto; }
.scrolltl-card > .scrolltl-align-right .scrolltl-media-frame  { margin-left: auto; }

.scrolltl-card > .scrolltl-align-full .scrolltl-media-frame,
.scrolltl-card > .scrolltl-align-full img {
	width: 100%;
}

.scrolltl-card > .scrolltl-media--image img {
	display: block;
	max-width: 100%;
	height: auto;
}

/* ---------- Images: frame, tint, hover effects ---------- */
.scrolltl-media-anim {
	display: block;
}

.scrolltl-node .scrolltl-media-anim {
	width: 100%;
	height: 100%;
}

.scrolltl-media-frame {
	position: relative;
	display: block;
	width: fit-content;
	max-width: 100%;
	overflow: hidden;
	border-radius: calc(var(--scrolltl-card-radius, 10px) / 1.5);
	transition:
		transform var(--scrolltl-img-speed, 400ms) ease,
		box-shadow var(--scrolltl-img-speed, 400ms) ease;
}

.scrolltl-media-link {
	display: block;
}

.scrolltl-media-frame img {
	transition:
		transform var(--scrolltl-img-speed, 400ms) ease,
		filter var(--scrolltl-img-speed, 400ms) ease;
}

/* Tint layer */
.scrolltl-media-frame::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--scrolltl-img-tint, transparent);
	opacity: calc(var(--scrolltl-img-hot, 0) * var(--scrolltl-img-tint-opacity, 0.4));
	pointer-events: none;
	transition:
		opacity var(--scrolltl-img-speed, 400ms) ease,
		transform var(--scrolltl-img-speed, 400ms) ease;
}

/* Tint only the visible shapes: the image itself is the overlay's stencil */
.scrolltl-tint-shape .scrolltl-media-frame::after {
	-webkit-mask-image: var(--scrolltl-img-mask, none);
	mask-image: var(--scrolltl-img-mask, none);
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
}

.scrolltl-tint-shape .scrolltl-node .scrolltl-media-frame::after {
	-webkit-mask-size: cover;
	mask-size: cover;
}

/* "Hot" = the trigger is on. Effects below scale with it (0 = off, 1 = on). */
.scrolltl-imghover-image .scrolltl-media-frame:hover,
.scrolltl-imghover-item .scrolltl-item:hover .scrolltl-media-frame,
.scrolltl-imghover-active .scrolltl-item.is-active .scrolltl-media-frame {
	--scrolltl-img-hot: 1;
}

.scrolltl-imgfx-zoom-in .scrolltl-media-frame img,
.scrolltl-imgfx-zoom-in .scrolltl-media-frame::after {
	transform: scale(calc(1 + 0.08 * var(--scrolltl-img-hot, 0)));
}

.scrolltl-imgfx-zoom-out .scrolltl-media-frame img,
.scrolltl-imgfx-zoom-out .scrolltl-media-frame::after {
	transform: scale(calc(1.08 - 0.08 * var(--scrolltl-img-hot, 0)));
}

.scrolltl-imgfx-tilt .scrolltl-media-frame img,
.scrolltl-imgfx-tilt .scrolltl-media-frame::after {
	transform: rotate(calc(2deg * var(--scrolltl-img-hot, 0))) scale(calc(1 + 0.1 * var(--scrolltl-img-hot, 0)));
}

.scrolltl-imgfx-lift .scrolltl-card .scrolltl-media-frame {
	transform: translateY(calc(-4px * var(--scrolltl-img-hot, 0)));
	box-shadow: 0 calc(12px * var(--scrolltl-img-hot, 0)) calc(24px * var(--scrolltl-img-hot, 0)) rgba(0, 0, 0, calc(0.25 * var(--scrolltl-img-hot, 0)));
}

.scrolltl-imgfx-grayscale .scrolltl-media-frame img {
	filter: grayscale(calc(1 - var(--scrolltl-img-hot, 0)));
}

.scrolltl-title {
	margin:
		var(--scrolltl-title-mt, 0px)
		var(--scrolltl-title-mr, 0px)
		var(--scrolltl-title-mb, 0.5em)
		var(--scrolltl-title-ml, 0px);
	text-align: var(--scrolltl-title-align, left);
	color: var(--scrolltl-title-color, #111827);
	transition: color var(--scrolltl-hl-duration, 450ms) ease;
}

.scrolltl-item.is-active .scrolltl-title {
	color: var(--scrolltl-active-title-color, #1d4ed8);
}

.scrolltl-title a {
	color: inherit;
	text-decoration: none;
}

/* Title hover: styles go on the text span so a background hugs the words */
.scrolltl-title-text {
	padding: 0 0.15em;
	margin: 0 -0.15em;
	border-radius: 3px;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
	transition: color 0.2s ease, background-color 0.2s ease;
}

/* An unset variable makes these fall back to the normal title color / no background */
.scrolltl-title:hover .scrolltl-title-text,
.scrolltl-title a:focus-visible .scrolltl-title-text {
	color: var(--scrolltl-title-hover-color);
	background-color: var(--scrolltl-title-hover-bg);
}

.scrolltl-title-deco-links .scrolltl-title--linked:hover .scrolltl-title-text,
.scrolltl-title-deco-links .scrolltl-title a:focus-visible .scrolltl-title-text,
.scrolltl-title-deco-always .scrolltl-title:hover .scrolltl-title-text {
	text-decoration: underline;
}

.scrolltl-text {
	color: inherit;
}

.scrolltl-text > :last-child,
.scrolltl-card > :last-child {
	margin-bottom: 0;
}

/* ---------- Sliding highlight ---------- */
.scrolltl-highlight {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 2;
	width: 0;
	height: 0;
	pointer-events: none;
	background: var(--scrolltl-hl-bg, rgba(59, 130, 246, 0.06));
	border: var(--scrolltl-hl-border-width, 2px) solid var(--scrolltl-hl-border, #3b82f6);
	border-radius: var(--scrolltl-card-radius, 10px);
	box-shadow: var(--scrolltl-hl-shadow, none);
	opacity: 0;
	will-change: transform, width, height;
	transition:
		transform var(--scrolltl-hl-duration, 450ms) var(--scrolltl-hl-easing, ease),
		width var(--scrolltl-hl-duration, 450ms) var(--scrolltl-hl-easing, ease),
		height var(--scrolltl-hl-duration, 450ms) var(--scrolltl-hl-easing, ease),
		opacity 0.25s ease;
}

.scrolltl-highlight.is-visible { opacity: 1; }
.scrolltl-highlight.no-anim    { transition: none; }

/* ---------- Content reveal ---------- */
/* Hidden content keeps its space, so the layout never jumps while scrolling. */
.scrolltl-reveal-on .scrolltl-reveal {
	opacity: 0;
	pointer-events: none;
}

.scrolltl-reveal-on .scrolltl-reveal.is-revealed,
.scrolltl-reveal-on .scrolltl-reveal.is-hiding {
	opacity: 1;
}

.scrolltl-reveal-on .scrolltl-reveal.is-revealed {
	pointer-events: auto;
}

/* Whole-card reveal: the hidden title still catches hover, nothing else is clickable */
.scrolltl-reveal-on .scrolltl-reveal--card:not(.is-revealed):not(.is-hiding) {
	pointer-events: auto;
}

.scrolltl-reveal-on .scrolltl-reveal--card:not(.is-revealed) * {
	pointer-events: none;
}

.scrolltl-reveal-on .scrolltl-reveal--card:not(.is-revealed):not(.is-hiding) .scrolltl-title {
	pointer-events: auto;
}

/* Partly visible ("greyed out") before reveal.
   !important wins over animation opacity, so the content brightens smoothly
   from the preview level instead of dropping to invisible first.
   Movement from the reveal animation still plays. */
.scrolltl-reveal-on.scrolltl-pre-visible .scrolltl-reveal {
	opacity: var(--scrolltl-pre-opacity, 0) !important;
	transition:
		opacity var(--scrolltl-reveal-duration, 800ms) ease,
		filter var(--scrolltl-reveal-duration, 800ms) ease;
}

.scrolltl-reveal-on.scrolltl-pre-visible .scrolltl-reveal.is-revealed {
	opacity: 1 !important;
}

.scrolltl-reveal-on.scrolltl-pre-gray .scrolltl-reveal:not(.is-revealed) {
	filter: grayscale(1);
}

.scrolltl-reveal-on .scrolltl-reveal.animated {
	animation-duration: var(--scrolltl-reveal-duration, 800ms) !important;
	animation-fill-mode: both !important;
}

/* ==========================================================
   Layouts
   ========================================================== */

/* Left (also the mobile fallback for centered) */
.scrolltl-layout-left .scrolltl-item,
.scrolltl-layout-center .scrolltl-item {
	padding-left: var(--scrolltl-rail);
}

.scrolltl-layout-left .scrolltl-node,
.scrolltl-layout-center .scrolltl-node {
	left: calc(var(--scrolltl-rail) / 2 - var(--scrolltl-node-size, 18px) / 2);
}

.scrolltl-layout-left .scrolltl-line,
.scrolltl-layout-center .scrolltl-line {
	left: calc(var(--scrolltl-rail) / 2 - var(--scrolltl-line-width, 2px) / 2);
}

/* Right */
.scrolltl-layout-right .scrolltl-item {
	padding-right: var(--scrolltl-rail);
}

.scrolltl-layout-right .scrolltl-node {
	right: calc(var(--scrolltl-rail) / 2 - var(--scrolltl-node-size, 18px) / 2);
}

.scrolltl-layout-right .scrolltl-line {
	right: calc(var(--scrolltl-rail) / 2 - var(--scrolltl-line-width, 2px) / 2);
}

/* Centered / alternating (tablet and up) */
@media (min-width: 768px) {
	.scrolltl-layout-center .scrolltl-line {
		left: calc(50% - var(--scrolltl-line-width, 2px) / 2);
	}

	.scrolltl-layout-center .scrolltl-item {
		width: 50%;
		padding-left: 0;
	}

	.scrolltl-layout-center .scrolltl-item--odd {
		margin-right: auto;
		padding-right: calc(var(--scrolltl-rail) / 2);
	}

	.scrolltl-layout-center .scrolltl-item--odd .scrolltl-node {
		left: auto;
		right: calc(var(--scrolltl-node-size, 18px) / -2);
	}

	.scrolltl-layout-center .scrolltl-item--even {
		margin-left: 50%;
		padding-left: calc(var(--scrolltl-rail) / 2);
	}

	.scrolltl-layout-center .scrolltl-item--even .scrolltl-node {
		left: calc(var(--scrolltl-node-size, 18px) / -2);
	}
}

/* ==========================================================
   Mobile (767px and narrower)
   ========================================================== */
@media (max-width: 767px) {

	/* Stacked: line in the middle, node above each centered card */
	.scrolltl-layout-center.scrolltl-mobile-stack .scrolltl-line {
		left: calc(50% - var(--scrolltl-line-width, 2px) / 2);
	}

	.scrolltl-layout-center.scrolltl-mobile-stack .scrolltl-item {
		width: 100%;
		margin: 0;
		padding: calc(var(--scrolltl-node-size, 18px) * var(--scrolltl-node-active-scale, 1.3) + var(--scrolltl-m-node-gap, 16px)) 0 0;
	}

	.scrolltl-layout-center.scrolltl-mobile-stack .scrolltl-item .scrolltl-node {
		left: calc(50% - var(--scrolltl-node-size, 18px) / 2);
		right: auto;
		/* room for the node to grow when active */
		top: calc(var(--scrolltl-node-size, 18px) * (var(--scrolltl-node-active-scale, 1.3) - 1) / 2);
	}

	/* Center card contents */
	.scrolltl-mobile-center .scrolltl-card {
		text-align: center;
	}

	.scrolltl-mobile-center .scrolltl-title {
		text-align: center !important;
	}

	.scrolltl-mobile-center .scrolltl-card > .scrolltl-media {
		text-align: center;
	}

	.scrolltl-mobile-center .scrolltl-card > .scrolltl-media .scrolltl-media-frame {
		margin-left: auto !important;
		margin-right: auto !important;
	}

	/* Image width */
	.scrolltl-has-m-img-width .scrolltl-card .scrolltl-media-frame {
		width: var(--scrolltl-m-img-width) !important;
	}

	.scrolltl-has-m-img-width .scrolltl-card .scrolltl-media-frame img {
		width: 100% !important;
		height: auto;
	}

	/* Title size */
	.scrolltl-has-m-title-size .scrolltl-title {
		font-size: var(--scrolltl-m-title-size) !important;
	}
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.scrolltl-highlight,
	.scrolltl-node,
	.scrolltl-node-icon,
	.scrolltl-media-frame,
	.scrolltl-media-frame img,
	.scrolltl-media-frame::after,
	.scrolltl-title,
	.scrolltl-line-progress {
		transition: none !important;
	}
}
