.c-nursery-tabs {
	position: sticky;
	top: var(--kp-header-h, 0);
	z-index: calc(var(--z-header) - 1);
	background: var(--color-yellow-light);
}

.c-nursery-tabs__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: flex-start;
	margin: 0;
	padding-inline: var(--spacing-page);
	list-style: none;
}

.c-nursery-tabs__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex-shrink: 0;
	padding-top: 12px;
	padding-inline: 20px;
	color: var(--color-navy);
	font-size: var(--text-body-sm);
	line-height: 18px;
	text-decoration: none;
	white-space: nowrap;
}

/* The 10px gap is a spacer layer in the design, so it belongs to the indicator, not the link */
.c-nursery-tabs__indicator {
	width: 100%;
	height: 2px;
	margin-top: 10px;
	border-radius: 2px;
	background: var(--color-navy);
	opacity: 0;
}

.c-nursery-tabs__link[aria-current='true'] .c-nursery-tabs__indicator,
.c-nursery-tabs__link:hover .c-nursery-tabs__indicator {
	opacity: 1;
}

.c-nursery-tabs__link:focus-visible {
	outline: 2px solid var(--color-navy);
	outline-offset: -2px;
}

/* Anchors land clear of the sticky header and this bar */
.c-nursery-body :where(section[id]) {
	scroll-margin-top: calc(var(--kp-header-h, 0px) + var(--kp-tabs-h, 42px) + var(--spacing-md));
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

@media (width < 768px) {
	.c-nursery-tabs__list {
		flex-wrap: nowrap;
		justify-content: flex-start;
		padding-inline: var(--gutter);
		overflow-x: auto;
		scrollbar-width: none;
	}

	.c-nursery-tabs__list::-webkit-scrollbar {
		display: none;
	}

	.c-nursery-tabs__link {
		padding-inline: var(--spacing-md);
	}
}
