/* MENU: sticky glass bar with the logo; uses the panel variables from styles.css (themes may override) */
.menubar {
    position: sticky;
    top: 0;
    z-index: 100;
    isolation: isolate;
    display: flex;
    align-items: center;
    gap: 8px 16px;
    padding: 6px max(16px, env(safe-area-inset-right, 0px)) 6px max(16px, env(safe-area-inset-left, 0px));
    color: var(--panel-fg);
    font: 500 16px/1.4 var(--panel-font);
    text-align: left;
}
/* glass on a pseudo-element: blur on the bar itself would stop the dropdowns from blurring the page */
.menubar::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--panel-bg);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    backdrop-filter: blur(14px) saturate(1.2);
    border-radius: inherit;
}
.menubar::before {
    border-bottom: 1px solid var(--panel-line);
    box-shadow: 0 8px 24px -18px rgb(0 0 0 / .5);
}
.menu-logo {
    font-family: stanistilFont;
    font-size: 34px;
    font-weight: normal;
    line-height: 1.1;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}
.menubar a, .menubar a:hover {
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
}
.menuitem a, button.menuitem {
    display: block;
    padding: 6px 12px;
    border-radius: 8px;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    width: 100%;
    cursor: pointer;
}
.menuitem a:hover, button.menuitem:hover, .menutitle:hover {
    background: rgb(127 127 127 / .15);
}
.menutitle {
    border: 0;
    background: none;
    color: inherit;
    font: 600 16px var(--panel-font);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
}
button.menutitle::after { content: " \25BE"; font-size: .8em; opacity: .7; }
#selected_event { font: inherit; font-size: 14px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--panel-line); max-width: 220px; }

/* phones and tablets: logo + Menu button, the menu folds open under the bar (menu.js toggles display) */
@media (max-width: 991.98px) {
    .menubutton {
        margin-left: auto;
        border: 1px solid var(--panel-line);
        border-radius: 999px;
        background: none;
        color: inherit;
        font: 600 15px var(--panel-font);
        padding: 6px 16px;
        cursor: pointer;
    }
    .menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        padding: 8px 16px 16px;
        isolation: isolate;
    }
    .menu::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background: var(--panel-bg);
        -webkit-backdrop-filter: blur(14px) saturate(1.2);
        backdrop-filter: blur(14px) saturate(1.2);
        border-bottom: 1px solid var(--panel-line);
    }
    div.menutitle {
        padding: 12px 12px 2px;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: .08em;
        opacity: .7;
    }
    .language-menu .menuselection { display: flex; gap: 4px; }
    .language-menu button.menuitem { width: auto; text-transform: uppercase; }
}

/* desktop: links in the bar, groups open as glass dropdowns */
@media (min-width: 992px) {
    .menu {
        display: flex;
        align-items: center;
        flex: 1;
        gap: 4px;
    }
    .menu-group {
        position: relative;
    }
    .menuselection {
        display: none;
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        min-width: 220px;
        padding: 6px;
        border-radius: 12px;
        isolation: isolate;
        z-index: 1;
    }
    .menuselection::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background: var(--panel-bg);
        -webkit-backdrop-filter: blur(14px) saturate(1.2);
        backdrop-filter: blur(14px) saturate(1.2);
        border-radius: inherit;
        border: 1px solid var(--panel-line);
        box-shadow: 0 14px 30px -16px rgb(0 0 0 / .5);
    }
    .menuitem a { font-weight: 600; }
    .menu > .menuitem a { display: inline-block; }
    .language-menu {
        margin-left: auto;
    }
    .language-menu .menuselection {
        left: auto;
        right: 0;
        min-width: 80px;
    }
    .language-menu .menutitle { text-transform: uppercase; }
}
