/* Edumeal navigation (edumeal-navigation.php): header menu + hamburger, footer site map.
   Header post 23 ([edumeal_header_menu]), footer post 25 ([edumeal_footer_sitemap]).
   The !important colour locks beat the site-wide a:hover colour (turquoise): menu links keep
   their white / navy colour on hover and only get the underline (approved 2026-11-12). */

/* ---------- header ---------- */
.site-header { position: relative; z-index: 1000; }
/* the Oxygen Shortcode wrapper and ours: their children sit straight in the header flex row */
.site-header__inner > :has(> .edumeal-header-menu),
.edumeal-header-menu { display: contents; }

.edumeal-nav { display: flex; align-items: center; gap: 24px; flex: 0 0 auto; }
@media (max-width: 1119px) { .edumeal-nav { gap: 20px; } }
.edumeal-nav__item { position: relative; }
.edumeal-nav__top { font-family: var(--font-body); font-weight: 600; font-size: var(--text-medium); line-height: 1.4; text-decoration: none; white-space: nowrap; background: none; border: 0; padding: 6px 0; margin: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.edumeal-nav__top:hover,
.edumeal-nav__top[aria-expanded="true"] { text-decoration: underline; text-underline-offset: 6px; }
.edumeal-nav__top[aria-current],
.edumeal-nav__top.is-current { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.edumeal-nav__caret { width: 12px; height: 12px; transition: transform .15s; }
.edumeal-nav__top[aria-expanded="true"] .edumeal-nav__caret { transform: rotate(180deg); }

/* dropdown: as wide as its content, centred under its menu item */
.edumeal-nav__panel { display: none; position: absolute; top: calc(100% + 18px); left: 50%; transform: translateX(-50%); width: max-content; background: var(--primary-white); border-radius: 16px; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); padding: 24px 28px; gap: 48px; z-index: 1001; }
.edumeal-nav__panel::before { content: ""; position: absolute; left: 0; right: 0; top: -18px; height: 18px; } /* hover bridge over the gap */
.edumeal-nav__item.is-open .edumeal-nav__panel { display: flex; }
.edumeal-nav__item:last-child .edumeal-nav__panel { left: auto; right: 0; transform: none; }
.edumeal-nav__col { display: flex; flex-direction: column; gap: 6px; }
.edumeal-nav__coltitle { font-family: var(--font-body); font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-darker, #555); margin: 0 0 4px; white-space: nowrap; }
.edumeal-nav__link { font-family: var(--font-body); font-weight: 600; font-size: var(--text-regular); line-height: 1.4; text-decoration: none; padding: 4px 0; white-space: nowrap; }
.edumeal-nav__link:hover,
.edumeal-nav__link[aria-current] { text-decoration: underline; }

/* hamburger + full menu panel */
.edumeal-burger { display: none; flex: 0 0 auto; width: 48px; height: 48px; margin-right: -8px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--primary-white); cursor: pointer; align-items: center; justify-content: center; }
.edumeal-burger svg { width: 32px; height: 32px; display: block; }
.edumeal-burger__close,
.edumeal-burger[aria-expanded="true"] .edumeal-burger__open { display: none; }
.edumeal-burger[aria-expanded="true"] .edumeal-burger__close { display: block; }
.edumeal-burger:focus-visible,
.edumeal-nav__top:focus-visible { outline: 2px solid var(--primary-white); outline-offset: 3px; }

.edumeal-drawer { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--primary-white); /* no shadow: white on the white layer (Michael, 2026-11-14) */ max-height: calc(100dvh - var(--edumeal-nav-header-h, 96px)); overflow: auto; z-index: 1001; padding: 8px 24px 32px; }
.edumeal-drawer__grid { display: grid; grid-template-columns: 1fr; column-gap: 32px; }
.edumeal-drawer__group { padding: 16px 0; border-bottom: 1px solid rgba(35, 97, 146, .15); }
.edumeal-drawer__title { font-family: var(--font-body); font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-darker, #555); margin: 0 0 6px; }
.edumeal-drawer__link { display: block; font-family: var(--font-body); font-weight: 600; font-size: var(--text-medium); line-height: 1.4; text-decoration: none; padding: 8px 0; }
.edumeal-drawer__link:hover,
.edumeal-drawer__link[aria-current] { text-decoration: underline; }
@media (min-width: 600px) {
	.edumeal-drawer { padding-inline: 40px; }
	.edumeal-drawer__grid { grid-template-columns: 1fr 1fr; }
}

/* compact = hamburger instead of the bar: set by navigation.js as soon as the bar would wrap
   under the logo; the media query below gives phones the same state before the script runs */
.site-header.edumeal-nav-compact .site-header__inner { flex-wrap: nowrap; }
.site-header.edumeal-nav-compact .edumeal-nav { display: none; }
.site-header.edumeal-nav-compact .edumeal-burger { display: inline-flex; }
.site-header.edumeal-nav-drawer-open .edumeal-drawer { display: block; }

/* open hamburger (Michael, 2026-11-14): the page underneath can't move or be touched.
   navigation.js locks scrolling (overflow: hidden, a touch guard and a scroll guard that puts
   the page straight back). Nothing is pinned to the screen: Safari 26 takes its bar colour from
   a pinned element at the screen edge and keeps it until reload, and pinned parts drift apart
   from page content during a pinch. So the panel and the dim layer hang in the page directly
   under the header (absolute, inside it); with the page locked they look pinned, and during a
   pinch they move together with the header as one piece. The layer under the panel is opaque
   white, so nothing of the page shows or flickers through. The panel is as tall as the rest of
   the screen (--edumeal-nav-drawer-top = the header's bottom edge on open) and scrolls on its own
   without handing the scroll on; the white layer runs far down, so a pinch-out shows white, not
   page. Pinch-zoom stays allowed (accessibility); manipulation only drops double-tap zoom. */
html.edumeal-nav-locked,
html.edumeal-nav-locked body { overflow: hidden; }
.edumeal-nav-backdrop { display: none; position: absolute; top: 100%; left: 0; right: 0; height: 300vh; z-index: 1000; background: var(--primary-white, #fff); touch-action: manipulation; } /* opaque white (Michael, 2026-11-14): a see-through dim let the page flicker through during a pinch */
html.edumeal-nav-locked .edumeal-nav-backdrop { display: block; }
html.edumeal-nav-locked .site-header.edumeal-nav-drawer-open { touch-action: manipulation; }
/* top: 100% of the header's padding box = the top of its 2px white bottom border, so the panel
   covers that border (white on white) and no seam can show. */
html.edumeal-nav-locked .site-header.edumeal-nav-drawer-open .edumeal-drawer { position: absolute; top: 100%; max-height: calc(100dvh - var(--edumeal-nav-drawer-top, 96px) + 2px); overflow-y: auto; overscroll-behavior: contain; touch-action: manipulation; -webkit-overflow-scrolling: touch; }
/* "there's more below" (Michael, 2026-11-14): an 84px fade over the bottom edge of the open
   panel, reaching 85% white and only the last few pixels fully white, so the text softly disappears. Its strength follows the distance
   to the end of the list (--edumeal-nav-fade, set by navigation.js: 1 while more than 84px is
   left, falling to 0 at the end), so it eases out and back in with the finger instead of
   switching. */
html.edumeal-nav-locked .edumeal-drawer::after { content: ""; position: sticky; bottom: -32px; display: block; height: 84px; margin: -84px -24px -32px; background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, .85) 80%, var(--primary-white, #fff)); pointer-events: none; opacity: var(--edumeal-nav-fade, 1); transition: opacity .08s linear; }
@media (min-width: 600px) { html.edumeal-nav-locked .edumeal-drawer::after { margin-inline: -40px; } }
@media (max-width: 1023px) {
	.site-header .site-header__inner { flex-wrap: nowrap; }
	.site-header .edumeal-nav { display: none; }
	.site-header .edumeal-burger { display: inline-flex; }
}

/* colour locks */
html .edumeal-nav a.edumeal-nav__top,
html .edumeal-nav a.edumeal-nav__top:is(:link, :visited, :hover, :focus, :active),
html .edumeal-nav button.edumeal-nav__top,
html .edumeal-nav button.edumeal-nav__top:is(:hover, :focus, :active) { color: var(--primary-white) !important; }
html .edumeal-nav a.edumeal-nav__link,
html .edumeal-nav a.edumeal-nav__link:is(:link, :visited, :hover, :focus, :active),
html .edumeal-drawer a.edumeal-drawer__link,
html .edumeal-drawer a.edumeal-drawer__link:is(:link, :visited, :hover, :focus, :active) { color: var(--primary-blue-dark) !important; }

/* ---------- footer site map ---------- */
.footer-columns > :has(> .edumeal-sitemap),
.edumeal-sitemap { display: contents; }
.footer-columns:has(.edumeal-sitemap) { flex-wrap: wrap; gap: 24px 40px; }
.edumeal-sitemap .footer-links { max-width: 220px; }
html .edumeal-sitemap a.footer-links__link:is(:link, :visited, :hover, :focus, :active) { color: var(--gray-darker) !important; }
/* Tablet and small laptops (768–1279 px; Michael's colleagues, 2026-11-14): the four columns
   (722 px with the social icons) no longer fit beside the newsletter, so they used to wrap
   under it. Now the site map stays on the right of the newsletter, its columns 2 and 2 (as on
   phones), the social icons in a third column at the top right. :has() makes these rules
   outrank the Oxygen selectors (.site-footer__inner, .footer-newsletter, .footer-columns)
   whatever order the stylesheets load in. */
@media (min-width: 768px) and (max-width: 1279px) {
	.site-footer__inner:has(.edumeal-sitemap) { flex-wrap: nowrap; }
	.site-footer__inner:has(.edumeal-sitemap) > .footer-newsletter { flex: 1 1 0; min-width: 0; }
	.footer-columns:has(.edumeal-sitemap) {
		display: grid;
		grid-template-columns: max-content max-content auto;
		gap: 24px;
		flex: 0 0 auto;
	}
	.footer-columns:has(.edumeal-sitemap) > .footer-social-col { grid-column: 3; grid-row: 1 / span 2; }
}
@media (max-width: 767px) {
	.footer-columns:has(.edumeal-sitemap) { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
}
