/**
 * Anchor navigation styles.
 * Plain CSS on purpose: this module doesn't depend on the host theme's
 * build pipeline, so it can be dropped into any project as-is.
 */

.anchor-nav {
	background-color: #ffffff;
	border-bottom: 1px solid rgba(53, 53, 53, 0.08);
	position: relative;
	z-index: 9;
}

/*
 * Mirrors .site-header.is-scrolled (see _site-header.scss): same fixed
 * positioning, same slide-down reveal, toggled by anchor-nav.js at the same
 * scroll threshold header-scroll.js uses — so the nav visibly follows the
 * header's own scroll animation instead of using an unrelated sticky offset.
 */
.anchor-nav.is-pinned {
	animation: certifq-anchor-nav-settle 0.28s ease both;
	box-shadow: 0 7px 14px rgba(6, 65, 61, 0.1);
	left: 0;
	position: fixed;
	right: 0;
	top: var(--certifq-anchor-nav-top, 0px);
	z-index: 9;
}

@keyframes certifq-anchor-nav-settle {
	from {
		transform: translateY(-100%);
	}

	to {
		transform: translateY(0);
	}
}

/* Reserves the nav's own height in the document flow while it's pinned
   (position: fixed takes it out of flow), so the content below doesn't
   jump up. Height is set by anchor-nav.js to match the nav's real height. */
.anchor-nav__spacer {
	height: 0;
}

.anchor-nav__spacer.is-active {
	height: var(--certifq-anchor-nav-height, 0px);
}

.anchor-nav__inner {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.anchor-nav__list {
	display: flex;
	gap: 24px;
	list-style: none;
	margin: 0;
	padding: 12px 0;
	white-space: nowrap;
}

.anchor-nav__link {
	color: #6d6d6d;
	display: inline-block;
	font-size: 15px;
	font-weight: 500;
	padding: 6px 2px;
	position: relative;
	text-decoration: none;
	transition: color 0.2s ease;
}

.anchor-nav__link::after {
	background-color: #11b7ab;
	border-radius: 999px;
	bottom: 0;
	content: '';
	height: 2px;
	left: 0;
	position: absolute;
	right: 100%;
	transition: right 0.2s ease;
}

.anchor-nav__link:hover,
.anchor-nav__link:focus-visible {
	color: #353535;
}

.anchor-nav__link.is-active {
	color: #09948a;
}

.anchor-nav__link.is-active::after {
	right: 0;
}

/* Compensates for the sticky header + anchor nav when jumping to a heading,
   whether via a click or a direct #fragment URL. The static fallback here
   already applies before anchor-nav.js measures the real heights. */
[data-anchor-label] {
	scroll-margin-top: var(--certifq-anchor-nav-scroll-offset, 112px);
}

@media (prefers-reduced-motion: reduce) {
	.anchor-nav__link::after {
		transition: none;
	}

	.anchor-nav.is-pinned {
		animation: none;
	}
}
