/* =========================================
   CSS VARIABLES - CUSTOMIZE YOUR MENU
   ========================================= */

.serif-dropdown-menu {
    /* Colors - Light Theme */
    --sdm-bg-light: #fefefe;
    --sdm-bg-panel-light: rgba(254, 254, 254, 0.95);
    --sdm-text-primary-light: #1a1a1a;
    --sdm-text-secondary-light: #666666;
    --sdm-text-muted-light: #999999;
    --sdm-border-light: #e5e5e5;
    --sdm-dropdown-bg-light: #ffffff;
    --sdm-dropdown-shadow-light: 0 8px 32px rgba(0, 0, 0, 0.12);
    --sdm-dropdown-hover-light: #f5f5f5;
    --sdm-cta-accent-light: #1a1a1a;
    
    /* Colors - Dark Theme */
    --sdm-bg-dark: #1a1a1a;
    --sdm-bg-panel-dark: rgba(26, 26, 26, 0.95);
    --sdm-text-primary-dark: #ffffff;
    --sdm-text-secondary-dark: #b0b0b0;
    --sdm-text-muted-dark: #a3a3a3;
    --sdm-border-dark: rgba(255, 255, 255, 0.15);
    --sdm-dropdown-bg-dark: #252525;
    --sdm-dropdown-shadow-dark: 0 8px 32px rgba(0, 0, 0, 0.4);
    --sdm-dropdown-hover-dark: #333333;
    --sdm-cta-accent-dark: #ffffff;
    
    /* Dimensions */
    --sdm-max-width: 1400px;
    --sdm-padding-x: 48px;
    --sdm-top-padding-y: 20px;
    --sdm-nav-padding-y: 16px;
    --sdm-top-padding-y-scrolled: 14px;
    --sdm-nav-padding-y-scrolled: 12px;
    
    /* Dropdown dimensions */
    --sdm-dropdown-min-width: 200px;
    --sdm-dropdown-padding: 8px 0;
    --sdm-dropdown-item-padding: 10px 20px;
    --sdm-dropdown-border-radius: 8px;
    --sdm-dropdown-offset: 8px;
    --sdm-submenu-offset: 4px;
    
    /* Typography */
    --sdm-logo-size: 18px;
    --sdm-logo-weight: 700;
    --sdm-date-size: 11px;
    --sdm-link-size: 12px;
    --sdm-link-weight: 400;
    --sdm-link-gap: 48px;
    --sdm-cta-size: 11px;
    --sdm-cta-weight: 500;
    --sdm-cta-padding: 10px 24px;
    --sdm-dropdown-link-size: 14px;
    
    /* Mobile Typography */
    --sdm-mobile-logo-size: 20px;
    --sdm-mobile-link-size: 16px;
    --sdm-mobile-link-gap: 32px;
    --sdm-mobile-cta-size: 12px;
    --sdm-mobile-cta-padding: 14px 28px;
    
    /* Animations */
    --sdm-transition: 0.3s ease;
    --sdm-fade-transition: 0.6s ease-out;
    --sdm-mobile-transition: 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    --sdm-dropdown-transition: 0.2s ease;
    
    /* Blur effect */
    --sdm-blur: 8px;
    
    /* Z-index layers */
    --sdm-z-nav: 1000;
    --sdm-z-toggle: 1001;
    --sdm-z-dropdown: 1002;
    
    /* Hamburger */
    --sdm-hamburger-width: 20px;
    --sdm-hamburger-height: 2px;
    --sdm-hamburger-gap: 5px;
    
    /* Chevron */
    --sdm-chevron-size: 10px;
    
    /* Active theme variables (set by JS or CSS) */
    --sdm-bg: var(--sdm-bg-light);
    --sdm-bg-panel: var(--sdm-bg-panel-light);
    --sdm-text-primary: var(--sdm-text-primary-light);
    --sdm-text-secondary: var(--sdm-text-secondary-light);
    --sdm-text-muted: var(--sdm-text-muted-light);
    --sdm-border: var(--sdm-border-light);
    --sdm-dropdown-bg: var(--sdm-dropdown-bg-light);
    --sdm-dropdown-shadow: var(--sdm-dropdown-shadow-light);
    --sdm-dropdown-hover: var(--sdm-dropdown-hover-light);
    --sdm-cta-accent: var(--sdm-cta-accent-light);
}

/* =========================================
   BASE MENU STYLES
   ========================================= */

