/**
 * The Master Timeline front-end styles.
 * Main timeline colour supplied by the user: #615e79.
 * Historical Entry accents rotate through Pride-inspired colours.
 */

.csmt-timeline-shell {
	--csmt-purple: #615e79;
	--csmt-purple-dark: #4f4c65;
	--csmt-white: #ffffff;
	--csmt-soft: #f4f3f7;
	--csmt-line: 3px;
	--csmt-radius: 16px;
	width: 100%;
	max-width: 1480px;
	margin: 0 auto;
	padding: clamp(24px, 4vw, 64px) clamp(12px, 2vw, 28px);
	box-sizing: border-box;
}

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

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

.csmt-axis {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: var(--csmt-line);
	transform: translateX(-50%);
	background: var(--csmt-purple);
	border-radius: 999px;
	z-index: 0;
}

.csmt-year-row {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr);
	align-items: center;
	min-height: 150px;
	margin: clamp(30px, 5vw, 76px) 0;
	z-index: 1;
}

.csmt-year-row.is-active {
	z-index: 20;
}

.csmt-year-side {
	min-width: 0;
	overflow: visible;
}

.csmt-axis-marker {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	z-index: 5;
}

.csmt-axis-marker span {
	display: block;
	width: 18px;
	height: 18px;
	border: 4px solid var(--csmt-white);
	border-radius: 50%;
	background: var(--csmt-purple);
	box-shadow: 0 0 0 2px var(--csmt-purple);
}

.csmt-year-stage {
	position: relative;
	display: flex;
	align-items: center;
	min-width: 0;
	min-height: 110px;
	overflow: visible;
	isolation: isolate;
}

.csmt-year-row--left .csmt-year-stage {
	justify-content: flex-end;
}

.csmt-year-row--right .csmt-year-stage {
	justify-content: flex-start;
}

.csmt-year-trigger {
	position: relative;
	z-index: 6;
	flex: 0 0 132px;
	min-width: 132px;
	min-height: 96px;
	margin: 0;
	padding: 18px 14px;
	border: 0;
	border-radius: var(--csmt-radius);
	background: var(--csmt-purple);
	color: var(--csmt-white);
	font: inherit;
	font-size: clamp(1.55rem, 2.1vw, 2.25rem);
	font-weight: 800;
	line-height: 1;
	letter-spacing: 0.02em;
	text-align: center;
	cursor: pointer;
	box-shadow: 0 12px 28px rgba(38, 35, 54, 0.18);
	transition: transform 260ms ease, background-color 260ms ease, box-shadow 260ms ease;
}

.csmt-year-trigger::after {
	content: "";
	position: absolute;
	inset: -7px;
	border: 2px solid rgba(97, 94, 121, 0.45);
	border-radius: calc(var(--csmt-radius) + 5px);
	opacity: 0;
	transform: scale(0.88);
	pointer-events: none;
}

.csmt-year-trigger:hover,
.csmt-year-trigger:focus-visible,
.csmt-year-row.is-active .csmt-year-trigger {
	background: var(--csmt-purple-dark);
	transform: scale(1.075);
	box-shadow: 0 16px 34px rgba(38, 35, 54, 0.24);
}

.csmt-year-trigger:hover::after,
.csmt-year-trigger:focus-visible::after,
.csmt-year-trigger.is-pressed::after,
.csmt-year-row.is-active .csmt-year-trigger::after {
	animation: csmt-year-pulse 950ms ease-out;
}

.csmt-year-trigger:focus-visible {
	outline: 3px solid var(--csmt-white);
	outline-offset: -7px;
}

