---
/**
* Header — the logo, the main links and an optional action button. Below
* 860px the links move into a full-screen menu opened by a menu button.
* logo: { href, label, svg? } — label names the link; the mark is the
* `logo` slot (an
, say) or an svg string.
* links: { href, label }[] — the main links.
* action: { href, label } — drawn as a secondary Button with an arrow.
* root: prefix for every href; '/' on pages in a folder.
* Behaviour (the script below): the header gets .scrolled once the page
* scrolls and .is-hidden while reading down; same-page links get
* aria-current for the section in view and scroll smoothly; the menu
* button opens and closes the menu, and Escape closes it.
*/
import Button from './Button.astro';
import MenuButton from './MenuButton.astro';
interface Link { href: string; label: string }
interface Props {
logo: { href: string; label: string; svg?: string };
links?: Link[];
action?: { href: string; label: string };
root?: string;
}
const { logo, links = [], action, root = '' } = Astro.props;
---
{/* The script comes first, so the header stays next to what follows it (the site reads .site-header:has(+ main …)). */}