.serif-dropdown-menu {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--sdm-bg-panel);
    backdrop-filter: blur(var(--sdm-blur));
    -webkit-backdrop-filter: blur(var(--sdm-blur));
    border-bottom: 1px solid var(--sdm-border);
    z-index: var(--sdm-z-nav);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transition: background var(--sdm-transition),
                border-color var(--sdm-transition);
}

@keyframes serifDropdownMenuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom adjustment for section after the menu */
.serif-dropdown-menu + .is-section-10 { min-height: calc(10vh - 125px) !important; }
.serif-dropdown-menu + .is-section-15 { min-height: calc(15vh - 125px) !important; }
.serif-dropdown-menu + .is-section-20 { min-height: calc(20vh - 125px) !important; }
.serif-dropdown-menu + .is-section-25 { min-height: calc(25vh - 125px) !important; }
.serif-dropdown-menu + .is-section-30 { min-height: calc(30vh - 125px) !important; }
.serif-dropdown-menu + .is-section-40 { min-height: calc(40vh - 125px) !important; }
.serif-dropdown-menu + .is-section-50 { min-height: calc(50vh - 125px) !important; }
.serif-dropdown-menu + .is-section-60 { min-height: calc(60vh - 125px) !important; }
.serif-dropdown-menu + .is-section-70 { min-height: calc(70vh - 125px) !important; }
.serif-dropdown-menu + .is-section-75 { min-height: calc(75vh - 125px) !important; }
.serif-dropdown-menu + .is-section-80 { min-height: calc(80vh - 125px) !important; }
.serif-dropdown-menu + .is-section-85 { min-height: calc(85vh - 125px) !important; }
.serif-dropdown-menu + .is-section-90 { min-height: calc(90vh - 125px) !important; }
.serif-dropdown-menu + .is-section-100 { min-height: calc(100vh - 125px) !important; }

.serif-dropdown-menu + .box-canvas.is-section-10 { height: calc(10vh - 125px) !important; }
.serif-dropdown-menu + .box-canvas.is-section-15 { height: calc(15vh - 125px) !important; }
.serif-dropdown-menu + .box-canvas.is-section-20 { height: calc(20vh - 125px) !important; }
.serif-dropdown-menu + .box-canvas.is-section-25 { height: calc(25vh - 125px) !important; }
.serif-dropdown-menu + .box-canvas.is-section-30 { height: calc(30vh - 125px) !important; }
.serif-dropdown-menu + .box-canvas.is-section-40 { height: calc(40vh - 125px) !important; }
.serif-dropdown-menu + .box-canvas.is-section-50 { height: calc(50vh - 125px) !important; }
.serif-dropdown-menu + .box-canvas.is-section-60 { height: calc(60vh - 125px) !important; }
.serif-dropdown-menu + .box-canvas.is-section-70 { height: calc(70vh - 125px) !important; }
.serif-dropdown-menu + .box-canvas.is-section-75 { height: calc(75vh - 125px) !important; }
.serif-dropdown-menu + .box-canvas.is-section-80 { height: calc(80vh - 125px) !important; }
.serif-dropdown-menu + .box-canvas.is-section-85 { height: calc(85vh - 125px) !important; }
.serif-dropdown-menu + .box-canvas.is-section-90 { height: calc(90vh - 125px) !important; }
.serif-dropdown-menu + .box-canvas.is-section-100 { height: calc(100vh - 125px) !important; }

.serif-dropdown-menu *,
.serif-dropdown-menu *::before,
.serif-dropdown-menu *::after {
    box-sizing: border-box;
}

/* =========================================
   CONTAINER
   ========================================= */

.serif-dropdown-menu__container {
    max-width: var(--sdm-max-width);
    margin: 0 auto;
    padding: 0 var(--sdm-padding-x);
}

/* =========================================
   TOP ROW (Logo + Actions)
   ========================================= */

.serif-dropdown-menu__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sdm-top-padding-y) 0;
    border-bottom: 1px solid var(--sdm-border);
    transition: padding var(--sdm-transition),
                border-color var(--sdm-transition);
}

/* =========================================
   LOGO
   ========================================= */

.serif-dropdown-menu__logo {
    font-size: var(--sdm-logo-size);
    font-weight: var(--sdm-logo-weight);
    letter-spacing: -0.01em;
    color: var(--sdm-text-primary);
    text-decoration: none;
    transition: opacity var(--sdm-transition),
                color var(--sdm-transition);
    display: flex;
    align-items: center;
    z-index: var(--sdm-z-toggle);
}

