/* Eddan — site chrome: header, navigation, mega panel, breadcrumb, footer.
   Tokens come from tokens.css. The .eddan-btn base is duplicated verbatim from the
   design system's selectors.css so the chrome renders correctly on pages Breakdance
   does not touch (404, search, the fallback template). The declarations are identical,
   so load order between the two files does not matter. */

/* ---------- base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html { background: var(--color-paper); }

body {
	margin: 0;
	background: var(--color-paper);
	color: var(--color-ink);
	font-family: var(--font-sans);
	-webkit-font-smoothing: antialiased;
	text-wrap: pretty;
}

a {
	color: inherit;
	text-decoration: none;
	transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

a:hover { color: var(--color-brass); }
a:focus-visible { outline: 2px solid var(--color-brass); outline-offset: 3px; }

img, svg, video { display: block; max-width: 100%; }

::selection { background: var(--color-brass-light); color: var(--color-ink); }

.eddan-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100;
	padding: 12px 20px;
	background: var(--color-ink);
	color: var(--color-paper);
	font-size: var(--text-ui);
}

.eddan-skip:focus {
	left: 0;
	color: var(--color-paper);
}

.eddan-eyebrow {
	margin: 0 0 10px;
	font-size: var(--text-eyebrow);
	letter-spacing: var(--tracking-eyebrow);
	text-transform: uppercase;
	color: var(--color-brass);
}

/* ---------- buttons (mirrors selectors.css) ---------- */

.eddan-btn {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	font-family: var(--font-sans);
	font-size: 15px;
	line-height: 1;
	padding: 15px 26px;
	border: 1px solid transparent;
	border-radius: var(--radius-pill);
	white-space: nowrap;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.eddan-btn[data-style="solid"]   { color: var(--color-paper); background-color: var(--color-ink); }
.eddan-btn[data-style="solid"]:hover  { color: var(--color-paper); background-color: var(--color-brass); }
.eddan-btn[data-style="outline"] { color: inherit; border-color: var(--color-rule-strong); }
.eddan-btn[data-style="outline"]:hover { color: var(--color-paper); background-color: var(--color-ink); border-color: var(--color-ink); }
.eddan-btn[data-style="light"]   { color: var(--color-ink); background-color: var(--color-paper); }
.eddan-btn[data-style="light"]:hover  { color: var(--color-ink); background-color: var(--color-brass-light); }

/* Header-sized variant: the design kit uses 13px / 10px 16-18px in the header only. */
.eddan-btn--sm { font-size: var(--text-small); padding: 10px 18px; }
.eddan-btn--sm[data-style="outline"] { padding: 10px 16px; }

/* ---------- header ---------- */

.eddan-header {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
	padding: 22px var(--page-gutter);
	border-bottom: 1px solid var(--color-rule);
	background: var(--color-paper);
}

.eddan-header__logo { display: flex; align-items: center; flex: 0 0 auto; }
.eddan-header__logo img { height: 38px; width: auto; }

.eddan-header__actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

/* ---------- navigation ---------- */

.eddan-nav {
	display: flex;
	align-items: center;
	gap: 34px;
	font-size: var(--text-ui);
	letter-spacing: .01em;
}

.eddan-nav__group { display: flex; align-items: center; }

.eddan-nav__link {
	position: relative;
	display: inline-flex;
	align-items: center;
	padding-bottom: 3px;
}

.eddan-nav__link::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 1px;
	background: var(--color-brass);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .2s ease;
}

/* Both "page" (this page) and "true" (an ancestor of it) keep the underline on. */
.eddan-nav__link:hover::after,
.eddan-nav__link[aria-current]::after { transform: scaleX(1); }

.eddan-nav__caret {
	display: inline-block;
	width: 6px;
	height: 6px;
	margin: 0 0 3px 7px;
	border-right: 1px solid currentColor;
	border-bottom: 1px solid currentColor;
	transform: rotate(45deg);
}

/* ---------- mega panel ---------- */

