#header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: center;
    height: 72px;
    width: 100%;
    box-shadow: initial;
    background-color: var(--bg-mono);
    z-index: var(--z-header);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 0 var(--page-gutter-px);
    max-width: var(--max-content-width);
}

#header-behind {
    height: 0px;
}

#header-image {
    width: fit-content;
}

#header-image img {
    height: 2.5rem;
}

#header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#header-actions .login {
    background: var(--brand-primary-gradient);
    color: var(--brand-on-primary);
}

#header-actions .login:hover {
    background: var(--brand-primary-gradient-hover);
}

.header-logout-form {
    margin: 0;
    padding: 0;
    display: contents;
}

#header-actions .logout {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

#header-actions .logout:hover {
    background: var(--bg-accent);
}

.header-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 2rem;
    min-width: 6rem;
    padding-left: 12px;
    padding-right: 12px;
    font-size: 1rem;
    font-family: inherit;
    border: none;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.header-btn.logout,
.header-btn.login {
    font-size: 0.875rem;
    border-radius: var(--radius-full);
}

@media screen and (max-width: 768px) {
    #header {
        height: 60px;
    }

    #header-image img {
        height: 2rem;
    }

        .header-btn {
        height: 1.5rem;
        width: 4.75rem;
    }
}

@media screen and (max-width: 480px) {
    #header {
        position: fixed;
    }

    #header-behind {
        height: 60px;
    }

    #header-image img {
        height: 1.5rem;
    }

    .header-btn {
        height: 1.75rem;
        min-width: 3.75rem;
        width: auto;
        font-size: 0.6875rem;
    }
}

/* Coloration */
/* .darkmode #header {
    background-color: #000000;
}
.lightmode #header {
    background-color: #FFFFFF;
} */


/* #header-actions .logout,
#header-actions .login {
    background: var(--brand-primary-gradient);
    color: var(--dark-bg-primary);
}

#header-actions .logout:hover,
#header-actions .login:hover {
    background: var(--brand-primary-gradient-hover);
}

.darkmode #header-actions .logout {
    background: var(--dark-bg-accent);
    color: var(--dark-text-primary);
}
.lightmode #header-actions .logout {
    background: var(--light-bg-accent);
    color: var(--light-text-primary);
} */

/* Header Dropdown Overrides */
/* Header dropdowns are always on the right side, so they drop down and align right */
#header-actions .dropdown-menu {
    right: 0;
    left: auto;
    top: 100%;
    transform: translateY(0.5rem);
    margin-bottom: 0.5rem;
}

#header-actions .dropdown-menu.show {
    transform: translateY(0.5rem);
}

/* Mobile overrides for header dropdowns */
@media screen and (max-width: 768px) {
    #header-actions .dropdown-menu {
        right: 0;
        left: auto;
    }
}

@media screen and (max-width: 480px) {
    #header-actions .dropdown-menu {
        right: 0;
        left: auto;
    }
}

/* Header Tooltip Overrides */
/* Header tooltips should appear below the button */
#header-actions .dropdown-tooltip {
    bottom: -2.5rem;
    top: auto;
    transform: translateX(-50%);
}

#header-actions .dropdown-tooltip::before {
    top: -0.25rem;
    bottom: auto;
    border-top: none;
    border-bottom: 0.25rem solid var(--bg-tertiary);
    border-left: 0.25rem solid transparent;
    border-right: 0.25rem solid transparent;
}

/* ========================================
   LIGHTMODE OVERRIDES
   ======================================== */

/* White header floats above #f0f2f5 content */
.lightmode #header {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
}

/* --bg-tertiary on white header is nearly invisible;
   subtle shadow gives definition without a hard edge */
.lightmode #header-actions .logout {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Same treatment for language selector */
.lightmode #header-actions .language-selector-btn {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}