.serif-dropdown-menu__logo:focus-visible {
    outline: 2px solid var(--sdm-text-primary);
    outline-offset: 4px;
    border-radius: 2px;
}

/* Logo with image support */
.serif-dropdown-menu__logo-combo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.serif-dropdown-menu__logo-image {
    height: 45px;
    width: auto;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    transition: height var(--sdm-transition),
                width var(--sdm-transition);
}

.serif-dropdown-menu__logo-image img {
    height: 100%;
    width: auto;
    object-fit: contain;
    display: block;
}

.serif-dropdown-menu__logo-image--rounded {
    width: 45px;
    border-radius: 50%;
    aspect-ratio: 1 / 1;
}

.serif-dropdown-menu__logo-image--rounded img {
    width: 100%;
    object-fit: cover;
}

/* =========================================
   ACTIONS (Date + CTA)
   ========================================= */

.serif-dropdown-menu__actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.serif-dropdown-menu__tagline {
    font-size: var(--sdm-date-size);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sdm-text-muted);
    font-weight: 400;
    transition: color var(--sdm-transition);
}

/* =========================================
   CTA BUTTON
   ========================================= */

.serif-dropdown-menu__cta {
    font-size: var(--sdm-cta-size);
    font-weight: var(--sdm-cta-weight);
    color: var(--sdm-cta-accent);
    text-decoration: none;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: var(--sdm-cta-padding);
    border: 1px solid var(--sdm-cta-accent);
    transition: all var(--sdm-transition);
    white-space: nowrap;
}

.serif-dropdown-menu__cta:hover {
    background: var(--sdm-cta-accent);
    color: var(--sdm-bg);
}

.serif-dropdown-menu__cta:focus-visible {
    outline: 2px solid var(--sdm-text-primary);
    outline-offset: 4px;
}

/* =========================================
   MENU TOGGLE (Hidden Checkbox)
   ========================================= */

.serif-dropdown-menu__toggle {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* =========================================
   HAMBURGER BUTTON
   ========================================= */

.serif-dropdown-menu__toggle-button {
    display: none;
    cursor: pointer;
    z-index: var(--sdm-z-toggle);
    padding: 10px;
    margin-right: -10px;
    user-select: none;
    background: none;
    border: none;
    position: relative;
}

.serif-dropdown-menu__toggle-button:focus-visible {
    outline: 2px solid var(--sdm-text-primary);
    outline-offset: 4px;
    border-radius: 2px;
}

.serif-dropdown-menu__hamburger {
    width: var(--sdm-hamburger-width);
    height: var(--sdm-hamburger-height);
    background: var(--sdm-text-primary);
    display: block;
    position: relative;
    transition: var(--sdm-transition);
}

.serif-dropdown-menu__hamburger::before,
.serif-dropdown-menu__hamburger::after {
    content: '';
    width: var(--sdm-hamburger-width);
    height: var(--sdm-hamburger-height);
    background: var(--sdm-text-primary);
    position: absolute;
    left: 0;
    transition: var(--sdm-transition);
}

.serif-dropdown-menu__hamburger::before {
    top: calc(-1 * var(--sdm-hamburger-gap));
}

.serif-dropdown-menu__hamburger::after {
    bottom: calc(-1 * var(--sdm-hamburger-gap));
}

/* =========================================
   NAVIGATION ROW
   ========================================= */

.serif-dropdown-menu__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sdm-link-gap);
    padding: var(--sdm-nav-padding-y) 0;
    transition: padding var(--sdm-transition),
                gap var(--sdm-transition);
}

.serif-dropdown-menu__nav-list {
    display: flex;
    align-items: center;
    gap: var(--sdm-link-gap);
    list-style: none;
    margin: 0;
    padding: 0;
}

/* =========================================
   NAV ITEMS & LINKS
   ========================================= */

.serif-dropdown-menu__nav-item {
    position: relative;
}

.serif-dropdown-menu__link-wrapper {
    display: flex;
    align-items: center;
    position: relative;
}