.eddan-nav__panel {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: 5;
	display: grid;
	grid-template-columns: 260px 1fr 1fr 1fr;
	gap: var(--space-4);
	padding: 36px var(--page-gutter) 40px;
	background: var(--color-paper);
	border-bottom: 1px solid var(--color-rule);
	box-shadow: 0 24px 40px -24px rgba(28, 26, 23, .25);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

.eddan-nav__group:hover > .eddan-nav__panel,
.eddan-nav__group:focus-within > .eddan-nav__panel {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.eddan-nav__panel-lede {
	margin: 0;
	font-family: var(--font-serif);
	font-size: var(--text-h3);
	line-height: 1.15;
}

.eddan-nav__col { display: flex; flex-direction: column; font-size: var(--text-body); }

.eddan-nav__col-title {
	margin: 0 0 8px;
	font-size: var(--text-eyebrow);
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--color-muted);
}

.eddan-nav__col a {
	padding: 8px 0;
	border-bottom: 1px solid rgba(28, 26, 23, .1);
	transition: padding-left .15s ease, color .15s ease;
}

.eddan-nav__col a:last-child { border-bottom: 0; }
.eddan-nav__col a:hover { padding-left: 6px; }

/* ---------- footer ---------- */

.eddan-footer {
	margin-top: auto;
	padding: 48px var(--page-gutter) 32px;
	border-top: 1px solid var(--color-rule);
	font-size: var(--text-ui);
	line-height: 1.6;
	color: var(--color-ink-3);
}

/* The footer band spans the viewport so its rules reach edge to edge, but its contents
   stay inside the same measure as the rest of the page. Without this the columns kept
   spreading past --page-max on wide screens while the content above them stopped. */
.eddan-footer__cols,
.eddan-footer__bar {
	max-width: var(--page-max);
	margin-right: auto;
	margin-left: auto;
	width: 100%;
}

.eddan-footer__cols {
	display: grid;
	grid-template-columns: 1.5fr 1.1fr 1.1fr .85fr .8fr;
	gap: var(--space-2) var(--space-3);
}

.eddan-footer__col { display: flex; flex-direction: column; }
.eddan-footer__col p { margin: 0 0 12px; }
.eddan-footer__col > a { padding: 3px 0; }

/* align-self is the fix for the logo sitting indented from the address beneath it: the
   column is a stretching flex container, so width:auto resolved to the full column width
   (342px). The SVG then letterboxed inside that box and centred itself. */
.eddan-footer__logo {
	height: 34px;
	width: auto;
	align-self: flex-start;
	margin-bottom: 18px;
}
.eddan-footer__title { color: var(--color-ink); margin-bottom: 10px !important; }
.eddan-footer__label { font-size: var(--text-small); color: var(--color-muted); }

.eddan-footer__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
	margin-top: var(--space-4);
	padding-top: var(--space-2);
	border-top: 1px solid var(--color-rule);
	font-size: var(--text-eyebrow);
	color: var(--color-muted-2);
}

.eddan-footer__sponsor { display: inline-flex; align-items: center; gap: 14px; }
.eddan-footer__sponsor img { height: 52px; width: auto; }

/* ---------- fallback template ---------- */

.eddan-fallback {
	max-width: 760px;
	margin: 0 auto;
	padding: var(--space-6) var(--page-gutter);
}

.eddan-fallback h1 {
	font-family: var(--font-serif);
	font-weight: 400;
	font-size: var(--text-h1-article);
	line-height: 1.02;
	letter-spacing: var(--tracking-display);
	margin: 0 0 var(--space-3);
}

/* ---------- responsive ----------
   Type and gutters scale through the tokens. The nav no longer wraps to its own row
   below the desktop breakpoint — it moves behind the disclosure button; see the
   small-screen menu section at the end of this file. */

@media (max-width: 1119px) {
	.eddan-footer__cols { grid-template-columns: 1fr 1fr; gap: var(--space-3); }
}

