/*
 * Header — namespace .h-*
 * Desktop bar (≥992px) + Mobile bar (<992px) handled here.
 * Menu rendering is in desktop-menu.css / mobile-menu.css (separate concerns).
 */

/* ───── Common ───── */
.h-bar-mobile,
.h-search-mobile,
.h-slogan-mobile {
    display: none;
}

/* ───── DESKTOP BAR (≥992px) ───── */
.h-bar-desktop {
    background: #fff;
}
.h-bar-desktop__inner {
    display: flex;
    align-items: center;
    max-width: 1440px;
    margin: 0 auto;
    padding: 10px 15px;
    gap: 16px;
}
.h-bar-desktop__logo {
    flex: 0 0 auto;
    line-height: 0;
}
.h-bar-desktop__logo img {
    display: block;
    width: 300px;
    max-width: 100%;
    height: auto;
}
.h-bar-desktop__slogan {
    flex: 1 1 auto;
    text-align: center;
    line-height: 0;
}
.h-bar-desktop__slogan img {
    display: inline-block;
    width: 300px;
    height: 30px;
    max-width: 100%;
}
.h-bar-desktop__search {
    flex: 0 0 280px;
    max-width: 280px;
}
.h-bar-desktop__theme {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
}

/* ───── MOBILE BAR (<992px) ───── */
@media (max-width: 991px) {
    .h-bar-desktop { display: none; }

    .h-bar-mobile {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        align-items: center;
        gap: 6px;
        padding: 6px 10px;
        height: 52px;
        background: #fff;
        box-shadow: 0 1px 4px rgba(0,0,0,.06);
    }

    /* Logo (free flex) */
    .h-bar-mobile__logo {
        flex: 1 1 auto;
        text-align: center;
        min-width: 0;
        line-height: 0;
        overflow: hidden;
    }
    .h-bar-mobile__logo img {
        display: inline-block;
        max-width: 100%;
        max-height: 36px;
        width: auto;
        height: auto;
        vertical-align: middle;
    }

    /* Avatar slot 40px (mini-login plugin overlays here) */
    .h-bar-mobile__avatar {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
    }

    /* Search button 30px */
    .h-bar-mobile__search-btn {
        flex: 0 0 30px;
        width: 30px;
        height: 30px;
        padding: 3px;
        background: transparent;
        border: 0;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .h-bar-mobile__search-btn img {
        display: block;
        width: 24px;
        height: 24px;
    }
    .h-bar-mobile__search-btn:hover img {
        filter: brightness(0) saturate(100%) invert(18%) sepia(93%) saturate(5236%) hue-rotate(356deg);
    }

    /* Theme toggle 38px (sun/moon icons styled in dark-mode.css) */
    .h-bar-mobile__theme {
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
    }

    /* Mini-login override — overlay over .h-bar-mobile__avatar slot */
    #mini-login-widget {
        position: fixed !important;
        top: 6px !important;
        right: 50px !important;
    }

    /* Search dropdown — slides under bar */
    .h-search-mobile {
        position: fixed;
        top: 52px;
        left: 0;
        right: 0;
        z-index: 999;
        padding: 10px;
        background: #fff;
        border-bottom: 1px solid #d1d5db;
        box-shadow: 0 4px 16px rgba(0,0,0,.12);
    }
    .h-search-mobile.is-open {
        display: block;
    }

    /* Slogan below fixed bar */
    .h-slogan-mobile {
        display: block;
        text-align: center;
        margin-top: 60px;
        padding: 6px 10px;
        line-height: 0;
    }
    .h-slogan-mobile img {
        display: inline-block;
        max-width: 300px;
        height: auto;
    }
}

/* ───── Theme toggle base (sun/moon swap CSS in dark-mode.css) ───── */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: #475569;
    cursor: pointer;
    transition: background .2s, color .2s, transform .2s;
}
.theme-toggle:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}