.serif-dropdown-menu__link {
    font-size: var(--sdm-link-size);
    font-weight: var(--sdm-link-weight);
    color: var(--sdm-text-secondary);
    text-decoration: none;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: color var(--sdm-transition);
    position: relative;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.serif-dropdown-menu__link:hover,
.serif-dropdown-menu__link:focus-visible {
    color: var(--sdm-text-primary);
}

.serif-dropdown-menu__link:focus-visible {
    outline: 2px solid var(--sdm-text-primary);
    outline-offset: 4px;
    border-radius: 2px;
}

.serif-dropdown-menu__link--active {
    color: var(--sdm-text-primary);
}

/* =========================================
   CHEVRON ICON
   ========================================= */

.serif-dropdown-menu__chevron {
    width: var(--sdm-chevron-size);
    height: var(--sdm-chevron-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--sdm-dropdown-transition);
    flex-shrink: 0;
}

.serif-dropdown-menu__chevron svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Rotate chevron when dropdown is open */
.serif-dropdown-menu__nav-item--open > .serif-dropdown-menu__link .serif-dropdown-menu__chevron,
.serif-dropdown-menu__nav-item--open > .serif-dropdown-menu__link-wrapper > .serif-dropdown-menu__link .serif-dropdown-menu__chevron {
    transform: rotate(180deg);
}

/* =========================================
   CHEVRON TOGGLE BUTTON (Mobile split target)
   ========================================= */

.serif-dropdown-menu__chevron-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 8px;
    margin: 0;
    cursor: pointer;
    color: var(--sdm-text-secondary);
    transition: color var(--sdm-transition);
}

.serif-dropdown-menu__chevron-toggle:hover,
.serif-dropdown-menu__chevron-toggle:focus-visible {
    color: var(--sdm-text-primary);
}

.serif-dropdown-menu__chevron-toggle:focus-visible {
    outline: 2px solid var(--sdm-text-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

.serif-dropdown-menu__chevron-toggle .serif-dropdown-menu__chevron {
    width: 12px;
    height: 12px;
}

/* =========================================
   DROPDOWN PANEL (Desktop)
   ========================================= */

.serif-dropdown-menu__dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: var(--sdm-dropdown-min-width);
    background: var(--sdm-dropdown-bg);
    border-radius: var(--sdm-dropdown-border-radius);
    box-shadow: var(--sdm-dropdown-shadow);
    padding: var(--sdm-dropdown-padding);
    margin-top: var(--sdm-dropdown-offset);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) translateY(-10px);
    transition: opacity var(--sdm-dropdown-transition),
                visibility var(--sdm-dropdown-transition),
                transform var(--sdm-dropdown-transition);
    z-index: var(--sdm-z-dropdown);
}

/* Show dropdown on hover/open */
.serif-dropdown-menu__nav-item--open > .serif-dropdown-menu__dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.serif-dropdown-menu__dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* =========================================
   DROPDOWN ITEMS
   ========================================= */

.serif-dropdown-menu__dropdown-item {
    position: relative;
}

.serif-dropdown-menu__dropdown-link-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.serif-dropdown-menu__dropdown-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--sdm-dropdown-item-padding);
    font-size: var(--sdm-dropdown-link-size);
    color: var(--sdm-text-secondary);
    text-decoration: none;
    transition: background var(--sdm-dropdown-transition),
                color var(--sdm-dropdown-transition);
    white-space: nowrap;
}

.serif-dropdown-menu__dropdown-link:hover,
.serif-dropdown-menu__dropdown-link:focus-visible {
    background: var(--sdm-dropdown-hover);
    color: var(--sdm-text-primary);
}

.serif-dropdown-menu__dropdown-link:focus-visible {
    outline: none;
    background: var(--sdm-dropdown-hover);
}

/* Nested dropdown chevron points right */
.serif-dropdown-menu__dropdown-link .serif-dropdown-menu__chevron {
    transform: rotate(-90deg);
}

.serif-dropdown-menu__dropdown-item--open > .serif-dropdown-menu__dropdown-link .serif-dropdown-menu__chevron,
.serif-dropdown-menu__dropdown-item--open > .serif-dropdown-menu__dropdown-link-wrapper > .serif-dropdown-menu__dropdown-link .serif-dropdown-menu__chevron {
    transform: rotate(90deg);
}

/* =========================================
   NESTED SUBMENU (Desktop)
   ========================================= */

.serif-dropdown-menu__submenu {
    position: absolute;
    top: 0;
    left: 100%;
    min-width: var(--sdm-dropdown-min-width);
    background: var(--sdm-dropdown-bg);
    border-radius: var(--sdm-dropdown-border-radius);
    box-shadow: var(--sdm-dropdown-shadow);
    padding: var(--sdm-dropdown-padding);
    margin-left: var(--sdm-submenu-offset);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-10px);
    transition: opacity var(--sdm-dropdown-transition),
                visibility var(--sdm-dropdown-transition),
                transform var(--sdm-dropdown-transition);
    z-index: var(--sdm-z-dropdown);
}