.csmt-branches {
	position: relative;
	z-index: 3;
	flex: 0 0 0;
	width: 0;
	height: 0;
	min-width: 0;
	max-width: 0;
	max-height: 0;
	overflow: visible;
	opacity: 0;
	transform: scale(0.9);
	transform-origin: center;
	pointer-events: none;
	transition:
		flex-basis 420ms cubic-bezier(0.22, 1, 0.36, 1),
		width 420ms cubic-bezier(0.22, 1, 0.36, 1),
		height 420ms cubic-bezier(0.22, 1, 0.36, 1),
		max-width 420ms cubic-bezier(0.22, 1, 0.36, 1),
		max-height 420ms cubic-bezier(0.22, 1, 0.36, 1),
		opacity 230ms ease,
		transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
		margin 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.csmt-year-row--left .csmt-branches {
	order: 1;
	transform-origin: right center;
}

.csmt-year-row--left .csmt-year-trigger {
	order: 2;
}

.csmt-year-row--right .csmt-year-trigger {
	order: 1;
}

.csmt-year-row--right .csmt-branches {
	order: 2;
	transform-origin: left center;
}

.csmt-year-row.is-active .csmt-branches {
	flex-basis: var(--csmt-branches-width, 560px);
	width: var(--csmt-branches-width, 560px);
	height: var(--csmt-fan-height, 260px);
	max-width: var(--csmt-branches-width, 560px);
	max-height: var(--csmt-fan-height, 260px);
	opacity: 1;
	transform: scale(1);
	pointer-events: auto;
}

.csmt-year-row--left.is-active .csmt-branches {
	margin-right: 24px;
}

.csmt-year-row--right.is-active .csmt-branches {
	margin-left: 24px;
}

.csmt-entry-fan {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: visible;
	z-index: 3;
}

.csmt-entry-card {
	--csmt-x: 0px;
	--csmt-y: 0px;
	--csmt-origin-x: 0px;
	--csmt-origin-y: 0px;
	--csmt-rotation: 0deg;
	--csmt-card-z: 30;
	--csmt-entry-delay: 0ms;
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: var(--csmt-card-width, 160px);
	height: var(--csmt-card-height, 115px);
	border: 0;
	background: transparent;
	color: var(--csmt-white);
	text-decoration: none !important;
	cursor: pointer;
	opacity: 0;
	filter: none;
	transform: translate3d(var(--csmt-origin-x), var(--csmt-origin-y), 0) rotate(0deg) scale(0.38);
	transform-origin: center;
	pointer-events: none;
	z-index: var(--csmt-card-z);
	transition:
		transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
		opacity 240ms ease,
		filter 220ms ease;
}

.csmt-year-row.is-active .csmt-entry-card {
	opacity: 1;
	transform: translate3d(var(--csmt-x), var(--csmt-y), 0) rotate(var(--csmt-rotation)) scale(1);
	pointer-events: auto;
	transition-delay: var(--csmt-entry-delay);
}

.csmt-entry-card:hover,
.csmt-entry-card:focus-visible,
.csmt-entry-card.is-focused,
.csmt-entry-card.is-previewing {
	z-index: 1200;
	transition-delay: 0ms;
}

.csmt-entry-card:focus-visible {
	outline: none;
}

.csmt-entry-card-inner {
	position: absolute;
	top: 50%;
	left: 50%;
	display: block;
	width: 100%;
	height: 100%;
	overflow: hidden;
	border: 3px solid var(--csmt-entry-accent, var(--csmt-purple));
	border-radius: 11px;
	background: var(--csmt-purple);
	box-shadow: 0 7px 16px rgba(38, 35, 54, 0.2);
	transform: translate(-50%, -50%);
	transition:
		width 240ms cubic-bezier(0.22, 1, 0.36, 1),
		height 240ms cubic-bezier(0.22, 1, 0.36, 1),
		box-shadow 240ms ease,
		border-radius 240ms ease;
}

.csmt-entry-card:hover .csmt-entry-card-inner,
.csmt-entry-card:focus-visible .csmt-entry-card-inner,
.csmt-entry-card.is-focused .csmt-entry-card-inner,
.csmt-entry-card.is-previewing .csmt-entry-card-inner {
	width: var(--csmt-active-card-width, 190px);
	height: var(--csmt-active-card-height, 137px);
	border-radius: 14px;
	box-shadow: 0 18px 38px rgba(38, 35, 54, 0.35);
}

.csmt-entry-card:focus-visible .csmt-entry-card-inner {
	outline: 3px solid var(--csmt-white);
	outline-offset: 3px;
}

.csmt-entry-fan.has-focused-card .csmt-entry-card:not(.is-focused):not(.is-previewing):not(:hover):not(:focus-visible) {
	opacity: 0.6;
	filter: blur(1.25px) saturate(0.82);
}

.csmt-entry-media,
.csmt-entry-image {
	display: block;
	width: 100%;
	height: 100%;
}

.csmt-entry-image {
	object-fit: cover;
	transition: transform 360ms ease, filter 240ms ease;
}

.csmt-entry-card:hover .csmt-entry-image,
.csmt-entry-card:focus-visible .csmt-entry-image,
.csmt-entry-card.is-focused .csmt-entry-image,
.csmt-entry-card.is-previewing .csmt-entry-image {
	transform: scale(1.06);
	filter: brightness(0.58);
}

.csmt-entry-summary {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	gap: 5px;
	min-height: 27px;
	padding: 5px 6px;
	background: var(--csmt-entry-accent, var(--csmt-purple));
	color: var(--csmt-entry-contrast, var(--csmt-white));
	z-index: 2;
	transition: opacity 180ms ease, transform 180ms ease;
}

.csmt-entry-year {
	flex: 0 0 auto;
	font-size: 0.62rem;
	font-weight: 900;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.csmt-entry-title {
	min-width: 0;
	font-size: 0.72rem;
	font-weight: 800;
	line-height: 1.1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.csmt-entry-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	padding: 10px 11px;
	background: var(--csmt-entry-overlay, var(--csmt-purple-dark));
	color: var(--csmt-white);
	opacity: 0;
	transform: translateY(7px);
	pointer-events: none;
	z-index: 3;
	transition: opacity 190ms ease, transform 190ms ease;
}

.csmt-entry-card:hover .csmt-entry-overlay,
.csmt-entry-card:focus-visible .csmt-entry-overlay,
.csmt-entry-card.is-focused .csmt-entry-overlay,
.csmt-entry-card.is-previewing .csmt-entry-overlay {
	opacity: 0.96;
	transform: translateY(0);
	pointer-events: auto;
}

.csmt-entry-card:hover .csmt-entry-summary,
.csmt-entry-card:focus-visible .csmt-entry-summary,
.csmt-entry-card.is-focused .csmt-entry-summary,
.csmt-entry-card.is-previewing .csmt-entry-summary {
	opacity: 0;
	transform: translateY(6px);
}

.csmt-entry-overlay-year {
	margin-bottom: 2px;
	font-size: 0.61rem;
	font-weight: 900;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.csmt-entry-overlay-title {
	display: -webkit-box;
	margin-bottom: 4px;
	overflow: hidden;
	font-size: 0.84rem;
	font-weight: 900;
	line-height: 1.08;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.csmt-entry-description {
	display: -webkit-box;
	margin-bottom: 7px;
	overflow: hidden;
	font-size: 0.66rem;
	line-height: 1.22;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

/* Historical Entry description links are intentionally scoped to this plugin only. */
.csmt-timeline-shell .csmt-entry-description p {
	margin: 0;
}

.csmt-timeline-shell .csmt-entry-description a,
.csmt-timeline-shell .csmt-entry-description a:visited,
.csmt-timeline-shell .csmt-entry-description a:hover,
.csmt-timeline-shell .csmt-entry-description a:focus {
	color: inherit !important;
	font-weight: inherit !important;
	text-decoration: underline !important;
	text-underline-offset: 0.12em;
}

.csmt-entry-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 20px;
	padding: 4px 7px;
	border: 1px solid var(--csmt-white);
	border-radius: 999px;
	font-size: 0.55rem;
	font-weight: 900;
	line-height: 1;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.csmt-branch-lines {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
	pointer-events: none;
	z-index: 1;
}

.csmt-branch-lines path {
	fill: none;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
	opacity: 0.56;
	vector-effect: non-scaling-stroke;
	transition: opacity 180ms ease, stroke-width 180ms ease;
}

.csmt-branch-lines path.is-muted {
	opacity: 0.1;
}

.csmt-branch-lines path.is-highlighted {
	stroke-width: 3.2;
	opacity: 1;
}


/*
 * Draggable Earth timeline navigator.
 * The globe is visually 28px while its transparent button remains 44px for touch use.
 */
.csmt-earth-navigator {
	position: fixed;
	left: 0;
	top: 0;
	width: 0;
	height: 0;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	z-index: 80;
	transition: opacity 180ms ease, visibility 180ms ease;
}

.csmt-earth-navigator.is-visible {
	opacity: 1;
	visibility: visible;
}

.csmt-earth-track {
	position: absolute;
	inset: 0;
	width: 0;
	height: 100%;
	pointer-events: none;
}

.csmt-earth-handle {
	--csmt-earth-rotation: 0deg;
	position: absolute;
	left: 0;
	top: 22px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 8px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--csmt-white);
	font: inherit;
	line-height: 1;
	cursor: grab;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	pointer-events: auto;
	transform: translate(-50%, -50%);
	transition: filter 160ms ease;
}

.csmt-earth-handle::before {
	content: "";
	position: absolute;
	inset: 5px;
	border: 2px solid rgba(255, 255, 255, 0.95);
	border-radius: 50%;
	background: rgba(97, 94, 121, 0.2);
	box-shadow: 0 3px 10px rgba(25, 23, 35, 0.35);
	transform: scale(0.88);
	opacity: 0;
	transition: opacity 160ms ease, transform 160ms ease;
}

.csmt-earth-handle:hover::before,
.csmt-earth-handle:focus-visible::before,
.csmt-earth-navigator.is-dragging .csmt-earth-handle::before {
	opacity: 1;
	transform: scale(1);
}

.csmt-earth-handle:focus-visible {
	outline: 3px solid var(--csmt-purple);
	outline-offset: 3px;
}

.csmt-earth-navigator.is-dragging .csmt-earth-handle {
	cursor: grabbing;
	filter: drop-shadow(0 5px 8px rgba(25, 23, 35, 0.3));
}

.csmt-earth-icon {
	position: relative;
	display: block;
	width: 28px;
	height: 28px;
	filter: drop-shadow(0 2px 3px rgba(25, 23, 35, 0.32));
	transform: rotate(var(--csmt-earth-rotation));
	transform-origin: center;
	transition: transform 120ms linear;
	z-index: 1;
}

.csmt-earth-icon svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.csmt-earth-ocean {
	fill: #2f80c9;
	stroke: #ffffff;
	stroke-width: 1.4;
}

.csmt-earth-land {
	fill: #57a85a;
	stroke: #31763a;
	stroke-width: 0.45;
	stroke-linejoin: round;
}

.csmt-earth-grid {
	fill: none;
	stroke: rgba(255, 255, 255, 0.52);
	stroke-width: 0.65;
	pointer-events: none;
}

.csmt-earth-year-label {
	position: absolute;
	left: calc(100% + 2px);
	top: 50%;
	display: inline-flex;
	align-items: center;
	min-height: 28px;
	padding: 5px 9px;
	border: 2px solid var(--csmt-purple);
	border-radius: 999px;
	background: var(--csmt-white);
	color: #292635;
	font-size: 0.72rem;
	font-weight: 900;
	line-height: 1;
	white-space: nowrap;
	box-shadow: 0 5px 14px rgba(25, 23, 35, 0.18);
	opacity: 0;
	pointer-events: none;
	transform: translate(4px, -50%) scale(0.94);
	transform-origin: left center;
	transition: opacity 150ms ease, transform 150ms ease;
}

.csmt-earth-handle:hover .csmt-earth-year-label,
.csmt-earth-handle:focus-visible .csmt-earth-year-label,
.csmt-earth-navigator.is-dragging .csmt-earth-year-label {
	opacity: 1;
	transform: translate(4px, -50%) scale(1);
}

html.csmt-is-dragging-timeline,
html.csmt-is-dragging-timeline body {
	cursor: grabbing !important;
	user-select: none !important;
	-webkit-user-select: none !important;
}

.csmt-empty-state {
	padding: 18px 20px;
	border-left: 5px solid #615e79;
	background: #f4f3f7;
	color: #292635;
	font-weight: 700;
}

@keyframes csmt-year-pulse {
	0% {
		opacity: 0.75;
		transform: scale(0.88);
	}
	100% {
		opacity: 0;
		transform: scale(1.25);
	}
}

@media (max-width: 1240px) {
	.csmt-year-row {
		grid-template-columns: minmax(0, 1fr) 60px minmax(0, 1fr);
	}

	.csmt-year-trigger {
		flex-basis: 116px;
		min-width: 116px;
		min-height: 88px;
	}
}

@media (max-width: 900px) and (min-width: 769px) {
	.csmt-timeline-shell {
		padding-left: 8px;
		padding-right: 8px;
	}

	.csmt-year-row {
		grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr);
	}

	.csmt-year-trigger {
		flex-basis: 102px;
		min-width: 102px;
		min-height: 80px;
		font-size: 1.35rem;
	}

	.csmt-year-row--left.is-active .csmt-branches {
		margin-right: 16px;
	}

	.csmt-year-row--right.is-active .csmt-branches {
		margin-left: 16px;
	}
}

@media (max-width: 768px) {
	.csmt-timeline-shell {
		padding: 26px 10px 42px;
		overflow-x: clip;
	}

	.csmt-axis {
		left: 18px;
		transform: none;
	}

	.csmt-year-row {
		display: grid;
		grid-template-columns: 37px minmax(0, 1fr);
		align-items: start;
		min-height: 0;
		margin: 34px 0 46px;
	}

	.csmt-axis-marker {
		grid-column: 1;
		grid-row: 1;
		height: 82px;
	}

	.csmt-year-side {
		grid-column: 2;
		grid-row: 1;
	}

	.csmt-year-side:empty {
		display: none;
	}

	.csmt-year-stage,
	.csmt-year-row--left .csmt-year-stage,
	.csmt-year-row--right .csmt-year-stage {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		width: 100%;
	}

	.csmt-year-trigger,
	.csmt-year-row--left .csmt-year-trigger,
	.csmt-year-row--right .csmt-year-trigger {
		order: 1;
		align-self: flex-start;
		flex-basis: auto;
		min-width: 128px;
		min-height: 78px;
		font-size: 1.55rem;
	}

	.csmt-branches,
	.csmt-year-row--left .csmt-branches,
	.csmt-year-row--right .csmt-branches {
		order: 2;
		align-self: stretch;
		margin: 0;
		transform-origin: top left;
	}

	.csmt-year-row.is-active .csmt-branches,
	.csmt-year-row--left.is-active .csmt-branches,
	.csmt-year-row--right.is-active .csmt-branches {
		flex-basis: var(--csmt-fan-height, 260px);
		width: min(100%, var(--csmt-branches-width, 100%));
		max-width: 100%;
		margin: 18px 0 0;
	}

	.csmt-entry-overlay {
		padding: 9px 10px;
	}

	.csmt-entry-description {
		-webkit-line-clamp: 2;
	}
}


@media (max-width: 768px) {
	.csmt-earth-icon {
		width: 26px;
		height: 26px;
	}

	.csmt-earth-year-label {
		left: calc(100% - 1px);
		min-height: 26px;
		padding: 5px 8px;
		font-size: 0.68rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.csmt-timeline-shell *,
	.csmt-timeline-shell *::before,
	.csmt-timeline-shell *::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}

/* Historical Entry rich text is intentionally scoped to The Master Timeline only. */
.csmt-timeline-shell .csmt-entry-description strong,
.csmt-timeline-shell .csmt-entry-description b {
	font-weight: 700;
}

/* ==========================================================================\n   Historical Entry fan groups\n   ========================================================================== */

.csmt-entry-card.is-group-hidden {
	opacity: 0 !important;
	visibility: hidden;
	pointer-events: none !important;
	transform: translate3d(var(--csmt-origin-x), var(--csmt-origin-y), 0) scale(0.35) !important;
	transition-delay: 0ms !important;
}

.csmt-group-nav {
	position: absolute;
	top: 50%;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 38px;
	padding: 4px 6px;
	border: 1px solid rgba(97, 94, 121, 0.28);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.96);
	box-shadow: 0 7px 18px rgba(38, 35, 54, 0.14);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	z-index: 1400;
	transition: opacity 180ms ease, transform 220ms ease, visibility 180ms ease;
}

.csmt-year-row--left .csmt-group-nav {
	right: 0;
	transform: translateY(58px) translateX(0) scale(0.96);
}

.csmt-year-row--right .csmt-group-nav {
	left: 0;
	transform: translateY(58px) translateX(0) scale(0.96);
}

.csmt-group-nav.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.csmt-year-row--left .csmt-group-nav.is-visible,
.csmt-year-row--right .csmt-group-nav.is-visible {
	transform: translateY(58px) translateX(0) scale(1);
}

.csmt-group-nav-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	min-width: 30px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--csmt-purple);
	color: var(--csmt-white);
	font: inherit;
	font-size: 1.35rem;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
	transition: transform 160ms ease, background-color 160ms ease;
}

.csmt-group-nav-button:hover,
.csmt-group-nav-button:focus-visible {
	background: var(--csmt-purple-dark);
	transform: scale(1.08);
}

.csmt-group-nav-button:focus-visible {
	outline: 2px solid var(--csmt-purple);
	outline-offset: 2px;
}

.csmt-group-nav-status {
	min-width: 42px;
	color: var(--csmt-purple-dark);
	font-size: 0.76rem;
	font-weight: 800;
	line-height: 1;
	text-align: center;
	white-space: nowrap;
}

@media (max-width: 768px) {
	.csmt-group-nav {
		top: auto;
		bottom: -46px;
		left: 50% !important;
		right: auto !important;
		transform: translateX(-50%) scale(0.96) !important;
	}

	.csmt-group-nav.is-visible {
		transform: translateX(-50%) scale(1) !important;
	}
}
