/* ========================================================================== 1. VARIABLES & OPTIMIZED KEYFRAMES ========================================================================== */
 :root {
     --transition-fast: 0.2s;
     --transition-medium: 0.3s;
     --shadow-light: 0 2px 4px rgba(0,0,0,.3);
     --shadow-medium: 0 2px 10px rgba(0, 0, 0, 0.15);
     --shadow-heavy: 0 10px 30px rgba(0, 0, 0, 0.15);
     --border-radius: .50rem; 
     --nav-height: 93px;
     --mega-menu-width: 275px;
    /* Dynamic nav sizing — adjusted by JS fitNavItems() */
     --nav-font-size: 20px;
     --nav-padding-v: 28px;
     --nav-padding-h: 25px;
     --nav-min-font-size: 20px;
}
/* Optimized animation with transform3d for hardware acceleration */
 @keyframes fadeInUp {
     from {
         opacity: 0;
         transform: translate3d(0, 20px, 0);
    }
     to {
         opacity: 1;
         transform: translate3d(0, 0, 0);
    }
}
/* ========================================================================== 2. MAIN NAVIGATION STRUCTURE ========================================================================== */
 .header-section {
     width: 100%;
}
 .main-nav {
     box-shadow: var(--shadow-medium);
     position: relative;
     z-index: 1001;
    /* Enable hardware acceleration */
     transform: translate3d(0, 0, 0);
     backface-visibility: hidden;
}
 .nav-container {
     width: 100%;
     margin: 0 auto;
     display: flex;
     align-items: center;
    /* Fixed height independent of --nav-height. The JS positionMegaMenus() writes the full .main-nav height (top-bar + nav-container) back into --nav-height for mega-menu positioning. Using min/max-height tied to that variable causes a feedback loop that inflates the container. A fixed explicit height avoids this.*/
     height: 84px;
     border-bottom: 1px solid #ddd;
     max-width: 1400px;
}
/* ========================================================================== 3. LOGO STYLES ========================================================================== */
 .navbar-brand {
     padding: 0 12px;
}
 .logo {
     display: flex;
     align-items: center;
    /* No vertical padding needed — the container's fixed height + align-items:center handles it */
     padding: 0;
}
 .logo img {
    /* Reduced from 50px to match new 70px nav-height target */
     height: 42px;
     margin-right: 15px;
    /* Optimize image rendering */
     image-rendering: -webkit-optimize-contrast;
     image-rendering: optimize-contrast;
}
 .logo-text {
     font-size: 24px;
     font-weight: bold;
     color: #2D2A26;
}
/* ========================================================================== 4. NAVIGATION MENU ========================================================================== */
 .nav-menu {
     display: flex;
     list-style: none !important;
     align-items: center;
     flex: 1;
     flex-wrap: nowrap;
     overflow: hidden;
     padding-right: 15px;
}
 .nav-item {
     position: static;
     list-style: none !important;
    /* Static positioning for proper mega menu alignment */
}
/* Class for JS-activated (click/keyboard) items */
 .nav-item.menu-open .mega-menu {
     max-height: 1000px;
     opacity: 1;
     visibility: visible;
     border-bottom: 1px solid rgba(0, 0, 0, .06);
}
/* Navigation Links - Optimized transitions */
 .nav-link {
     display: block;
     padding: var(--nav-padding-v) var(--nav-padding-h);
     color: var(--body-text-template);
     text-decoration: none;
     font-weight: 700;
     transition: color var(--transition-medium) ease;
     cursor: pointer;
     font-size: var(--nav-font-size, 21px);
     white-space: nowrap;
     position: relative;
    /* Enable hardware acceleration */
     transform: translate3d(0, 0, 0);
     will-change: color;
}
 .nav-link:hover, .nav-item:hover .nav-link {
     color: var(--primary-template);
}
/* Optimized underline effect using transform instead of width */
 .nav-link::after {
     content: '';
     position: absolute;
     bottom: 10px;
     left: 50%;
     width: 80%;
     height: 2px;
     background: var(--primary-template);
     transition: transform var(--transition-medium) ease;
     transform: translate3d(-50%, 0, 0) scaleX(0);
     transform-origin: center;
}
 .nav-link:hover::after {
     transform: translate3d(-50%, 0, 0) scaleX(1);
}
/* Show underline when mega menu is open (active/clicked state) */
 .nav-item.menu-open > .nav-link::after {
     transform: translate3d(-50%, 0, 0) scaleX(1);
}
/* Show underline for keyboard-focused nav links */
 .nav-link:focus-visible::after {
     transform: translate3d(-50%, 0, 0) scaleX(1);
}
 .nav-link i {
     margin-left: 5px;
     font-size: 12px;
}
/* Regular Dropdown */
 .nav-item.dropdown .mega-menu {
    position: absolute;
  width: max-content;
  max-width: 400px;
  left: auto;
  right: auto;
}
 .nav-item.dropdown .mega-content {
     padding: 20px;
     display: block;
     max-width: 100%;
     max-height: calc(100vh - var(--nav-height) - 40px);
     overflow-y: auto;
}

 .nav-item.dropdown .mega-column h3 {
     margin-bottom: 5px;
     font-size: 14px;
}
 .nav-item.dropdown .mega-columns-wrapper {
     flex: 1;
     display: block;
     flex-wrap: wrap;
     gap: 20px;
     min-width: 0;
    /* Important for flex shrinking */
}
 .nav-item.dropdown .mega-columns-wrapper {
     column-count: 1;
}
/* ========================================================================== 5. ACCESSIBILITY & FOCUS STATES ========================================================================== */
/* Suppress rectangular outline on mouse-click to remove left/right border artifact */
 .nav-link:focus {
     outline: none;
}
/* Restore outline for keyboard navigation only (WCAG 2.1 AA compliant) */
 .nav-link:focus-visible {
     outline: 2px solid var(--primary-template);
     outline-offset: 2px;
}
/* Remove the automatic focus-within behavior */
/* .nav-item:focus-within .mega-menu {
     opacity: 1;
     visibility: visible;
     transform: translate3d(0, 0, 0);
}
 */
