/* ---------- Base tweaks ---------- */ .menu-bar { display: flex; align-items: stretch; gap: 0; } .menu-bar > li { position: relative; } .menu-link { text-decoration: none; } /* ---------- Compact dropdowns ---------- Applied to top-level items with class: menu-compact Keeps Research as full mega-menu, but makes About/News/Join us compact. --------------------------------------- */ .menu-bar > li.menu-compact > .mega-menu, .menu-bar > li.menu-compact .mega-menu { position: absolute; top: 100%; left: 0; right: auto; width: 18rem; min-width: 16rem; max-width: 22rem; display: none; padding: 0.4rem 0; margin: 0; z-index: 1000; box-sizing: border-box; } /* Show on hover and keyboard focus */ .menu-bar > li.menu-compact:hover > .mega-menu, .menu-bar > li.menu-compact:focus-within > .mega-menu { display: block; } /* Neutralise the multi-column layout for compact menus */ .menu-bar > li.menu-compact > .mega-menu { grid-template-columns: none !important; column-count: 1 !important; } .menu-bar > li.menu-compact > .mega-menu > li, .menu-bar > li.menu-compact > .mega-menu .menu-list { display: block; width: 100%; margin: 0; padding: 0; } /* Compact item styling */ .menu-bar > li.menu-compact > .mega-menu .mega-menu-header, .menu-bar > li.menu-compact > .mega-menu .menu-link { display: block; width: 100%; box-sizing: border-box; text-transform: none; white-space: normal; line-height: 1.35; padding: 0.55rem 0.9rem; } /* Remove heavy section-header feel inside compact menus */ .menu-bar > li.menu-compact > .mega-menu .mega-menu-header { font-weight: 500; font-size: 1rem; } /* Hide mobile back item on desktop compact menus */ .menu-bar > li.menu-compact > .mega-menu .mobile-menu-back-item { display: none; } /* ---------- Wider dropdown for Research ---------- Leave it as a mega-menu, but make wrapping cleaner. --------------------------------------- */ .menu-bar > li:not(.menu-compact) > .mega-menu .mega-menu-header { text-transform: none; white-space: normal; line-height: 1.35; } .menu-bar > li:not(.menu-compact) > .mega-menu .menu-link { white-space: normal; line-height: 1.35; } /* ---------- Optional visual polish ---------- Only add these if your skin does not already handle colors/backgrounds well. --------------------------------------- */ .menu-bar > li.menu-compact > .mega-menu { background: #fff; border: 1px solid rgba(0,0,0,0.12); box-shadow: 0 8px 20px rgba(0,0,0,0.12); border-radius: 0.35rem; } .menu-bar > li.menu-compact > .mega-menu .menu-link:hover, .menu-bar > li.menu-compact > .mega-menu .menu-link:focus { background: rgba(0,0,0,0.05); } /* ---------- Mobile ---------- Fall back to block layout. --------------------------------------- */ @media (max-width: 900px) { .menu-bar { display: block; } .menu-bar > li.menu-compact > .mega-menu, .menu-bar > li.menu-compact .mega-menu { position: static; width: auto; min-width: 0; max-width: none; display: block; border: 0; box-shadow: none; border-radius: 0; padding: 0; } .menu-bar > li.menu-compact > .mega-menu .mobile-menu-back-item { display: list-item; } }