@media (max-width: 767px) {
	.eddan-header__logo img { height: 32px; }
	.eddan-footer__cols { grid-template-columns: 1fr; }
	.eddan-footer__bar { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
	.eddan-nav__link::after,
	.eddan-nav__panel,
	.eddan-nav__col a { transition: none; }
}

/* ---------- template overrides ----------
   The facts list is a real <dl> in the theme (it was nested divs in the builder), so
   the browser's default list margins need clearing. Everything else about
   .eddan-laureate__facts comes from the design system stylesheet. */

dl.eddan-laureate__facts { margin: 0; }
dl.eddan-laureate__facts dd { margin: 0; }


/* ---------- image aspect ratios ----------
   the_post_thumbnail() and wp_get_attachment_image() emit width and height attributes.
   Two definite dimensions make the design system's aspect-ratio rules inert, so images
   rendered at their natural ratio — card images came out anywhere from 449px to 683px tall
   in a 308px column instead of 205px, which is why the cards in a grid had unequal heights.
   The element+class selectors also outrank Smush's `.lazyload { aspect-ratio: ... }`, which
   otherwise substitutes each image's own ratio. */

img.eddan-card__img,
img.eddan-article__img,
img.eddan-laureate__portrait,
img.eddan-media__img { height: auto; }

img.eddan-card__img { aspect-ratio: 3 / 2; }
.eddan-cards[data-ratio="4/5"]  img.eddan-card__img { aspect-ratio: 4 / 5; }
.eddan-cards[data-ratio="1/1"]  img.eddan-card__img { aspect-ratio: 1 / 1; }
.eddan-cards[data-ratio="16/9"] img.eddan-card__img { aspect-ratio: 16 / 9; }

img.eddan-article__img       { aspect-ratio: 16 / 9; }
img.eddan-laureate__portrait { aspect-ratio: 4 / 5; }

/* Equal-height cards. Fixing the ratios made every image the same height, but the text
   under it still wraps to a different number of lines from card to card, so rows ended up
   293px, 313px and 332px on Verðlaunin. grid-auto-rows:1fr sizes every row to the tallest
   and the cards stretch into it, so titles stay top-aligned and the blocks line up.
   Only for grids: a carousel flows by column and has no rows to equalise. */
.eddan-cards[data-display="grid"] .eddan-cards__grid { grid-auto-rows: 1fr; }
.eddan-cards__grid > .eddan-card { align-self: stretch; }


/* The news index's "Eldri fréttir" control, centred under the grid as the design kit has
   it. .eddan-btn itself comes from the design system. */
.eddan-cards__more {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-top: var(--space-4);
}


/* ---------- page measure ----------
   --page-max has always been 1440px, but only .eddan-footer__cols / __bar honoured it.
   On anything wider the sections kept spreading to the viewport while the footer
   stopped, so the page lost its measure on large screens.

   The measure to match is the footer's: content 1440px wide, centred, which at 1920px
   puts every content edge at x=240.

   Sections fall into four shapes, by whether they carry a gutter of horizontal padding
   and whether they are already inset by a margin. These lists were built by measuring
   the rendered padding and margin of every top-level section across the site, not by
   reading the stylesheet — getting a section into the wrong group leaves its text one
   gutter (56px) out of line with the header and footer, which is exactly the bug the
   first attempt at this shipped. A new section needs adding to the right list.

   .eddan-article keeps its own narrower measure and is deliberately absent. */

/* 1. Gutter of padding, no margin — cap allows for the padding inside. */
main > .eddan-hero,
main > .eddan-ehero,
main > .eddan-prose,
main > .eddan-media,
main > .eddan-contact,
main > .eddan-map,
main > .eddan-jury,
main > .eddan-rollsec,
main > .eddan-feat,
main > .eddan-laureate,
main > .eddan-formpage,
main > .eddan-awards,
main > .eddan-film,
main > .eddan-cards[data-display="carousel"],
main > .eddan-archive,
main > .eddan-boardsec {
	width: 100%;
	max-width: calc(var(--page-max) + var(--page-gutter) * 2);
	margin-inline: auto;
}

/* .eddan-archive and .eddan-boardsec had no horizontal padding and no child supplying
   one, so their text sat flush against the viewport edge at every width. Given the
   gutter the rest of the page uses, which also moves them into group 1 above. */
main > .eddan-archive,
main > .eddan-boardsec {
	padding-inline: var(--page-gutter);
}

/* 2. No horizontal padding — the element edge is the content edge, so cap at the
      measure itself. */
main > .eddan-links,
main > .eddan-subsec {
	width: 100%;
	max-width: var(--page-max);
	margin-inline: auto;
}

/* 3. Already inset by a gutter-wide margin and carrying no padding — grow the margin
      rather than capping, so the inset survives below the breakpoint. */
main > .eddan-emedia,
main > .eddan-efacts,
main > .eddan-pager {
	margin-inline: max(var(--page-gutter), calc((100% - var(--page-max)) / 2));
}

/* 4. .eddan-cta is the one inset card that also pads itself, so its margin has to leave
      room for that padding on top of the measure. */
main > .eddan-cta {
	margin-inline: max(
		var(--page-gutter),
		calc((100% - var(--page-max) - var(--page-gutter) * 2) / 2)
	);
}

/* The header and the breadcrumbs each carry a rule (and the header a paper band) meant
   to reach the viewport edge, so they keep full width and pull their contents in with
   padding instead. The breadcrumbs sit outside <main> anyway. */
.eddan-header,
.eddan-crumbs {
	padding-inline: max(var(--page-gutter), calc((100% - var(--page-max)) / 2));
}

/* .eddan-cards[data-display="grid"] is deliberately absent from all of the above: the
   card grid stays full width. The carousel is in group 1 — on the front page it reads as
   a content block rather than a full-bleed band. */

/* ---------- space above the footer ----------
   A few sections carry no bottom padding of their own because something always follows
   them. When one is the last thing on a page it ran straight into the footer — /kjorskra/
   is the clearest case, where .eddan-rollsec is `padding: 0 var(--page-gutter)`.
   Scoped to :last-child so pages where these sit mid-stack are untouched, and so the
   sections that already pad themselves do not end up double-spaced. */

main > .eddan-rollsec:last-child,
main > .eddan-archive:last-child,
main > .eddan-links:last-child,
main > .eddan-boardsec:last-child {
	padding-bottom: var(--space-5);
}

/* ---------- form controls ----------
   Radios and checkboxes were drawing in the browser's default blue because nothing set
   accent-color; the design system only ever styled text inputs and buttons. */

.gform_wrapper input[type="radio"],
.gform_wrapper input[type="checkbox"] {
	accent-color: var(--color-ink);
}

/* Focus. The design system already defines the focus state as a brass border plus a soft
   brass glow (--gf-ctrl-border-color-focus / --gf-ctrl-shadow-focus); the browser's blue
   ring was sitting on top of it. Suppressed on the controls that carry that glow, and
   replaced with a brass ring on the ones that do not — buttons, radios and checkboxes —
   so keyboard focus stays visible rather than disappearing. */

body .gform_wrapper.gform-theme input:focus,
body .gform_wrapper.gform-theme input:focus-visible,
body .gform_wrapper.gform-theme select:focus,
body .gform_wrapper.gform-theme select:focus-visible,
body .gform_wrapper.gform-theme textarea:focus,
body .gform_wrapper.gform-theme textarea:focus-visible {
	outline: none;
	border-color: var(--gf-ctrl-border-color-focus, var(--color-brass));
	box-shadow: var(--gf-ctrl-shadow-focus, 0 0 0 3px rgba(138, 106, 44, .16));
}

.gform_wrapper input[type="radio"]:focus-visible,
.gform_wrapper input[type="checkbox"]:focus-visible,
.gform_wrapper button:focus-visible,
.gform_wrapper .gform_button:focus-visible,
.gform_wrapper a:focus-visible {
	outline: 2px solid var(--color-brass);
	outline-offset: 2px;
}

/* ---------- running total ----------
   Appended to the form by eddan-innsending-interim.php. */

.eddan-total {
	margin-top: var(--space-3);
	padding: var(--space-2) var(--space-3);
	border: 1px solid var(--color-rule-strong);
	border-radius: 3px;
	background: #fffdf8;
	font-family: var(--font-sans);
}

.eddan-total__row {
	display: flex;
	justify-content: space-between;
	gap: var(--space-2);
	color: var(--color-ink-2);
	font-size: var(--text-small);
	padding: 2px 0;
}

.eddan-total__row--sum {
	margin-top: 6px;
	padding-top: 8px;
	border-top: 1px solid var(--color-rule);
	color: var(--color-ink);
	font-size: var(--text-body);
}

.eddan-total__note {
	margin: 6px 0 0;
	color: var(--color-muted);
	font-size: var(--text-small);
}

/* ---------- footer social ---------- */

.eddan-footer__social {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.eddan-footer__social svg,
.eddan-contact__social svg {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	fill: currentColor;
}

.eddan-contact__social {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: var(--space-1);
}

/* Radios and checkboxes. Setting accent-color directly loses to Gravity Forms' own
   `.gform-theme--framework input[type="radio"]:where(...)` rule — :where() contributes no
   specificity, so both selectors weigh the same and the framework stylesheet, loading
   later, wins. Setting the token it reads is both cleaner and how the rest of the form is
   themed. */

body .gform_wrapper.gform-theme {
	--gf-ctrl-accent-color: var(--color-ink);
	--gf-ctrl-choice-check-color: var(--color-ink);
}

/* Section headings on the submission form ("Verkið", "Tengiliður", …). Gravity Forms
   renders these as h3.gsection_title at roughly 17px, which read as labels rather than
   as the section breaks they are on a form this long. Scoped to the form page so the
   contact form keeps its own scale. */

body .eddan-formpage .gsection_title {
	font-size: 2rem;
	line-height: 1.2;
	letter-spacing: var(--tracking-display);
}

body .eddan-formpage .gfield--type-section {
	margin-top: var(--space-3);
}

body .eddan-formpage .gfield--type-section:first-child {
	margin-top: 0;
}

/* Award rows on an edition page. .eddan-awards__list already draws a solid rule across
   its top, and every .eddan-results row carries a hairline of its own, so the first row
   doubled it. The row separators matter between rows, not above the first one. */

.eddan-awards__list > .eddan-results:first-child {
	border-top: 0;
}


/* ---------- interim submission page ----------
   /innsending-2027/ is rendered by page-innsending-2027.php rather than the ACF
   dispatcher, so it needs the section padding the flexible layouts carry themselves.
   The form markup reuses .eddan-contact__form, which is where the .gform_* layout rules
   in design-system.css are scoped.

   The --gf-* block below is a copy of the `body #gform_wrapper_1.gform-theme` rule in
   design-system.css. That file is generated from the Breakdance export and must not be
   hand-edited, and Gravity Forms sets its own defaults directly on the wrapper element,
   so the tokens cannot simply be inherited from an ancestor — form 2 needs its own copy
   to look like the contact form. Keep the two in step. */

.eddan-formpage {
	padding: var(--space-6) var(--page-gutter) var(--space-5);
}

.eddan-formpage .eddan-contact__form {
	max-width: 760px;
}

body #gform_wrapper_2.gform-theme {
	--gf-color-primary:var(--color-ink);
	--gf-color-primary-rgb:28,26,23;
	--gf-color-primary-darker:var(--color-brass);
	--gf-color-primary-lighter:var(--color-brass-light);
	--gf-color-primary-contrast:var(--color-paper);
	--gf-radius:3px;
	--gf-ctrl-size:auto;
	--gf-ctrl-bg-color:#fffdf8;
	--gf-ctrl-bg-color-hover:#fffdf8;
	--gf-ctrl-bg-color-focus:#fff;
	--gf-ctrl-border-color:var(--color-rule-strong);
	--gf-ctrl-border-color-hover:var(--color-ink-3);
	--gf-ctrl-border-color-focus:var(--color-brass);
	--gf-ctrl-border-width:1px;
	--gf-ctrl-color:var(--color-ink-2);
	--gf-ctrl-font-family:var(--font-sans);
	--gf-ctrl-font-size:var(--text-body);
	--gf-ctrl-line-height:1.45;
	--gf-ctrl-padding-x:15px;
	--gf-ctrl-padding-y:13px;
	--gf-ctrl-placeholder-color:var(--color-muted-2);
	--gf-ctrl-placeholder-font-family:var(--font-sans);
	--gf-ctrl-placeholder-font-size:var(--text-body);
	--gf-ctrl-shadow-focus:0 0 0 3px rgba(138,106,44,.16);
	--gf-ctrl-label-color-primary:var(--color-muted);
	--gf-ctrl-label-font-family-primary:var(--font-sans);
	--gf-ctrl-label-font-size-primary:var(--text-small);
	--gf-ctrl-label-font-weight-primary:400;
	--gf-ctrl-label-color-req:var(--color-brass);
	--gf-ctrl-label-font-size-req:var(--text-small);
	--gf-ctrl-btn-bg-color-primary:var(--color-ink);
	--gf-ctrl-btn-bg-color-hover-primary:var(--color-brass);
	--gf-ctrl-btn-bg-color-focus-primary:var(--color-brass);
	--gf-ctrl-btn-border-color-primary:var(--color-ink);
	--gf-ctrl-btn-border-color-hover-primary:var(--color-brass);
	--gf-ctrl-btn-border-color-focus-primary:var(--color-brass);
	--gf-ctrl-btn-color-primary:var(--color-paper);
	--gf-ctrl-btn-color-hover-primary:var(--color-paper);
	--gf-ctrl-btn-color-focus-primary:var(--color-paper);
	--gf-ctrl-btn-font-family:var(--font-sans);
	--gf-ctrl-btn-font-size:var(--text-ui);
	--gf-ctrl-btn-font-weight:500;
	--gf-ctrl-btn-radius:var(--radius-pill);
	--gf-ctrl-btn-padding-x:26px;
	--gf-ctrl-btn-padding-y:14px;
	--gf-ctrl-btn-shadow:none;
	--gf-ctrl-btn-shadow-hover:none;
	--gf-ctrl-btn-size:auto;
}

/* ---------- small-screen menu ----------
   Above 1119px the nav sits across the header and the mega panels open on hover, which
   is unchanged. Below it the menu moves behind a disclosure button: the nav and the
   header actions share one panel, and each mega panel becomes an accordion.

   State lives on aria-expanded — on .eddan-burger for the panel and on each
   .eddan-nav__toggle for its section — so the CSS and assistive technology read the
   same attribute rather than a class that could drift from it. */

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* display:contents keeps the nav and the actions as direct flex children of the header
   on desktop, so wrapping them changes nothing above the breakpoint. */
.eddan-header__menu { display: contents; }

.eddan-burger,
.eddan-nav__toggle { display: none; }

@media (max-width: 1119px) {

	.eddan-header {
		position: relative;
		flex-wrap: nowrap;
		row-gap: 0;
	}

	.eddan-burger {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin-right: calc(var(--page-gutter) * -0.35);
		padding: 0;
		background: none;
		border: 0;
		color: var(--color-ink);
		cursor: pointer;
	}

	/* Three rules that fold into a cross, drawn from one element so there is no extra
	   markup: the bar itself plus its two pseudo-elements. */
	.eddan-burger__bars,
	.eddan-burger__bars::before,
	.eddan-burger__bars::after {
		display: block;
		width: 22px;
		height: 1px;
		background: currentColor;
		transition: transform .22s ease, opacity .15s ease;
	}

	.eddan-burger__bars { position: relative; }

	.eddan-burger__bars::before,
	.eddan-burger__bars::after {
		content: "";
		position: absolute;
		left: 0;
	}

	.eddan-burger__bars::before { top: -7px; }
	.eddan-burger__bars::after  { top: 7px; }

	.eddan-burger[aria-expanded="true"] .eddan-burger__bars { background: transparent; }
	.eddan-burger[aria-expanded="true"] .eddan-burger__bars::before { transform: translateY(7px) rotate(45deg); }
	.eddan-burger[aria-expanded="true"] .eddan-burger__bars::after  { transform: translateY(-7px) rotate(-45deg); }

	/* The panel starts under the header — whose height the script measures into
	   --eddan-header-h — and takes the rest of the viewport so long menus scroll
	   inside it rather than moving the page behind. */
	.eddan-header__menu {
		display: block;
		position: fixed;
		inset: var(--eddan-header-h, 76px) 0 0;
		z-index: 30;
		padding: var(--space-3) var(--page-gutter) var(--space-5);
		overflow-y: auto;
		overscroll-behavior: contain;
		background: var(--color-paper);
		border-top: 1px solid var(--color-rule);
		opacity: 0;
		visibility: hidden;
		transform: translateY(-8px);
		transition: opacity .2s ease, transform .2s ease, visibility .2s;
	}

	.eddan-burger[aria-expanded="true"] + .eddan-header__menu {
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.eddan-nav {
		display: block;
		font-size: inherit;
	}

	.eddan-nav__group {
		display: grid;
		grid-template-columns: 1fr auto;
		align-items: center;
	}

	/* Top-level items read as headings at this size, so they take the display face. */
	.eddan-nav__link {
		padding: 14px 0;
		font-family: var(--font-serif);
		font-size: var(--text-h3);
		line-height: 1.1;
		border-bottom: 1px solid var(--color-rule);
	}

	.eddan-nav > a.eddan-nav__link { display: block; }
	.eddan-nav__group > .eddan-nav__link { border-bottom: 0; }

	/* The caret inside the link is the desktop hover affordance; on a phone the button
	   beside it is what opens the panel. */
	.eddan-nav__link .eddan-nav__caret { display: none; }

	.eddan-nav__group { border-bottom: 1px solid var(--color-rule); }

	.eddan-nav__toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		background: none;
		border: 0;
		color: var(--color-ink);
		cursor: pointer;
	}

	.eddan-nav__toggle .eddan-nav__caret {
		margin: 0 0 3px;
		transition: transform .2s ease;
	}

	.eddan-nav__toggle[aria-expanded="true"] .eddan-nav__caret {
		transform: rotate(-135deg);
		margin-bottom: -3px;
	}

	/* The panel is a plain block in the flow here, not the floating desktop card. */
	.eddan-nav__panel {
		position: static;
		grid-column: 1 / -1;
		display: none;
		grid-template-columns: 1fr;
		gap: var(--space-2);
		padding: 0 0 var(--space-2);
		background: none;
		border-bottom: 0;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: none;
	}

	.eddan-nav__toggle[aria-expanded="true"] ~ .eddan-nav__panel { display: grid; }

	/* Hover must not reopen the panel once the accordion is in charge, or a stray
	   pointer leaves it stuck open with the button still reporting collapsed. */
	.eddan-nav__group:hover > .eddan-nav__panel,
	.eddan-nav__group:focus-within > .eddan-nav__panel {
		opacity: 1;
		visibility: visible;
	}

	.eddan-nav__panel-intro { display: none; }

	.eddan-nav__col a { padding: 10px 0; }

	.eddan-header__actions {
		display: flex;
		flex-wrap: wrap;
		gap: 10px;
		margin-top: var(--space-3);
	}

	.eddan-header__actions .eddan-btn { flex: 1 1 auto; justify-content: center; }

	/* Hold the page still behind the panel. */
	html.eddan-menu-open,
	html.eddan-menu-open body { overflow: hidden; }
}

@media (max-width: 1119px) and (prefers-reduced-motion: reduce) {
	.eddan-header__menu,
	.eddan-burger__bars,
	.eddan-burger__bars::before,
	.eddan-burger__bars::after,
	.eddan-nav__toggle .eddan-nav__caret { transition: none; }
}