/* ========================================================================== 6. MEGA MENU STRUCTURE - Accordion slide effect for desktop ========================================================================== */
 .mega-menu {
     position: absolute;
     left: 0;
     right: 0;
     width: 100vw;
     background: white;
     box-shadow: var(--shadow-heavy);
    /* Accordion effect - start collapsed */
     max-height: 0;
     overflow: hidden;
     opacity: 1;
    /* Always fully visible during animation */
     visibility: visible;
    /* Always visible during animation */
    /* Smooth accordion transition */
     transition: max-height 0.4s ease-out;
     z-index: 1000;
    /* Performance optimizations */
     contain: layout style paint;
     will-change: max-height;
     backface-visibility: hidden;
}
/* Accordion open state — controlled by JS click only */
/* ========================================================================== 7. MEGA MENU CONTENT ========================================================================== */
/* FLEXIBLE LAYOUT - Key Solution */
 .mega-content {
     max-width: 1400px;
     margin: 0 auto;
     padding: 40px 0px;
     display: flex;
     gap: 30px;
     align-items: flex-start;
    /* Constrain height to viewport so content scrolls instead of overflowing */
     max-height: calc(100vh - var(--nav-height) - 80px);
     overflow-y: auto;
}
/* Subtle scrollbar for mega-menu overflow */
 .mega-content::-webkit-scrollbar {
     width: 6px;
}
 .mega-content::-webkit-scrollbar-thumb {
     background: rgba(0,0,0,0.2);
     border-radius: 3px;
}
 .mega-content {
     scrollbar-width: thin;
     scrollbar-color: rgba(0,0,0,0.2) transparent;
}
 .mega-column {
    /* flex: 1;
     padding-left: 10px;
     padding-right: 10px;
     animation: fadeInUp var(--transition-medium) ease-out;
     transform: translate3d(0, 0, 0);
     white-space: nowrap;
     */
     break-inside: avoid;
     margin-bottom: 10px;
     display: inline-block;
     width: 100%;
}
 .mega-column a {
     color: #374151;
     text-decoration: none;
     display: block;
     padding: 0px 0;
     transition: color var(--transition-medium) ease, padding-left var(--transition-medium) ease;
     border-left: 3px solid transparent;
     padding-left: 10px;
    /* Optimize for hover effects */
     will-change: color, padding-left;
}
.mega-submenu a {
     padding-left: 20px;
     font-size: 14px;
}
.mega-submenu a {
     padding-left: 20px;
}

 .mega-column h3 {
     color: var(--primary-template);
     font-size: 16px;
     margin-bottom: 0px;
     padding-bottom: 7px;
     border-bottom: 1px solid rgba(97, 109, 126, 0.12);
}
 .mega-column h3 a {
     color: var(--body-text-template);
     font-size: 16px;
}
 .mega-column ul {
     list-style: none;
}
 .mega-column li {
     margin: 0px 0px 0px 0px;
     list-style: none;
}
 .mega-column a:hover {
     color: var(--body-text-template);
     border-left-color: var(--primary-template);
     padding-left: 15px;
}
.mega-submenu a:hover {
     padding-left: 20px;
}
/* Left section - wraps columns as needed */
 .mega-columns-wrapper {
    /*flex: 1;
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
     flex-wrap: wrap;
     gap: 20px;
     min-width: 0;
    */
     column-count: 3;
     column-gap: 10px;
     display: block;
}
/* ========================================================================== 8. MEGA MENU SIDEBAR ========================================================================== */
 .mega-column-side-right {
     flex: 0 0 auto;
     padding: 25px;
     border-radius: var(--border-radius);
     box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
}
 .mega-column-side-right h2 {
     color: var(--body-bg-template);
}
/* ========================================================================== 9. MEGA MENU FOOTER ========================================================================== */
 .mega-footer {
     height: 45px;
     border-top: 1px solid #e5e7eb;
     display: flex;
     align-items: center;
     justify-content: flex-start;
     margin-top: 30px;
     color: var(--body-text-template);
     font-size: 14px;
     padding-left: 20px;
}
/* ========================================================================== 10. SPECIALIZED MEGA MENU LAYOUTS ========================================================================== */
 .academics-mega {
     grid-template-columns: repeat(4, 1fr);
}
/* .mega-search {
     background: none !important;
     box-shadow: none !important;
}
 .mega-search .mega-content {
     margin: 0 auto;
}
 */
 .highlight-box {
     background: linear-gradient(135deg, #3b82f6, #1e40af);
     color: white;
     padding: 20px;
     border-radius: 8px;
     text-align: center;
    /* Performance optimization */
     contain: layout style paint;
}
 .highlight-box h4 {
     margin-bottom: 10px;
     font-size: 16px;
}
 .highlight-box p {
     font-size: 14px;
     opacity: 0.9;
}
/* ========================================================================== 11. SEARCH BAR STYLES ========================================================================== */
 .header-section #search-bar {
     height: 100%;
     -webkit-transform: rotate(360deg);
     -moz-transform: rotate(360deg);
     -ms-transform: rotate(360deg);
     -o-transform: rotate(360deg);
     transform: rotate(360deg);
     position: fixed;
     width: 100%;
     top: 0;
     left: 0;
     right: 0;
     visibility: hidden;
     opacity: 0;
     z-index: 9999;
     -moz-transition: 0.5s;
     -ms-transition: 0.5s;
     -o-transition: 0.5s;
     transition: 0.5s;
     align-content: center;
}
 .header-section #search-bar.active {
     visibility: visible;
     opacity: 1;
}
 #search-bar .form-group {
     margin-bottom: 0;
     position: relative;
     width: 75%;
     margin: 0 auto;
}
 .close-bar {
     float: right !important;
     margin-right: 20px;
     background-color: white;
     border-radius: 6px;
     width: 50px;
     text-align: center;
     padding: 10px;
}
 #search-bar input {
     border: none;
     font-size: 23px;
     height: 42px;
     box-shadow: var(--shadow-light);
     backdrop-filter: blur(10px);
     contain: layout style;
     will-change: backdrop-filter;
     border-radius: var(--border-radius);
}
 #search-bar .form-control::placeholder {
     color: var(--primary-template);
     opacity: 1;
}
 .form-group label {
     display: block;
     margin-bottom: 0.5em;
    /* Adds space between label and input */
     font-family: var(--primary-font-template), var(--primary-font-style);
     font-size: xx-large;
     color: var(--body-bg-template);
}
/* #search-bar {
     min-width: 267px;
     width: 75%;
     background: rgba(255, 255, 255, 0.95);
     backdrop-filter: blur(10px);
     border: 1px solid rgba(0, 0, 0, 0.1);
     border-radius: var(--border-radius);
     box-shadow: var(--shadow-light);
     padding: 5px;
     margin-top: 15px;
     padding-left: 30px;
     outline: none;
     contain: layout style;
     will-change: backdrop-filter;
}
 #search-bar .form-group {
     margin-bottom: 0;
     position: relative;
}
 #search-bar input {
     border: none;
     width: 100%;
     background: none;
     font-size: 23px;
     height: 42px;
}
 .form-bar {
     margin-block-end: 0;
}
 #search-bar .submit {
     background-color: var(--primary-template);
     color: #fff;
     font-family: var(--primary-font-template), var(--primary-font-style);
     border-radius: var(--border-radius);
     font-size: 23px;
     cursor: pointer;
     transition: background-color var(--transition-fast) ease;
}
 #search-bar .form-control::placeholder {
     color: var(--primary-template);
     opacity: 1;
}
 .mega-search {
     margin: auto;
}
 */