/* Show submenu on hover/open */
.serif-dropdown-menu__dropdown-item--open > .serif-dropdown-menu__submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

/* Mobile CTA (hidden by default, shown in mobile nav) */
.serif-dropdown-menu__nav-cta {
    display: none;
}

/* =========================================
   THEME VARIATIONS
   ========================================= */

/* Dark Theme Override */
.serif-dropdown-menu--theme-dark {
    --sdm-bg: var(--sdm-bg-dark);
    --sdm-bg-panel: var(--sdm-bg-panel-dark);
    --sdm-text-primary: var(--sdm-text-primary-dark);
    --sdm-text-secondary: var(--sdm-text-secondary-dark);
    --sdm-text-muted: var(--sdm-text-muted-dark);
    --sdm-border: var(--sdm-border-dark);
    --sdm-dropdown-bg: var(--sdm-dropdown-bg-dark);
    --sdm-dropdown-shadow: var(--sdm-dropdown-shadow-dark);
    --sdm-dropdown-hover: var(--sdm-dropdown-hover-dark);
    --sdm-cta-accent: var(--sdm-cta-accent-dark);
}

/* =========================================
   SCROLLED STATE
   ========================================= */
@media (min-width: 768px) {
    .serif-dropdown-menu--scrolled .serif-dropdown-menu__top {
        padding: var(--sdm-top-padding-y-scrolled) 0;
    }


    .serif-dropdown-menu--scrolled .serif-dropdown-menu__nav {
        padding: var(--sdm-nav-padding-y-scrolled) 0;
    }

    .serif-dropdown-menu--scrolled .serif-dropdown-menu__logo-image {
        height: 36px;
    }

    .serif-dropdown-menu--scrolled .serif-dropdown-menu__logo-image--rounded {
        width: 36px;
    }
}

/* =========================================
   RESPONSIVE / MOBILE STYLES
   ========================================= */

@media (max-width: 1024px) {
    .serif-dropdown-menu {
        --sdm-link-gap: 32px;
    }
}

