/* Public navigation polish: compact sub-menus, smooth opening, one clear current item. */

/* Desktop dropdowns */
.fhf-public-reference .fhf-nav-button .fhf-icon { transition: transform .2s ease; }
.fhf-public-reference .fhf-nav-button[aria-expanded=true] .fhf-icon { transform: rotate(180deg); }
.fhf-public-reference .fhf-nav-panel { width: min(320px, calc(100vw - 32px)); padding: 6px; border-radius: 14px; box-shadow: 0 14px 36px rgba(0, 60, 43, .14), 0 2px 6px rgba(0, 60, 43, .08); }
.fhf-public-reference .fhf-nav-panel:not([hidden]) { animation: fhf-nav-in .18s cubic-bezier(.2, .7, .3, 1); transform-origin: top left; }
.fhf-public-reference .fhf-nav-panel-mega { width: min(540px, calc(100vw - 48px)); }
.fhf-public-reference .fhf-nav-panel ul { gap: 1px; }
.fhf-public-reference .fhf-nav-panel-mega > ul { gap: 1px 6px; }
.fhf-public-reference .fhf-nav-panel a { min-height: 40px; gap: 10px; padding: 5px 8px; border-radius: 9px; font-size: .875rem; font-weight: 600; transition: background-color .15s ease, color .15s ease; }
.fhf-public-reference .fhf-nav-icon { width: 30px; height: 30px; border-radius: 8px; transition: background-color .15s ease, color .15s ease; }
.fhf-public-reference .fhf-nav-icon .fhf-icon { width: 18px; height: 18px; }
.fhf-public-reference .fhf-nav-panel a:hover .fhf-nav-icon,
.fhf-public-reference .fhf-nav-panel a:focus-visible .fhf-nav-icon,
.fhf-public-reference .fhf-nav-panel a[aria-current="page"] .fhf-nav-icon { background: #006b4e; color: #fff; }
.fhf-public-reference .fhf-nav-panel .fhf-mega-all { min-height: 36px; margin: 6px 0 0; padding: 8px 8px 2px; font-size: .85rem; }
.fhf-public-reference .fhf-nav-panel .fhf-badge { font-size: .68rem; }
@keyframes fhf-nav-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }

/* Phone menu drawer: tighter rows, sub-items indented under their group. */
.fhf-drawer-content { padding-top: 14px; }
.fhf-drawer-menu { gap: 2px; margin-block: 12px; }
.fhf-drawer-menu a, .fhf-drawer-menu summary { min-height: 44px; padding: 8px 12px; }
.fhf-drawer-group { padding-block: 2px; }
.fhf-drawer-group > summary .fhf-icon { transition: transform .2s ease; }
.fhf-drawer-group[open] > summary .fhf-icon { transform: rotate(180deg); }
.fhf-drawer-group > a { min-height: 40px; margin-inline-start: 12px; padding-block: 6px; font-size: .9rem; }
.fhf-drawer-group[open] > a { animation: fhf-nav-in .18s ease-out; }

@media (prefers-reduced-motion: reduce) {
    .fhf-public-reference .fhf-nav-panel:not([hidden]), .fhf-drawer-group[open] > a { animation: none; }
    .fhf-public-reference .fhf-nav-button .fhf-icon, .fhf-drawer-group > summary .fhf-icon { transition: none; }
}