/* ========================================================================== 12. MOBILE NAVIGATION ========================================================================== */
 .mobile-menu-btn {
     display: none;
     background: none;
     border: none;
     color: black;
     font-size: 24px;
     cursor: pointer;
     margin-left: auto;
    /* Touch optimization */
     touch-action: manipulation;
}
 .mobile-menu-toggle {
     display: none;
}
/* ========================================================================== 13. MOBILE RESPONSIVE STYLES - Keep original mobile behavior ========================================================================== */
 @media (max-width: 991px) {
     .main-nav {
         display:none;
    }
     .mega-footer {
         display: none;
    }
     .mega-column-side-right {
         display: none;
    }
     .nav-container {
         flex-wrap: wrap;
    }
     .mobile-menu-btn {
         display: block;
         order: 3;
    }
     .logo {
         order: 1;
         padding: 0;
    }
     .nav-menu {
         order: 4;
         position: absolute;
         top: 100%;
         left: 0;
         right: 0;
         background-color: #ffffff;
         flex-direction: column;
         width: 100%;
         margin-left: 0;
         display: none;
         box-shadow: var(--shadow-medium);
        /* Mobile optimization */
         transform: translate3d(0, 0, 0);
         contain: layout style;
    }
     .mobile-menu-toggle:checked + .nav-container .nav-menu {
         display: flex;
         height: calc(100vh - var(--nav-height));
    }
     .nav-item {
         width: 100%;
         border-bottom: 1px solid rgba(255, 255, 255, 0.1);
         position: relative;
    }
     .nav-item:last-child {
         border-bottom: none;
    }
     .nav-link {
         padding: 15px 20px;
         display: block;
         width: 100%;
         text-align: left;
    }
    /* Mobile mega menu - revert to original behavior */
     .mega-menu {
         position: static;
         width: 100%;
         margin-left: 0;
         transform: none;
         display: none;
        /* Reset accordion properties for mobile */
         max-height: none;
         overflow: visible;
         opacity: 0;
         visibility: hidden;
         transition: opacity var(--transition-fast) ease-in, visibility var(--transition-fast) ease-in;
        /* Mobile mega menu optimization */
         contain: layout style paint;
    }
     .mega-content {
         grid-template-columns: 1fr;
         gap: 20px;
         padding: 20px;
         max-width: 100%;
    }
     .academics-mega {
         grid-template-columns: 1fr;
    }
    /* Ensure mega menu shows properly on mobile when activated */
     .nav-item.menu-open .mega-menu {
         display: block !important;
         opacity: 1 !important;
         visibility: visible !important;
         transform: none !important;
         position: static !important;
         transition: none !important;
         max-height: none !important;
         overflow: visible !important;
    }
     .nav-item.menu-open .nav-link {
         border-bottom: none;
    }
    /* Make sure the nav link is properly clickable */
     .nav-link {
         cursor: pointer;
         touch-action: manipulation;
         border-bottom: 1px solid rgba(0, 0, 0, 0.1);
         transition: transform var(--transition-medium) ease;
    }
    /* Ensure mega menu content is visible */
     .mega-menu .mega-content {
         display: flex !important;
         flex-direction: column;
    }
    /* Fix mega column display on mobile */
     .mega-column {
         width: 100% !important;
         flex: none !important;
         min-width: auto !important;
    }
     .nav-link:focus:not(:focus-visible) {
         outline: none;
    }
     .nav-link i {
         position: absolute;
         font-size: 23px;
         right: 30px;
    }
}
/* ========================================================================== 13b. DYNAMIC BREAKPOINT — JS adds .force-mobile when nav items can't fit ========================================================================== */
 .force-mobile .main-nav {
     display: none;
}
 .force-mobile .navbar-header.navbar {
     display: block !important;
}

