/* Restaurant sub-nav (ManO2 Figma 1:1525, Kaptol 1:2225): a 44px warm-white bar under the hero
   with links to the page's sections. When it reaches the header pill, the pill slides away and
   the bar sticks to the top; scrolled back up, the bar returns to its place and the pill comes
   back (mano-core/assets/js/mano-subnav.js sets body.has-subnav-stuck and marks the current link).
   Colours follow the restaurant: ManO2 by default, Kaptol when the page uses the Kaptol section style. */

.mano-subnav {
	--mano-subnav-current: var(--wp--preset--color--dark-kaptol);
	--mano-subnav-link: var(--wp--preset--color--kaptol);
}

body:has(.is-style-section-kaptol) .mano-subnav {
	--mano-subnav-current: var(--wp--preset--color--kaptol);
	--mano-subnav-link: var(--wp--preset--color--beige);
}

.mano-subnav.mano-subnav {
	position: sticky;
	z-index: 90; /* under the header pill (100) */
	top: var(--wp-admin--admin-bar--height, 0px);
	box-sizing: border-box;
	height: 44px;
	margin-block: 0;
	border-bottom: 0.5px solid var(--wp--preset--color--kaptol);
	background: var(--wp--preset--color--topla-bijela);
}

/* One line of links; on narrow screens the line scrolls sideways inside the bar. */
.mano-subnav__list.mano-subnav__list {
	display: flex;
	gap: 28px;
	height: 100%;
	margin: 0;
	padding: 0 var(--wp--preset--spacing--gutter);
	overflow-x: auto;
	list-style: none;
	scrollbar-width: none;
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	line-height: normal;
	white-space: nowrap;
	-webkit-font-smoothing: antialiased; /* grayscale, like Figma's render (see the footer) */
	-moz-osx-font-smoothing: grayscale;
}

.mano-subnav__list::-webkit-scrollbar {
	display: none;
}

.mano-subnav__list li {
	display: flex;
	flex: none;
	align-items: center;
	margin: 0;
}

.mano-subnav__list a {
	color: var(--mano-subnav-link);
	text-decoration: none;
	transition: color 0.2s ease;
}

.mano-subnav__list a[aria-current],
.mano-subnav__list a:hover,
.mano-subnav__list a:focus-visible {
	color: var(--mano-subnav-current);
}

/* Section links land just under the stuck bar. */
body:has(.mano-subnav) [id] {
	scroll-margin-top: calc(44px + var(--wp-admin--admin-bar--height, 0px));
}

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

	body:has(.mano-subnav) .mano-header {
		transition: top 0.35s ease, opacity 0.35s ease, visibility 0s linear 0s;
	}

	body.has-subnav-stuck .mano-header {
		transition: top 0.35s ease, opacity 0.35s ease, visibility 0s linear 0.35s;
	}
}

/* The pill moves up out of the screen (its own height plus its 32px offset). */
:where(body.has-subnav-stuck:not(.editor-styles-wrapper)) .mano-header {
	top: -100px;
	opacity: 0;
	visibility: hidden;
}

/* Standard-density screens draw a 0.5px rule as a full pixel; half the colour keeps Figma's weight. */
@media (max-resolution: 1.5dppx) {
	.mano-subnav.mano-subnav {
		border-bottom-color: color-mix(in srgb, var(--wp--preset--color--kaptol) 50%, transparent);
	}
}