@media (max-width: 768px) {
    .serif-dropdown-menu {
        --sdm-padding-x: 24px;
        --sdm-top-padding-y: 16px;
        --sdm-nav-padding-y: 14px;
        --sdm-top-padding-y-scrolled: 12px;
        --sdm-nav-padding-y-scrolled: 10px;
    }
    
    .serif-dropdown-menu__toggle-button {
        display: block;
    }
    
    .serif-dropdown-menu__logo {
        font-size: var(--sdm-mobile-logo-size);
    }
    
    .serif-dropdown-menu__tagline {
        display: none;
    }
    
    /* Hide desktop CTA */
    .serif-dropdown-menu__actions .serif-dropdown-menu__cta {
        display: none;
    }
    
    /* Navigation becomes full-screen overlay */
    .serif-dropdown-menu__nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--sdm-bg);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        gap: 0;
        padding: 80px 24px 40px;
        transform: translateY(-100%);
        transition: transform var(--sdm-mobile-transition);
        z-index: var(--sdm-z-nav);
        overflow-y: auto;
    }
    
    .serif-dropdown-menu__nav-list {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
    }
    
    .serif-dropdown-menu__nav-item {
        border-bottom: 1px solid var(--sdm-border);
    }
    
    .serif-dropdown-menu__link-wrapper {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .serif-dropdown-menu__link {
        font-size: var(--sdm-mobile-link-size);
        color: var(--sdm-text-primary);
        padding: 16px 0;
        flex: 1;
    }
    
    /* Hide inline chevron on mobile for non-container items */
    .serif-dropdown-menu__link .serif-dropdown-menu__chevron {
        display: none;
    }
    
    /* Show chevron toggle button on mobile for non-container items with children */
    .serif-dropdown-menu__chevron-toggle {
        display: flex;
        padding: 16px;
        margin-right: -16px;
    }
    
    /* For container items, show chevron in link and hide toggle button */
    .serif-dropdown-menu__nav-item[data-is-container] > .serif-dropdown-menu__link .serif-dropdown-menu__chevron,
    .serif-dropdown-menu__nav-item[data-is-container] > .serif-dropdown-menu__link-wrapper > .serif-dropdown-menu__link .serif-dropdown-menu__chevron {
        display: inline-flex;
    }
    
    .serif-dropdown-menu__nav-item[data-is-container] > .serif-dropdown-menu__link-wrapper > .serif-dropdown-menu__chevron-toggle {
        display: none;
    }
    
    /* Mobile dropdown styles */
    .serif-dropdown-menu__dropdown {
        position: static;
        transform: none;
        min-width: 100%;
        background: transparent;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        margin: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        pointer-events: none;
        transition: max-height var(--sdm-mobile-transition);
    }
    
    .serif-dropdown-menu__nav-item--open > .serif-dropdown-menu__dropdown {
        max-height: 1000px;
        transform: none;
        pointer-events: auto;
    }
    
    .serif-dropdown-menu__dropdown-list {
        padding-left: 16px;
        border-left: 2px solid var(--sdm-border);
        margin-left: 8px;
    }
    
    .serif-dropdown-menu__dropdown-item {
        border-bottom: none;
    }
    
    .serif-dropdown-menu__dropdown-link-wrapper {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .serif-dropdown-menu__dropdown-link {
        font-size: 15px;
        padding: 12px 0;
        flex: 1;
    }
    
    .serif-dropdown-menu__dropdown-link:hover,
    .serif-dropdown-menu__dropdown-link:focus-visible {
        background: transparent;
    }
    
    /* Hide inline chevron on mobile for non-container dropdown items */
    .serif-dropdown-menu__dropdown-link .serif-dropdown-menu__chevron {
        display: none;
    }
    
    /* Show chevron toggle for dropdown items with children */
    .serif-dropdown-menu__dropdown-item .serif-dropdown-menu__chevron-toggle {
        display: flex;
        padding: 12px;
        margin-right: -12px;
    }
    
    /* For container dropdown items, show chevron in link */
    .serif-dropdown-menu__dropdown-item[data-is-container] > .serif-dropdown-menu__dropdown-link .serif-dropdown-menu__chevron,
    .serif-dropdown-menu__dropdown-item[data-is-container] > .serif-dropdown-menu__dropdown-link-wrapper > .serif-dropdown-menu__dropdown-link .serif-dropdown-menu__chevron {
        display: inline-flex;
        transform: rotate(0deg);
    }
    
    .serif-dropdown-menu__dropdown-item[data-is-container] > .serif-dropdown-menu__dropdown-link-wrapper > .serif-dropdown-menu__chevron-toggle {
        display: none;
    }
    
    /* Mobile submenu */
    .serif-dropdown-menu__submenu {
        position: static;
        transform: none;
        min-width: 100%;
        background: transparent;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        margin: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        pointer-events: none;
        transition: max-height var(--sdm-mobile-transition);
    }
    
    .serif-dropdown-menu__dropdown-item--open > .serif-dropdown-menu__submenu {
        max-height: 500px;
        transform: none;
        pointer-events: auto;
    }
    
    .serif-dropdown-menu__submenu .serif-dropdown-menu__dropdown-list {
        padding-left: 16px;
        border-left: 2px solid var(--sdm-border);
        margin-left: 8px;
    }
    
    /* Mobile chevron rotation */
    .serif-dropdown-menu__nav-item--open > .serif-dropdown-menu__link-wrapper > .serif-dropdown-menu__chevron-toggle .serif-dropdown-menu__chevron,
    .serif-dropdown-menu__dropdown-item--open > .serif-dropdown-menu__dropdown-link-wrapper > .serif-dropdown-menu__chevron-toggle .serif-dropdown-menu__chevron {
        transform: rotate(180deg);
    }
    
    /* Container item chevron rotation on mobile */
    .serif-dropdown-menu__nav-item--open[data-is-container] > .serif-dropdown-menu__link .serif-dropdown-menu__chevron,
    .serif-dropdown-menu__nav-item--open[data-is-container] > .serif-dropdown-menu__link-wrapper > .serif-dropdown-menu__link .serif-dropdown-menu__chevron,
    .serif-dropdown-menu__dropdown-item--open[data-is-container] > .serif-dropdown-menu__dropdown-link .serif-dropdown-menu__chevron,
    .serif-dropdown-menu__dropdown-item--open[data-is-container] > .serif-dropdown-menu__dropdown-link-wrapper > .serif-dropdown-menu__dropdown-link .serif-dropdown-menu__chevron {
        transform: rotate(180deg);
    }
    
    /* Mobile CTA inside nav */
    .serif-dropdown-menu__nav-cta {
        display: block;
        margin-top: 32px;
        text-align: center;
    }
    
    .serif-dropdown-menu__nav-cta .serif-dropdown-menu__cta {
        font-size: var(--sdm-mobile-cta-size);
        padding: var(--sdm-mobile-cta-padding);
        min-width: 200px;
        display: inline-block;
    }
    
    /* Menu Open State */
    .serif-dropdown-menu__toggle:checked ~ .serif-dropdown-menu__container .serif-dropdown-menu__nav {
        transform: translateY(0);
    }
    
    .serif-dropdown-menu__toggle:checked ~ .serif-dropdown-menu__container .serif-dropdown-menu__top .serif-dropdown-menu__hamburger {
        background: transparent;
    }
    
    .serif-dropdown-menu__toggle:checked ~ .serif-dropdown-menu__container .serif-dropdown-menu__top .serif-dropdown-menu__hamburger::before {
        transform: rotate(45deg) translate(3px, 4px);
    }
    
    .serif-dropdown-menu__toggle:checked ~ .serif-dropdown-menu__container .serif-dropdown-menu__top .serif-dropdown-menu__hamburger::after {
        transform: rotate(-45deg) translate(3px, -4px);
    }
    
    /* Prevent body scroll when menu is open */
    body:has(.serif-dropdown-menu__toggle:checked) {
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    .serif-dropdown-menu {
        --sdm-padding-x: 20px;
        --sdm-top-padding-y: 14px;
        --sdm-top-padding-y-scrolled: 10px;
        --sdm-nav-padding-y-scrolled: 8px;
    }
    
    .serif-dropdown-menu__nav {
        padding: 60px 20px 40px;
    }
    
    .serif-dropdown-menu__link {
        font-size: 18px;
    }
}

/* =========================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================= */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .serif-dropdown-menu,
    .serif-dropdown-menu *,
    .serif-dropdown-menu *::before,
    .serif-dropdown-menu *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .serif-dropdown-menu {
        border-bottom-width: 2px;
    }
    
    .serif-dropdown-menu__top {
        border-bottom-width: 2px;
    }
    
    .serif-dropdown-menu__link:focus-visible,
    .serif-dropdown-menu__logo:focus-visible,
    .serif-dropdown-menu__cta:focus-visible,
    .serif-dropdown-menu__toggle-button:focus-visible,
    .serif-dropdown-menu__dropdown-link:focus-visible {
        outline-width: 3px;
    }
}

/* Screen reader only class (utility) */
.serif-dropdown-menu__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* =========================================
   OPTIONAL MODIFIERS
   ========================================= */

/* Fixed position variant */
.serif-dropdown-menu--fixed {
    position: fixed;
}

/* No animation on load */
.serif-dropdown-menu--no-animation {
    animation: none;
}

/* Compact variant */
.serif-dropdown-menu--compact {
    --sdm-top-padding-y: 14px;
    --sdm-nav-padding-y: 12px;
    --sdm-logo-size: 16px;
    --sdm-link-size: 12px;
}

/* Single row variant (hide nav row) */
.serif-dropdown-menu--single-row .serif-dropdown-menu__nav {
    display: none;
}

.serif-dropdown-menu--single-row .serif-dropdown-menu__top {
    border-bottom: none;
}

/* Skip link for accessibility */
.serif-dropdown-menu__skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    background: var(--sdm-text-primary);
    color: var(--sdm-bg);
    padding: 8px 16px;
    text-decoration: none;
    font-size: 14px;
    z-index: calc(var(--sdm-z-toggle) + 1);
    border-radius: 4px;
    transition: top 0.2s ease;
}