/* ========================================================================== 13c. MOBILE NAV LOGO ALIGNMENT ========================================================================== */
/* The mobile .navbar-2 renders the logo directly without a .logo wrapper div, so flexbox centering must be applied here rather than relying on the .logo rules. */
 .navbar-2 .navbar-brand {
     display: -webkit-flex;
     display: flex;
     -webkit-align-items: center;
     align-items: center;
    /* Match desktop logo padding */
     padding: 8px 12px;
}
 .navbar-2 .navbar-brand img {
    /* Match desktop logo height for visual consistency */
     height: 42px;
}
/* ========================================================================== 14. PERFORMANCE UTILITIES ========================================================================== */
/* Reduce motion for users who prefer it */
 @media (prefers-reduced-motion: reduce) {
     *, *::before, *::after {
         animation-duration: 0.01ms !important;
         animation-iteration-count: 1 !important;
         transition-duration: 0.01ms !important;
    }
}
/* GPU acceleration for key interactive elements */
 .nav-link, .mega-menu, .mega-column, .mega-column a {
     backface-visibility: hidden;
     perspective: 1000px;
}
/* Optimize font rendering */
 .nav-link, .mega-column a, .logo-text {
     font-display: swap;
     text-rendering: optimizeLegibility;
     -webkit-font-smoothing: antialiased;
     -moz-osx-font-smoothing: grayscale;
}
 @media (min-width: 992px) {
    /* Core accordion styles */
     .mega-menu {
         max-height: none !important;
        /* allow natural height */
         overflow: visible;
        /* let content flow */
        /* slide animation via clip-path (auto‑height) */
         clip-path: inset(0 0 100% 0);
         visibility: hidden;
        /* hidden when clipped */
         transition: clip-path 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.45s;
        /* delay visibility toggle */
         will-change: clip-path;
         z-index: 999;
    }
    /* OPEN – via JS click or keyboard activation */
     .nav-item.menu-open > .mega-menu {
         clip-path: inset(0 0 0 0);
         visibility: visible;
         transition: clip-path 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
    }
    /* Ensure no overlap – close siblings instantly when one opens */
     .nav-item.menu-open ~ .nav-item > .mega-menu {
         clip-path: inset(0 0 100% 0);
         visibility: hidden;
         transition: clip-path 0.2s ease-out, visibility 0s linear 0.2s;
    }
}
 @media (max-width: 991px) {
     .nav-menu {
         max-height: 100vh;
         overflow-y: auto;
         -webkit-overflow-scrolling: touch;
    }
     .nav-item.menu-open .mega-menu {
         max-height: none !important;
         overflow: visible !important;
    }
}

