/* ==========================================================================
   Game Header Bar — [game_header_bar]
   3-column flexbox row: Logo (left) | Nav (centre) | Pills (right)
   All visual properties use !important to override Salient global styles.
   ========================================================================== */

/* ── Container ─────────────────────────────────────────────────────────── */

.eg-header-bar {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    gap: 1rem !important;
    padding: 0.5rem 1.25rem !important;
    background: transparent !important;
    min-height: 56px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* ── Logo column (left, shrinks to fit) ────────────────────────────────── */

.eg-header-bar .eg-hb-logo {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
}

.eg-header-bar .eg-hb-logo a {
    display: block !important;
    line-height: 1 !important;
    text-decoration: none !important;
    color: inherit !important;
    border: none !important;
    box-shadow: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.eg-header-bar .eg-hb-logo img {
    display: block !important;
    height: auto !important;
    width: auto !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.eg-header-bar .eg-hb-site-name {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: inherit !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

/* ── Nav column (centre, grows to fill) ────────────────────────────────── */

.eg-header-bar .eg-hb-nav {
    flex: 1 1 auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Reset Salient list/menu styles inside this nav */
.eg-header-bar .eg-hb-nav .eg-hb-menu,
.eg-header-bar .eg-hb-nav .eg-hb-menu ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.eg-header-bar .eg-hb-nav .eg-hb-menu > li {
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    float: none !important;
}

.eg-header-bar .eg-hb-nav .eg-hb-menu > li > a {
    display: inline-flex !important;
    align-items: center !important;
    padding: 0.4rem 0.75rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: inherit !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    white-space: nowrap !important;
    border-radius: 4px !important;
    transition: background 0.15s, color 0.15s !important;
}

.eg-header-bar .eg-hb-nav .eg-hb-menu > li > a:hover {
    background: rgba(0, 0, 0, 0.06) !important;
    color: inherit !important;
    text-decoration: none !important;
}

/* Current menu item highlight */
.eg-header-bar .eg-hb-nav .eg-hb-menu > li.current-menu-item > a,
.eg-header-bar .eg-hb-nav .eg-hb-menu > li.current-page-item > a {
    font-weight: 700 !important;
}

/* ── Pills column (right, shrinks to fit) ──────────────────────────────── */

.eg-header-bar .eg-hb-pills {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    margin-left: auto !important;
}

/* ── Outer wrapper: positioning frame (goes position:fixed when sticky) ───── */

.eg-header-bar-outer {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ── Background layer: always auto-height, owns background & shadow ────────
   Sits between the outer (positioning) and the inner bar (content/max-width).
   Having its own layer means bg renders at full viewport width regardless of
   the inner bar's max-width, and avoids height:0 / transparent !important
   battles on both the outer and the inner. ─────────────────────────────── */

.eg-hb-bg {
    width: 100% !important;
    box-sizing: border-box !important;
    transition: background-color 0.28s ease, box-shadow 0.28s ease !important;
}

/* ── Burger button ──────────────────────────────────────────────────────── */

.eg-header-bar .eg-hb-burger {
    display: none !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 5px !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    color: inherit !important;
    line-height: 1 !important;
}

.eg-header-bar .eg-hb-burger:hover {
    background: rgba(0, 0, 0, 0.06) !important;
}

.eg-header-bar .eg-hb-burger span {
    display: block !important;
    width: 20px !important;
    height: 2px !important;
    background: currentColor !important;
    border-radius: 2px !important;
    transition: transform 0.2s ease, opacity 0.2s ease !important;
    flex-shrink: 0 !important;
}

/* Burger → X when nav open */
.eg-header-bar .eg-hb-nav.eg-nav-open .eg-hb-burger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg) !important;
}

.eg-header-bar .eg-hb-nav.eg-nav-open .eg-hb-burger span:nth-child(2) {
    opacity: 0 !important;
    transform: scaleX(0) !important;
}

.eg-header-bar .eg-hb-nav.eg-nav-open .eg-hb-burger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg) !important;
}

/* Override Salient's global button selector (specificity 0,1,0,1 → needs 0,1,2,0) */
body[data-button-style] .eg-header-bar .eg-hb-burger {
    padding: 0 !important;
    background: none !important;
    border: none !important;
    width: 36px !important;
    height: 36px !important;
    min-height: 0 !important;
    font-size: 0 !important;
    line-height: 1 !important;
}

body[data-button-style] .eg-header-bar .eg-hb-burger:hover {
    background: rgba(0, 0, 0, 0.06) !important;
}

/* ── Responsive: burger mode ≤ 640px ───────────────────────────────────── */

@media (max-width: 640px) {
    .eg-header-bar {
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
        padding: 0.5rem 0.75rem !important;
    }

    /* Nav shrinks to just the burger icon; menu is revealed as a dropdown */
    .eg-header-bar .eg-hb-nav {
        order: 0 !important;
        flex: 0 0 auto !important;
        justify-content: flex-start !important;
        border-top: none !important;
        padding-top: 0 !important;
        position: relative !important;
    }

    .eg-header-bar .eg-hb-burger {
        display: flex !important;
    }

    .eg-header-bar .eg-hb-nav .eg-hb-menu {
        display: none !important;
    }

    /* Open state: dropdown panel below the burger */
    .eg-header-bar .eg-hb-nav.eg-nav-open .eg-hb-menu {
        display: flex !important;
        flex-direction: column !important;
        position: absolute !important;
        top: calc(100% + 4px) !important;
        left: 0 !important;
        min-width: 160px !important;
        background: #fff !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 0.5rem !important;
        padding: 0.5rem 0 !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
        z-index: 100 !important;
        flex-wrap: nowrap !important;
        gap: 0 !important;
    }

    .eg-header-bar .eg-hb-nav.eg-nav-open .eg-hb-menu > li {
        width: 100% !important;
        float: none !important;
    }

    .eg-header-bar .eg-hb-nav.eg-nav-open .eg-hb-menu > li > a {
        display: block !important;
        padding: 0.5rem 1rem !important;
        border-radius: 0 !important;
        white-space: nowrap !important;
        text-align: left !important;
    }

    .eg-header-bar .eg-hb-pills {
        margin-left: auto !important;
    }
}