.serif-dropdown-menu__skip-link:focus {
    top: 8px;
}

/* =========================================================================
   NESTED MENU FIX (repo-hosted) — added by Midas
   Open on CSS :hover, map the markup's "__sub-dropdown*" classes onto the
   template's existing submenu styles, remove stray list markers, hide the raw
   toggle buttons, and add hover bridges across the panel gaps so the menu does
   not close before the cursor can reach the (nested) items.
   ========================================================================= */

.serif-dropdown-menu__dropdown,
.serif-dropdown-menu__sub-dropdown,
.serif-dropdown-menu__dropdown-item,
.serif-dropdown-menu__sub-dropdown-item { list-style: none; }

.serif-dropdown-menu__dropdown-toggle,
.serif-dropdown-menu__sub-dropdown-toggle { display: none; }

.serif-dropdown-menu__link--has-dropdown::after,
.serif-dropdown-menu__dropdown-link--has-dropdown::after {
    content: '';
    width: 6px; height: 6px;
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
    transform-origin: center;
    opacity: .6;
    margin-top: -2px;
    flex-shrink: 0;
    transition: transform .2s ease;
}
.serif-dropdown-menu__dropdown-link--has-dropdown::after { transform: rotate(-45deg); margin-top: 0; }

.serif-dropdown-menu__sub-dropdown {
position: absolute;
    top: 0;
    left: 100%;
    min-width: var(--sdm-dropdown-min-width);
    background: var(--sdm-dropdown-bg);
    border-radius: var(--sdm-dropdown-border-radius);
    box-shadow: var(--sdm-dropdown-shadow);
    padding: var(--sdm-dropdown-padding);
    /*
     * Overlap the parent panel by 1px instead of leaving a transparent gap. A
     * transparent hover-bridge across a real gap loses the hit-test to page
     * content painted in a transformed stacking context (e.g. the hero slider),
     * so the flyout would close as the cursor crossed. Touching opaque panels
     * never expose that seam. The widened ::before below is a second safety net.
     */
    margin-left: -1px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-10px);
    transition: opacity var(--sdm-dropdown-transition),
                visibility var(--sdm-dropdown-transition),
                transform var(--sdm-dropdown-transition);
    z-index: var(--sdm-z-dropdown);
}
.serif-dropdown-menu__sub-dropdown-item {
position: relative;
}
.serif-dropdown-menu__sub-dropdown-link {
display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--sdm-dropdown-item-padding);
    font-size: var(--sdm-dropdown-link-size);
    color: var(--sdm-text-secondary);
    text-decoration: none;
    transition: background var(--sdm-dropdown-transition),
                color var(--sdm-dropdown-transition);
    white-space: nowrap;
}
.serif-dropdown-menu__sub-dropdown-link:hover {
    text-decoration: none;
}