/* ========================================================================== 15. MOBILE SLIDE-IN NAV PANEL Harvard-style hamburger + progressive-disclosure accordion ========================================================================== */

/* ── Hamburger button ─────────────────────────────────────────────────────── */
 .mobile-hamburger {
     background: none;
     border: none;
     padding: 10px;
     cursor: pointer;
     color: inherit;
     touch-action: manipulation;
    /* Minimum 44 × 44 px touch target (WCAG 2.5.5) */
     min-width: 44px;
     min-height: 44px;
     display: flex;
     align-items: center;
     justify-content: center;
     flex-direction: column;
     gap: 5px;
     line-height: 1;
}
 .mobile-hamburger:focus-visible {
     outline: 2px solid var(--primary-template);
     outline-offset: 2px;
     border-radius: 4px;
}
 .hamburger-bar {
     display: block;
     width: 24px;
     height: 2px;
     background: currentColor;
     border-radius: 2px;
     transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.28s ease;
     transform-origin: center;
}
/* Bars animate into × when the panel is open */
 .mobile-hamburger[aria-expanded="true"] .hamburger-bar:nth-child(1) {
     transform: translateY(7px) rotate(45deg);
}
 .mobile-hamburger[aria-expanded="true"] .hamburger-bar:nth-child(2) {
     opacity: 0;
     transform: scaleX(0);
}
 .mobile-hamburger[aria-expanded="true"] .hamburger-bar:nth-child(3) {
     transform: translateY(-7px) rotate(-45deg);
}

/* ── Slide-in panel ───────────────────────────────────────────────────────── */
 .mobile-nav-panel {
     position: fixed;
     top: 0;
     right: 0;
     width: 88vw;
    /* capped so it never looks too wide on tablets */
     max-width: 360px;
     height: 100%;
     background: #fff;
     box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
     overflow-y: auto;
     -webkit-overflow-scrolling: touch;
     overscroll-behavior: contain;
    /* starts off-screen to the right */
     transform: translateX(100%);
     transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
     z-index: 1100;
     display: flex;
     flex-direction: column;
}
 .mobile-nav-panel.is-open {
     transform: translateX(0);
}

/* ── Backdrop ─────────────────────────────────────────────────────────────── */
 .mobile-nav-backdrop {
     position: fixed;
     inset: 0;
     background: rgba(0, 0, 0, 0.45);
     opacity: 0;
     visibility: hidden;
     transition: opacity 0.32s ease, visibility 0s linear 0.32s;
     z-index: 1099;
}
 .mobile-nav-backdrop.is-open {
     opacity: 1;
     visibility: visible;
     transition: opacity 0.32s ease, visibility 0s;
}

/* ── Body scroll lock while panel is open ─────────────────────────────────── */
 body.mobile-nav-open {
     overflow: hidden;
}

/* ── Panel header: logo + close button ───────────────────────────────────── */
 .mobile-panel-header {
     display: flex;
     align-items: center;
     justify-content: space-between;
     padding: 12px 16px;
     border-bottom: 1px solid #e5e7eb;
     flex-shrink: 0;
}
 .mobile-panel-header .navbar-brand {
     padding: 0;
}
 .mobile-panel-header .navbar-brand img {
     height: 36px;
     width: auto;
}
 .mobile-nav-close {
     background: none;
     border: none;
     padding: 8px;
     cursor: pointer;
     color: inherit;
     min-width: 44px;
     min-height: 44px;
     display: flex;
     align-items: center;
     justify-content: center;
     font-size: 20px;
     border-radius: var(--border-radius, 0.5rem);
     transition: background-color var(--transition-fast, 0.2s) ease;
     touch-action: manipulation;
}
 .mobile-nav-close:hover {
     background-color: rgba(0, 0, 0, 0.06);
}
 .mobile-nav-close:focus-visible {
     outline: 2px solid var(--primary-template);
     outline-offset: 2px;
}

