/**
 * Component: anchor tabs (jump links to the page's sections).
 *
 * Contact-us frame: a white strip under the hero, links centred, the active
 * one orange. Not sticky until the designer confirms: add .anchor-tabs--sticky
 * (via the cartrack_anchor_tabs_sticky filter) to make it stick under the
 * header; that class also adds its height to the #anchor scroll offset.
 * Mobile (proposal, TODO): one row that scrolls sideways; js/anchor-tabs.js
 * keeps the active tab in view. Values come from assets/css/tokens.css.
 *
 * @package cartrack
 */

.anchor-tabs {
	border-bottom: 1px solid var(--anchor-tabs-border);
	background-color: var(--anchor-tabs-bg);
	font-family: var(--font-heading);
	font-size: var(--anchor-tabs-font-size);
}

.anchor-tabs--sticky {
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--header-height));
	z-index: 50;
}

.subpage:has(.anchor-tabs--sticky) {
	--subpage-strip-sticky-height: var(--anchor-tabs-height);
}

.anchor-tabs__scroller {
	overflow-x: auto;
	scrollbar-width: none;
}

.anchor-tabs__scroller::-webkit-scrollbar {
	display: none;
}

.anchor-tabs__list {
	display: flex;
	align-items: stretch;
	gap: var(--anchor-tabs-gap);
	width: max-content;
	min-width: 100%;
	margin: 0;
	padding: 0 var(--container-gutter);
	list-style: none;
}

.anchor-tabs__item {
	display: flex;
}

.anchor-tabs__link {
	display: flex;
	align-items: center;
	min-height: var(--anchor-tabs-height);
	color: var(--anchor-tabs-text);
	text-decoration: none;
	white-space: nowrap;
	transition: color var(--transition-fast);
}

/* TODO: verify hover and active states in Figma (only orange active text is shown). */
.anchor-tabs__link:hover,
.anchor-tabs__link[aria-current="true"] {
	color: var(--anchor-tabs-active);
}

.anchor-tabs__link:focus-visible {
	outline: 2px solid var(--color-focus-dark);
	outline-offset: -2px;
}

@media (min-width: 48em) { /* --bp-md */
	.anchor-tabs__list {
		justify-content: center;
	}
}