.serif-dropdown-menu__dropdown-item--open > .serif-dropdown-menu__sub-dropdown {
    opacity: 1; visibility: visible; pointer-events: auto; transform: none;
}

@media (min-width: 769px) {
    .serif-dropdown-menu__nav-item:hover > .serif-dropdown-menu__dropdown {
        opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0);
    }
    .serif-dropdown-menu__nav-item:hover > .serif-dropdown-menu__link-wrapper > .serif-dropdown-menu__link--has-dropdown::after {
        transform: rotate(225deg); margin-top: 2px;
    }
    .serif-dropdown-menu__dropdown-item:hover > .serif-dropdown-menu__sub-dropdown {
        opacity: 1; visibility: visible; pointer-events: auto; transform: none;
    }
    /* Hover bridge: first-level dropdown (fills the gap below the trigger) */
    .serif-dropdown-menu__dropdown::before {
        content: '';
        position: absolute;
        left: 0; right: 0;
        bottom: 100%;
        height: calc(var(--sdm-dropdown-offset) + 8px);
    }
    /*
     * Hover bridge: second-level flyout. Reaches ~10px back into the parent
     * panel's opaque area (which itself wins the hit-test over page content) so
     * the cursor path from row to flyout is continuously backed and never falls
     * through onto whatever sits behind the menu.
     */
    .serif-dropdown-menu__sub-dropdown::before {
        content: '';
        position: absolute;
        top: 0; bottom: 0;
        left: -10px;
        width: 14px;
    }
}


/* MIDAS first-level hover bridge */
/*
 * The gap between a top-level item and its dropdown sits inside the nav bar/pill,
 * where the item's own hover box does not reach (and a backdrop-filter pill paints
 * over any bridge placed on the panel). This pseudo-element fills that gap with a
 * z-index above the bar, and — being part of the item — keeps the item hovered so
 * the dropdown stays open while the cursor crosses to it. Only present while the
 * item is hovered/open, so it never intercepts the page otherwise.
 */
@media (min-width: 769px) {
    .serif-dropdown-menu__nav-item { position: relative; }
    .serif-dropdown-menu__nav-item:hover::after,
    .serif-dropdown-menu__nav-item--open::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: 22px;
        z-index: 2000;
    }
}