/* ── Search row (inline form) ─────────────────────────────────────────────── */
 .mobile-search-row {
     padding: 10px 16px;
     border-bottom: 1px solid #e5e7eb;
     flex-shrink: 0;
}
 .mobile-search-form {
     display: flex;
     align-items: center;
     gap: 8px;
     width: 100%;
     margin: 0;
}
 .mobile-search-input {
     flex: 1;
     min-height: 44px;
     padding: 8px 12px;
     border: 1px solid #e0e0e0;
     border-radius: var(--border-radius, 0.5rem);
     font-size: 15px;
     color: var(--body-text-template);
     background: #f5f5f5;
     outline: none;
     font-family: inherit;
     transition: border-color var(--transition-fast, 0.2s) ease, background-color var(--transition-fast, 0.2s) ease;
    /* Remove browser default search-input chrome */
     -webkit-appearance: none;
     appearance: none;
}
 .mobile-search-input:focus {
     border-color: var(--primary-template);
     background: #fff;
     box-shadow: 0 0 0 2px rgba(0, 48, 135, 0.12);
}
 .mobile-search-submit {
     flex-shrink: 0;
     min-width: 44px;
     min-height: 44px;
     display: flex;
     align-items: center;
     justify-content: center;
     background: var(--primary-template);
     color: #fff;
     border: none;
     border-radius: var(--border-radius, 0.5rem);
     cursor: pointer;
     font-size: 16px;
     transition: opacity var(--transition-fast, 0.2s) ease;
     touch-action: manipulation;
}
 .mobile-search-submit:hover {
     opacity: 0.88;
}
 .mobile-search-submit:focus-visible {
     outline: 2px solid var(--primary-template);
     outline-offset: 2px;
}
/* Visually-hidden label for screen readers (mirrors Bootstrap .sr-only) */
 .sr-only {
     position: absolute;
     width: 1px;
     height: 1px;
     padding: 0;
     margin: -1px;
     overflow: hidden;
     clip: rect(0, 0, 0, 0);
     white-space: nowrap;
     border: 0;
}

/* ── Level 1: nav list ────────────────────────────────────────────────────── */
 .mobile-nav-list {
     list-style: none;
     margin: 0;
     padding: 0;
     flex: 1;
    
}

/* Level 1 plain link */
.mobile-nav-item {
margin-inline-start: 0rem;
}
.mobile-submenu-links li {
    margin-inline-start: 0rem;
}
 .mobile-nav-item > .mobile-nav-link {
     display: flex;
     align-items: center;
     min-height: 52px;
     padding: 0 20px;
     font-size: 1rem;
     font-weight: 700;
     color: var(--body-text-template);
     text-decoration: none;
     border-bottom: 1px solid #e5e7eb;
     transition: color var(--transition-fast, 0.2s) ease, background-color var(--transition-fast, 0.2s) ease;
 
     
 }
 .mobile-nav-item > .mobile-nav-link:hover {
     color: var(--primary-template);
     background-color: rgba(0, 0, 0, 0.03);
}
 .mobile-nav-item > .mobile-nav-link:focus-visible {
     outline: 2px solid var(--primary-template);
     outline-offset: -2px;
}

