/* Fixed header dimensions; scrolling never scales the header or logo. */
:root {
    --bn-header-expanded-height: 133px;
    --bn-header-collapsed-height: var(--bn-header-expanded-height);
    --bn-header-height: var(--bn-header-expanded-height);
    --bn-logo-width: 146px;
    --bn-logo-height: 90px;
    --bn-admin-offset: 0px;
}

html { scroll-padding-top: calc(var(--bn-header-expanded-height) + var(--space-4)); }
html.has-scroll-header { scroll-padding-top: calc(var(--bn-header-expanded-height) + var(--space-4)); }
/* Reserve the complete fixed header height. */
body { padding-top: var(--bn-header-expanded-height); }
body.admin-bar { --bn-admin-offset: var(--wp-admin--admin-bar--height, 32px); }
:where(main, main [id]) { scroll-margin-top: var(--bn-admin-offset); }
main :where(a, button, input, select, textarea, [tabindex]) { scroll-margin-block: calc(var(--bn-header-expanded-height) + var(--bn-admin-offset) + var(--space-4)) var(--space-6); }
main:focus { outline: none; }
.skip-link { position: fixed; z-index: 1100; }
.skip-link:focus { top: calc(var(--bn-admin-offset) + 8px); }

.site-header {
    position: fixed;
    inset-inline: 0;
    top: var(--bn-admin-offset);
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-header);
}
.header-accent { height: 6px; background: var(--gold); }
.header-inner { display: flex; align-items: center; gap: var(--space-8); min-height: calc(var(--bn-header-height) - 7px); }
.brand { width: var(--bn-logo-width); flex-shrink: 0; }
.brand img { width: var(--bn-logo-width); height: var(--bn-logo-height); object-fit: contain; }
.desktop-navigation { margin-left: auto; }
.site-header .menu { display: flex; flex-wrap: wrap; gap: 30px; list-style: none; padding: 0; margin: 0; }
.site-header .menu a { display: flex; align-items: center; min-height: var(--control-height); padding-inline: 3px; text-decoration: none; font-size: var(--text-control); font-weight: 400; }
.site-header .menu .current-menu-item > a { color: var(--gold); }
.header-calendar { font-size: var(--text-caption); text-decoration: none; border: 1px solid var(--line); padding: 10px 14px; white-space: nowrap; }
.header-calendar span { color: var(--gold); margin-left: var(--space-3); }
.mobile-navigation { display: none; }

@media (max-width: 1250px) {
    .header-inner { gap: var(--space-6); }
    .header-calendar { display: none; }
}

@media (max-width: 782px) {
    body.admin-bar { --bn-admin-offset: var(--wp-admin--admin-bar--height, 46px); }
}

@media (max-width: 900px) {
    :root { --bn-header-expanded-height: 131px; --bn-header-collapsed-height: 71px; --bn-logo-width: 115px; --bn-logo-height: 60px; }
        /* Keep the native toolbar visible so its offset cannot leave a gap while scrolling. */
    .admin-bar #wpadminbar { position: fixed; }
    .header-inner { justify-content: space-between; gap: var(--space-4); }
    .desktop-navigation { display: none; }
    .mobile-navigation { display: block; }
}

.mobile-navigation summary {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    min-height: var(--control-height); padding: var(--space-2) var(--space-3); border: 1px solid var(--line);
    color: var(--text); font-size: var(--text-sm); cursor: pointer; list-style: none;
}
.mobile-navigation summary::-webkit-details-marker { display: none; }
.mobile-navigation summary:focus-visible { outline: var(--focus-width) solid var(--gold); outline-offset: 4px; }
.mobile-menu-icon { display: block; position: relative; width: 18px; height: 2px; background: currentColor; }
.mobile-menu-icon::before,.mobile-menu-icon::after { content: ''; position: absolute; inset-inline: 0; height: 2px; background: currentColor; }
.mobile-menu-icon::before { top: -6px; }
.mobile-menu-icon::after { top: 6px; }
.mobile-label-open { display: none; }
.mobile-navigation[open] .mobile-label-closed { display: none; }
.mobile-navigation[open] .mobile-label-open { display: inline; }
.mobile-navigation[open] .mobile-menu-icon { background: transparent; }
.mobile-navigation[open] .mobile-menu-icon::before { top: 0; transform: rotate(45deg); }
.mobile-navigation[open] .mobile-menu-icon::after { top: 0; transform: rotate(-45deg); }
.mobile-navigation-panel {
    position: absolute; top: 100%; inset-inline: 0;
    background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-menu);
    max-height: calc(100vh - var(--bn-header-height) - var(--bn-admin-offset));
    max-height: calc(100dvh - var(--bn-header-height) - var(--bn-admin-offset));
    overflow-y: auto; overscroll-behavior: contain;
}
.mobile-navigation-panel nav { padding-block: var(--space-3) var(--space-5); }
.site-header .mobile-navigation-panel .menu { display: block; }
.site-header .mobile-navigation-panel .menu a { min-height: 48px; padding: 10px var(--space-1); border-bottom: 1px solid var(--line); font-size: var(--text-base); }
.mobile-calendar { display: inline-block; margin-top: 18px; color: var(--gold); font-size: var(--text-sm); }

@media (prefers-reduced-motion: reduce) {
    .header-inner,.brand,.brand img { transition: none; }
}

/* Reflow for the shared text-size setting. */
:root[data-bn-large-text="true"] .desktop-navigation,
:root[data-bn-large-text="true"] .header-calendar { display: none; }
:root[data-bn-large-text="true"] .mobile-navigation { display: block; }
:root[data-bn-large-text="true"] { --bn-logo-width: 80px; --bn-logo-height: 60px; }
:root[data-bn-large-text="true"] .header-inner { justify-content: space-between; }
:root[data-bn-large-text="true"] .display-preferences-header { margin-left:auto; }
@media(max-width:900px) { .display-preferences-header { margin-left:auto; } }
@media(min-width:901px) and (max-width:1050px) {
    .site-header .menu { gap:18px; }
    .header-inner { gap:20px; }
}
