/* Page TOC (Understrap) */

:root {
	--understrap-toc-line: rgba(33, 37, 41, 0.18);
	--understrap-toc-accent: #2a303b;
	--understrap-toc-dot-active: var(--understrap-toc-accent);
	/* Horizontal center of spine (line + dot) from ol padding-box left edge */
	--understrap-toc-spine: 6px;
	--understrap-toc-ol-pl: 1.5rem;
}

.understrap-page-toc-sidebar {
	position: relative;
}

@media (min-width: 768px) {
	.understrap-page-toc-sidebar {
		position: -webkit-sticky;
		position: sticky;
		top: 20px;
		align-self: flex-start;
	}
}

@media (min-width: 768px) {
	body.admin-bar .understrap-page-toc-sidebar {
		top: 52px;
	}
}

.understrap-page-toc {
	margin-top: 10px;
}

/* Page title above casino hat (single-casino shortcode layout) */
.understrap-page-title-above-hat .entry-header {
	margin-bottom: 0;
}

.understrap-page-title-above-hat .entry-title {
	margin-bottom: 0.75rem;
}

/* Full-width casino row above main + TOC columns */
.understrap-page-casino-hat-row {
	margin-bottom: 0;
}

.understrap-page-casino-hat {
	margin-bottom: 0;
	padding-bottom: 0;
}

.understrap-page-toc ul,
.understrap-page-toc ol {
	list-style: none;
	padding-left: 0;
	margin: 0;
}

.understrap-page-toc li + li {
	margin-top: 10px;
}

.understrap-page-toc a {
	color: var(--bs-secondary, #6c757d);
	text-decoration: none;
}

.understrap-page-toc a.is-active {
	color: var(--understrap-toc-accent);
	font-weight: 700;
}

.understrap-page-toc a:hover {
	text-decoration: underline !important;
}

/* Desktop sidebar: timeline (vertical line + dots) */
@media (min-width: 768px) {
	.understrap-page-toc-sidebar .understrap-page-toc ol {
		position: relative;
		padding-left: var(--understrap-toc-ol-pl, 1.5rem);
		margin-left: 0.35rem;
	}

	/* Continuous vertical spine — centered on same axis as the active dot */
	.understrap-page-toc-sidebar .understrap-page-toc ol::before {
		content: "";
		position: absolute;
		left: calc(var(--understrap-toc-spine, 6px) - 1px);
		top: 0.75rem;
		bottom: 0.75rem;
		width: 1px;
		background: var(--understrap-toc-line);
		border-radius: 2px;
	}

	.understrap-page-toc-sidebar .understrap-page-toc li {
		position: relative;
		margin-top: 0;
		padding-left: 0.15rem;
	}

	.understrap-page-toc-sidebar .understrap-page-toc li + li {
		margin-top: 0.85rem;
	}

	/* Only the active item shows a dot on the spine */
	.understrap-page-toc-sidebar .understrap-page-toc li.understrap-toc-li-active::before {
		content: "";
		position: absolute;
		/* Spine center from ol padding edge = dot center; li starts after ol padding-left */
		left: calc(
			var(--understrap-toc-spine, 6px) - var(--understrap-toc-ol-pl, 1.5rem)
		);
		top: 0.42em;
		width: 10px;
		height: 10px;
		margin-top: 1px;
		transform: translateX(-50%);
		background: var(--understrap-toc-dot-active);
		border: 2px solid var(--understrap-toc-dot-active);
		border-radius: 50%;
		box-sizing: border-box;
		box-shadow: 0 0 0 5px rgb(255, 255, 255);
		z-index: 1;
		transition:
			border-color 0.15s ease,
			background-color 0.15s ease,
			box-shadow 0.15s ease;
	}

	.understrap-page-toc-sidebar .understrap-page-toc a {
		display: inline-block;
		line-height: 1.35;
		font-size: 0.95rem;
	}
}

@media (max-width: 767px) {
	.understrap-page-toc-widget.is-inline {
		display: block;
		margin: 12px 0 18px 0;
		padding: 10px 12px;
		border: 1px solid var(--bs-border-color, #dee2e6);
		border-radius: 10px;
		background: var(--bs-light, #f8f9fa);
	}

	.understrap-page-toc-widget.is-inline .widget-title {
		font-size: 14px;
		margin: 0 0 10px 0;
		padding: 0 0 8px 0;
		border-bottom: 1px solid var(--bs-border-color, #dee2e6);
	}

	.understrap-page-toc-widget.is-inline .understrap-page-toc {
		margin-top: 0;
	}

	.understrap-page-toc-widget.is-inline .understrap-page-toc a {
		font-size: 14px;
		line-height: 1.35;
	}

	.understrap-page-toc-widget.is-inline .understrap-page-toc a.is-active {
		color: var(--bs-secondary, #6c757d);
		font-weight: 400;
	}

	.understrap-page-toc-widget.is-inline .understrap-page-toc li + li {
		margin-top: 6px;
	}

	.understrap-page-toc-widget.is-inline .understrap-page-toc ol {
		list-style: none;
		padding-left: 0;
	}

	.understrap-page-toc-widget.is-inline .understrap-page-toc li {
		margin-left: 0;
	}

	/* No timeline chrome on small screens */
	.understrap-page-toc-widget.is-inline .understrap-page-toc ol::before,
	.understrap-page-toc-widget.is-inline .understrap-page-toc li::before {
		display: none;
	}
}