/* Keep the desktop header identical on every page so the menu never jumps. */
html { scrollbar-gutter: stable; background-color: var(--color-fhf-cream, #f7f4ee); }
@media (min-width: 768px) {
    .fhf-public-reference .fhf-desktop-bar { min-height: 76px; }
    .fhf-public-reference .fhf-desktop-header .fhf-brand img { width: 76px; height: 72px; object-fit: contain; }
    /* The current or open item is marked by colour and underline, not a heavier weight that changes its width. */
    .fhf-public-reference .fhf-desktop-header :is(.fhf-nav-link, .fhf-nav-button):is([aria-current], [aria-expanded="true"]) { font-weight: 600; }
}

/* Language button: compact, matching the other header tools. */
.fhf-language summary { min-height: 34px; gap: 4px; padding: 4px 8px; border-radius: 8px; font-size: .72rem; }
.fhf-public-reference .fhf-mobile-tools .fhf-language summary { min-height: 34px; padding-inline: 7px; }
.fhf-language summary .fhf-icon { width: 14px; height: 14px; }
.fhf-language nav { min-width: 168px; padding: 4px; border-radius: 10px; top: calc(100% + 6px); }
.fhf-language nav a { min-height: 36px; gap: 8px; padding: 6px 8px; font-size: .8rem; }
.fhf-language[open] nav { animation: fhf-nav-in .16s ease-out; }

/* Sub-menus: narrower and shorter rows. */
.fhf-public-reference .fhf-nav-panel { width: min(264px, calc(100vw - 32px)); padding: 4px; }
.fhf-public-reference .fhf-nav-panel-mega { width: min(480px, calc(100vw - 48px)); }
.fhf-public-reference .fhf-nav-panel a { min-height: 34px; gap: 8px; padding: 3px 8px; font-size: .82rem; }
.fhf-public-reference .fhf-nav-icon { width: 26px; height: 26px; border-radius: 7px; }
.fhf-public-reference .fhf-nav-icon .fhf-icon { width: 16px; height: 16px; }
.fhf-public-reference .fhf-nav-panel .fhf-mega-all { min-height: 32px; margin-top: 4px; padding: 6px 8px 2px; }
.fhf-drawer-group > a { min-height: 38px; padding-block: 5px; }
@media (prefers-reduced-motion: reduce) { .fhf-language[open] nav { animation: none; } }

/* Mobile menu, compact (Nov 2026): narrower panel, logo header, tight rows, no stray gaps. */
.fhf-navigation-drawer#public-navigation { width: min(320px, 86vw); border-radius: 18px 0 0 18px; }
#public-navigation .fhf-drawer-heading { gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; }
#public-navigation .fhf-drawer-title { display: flex; align-items: center; gap: 10px; min-width: 0; color: #003b2c; font-size: .98rem; font-weight: 800; line-height: 1.15; }
#public-navigation .fhf-drawer-logo { width: 36px; height: 36px; flex: none; object-fit: contain; }
#public-navigation .fhf-drawer-close { width: 38px; height: 38px; flex: none; font-size: 1.45rem; line-height: 1; }
#public-navigation .fhf-drawer-content { padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0px)); }
#public-navigation .fhf-drawer-utilities { gap: 8px; }
#public-navigation .fhf-drawer-utilities .fhf-account > summary { min-height: 40px; padding: 6px 10px; font-size: .88rem; }
#public-navigation .fhf-drawer-utilities .fhf-account-mark { width: 26px; height: 26px; font-size: .8rem; }
#public-navigation .fhf-drawer-utilities > a { min-height: 40px; font-size: .88rem; font-weight: 700; }
#public-navigation .fhf-drawer-search { min-height: 42px; margin-top: 10px; padding: 8px 12px; border-radius: 10px; font-size: .9rem; color: #52665b; }
#public-navigation .fhf-drawer-menu { gap: 0; margin-block: 8px 12px; }
#public-navigation .fhf-drawer-menu > a, #public-navigation .fhf-drawer-menu summary { min-height: 42px; padding: 8px 10px; gap: 10px; border-radius: 8px; font-size: .92rem; font-weight: 600; }
#public-navigation .fhf-drawer-menu summary { font-weight: 700; }
#public-navigation .fhf-drawer-menu .fhf-icon { width: 18px; height: 18px; color: var(--pal-700,#00664a); }
#public-navigation .fhf-drawer-group { padding-block: 0; border-bottom: 1px solid #e6ece7; }
#public-navigation .fhf-drawer-group:first-of-type { border-top: 1px solid #e6ece7; margin-top: 4px; }
#public-navigation .fhf-drawer-group > a { min-height: 36px; margin-inline-start: 6px; padding: 5px 10px; font-size: .86rem; font-weight: 500; }
#public-navigation .fhf-drawer-group[open] { padding-bottom: 6px; }
#public-navigation .fhf-drawer-menu > a:last-child { margin-top: 2px; color: var(--pal-700,#00664a); font-weight: 700; }
#public-navigation .fhf-drawer-content > .fhf-btn { width: 100%; min-height: 44px; border-radius: 10px; font-size: .95rem; }
@media (max-width: 359px) { .fhf-navigation-drawer#public-navigation { width: 90vw; } }
/* Language choice inside the mobile menu. */
#public-navigation .fhf-drawer-langs { margin: 0 0 12px; }
#public-navigation .fhf-drawer-langs p { margin: 0 0 6px; color: #52665b; font-size: .78rem; font-weight: 700; }
#public-navigation .fhf-drawer-langs div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
#public-navigation .fhf-drawer-langs a { display: flex; align-items: center; justify-content: center; min-height: 38px; padding: 6px 8px; border: 1px solid #dce5de; border-radius: 9px; background: #fff; color: #123a2d; font-size: .86rem; font-weight: 600; text-decoration: none; }
#public-navigation .fhf-drawer-langs a[aria-current] { border-color: var(--pal-700,#00664a); background: var(--pal-700,#00664a); color: #fff; }
.fhf-menu-button { position: relative; }
.fhf-menu-button .fhf-unread { position: absolute; top: 4px; right: 4px; }
/* The phone menu ends where its content ends (still scrolls when longer than the screen). */
.fhf-navigation-drawer#public-navigation { inset: 0 0 auto auto; height: auto; max-height: 100dvh; border-radius: 0 0 0 18px; }
[dir=rtl] .fhf-navigation-drawer#public-navigation { inset: 0 auto auto 0; border-radius: 0 0 18px 0; }
/* The public menu follows the member pages' dark appearance. */
html[data-member-theme=dark] #public-navigation{background:#102a22;color:#eff7f0}
html[data-member-theme=dark] #public-navigation .fhf-drawer-heading{background:#102a22;border-bottom-color:#2a4a3f}
html[data-member-theme=dark] #public-navigation .fhf-drawer-title{color:#eff7f0}
html[data-member-theme=dark] #public-navigation :is(.fhf-drawer-close,.fhf-drawer-search,.fhf-drawer-utilities .fhf-account>summary,.fhf-drawer-langs a){background:#17382e;color:#eff7f0;border-color:#2a4a3f}
html[data-member-theme=dark] #public-navigation :is(.fhf-drawer-menu>a,.fhf-drawer-menu summary,.fhf-drawer-group>a,.fhf-drawer-utilities>a){color:#eff7f0}
html[data-member-theme=dark] #public-navigation .fhf-drawer-menu .fhf-icon{color:#8fd8b8}
html[data-member-theme=dark] #public-navigation :is(.fhf-drawer-menu a:hover,.fhf-drawer-menu a[aria-current],.fhf-drawer-group[open]>summary){background:#1d4a3c;color:#fff}
html[data-member-theme=dark] #public-navigation .fhf-drawer-group{border-color:#2a4a3f}
html[data-member-theme=dark] #public-navigation .fhf-drawer-langs p{color:#b3c9bd}
html[data-member-theme=dark] #public-navigation .fhf-drawer-langs a[aria-current]{background:#0a8f68;border-color:#0a8f68;color:#fff}
html[data-member-theme=dark] #public-navigation .fhf-drawer-menu>a:last-child{color:#8fd8b8}
/* Account menu in dark mode: every item readable, not only the links. */
html[data-member-theme=dark] .fhf-account-menu{background:#17382e;color:#eff7f0;border-color:#2a4a3f}
html[data-member-theme=dark] .fhf-account-menu :is(a,button,.fhf-account-name){color:#eff7f0}
html[data-member-theme=dark] .fhf-account-menu .fhf-account-name{color:#8fd8b8}
html[data-member-theme=dark] .fhf-account-menu :is(a,button):is(:hover,:focus-visible){background:#1d4a3c;color:#fff}

/* Bottom bar (Nov 2026): shorter and tighter, safe-area aware; the spacer below the page matches its height. */
@media (max-width: 1023px) {
    .fhf-public-reference .fhf-bottom-nav { min-height: 0; padding: 4px; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); border-radius: 22px; }
    .fhf-public-reference .fhf-bottom-nav .fhf-tab { min-height: 46px; gap: 3px; padding: 4px 2px; border-radius: 16px; }
    .fhf-public-reference .fhf-bottom-nav .fhf-tab[aria-current]::after { bottom: 2px; }
    .fhf-public-reference .fhf-bottom-spacer { height: calc(72px + env(safe-area-inset-bottom, 0px)); }
}
.fhf-account-menu .member-theme-toggle [data-member-appearance-label]{margin-inline-start:.3em}

/* Staff tools and account menus in the mobile drawer: open inside the drawer, never past its right edge. */
#public-navigation .fhf-drawer-utilities{position:relative}
#public-navigation .fhf-drawer-utilities .fhf-account{position:static}
#public-navigation .fhf-drawer-utilities .fhf-account-menu{left:0;right:0;width:auto;max-width:none;z-index:50;transform-origin:top right}
/* In the header bar the menus line up with the button's right edge and stay on screen. */
.fhf-desktop-tools .fhf-admin-tools .fhf-account-menu{right:0;left:auto;z-index:50;transform-origin:top right;max-width:calc(100vw - 16px)}
