/* Experiment single: thin sticky section menu under the site header. */

.sb-experiment-section-nav {
	--sb-experiment-section-nav-height: 2.75rem;
	position: sticky;
	/* JS sets --sb-header-height / top to the live bottom of the fixed header. */
	top: var(--sb-header-height, 5rem);
	z-index: 45;
	border-bottom: 1px solid var(--sb-color-border);
	background: var(--sb-color-bg);
}

body.admin-bar .sb-experiment-section-nav {
	top: var(--sb-header-height, calc(5rem + 32px));
}

@media (max-width: 782px) {
	body.admin-bar .sb-experiment-section-nav {
		top: var(--sb-header-height, calc(5rem + 46px));
	}
}

.sb-experiment-section-nav__inner {
	display: flex;
	align-items: center;
	min-height: var(--sb-experiment-section-nav-height);
}

.sb-experiment-section-nav__list {
	display: flex;
	flex-wrap: nowrap;
	gap: clamp(1.1rem, 2.5vw, 1.75rem);
	align-items: center;
	width: 100%;
	margin: 0;
	padding: 0.55rem 0;
	overflow-x: auto;
	list-style: none;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.sb-experiment-section-nav__list::-webkit-scrollbar {
	display: none;
}

.sb-experiment-section-nav__item {
	flex: 0 0 auto;
	margin: 0;
}

.sb-experiment-section-nav__link {
	display: inline-block;
	color: var(--sb-color-muted-strong);
	font-family: var(--sb-font-heading);
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.12em;
	line-height: 1.2;
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
	border-bottom: 1px solid transparent;
	padding-bottom: 0.1rem;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.sb-experiment-section-nav__link:hover,
.sb-experiment-section-nav__link:focus-visible {
	color: var(--sb-color-ink);
}

.sb-experiment-section-nav__link.is-active {
	color: var(--sb-color-ink);
	border-bottom-color: var(--sb-color-ink);
}

/* Anchors clear the sticky header + section nav. */
#experiment-brief,
#experiment-hypothesis,
#experiment-notebook,
#experiment-gallery,
#experiment-findings {
	scroll-margin-top: calc(var(--sb-header-height, 5rem) + var(--sb-experiment-section-nav-height, 2.75rem) + var(--sb-space-sm));
}

@media (prefers-reduced-motion: reduce) {
	.sb-experiment-section-nav__link {
		transition: none;
	}

	html:has(.sb-experiment-section-nav) {
		scroll-behavior: auto;
	}
}
