/* Timeline Builder — frontend styles.
   Everything is scoped under .tlb-root so it can't affect the rest of the page. */

.tlb-root {
	box-sizing: border-box;
	background: transparent;
	color: var( --tlb-text );
	padding: 36px 20px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.tlb-root * {
	box-sizing: border-box;
}

.tlb-track-wrap {
	position: relative;
}
.tlb-track-wrap.tlb-vertical {
	display: flex;
	flex-direction: column;
}
.tlb-track-wrap.tlb-horizontal {
	display: flex;
	flex-direction: row;
	overflow-x: auto;
	padding: 46px 10px 30px;
	-webkit-overflow-scrolling: touch;
}

.tlb-spine {
	position: absolute;
	pointer-events: none;
}
.tlb-vertical .tlb-spine {
	left: 50%;
	top: 0;
	bottom: 0;
	border-left-width: 2px;
	border-left-style: solid;
	border-color: var( --tlb-accent );
	transform: translateX( -50% );
	opacity: .55;
}
.tlb-horizontal .tlb-spine {
	top: 50%;
	left: 0;
	right: 0;
	border-top-width: 2px;
	border-top-style: solid;
	border-color: var( --tlb-accent );
	transform: translateY( -50% );
	opacity: .55;
}
.tlb-spine.tlb-line-dashed { border-left-style: dashed; border-top-style: dashed; }
.tlb-spine.tlb-line-dotted { border-left-style: dotted; border-top-style: dotted; }

.tlb-item {
	position: relative;
}
.tlb-vertical-item {
	display: grid;
	grid-template-columns: 1fr 44px 1fr;
	align-items: center;
	column-gap: 18px;
	min-height: 104px;
}
.tlb-horizontal-item {
	display: grid;
	grid-template-rows: 1fr 44px 1fr;
	justify-items: center;
	row-gap: 12px;
	flex: 0 0 230px;
	padding: 0 16px;
}

.tlb-slot { display: flex; min-width: 0; }
.tlb-vertical-item .tlb-slot-a { justify-content: flex-end; }
.tlb-vertical-item .tlb-slot-b { justify-content: flex-start; }
.tlb-horizontal-item .tlb-slot-a { align-items: flex-end; }
.tlb-horizontal-item .tlb-slot-b { align-items: flex-start; }

.tlb-center {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}
.tlb-tick {
	position: absolute;
	background: var( --tlb-accent );
	opacity: .7;
}
.tlb-vertical-item .tlb-tick { width: 18px; height: 2px; left: 50%; top: 50%; transform: translate( -50%, -50% ); }
.tlb-horizontal-item .tlb-tick { width: 2px; height: 18px; left: 50%; top: 50%; transform: translate( -50%, -50% ); }

.tlb-marker {
	position: relative;
	z-index: 2;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var( --tlb-accent );
	color: #fff;
	line-height: 1;
	box-shadow: 0 2px 6px rgba( 0, 0, 0, .18 );
	overflow: hidden;
}
.tlb-marker-dot { width: 16px !important; height: 16px !important; }
.tlb-marker-media { width: 72px !important; height: 72px !important; font-size: 16px; }
.tlb-marker-image { background-size: cover; background-position: center; color: transparent; }
.tlb-marker.tlb-marker-image { width: 72px !important; height: 72px !important; }

.tlb-card { max-width: 280px; min-width: 0; }
.tlb-horizontal-item .tlb-card { max-width: 210px; text-align: left; }
.tlb-vertical-item .tlb-slot-a .tlb-card { text-align: right; }
.tlb-vertical-item .tlb-slot-b .tlb-card { text-align: left; }

.tlb-cardstyle-card .tlb-card-inner {
	background: var( --tlb-card-bg );
	border: 1px solid var( --tlb-card-border );
	border-radius: 12px;
	padding: 13px 15px;
	box-shadow: 0 3px 14px rgba( 0, 0, 0, .07 );
}
.tlb-cardstyle-minimal .tlb-card-inner {
	background: transparent;
	border: 0;
	padding: 1px 0 1px 11px;
	border-left: 2px solid var( --tlb-accent );
}
.tlb-cardstyle-minimal .tlb-slot-a .tlb-card-inner {
	border-left: 0;
	border-right: 2px solid var( --tlb-accent );
	padding: 1px 11px 1px 0;
}

.tlb-year-tag {
	display: inline-block;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 16px;
	letter-spacing: .04em;
	padding: 2px 8px;
	border-radius: 4px;
	background: var( --tlb-accent );
	color: #fff;
	margin-bottom: 6px;
}
.tlb-card-title {
	font-weight: 600;
	font-size: 20px !important;
	line-height: 1.3 !important;
	margin: 0 0 4px !important;
	color: var( --tlb-text );
}
.tlb-card-desc {
	font-size: 20px !important;
	line-height: 1.55 !important;
	color: var( --tlb-text-muted );
	margin: 0 !important;
}

.tlb-theme-light {
	--tlb-canvas-bg: #F7F5EF;
	--tlb-card-bg: #FFFFFF;
	--tlb-card-border: #E7E2D6;
	--tlb-text: #1B1A17;
	--tlb-text-muted: #6E6A60;
}
.tlb-theme-dark {
	--tlb-canvas-bg: #16181D;
	--tlb-card-bg: #1F2127;
	--tlb-card-border: #2D3038;
	--tlb-text: #F2F1EC;
	--tlb-text-muted: #9B9CA3;
}

.tlb-empty {
	font-size: 14px;
	opacity: .7;
}

/* On screens 800px and narrower, collapse BOTH orientations into a
   single centered column: marker on top, text centered directly
   below it. Stacking them removes any side-by-side alignment mismatch
   between the marker and the text, and avoids sideways scrolling. */
@media ( max-width: 800px ) {

	.tlb-track-wrap.tlb-horizontal {
		flex-direction: column;
		overflow-x: visible;
		padding: 30px 0;
	}

	.tlb-spine {
		display: none;
	}

	.tlb-tick {
		display: none;
	}

	.tlb-marker.tlb-marker-image {
		width: 48px !important;
		height: 48px !important;
	}

	.tlb-vertical-item,
	.tlb-horizontal-item {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 10px;
		flex: none;
		padding: 0 16px 28px;
		min-height: 0;
	}

	.tlb-center {
		order: -1;
	}

	.tlb-slot-a,
	.tlb-slot-b {
		width: 100%;
		justify-content: center !important;
		align-items: center !important;
	}

	.tlb-card,
	.tlb-vertical-item .tlb-slot-a .tlb-card,
	.tlb-vertical-item .tlb-slot-b .tlb-card,
	.tlb-horizontal-item .tlb-card {
		max-width: 320px;
		text-align: center !important;
	}

	.tlb-cardstyle-minimal .tlb-card-inner,
	.tlb-cardstyle-minimal .tlb-slot-a .tlb-card-inner {
		border-left: 0;
		border-right: 0;
		border-top: 2px solid var( --tlb-accent );
		padding: 10px 0 0;
	}
}

/* Tablet range: keep the horizontal layout, just narrower, so there's
   less to scroll through than the full desktop width. */
@media ( min-width: 801px ) and ( max-width: 1024px ) {
	.tlb-horizontal-item {
		flex: 0 0 170px;
		padding: 0 10px;
	}
	.tlb-horizontal-item .tlb-card {
		max-width: 150px;
	}
}

