/**
 * One-Page Category Menu
 *
 * A `.list-group` used as an in-page section index: each item links to an
 * anchor further down the page, the item matching the section currently in view
 * carries `.current`, and a chevron glyph marks every entry.
 *
 * The list-group itself is Bootstrap; nothing in the framework styles a
 * list-group used this way, so without these rules the menu renders as a plain
 * bordered list with no marker and no current-item colour. The markup carries
 * every class correctly, which is exactly why a class-token comparison cannot
 * see the omission: the classes resolve to no rules at all.
 *
 * Conditional: loaded only on pages whose rendered output contains
 * `.one-page-menu` (see canvas_feature_needles() in inc/block-theme.php).
 *
 * @package Canvas
 * @since   1.0.0
 */

.one-page-menu .list-group-item a {
	color: #111 !important;
	font-weight: 500;
}

.one-page-menu .list-group-item a::before {
	content: "\e77d";
	font-family: "font-icons";
	position: absolute;
	left: 0;
	top: 50%;
	font-size: 14px;
	margin-top: 1px;
	transform: translateY(-50%);
	color: #CCC;
}

.one-page-menu .list-group-item.current a,
.one-page-menu .list-group-item.current a::before {
	color: var(--cnvs-themecolor) !important;
}

/* ── Sticky index column ──────────────────────────────────────────────── */

/*
 * `.position-sticky` ships `position: sticky` with no threshold, which behaves
 * exactly like `static`: the index column would scroll away with the content
 * it indexes. The threshold is stated on the column that holds the index, so
 * the utility stays a no-op everywhere the design leaves it one.
 *
 * Below the md breakpoint the column stops sticking and sits above the content
 * as a collapsible bar, so it takes its natural height and gains the edge
 * shadow that separates it from what scrolls under it.
 */
.position-sticky:has(.one-page-menu) {
	top: 50px;
}

@media (max-width: 768.98px) {

	.position-sticky:has(.one-page-menu) {
		height: auto !important;
		box-shadow: 0 0.25rem .5rem rgba(0, 0, 0, .075);
	}
}