/* Level 1 accordion trigger (has submenu) */
 .mobile-nav-trigger {
     display: flex;
     align-items: center;
     width: 100%;
     min-height: 52px;
     padding: 0 20px;
     background: none;
     border: none;
     border-bottom: 1px solid #e5e7eb;
     cursor: pointer;
     text-align: left;
     font-size: 1rem;
     font-weight: 700;
     color: var(--body-text-template);
     transition: color var(--transition-fast, 0.2s) ease, background-color var(--transition-fast, 0.2s) ease;
     touch-action: manipulation;
}
 .mobile-nav-trigger:hover, .mobile-nav-trigger[aria-expanded="true"] {
     color: var(--primary-template);
     background-color: rgba(0, 0, 0, 0.03);
}
 .mobile-nav-trigger:focus-visible {
     outline: 2px solid var(--primary-template);
     outline-offset: -2px;
}
 .mobile-trigger-label {
     flex: 1;
}
 .mobile-chevron {
     display: flex;
     align-items: center;
     margin-left: 8px;
     flex-shrink: 0;
     transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
 .mobile-nav-trigger[aria-expanded="true"] .mobile-chevron {
     transform: rotate(180deg);
}

/* ── Accordion submenu panel ──────────────────────────────────────────────── */
 .mobile-submenu {
    /* max-height driven by JS (scrollHeight) for smooth animation */
     max-height: 0;
     overflow: hidden;
     background-color: #f9f9f9;
     border-bottom: 1px solid #e5e7eb;
     transition: max-height 0.32s ease-out;
}

/* ── Level 2: column group ────────────────────────────────────────────────── */
 .mobile-submenu-group {
     padding: 6px 0 10px;
     border-bottom: 1px solid #efefef;
}
 .mobile-submenu-group:last-child {
     border-bottom: none;
     padding-bottom: 14px;
}

/* Level 2 heading — bold, brand colour, acts as section label */
 .mobile-submenu-heading {
     display: block;
     padding: 8px 20px 6px 24px;
     font-weight: 700;
     font-size: 0.9em;
     color: var(--primary-template);
     text-decoration: none;
     letter-spacing: 0.01em;
}
 a.mobile-submenu-heading:hover {
     text-decoration: underline;
}
 a.mobile-submenu-heading:focus-visible {
     outline: 2px solid var(--primary-template);
     outline-offset: 2px;
}

/* ── Level 3: sub-links ───────────────────────────────────────────────────── */
 .mobile-submenu-links {
     list-style: none;
     margin: 0;
     padding: 0;
}
 .mobile-submenu-links li a {
     display: flex;
     align-items: center;
     min-height: 40px;
     padding: 7px 20px 7px 36px;
     font-size: 0.875em;
     color: var(--body-text-template);
     text-decoration: none;
     transition: color var(--transition-fast, 0.2s) ease, padding-left var(--transition-fast, 0.2s) ease;
}
 .mobile-submenu-links li a:hover {
     color: var(--primary-template);
     padding-left: 42px;
}
 .mobile-submenu-links li a:focus-visible {
     outline: 2px solid var(--primary-template);
     outline-offset: 2px;
}

/* ── CTA footer ───────────────────────────────────────────────────────────── */
/* Mirrors the .body-content block from the original off-canvas nav.
   Sticks to the bottom because .mobile-nav-list has flex:1 above it. */
 .mobile-panel-footer {
     padding: 16px;
     border-top: 2px solid #e5e7eb;
     display: flex;
     flex-direction: column;
     gap: 10px;
     flex-shrink: 0;
}
 .mobile-cta-btn {
     display: flex;
     align-items: center;
     justify-content: center;
     min-height: 48px;
     padding: 12px 20px;
     background: var(--primary-template);
     color: #fff;
     font-weight: 700;
     font-size: 1rem;
     font-family: inherit;
     text-decoration: none;
     text-align: center;
     border-radius: var(--border-radius, 0.5rem);
     transition: opacity var(--transition-fast, 0.2s) ease;
     touch-action: manipulation;
}
 .mobile-cta-btn:hover, .mobile-cta-btn:focus {
     opacity: 0.88;
     color: #fff;
     text-decoration: none;
}
 .mobile-cta-btn:focus-visible {
     outline: 2px solid #fff;
     outline-offset: -3px;
}

/* ── Reduced motion ───────────────────────────────────────────────────────── */
 @media (prefers-reduced-motion: reduce) {
     .mobile-nav-panel, .mobile-nav-backdrop, .hamburger-bar, .mobile-chevron, .mobile-submenu {
         transition-duration: 0.01ms !important;
    }
}
/* Suppress Bootstrap's visible-sm at non-mobile widths.
   The .force-mobile class (set by JS) overrides this with !important
   when the nav items genuinely don't fit. */
@media (min-width: 992px) {
  .navbar-header.navbar {
    display: none !important;
  }
}

/* ========================================================================== 12. TOP-ROW ADDITIONAL LINKS (addNavitem) — including RealDropdown ========================================================================== */
.add-links {
     list-style: none !important;
     margin: 0;
     padding: 0;
}
.add-links-item {
     display: inline-block;
     vertical-align: middle;
     list-style: none !important;
}
/* Native <details>/<summary> dropdown — no JS required to open/close,
   a small script only closes other open menus / outside clicks */
.add-links-dropdown {
     position: relative;
     display: inline-block;
     vertical-align: middle;
}
.add-links-toggle {
  display: inline-flex;
    align-items: center;
    gap: 4px;
    padding-left: 5px;
    font: inherit;
    cursor: pointer;
    list-style: none;
    user-select: none;
    color: var(--body-bg-template);
    line-height: 1.2em;
    font-size: .95rem;
    font-weight: bold;
    letter-spacing: 0.1em;
}
/* Hide the default disclosure triangle across browsers */
.add-links-toggle::-webkit-details-marker {
     display: none;
}
.add-links-toggle::marker {
     content: "";
}
.add-links-toggle i {
     font-size: 11px;
     transition: transform var(--transition-fast) ease;
}
.add-links-dropdown[open] > .add-links-toggle i {
     transform: rotate(180deg);
}
.add-links-toggle:focus-visible {
     outline: 2px solid var(--primary-template);
     outline-offset: 2px;
}
.top-row-dropdown-menu {
     position: absolute;
     top: 25px;
     margin-top: 8px;
     min-width: 260px;
     max-width: 380px;
     padding: 10px 0;
     list-style: none !important;
     background: #fff;
     border-radius: var(--border-radius);
     box-shadow: var(--shadow-heavy);
     z-index: 1002;
     text-align: left;
}
.top-row-dropdown-menu li {
     margin: 0;
     list-style: none !important;
}
.top-row-dropdown-menu li:last-child a {
     border-bottom: none;
}
.top-row-dropdown-menu a {
     display: block;
     padding: 14px 20px;
     color: var(--primary-template) !important;
     font-weight: 700;
     font-size: 16px;
     line-height: 1.3;
     text-decoration: none;
     white-space: normal;
     border-bottom: 1px solid rgba(97, 109, 126, 0.12);
     transition: color var(--transition-fast) ease, padding-left var(--transition-fast) ease;
}
.top-row-dropdown-menu a:hover,
.top-row-dropdown-menu a:focus-visible {
     color: var(--primary-template)) !important;
     padding-left: 24px;
     outline: none;
}
.top-row-dropdown-menu li {
  display: block;
  width: 100%;
  margin: 0;
}
/* ==========================================================================
   Motion: nav dropdown scale + fade, hero button press feedback
   Append to the END of _assets/css/mega-menu.css so it overrides the
   existing clip-path reveal (same specificity, later wins).
   ========================================================================== */

:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

/* Nav dropdowns (desktop only; the mobile off-canvas menu is untouched) */
@media (min-width: 992px) {
  .mega-menu {
    clip-path: none;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.97);
    transform-origin: top center; /* full-width panel drops from the nav bar */
    transition:
      opacity 150ms var(--ease-out),
      transform 150ms var(--ease-out),
      visibility 0s linear 150ms; /* stay hidden to clicks/focus once faded */
    will-change: auto;
  }

  /* Narrow single-column dropdowns sit under their trigger */
  .nav-item.dropdown > .mega-menu {
    transform-origin: top left;
  }

  .nav-item.menu-open > .mega-menu {
    clip-path: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition:
      opacity 200ms var(--ease-out),
      transform 200ms var(--ease-out),
      visibility 0s;
  }

  /* Neutralize the old sibling rule's clip-path/timing */
  .nav-item.menu-open ~ .nav-item > .mega-menu {
    clip-path: none;
    transition:
      opacity 150ms var(--ease-out),
      transform 150ms var(--ease-out),
      visibility 0s linear 150ms;
  }

  /* Switching from one open menu to another: swap instantly, no fade.
     data-instant is set for one beat by the snippet in megamenu.js. */
  .main-nav[data-instant] .mega-menu {
    transition: none;
  }
}

/* (Hero button press feedback moved to pdcc-hero-intro.css / hero-blocks.css —
   hero-blocks.css loads after this file and was overriding it.) */

/* Reduced motion: keep the fade, drop the scale */
@media (prefers-reduced-motion: reduce) {
  .mega-menu,
  .nav-item.menu-open > .mega-menu {
    transform: none;
  }
}
/* ==========================================================================
   Search overlay (#search-bar) — faster fade, field drops in
   Append to the END of _assets/css/mega-menu.css (same file as the
   original #search-bar rules; these override them).

   Replaces `transition: 0.5s` (all properties) with named properties:
   backdrop fades 200ms in / 150ms out; the search field moves 12px down
   into place on open and back up on close.
   ========================================================================== */

.header-section #search-bar {
  transform: none; /* was rotate(360deg): no visual effect, only kept a transform layer alive */
  transition:
    opacity 150ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
    visibility 0s linear 150ms; /* stays unclickable once faded */
}

.header-section #search-bar.active {
  transition:
    opacity 200ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
    visibility 0s;
}

.header-section #search-bar .form-bar {
  transform: translateY(-12px);
  transition: transform 150ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
}

.header-section #search-bar.active .form-bar {
  transform: none;
  transition: transform 250ms var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
}

/* Reduced motion: keep the fade, drop the movement */
@media (prefers-reduced-motion: reduce) {
  .header-section #search-bar .form-bar,
  .header-section #search-bar.active .form-bar {
    transform: none;
  }
}