/* ==========================================================================
 * wbs-nav.css — site-wide top menu for social.bitcoinpile.com (2026-09-02).
 *
 * Port of pacificair.com's navigation284.css submenu system (owner request:
 * "if need submenu implement the one we have implemented for PacificAir"),
 * recolored to bitcoinpile.com's palette (navy gradient bar, Bitcoin-orange
 * rule and highlights, Orbitron + Roboto). Same structure and mechanics:
 *   nav.navbar > ul > li > a  [+ ul.dropdown > li.has-submenu > a + ul.submenu]
 *   - dropdowns open on :hover with the slide-down animation
 *   - li.has-compact panels anchor under their item (PacificAir's
 *     .dropdown-compact hook, implemented); plain li are position:static so
 *     a full-width mega panel is available the day a menu grows big enough
 *   - aria-current wash + inset underline marks the current section
 *   - CSS dot separators between top-level items (never read by screen
 *     readers, vanish in burger mode)
 *   - <=768px burger menu; dropdowns suppressed there, so every top-level
 *     item must link to a real page
 *
 * Loaded by EVERY page (member pages, landing, account, terms, privacy).
 * The markup is rendered into <header id="wbs-nav"> by wbs.js — member pages
 * via WBS.boot(), standalone pages via WBS.topmenu().
 * ========================================================================== */

/* --- Fonts (2026-11-16): bitcoinpile.com's pair, Orbitron for headings and
   the wordmark, Roboto for everything else. Self-hosted latin subsets
   (variable fonts: one file covers every weight) rather than Google Fonts,
   so no page asks a third party for anything and the CSP stays 'self'.
   Declared here because this is the one stylesheet every page loads. --- */
@font-face {
    font-family: "Orbitron"; font-style: normal; font-weight: 400 900;
    font-display: swap; src: url(/static/fonts/orbitron-latin.woff2) format("woff2");
}
@font-face {
    font-family: "Roboto"; font-style: normal; font-weight: 100 900;
    font-display: swap; src: url(/static/fonts/roboto-latin.woff2) format("woff2");
}

/* --- Section colour (owner request 2026-09-02: "so we know where we
   are"). wbs.js stamps html[data-section]; the bar takes that section's
   gradient and rule, the rail card (wbs.css) its tint, and the current item
   becomes a chip in the section's highlight (--sec-hi). bitcoinpile.com's
   navy gradient with the Bitcoin-orange rule is the default and the brand;
   the live chat rooms run cyan, moderation red. Bars stay dark enough for
   white text (>= 7:1). --- */
:root {
    --sec-bar: #1a1a2e; --sec-bar-2: #2a2a4e; --sec-line: #f7931a;
    --sec-rail: #17172b; --sec-hi: #f7931a; --sec-hi-bg: rgba(247, 147, 26, 0.16);
    --sec-hi-line: rgba(247, 147, 26, 0.55);
}
html[data-section="hangout"] {
    --sec-bar: #0f1f2e; --sec-bar-2: #143447; --sec-line: #00d4ff;
    --sec-rail: #121f2b; --sec-hi: #00d4ff; --sec-hi-bg: rgba(0, 212, 255, 0.14);
    --sec-hi-line: rgba(0, 212, 255, 0.5);
}
/* "me" (account, help, search, activity) keeps the brand navy (owner,
   2026-09-03). */
html[data-section="mod"] {
    --sec-bar: #2e1219; --sec-bar-2: #4a1c26; --sec-line: #ff4d5e;
    --sec-rail: #271820; --sec-hi: #ff8a95; --sec-hi-bg: rgba(255, 77, 94, 0.16);
    --sec-hi-line: rgba(255, 77, 94, 0.55);
}

.navbar {
    /* bitcoinpile.com's .site-nav: a navy gradient over a 2px orange rule,
       white foreground; the dropdown panels stay dark. */
    background: linear-gradient(90deg, var(--sec-bar, #1a1a2e) 0%,
                var(--sec-bar-2, #2a2a4e) 50%, var(--sec-bar, #1a1a2e) 100%);
    border-bottom: 2px solid var(--sec-line, #f7931a);
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    position: sticky;           /* unlike pacificair: a social feed scrolls a
                                   lot, so the menu stays reachable */
    top: 0;
    z-index: 9999;
    width: 100%;
}

.navbar > ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0 auto;
    padding: 0 20px;
    max-width: 1760px;          /* aligns with the .shell content grid */
    list-style: none;
}

.navbar > ul > li {
    /* static, so a plain dropdown can span the full bar (mega panel);
       li.has-compact overrides to relative for anchored panels. */
    position: static;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}
.navbar > ul > li.has-compact { position: relative; }

.navbar a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 12px;          /* 15px until the Orbitron wordmark (2026-11-16):
                                    the moderator bar wrapped at 1440px with a
                                    scrollbar */
    color: #ffffff;
    text-decoration: none;
    font-size: .98rem;
    font-weight: 500;
    letter-spacing: .01em;
    white-space: nowrap;
    transition: color .15s ease, background .15s ease;
}

.navbar > ul > li:hover > a,
.navbar > ul > li > a:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* Brand: logo mark + wordmark in Orbitron, as on bitcoinpile.com. Orbitron
   reads wide, so it runs a touch smaller than its weight suggests. */
.navbar a.nav-brand {
    font-family: "Orbitron", "Roboto", sans-serif;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: #ffffff;
    padding: 9px 15px 9px 0;
}
.navbar a.nav-brand .accent { color: #f7931a; }
.navbar a.nav-brand svg { width: 28px; height: 28px; }
/* A social section's wordmark is two links, parent site and home
   (2026-09-23), that must still read as one word: the halves sit close
   and each washes on its own hover instead of both on the li's. */
.navbar a.nav-brand.nav-parent { padding-right: 3px; }
.navbar a.nav-brand.nav-home { padding-left: 3px; }
.navbar > ul > li.nav-brandpair:hover > a { background: none; }
.navbar > ul > li.nav-brandpair > a:hover,
.navbar > ul > li.nav-brandpair > a:focus-visible { background: rgba(255, 255, 255, 0.12); }

/* Right-side cluster (bell / account / sign-in) — pushed to the far edge.
   Only the FIRST right-side item carries the auto margin; siblings sit
   beside it (two autos would split the free space between them). */
.navbar > ul > li.nav-right { margin-left: auto; }
.navbar > ul > li.nav-right ~ li.nav-right { margin-left: 0; }
.navbar .nav-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.55); display: block;
}
.navbar a.nav-cta {                 /* signed-out "Sign In" */
    background: #f7931a; color: #1a1a2e; font-weight: 700;
    border-radius: 10px; padding: 8px 18px; margin: 8px 0;
}
.navbar > ul > li:hover > a.nav-cta { background: #ffa940; color: #1a1a2e; }

/* --- Site search glyph: bigger than the text items (owner, 2026-09-03)
   with the vertical padding trimmed so the bar stays the same height. --- */
.navbar > ul > li > a.nav-suchen {
    font-size: 1.45rem;
    line-height: 1;
    padding: 8px 12px;
}

/* --- Price ticker (wave 3, 2026-11-16): BTC over STRC, the first item of
   the right cluster. Two short stacked lines instead of one long one, so the
   member bar (and a moderator's, one item longer) still fits on one row at
   1440px. Up/down in bitcoinpile.com's own price colours (#00ff88 /
   #ff4444, both >= 4.5:1 on the bar); a delayed BTC feed is dimmed rather
   than hidden. Tabular figures so the columns do not jiggle on refresh. --- */
/* [hidden] has to be said here: the standalone pages (help, account, terms)
   load this file without wbs.css, whose global [hidden] rule is the only
   thing that beat display:flex/inline-flex — without it the empty ✉️ and 🔔
   badges showed a red "0" there. */
.navbar li.nav-ticker[hidden], .navbar .nav-ticker .tk[hidden],
.navbar li.nav-break[hidden], .navbar .nav-badge[hidden] { display: none !important; }
/* One grid for both lines, each line a subgrid of it: the columns are as
   wide as their widest figure and no wider (fixed em columns cost the bar
   ~50px). A browser without subgrid keeps the fixed columns. */
.navbar .tk-box {
    display: grid; grid-template-columns: auto auto auto; column-gap: 5px;
    align-content: center;
}
.navbar .nav-ticker a.tk {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 2.9em 5.4em 4.6em;
    grid-template-columns: subgrid;
    align-items: baseline;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: .76rem;
    line-height: 1.25;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}
.navbar .nav-ticker a.tk:hover,
.navbar .nav-ticker a.tk:focus-visible { background: rgba(255, 255, 255, 0.12); }
.navbar .tk-sym { color: #a0a3b8; font-weight: 700; letter-spacing: .03em; }
.navbar .tk-price { color: #ffffff; text-align: right; }
.navbar .tk-chg { text-align: right; }
.navbar .tk-chg.up { color: #00ff88; }
.navbar .tk-chg.down { color: #ff4444; }
.navbar .tk-chg.flat { color: #a0a3b8; }
.navbar .nav-ticker a.tk.stale { opacity: .55; }
/* When the bar cannot hold everything on one row (a moderator's at 1440px,
   anyone's below ~1240px), wbs.js unhides this zero-height full-width item
   in front of the ticker, so the right cluster — ticker, envelope, bell,
   account — wraps as one right-aligned row instead of an avatar alone. */
.navbar > ul > li.nav-break { flex-basis: 100%; height: 0; margin: 0; padding: 0; overflow: hidden; }
/* Outranks the dot separators' li + li:not(.nav-right)::before below. */
.navbar > ul > li + li.nav-break:not(.nav-right)::before { content: none; }

/* --- Current item: a chip in the section highlight — bitcoinpile.com's
   active asset pill (orange text on an orange wash, orange outline). The
   ported wash + underline was too quiet to answer "where am I" (owner,
   2026-09-02). ------------------------------------------------------------ */
.navbar > ul > li > a[aria-current] {
    background: var(--sec-hi-bg, rgba(247, 147, 26, 0.16));
    color: var(--sec-hi, #f7931a);
    box-shadow: inset 0 0 0 1px var(--sec-hi-line, rgba(247, 147, 26, 0.55));
    border-radius: 10px;
}
.navbar > ul > li:hover > a[aria-current] {
    background: var(--sec-hi-bg, rgba(247, 147, 26, 0.16));
    color: #ffffff;
}

/* --- Dot separators between top-level items (ported as-is: CSS ::before,
   so screen readers never announce them and they vanish in burger mode).
   The brand and the right-side cluster stay dot-free. -------------------- */
.navbar > ul > li + li:not(.nav-right)::before {
    content: "\00b7";
    color: rgba(255, 255, 255, 0.45);
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

/* === DROPDOWN PANELS (ported) =========================================== */

.navbar .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: #15152a;
    list-style: none;
    margin: 0;
    padding: 22px 40px 26px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
    z-index: 10000;
    border-top: 2px solid #2a2a48;
    border-bottom: 2px solid #2a2a48;
    border-radius: 0;
    flex-wrap: wrap;
    gap: 8px 26px;
    max-height: 80vh;
    overflow-y: auto;
    align-content: flex-start;
}

/* Hover opens every dropdown EXCEPT the bell — notifications open on click
   only (hovering must never mark them read), via the .open class from JS.
   :focus-within (2026-09-02) opens the same panels for the keyboard: Tab
   onto Friends, More or Account and its panel is there — Sign Out lives
   only inside the Account panel, and a keyboard user could never reach it.
   Desktop only: in burger mode a tap focuses, and dropdowns are off. */
.navbar > ul > li:hover:not(.nav-bell) > .dropdown { display: flex !important; }
.navbar > ul > li.nav-bell.open > .dropdown { display: flex !important; }
@media (min-width: 769px) {
    .navbar > ul > li:focus-within:not(.nav-bell) > .dropdown {
        display: flex !important; animation: wbsSlideDown .18s ease-out;
    }
}

@keyframes wbsSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.navbar > ul > li:hover:not(.nav-bell) > .dropdown,
.navbar > ul > li.nav-bell.open > .dropdown {
    animation: wbsSlideDown .18s ease-out;
}

/* Compact variant: anchored under its own item instead of spanning the bar
   (pacificair stubbed .dropdown-compact; BitcoinPile Social's current menus are small, so
   this is the variant in use — swap the class for a full-width mega panel). */
.navbar li.has-compact > .dropdown {
    left: 0; right: auto;
    width: max-content;
    min-width: 230px;
    padding: 14px 18px 16px;
    border: 1px solid #3a3a5e;
    border-radius: 0 0 12px 12px;
    border-top: 2px solid #2a2a48;
}
.navbar li.has-compact.nav-right > .dropdown { left: auto; right: 0; }

/* --- Notifications bell + panel, Messages envelope ----------------------- */
.navbar li.nav-bell > a { font-size: 1.12rem; padding: 11px 13px; }
.navbar li.nav-msg > a { font-size: 1.05rem; padding: 11px 13px; }
.nav-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
    background: #e0245e; color: #fff; font-size: .68rem; font-weight: 700;
}
.navbar li.nav-bell > .dropdown { padding: 12px 10px 10px; }
.notif-panel { min-width: 340px; max-width: 400px; }
.notif-title { color: #a0a3b8; font-size: .78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em; padding: 2px 10px 10px; }
.navbar .notif-row {
    display: flex; gap: 10px; align-items: center; padding: 9px 10px;
    border-radius: 10px; font-weight: 400; white-space: normal;
    color: #c9cdd4;
}
.navbar .notif-row:hover { background: #20203a; }
.navbar .notif-row img { width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid #3a3a5e; flex: none; }
.navbar .notif-row .nbody { flex: 1; min-width: 0; font-size: .9rem;
    line-height: 1.35; }
.navbar .notif-row strong { color: #f2f3f5; }
.navbar .notif-row .nwhen { color: #8a8fa8; font-size: .76rem; margin-top: 2px; }
.navbar .notif-row .ndot { width: 9px; height: 9px; border-radius: 50%;
    background: #f7931a; flex: none; }
.navbar .notif-row.unread { color: #f2f3f5; }
.navbar .notif-empty { color: #8a8fa8; font-size: .88rem;
    padding: 6px 10px 12px; white-space: normal; }

/* --- Top-level links in a dropdown (non-submenu items) ------------------ */
.navbar .dropdown > li { margin: 0; padding: 0; position: relative; }
.navbar .dropdown > li:not(.has-submenu) { width: auto; flex-shrink: 0; }
.navbar .dropdown > li:not(.has-submenu) > a {
    padding: 6px 14px;
    font-size: .84rem;
    font-weight: 500;
    color: #ffad5a;
    border-radius: 4px;
}
.navbar .dropdown > li:not(.has-submenu) > a:hover {
    background: #20203a;
    color: #ffc88a;
}

/* --- Submenu category columns (ported) ---------------------------------- */
.has-submenu {
    position: relative !important;
    min-width: 160px;
    max-width: 240px;
    flex: 0 0 auto;
}
.has-submenu > a {
    display: block;
    padding: 0 0 6px 0 !important;
    font-size: .72rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #f7931a !important;
    border-bottom: 1px solid #2a2a48 !important;
    margin-bottom: 6px;
    white-space: nowrap;
}
.has-submenu > a:hover { color: #ffc88a !important; background: transparent !important; }

/* The submenu is the always-visible list under its heading (no flyout). */
.submenu {
    display: block !important;
    position: static !important;
    background: transparent !important;
    list-style: none;
    margin: 0;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
}
.submenu li { position: relative; margin: 0; padding: 0; }
.submenu li a {
    padding: 5px 0;
    font-size: .86rem;
    font-weight: 500;
    color: #c9cdd4;
    display: block;
    line-height: 1.45;
    white-space: normal;
}
.submenu li a:hover {
    color: #ffffff;
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.submenu li a.danger { color: #e07a83; }
.submenu li a.danger:hover { color: #f0949c; }

/* --- 2-column submenu (ported; unused today, ready for bigger menus) ----- */
.has-submenu-2col { min-width: 380px; max-width: 480px; }
.has-submenu-2col > .submenu { column-count: 2; column-gap: 28px; }
.has-submenu-2col > .submenu > li { break-inside: avoid; }

/* Just above the burger breakpoint the signed-out bar (seven items since
   About joined it, 2026-09-22) wrapped to two rows below about 810px; 10px
   of padding a side instead of 15 keeps it on one. Plain top-level items
   only: the brand and Sign In outrank this selector and keep their own. */
@media (min-width: 769px) and (max-width: 840px) {
    .navbar > ul > li > a { padding-left: 10px; padding-right: 10px; }
}
/* A member's bar (brand + ten items + the right cluster) needs about 1300px
   at 12px a side; below that it tightens rather than wrapping. */
@media (min-width: 769px) and (max-width: 1360px) {
    .navbar > ul > li > a { padding-left: 8px; padding-right: 8px; }
    .navbar a.nav-brand { font-size: .94rem; }
}

/* --- Mobile burger (ported: <=768px the list collapses behind the toggle;
   the brand stays visible; dropdowns are suppressed, so every top-level
   item links to a real page; 44px touch targets). ----------------------- */
.nav-burger { display: none; background: none; border: 0; }
@media (max-width: 768px) {
    .nav-burger {
        display: flex; flex-direction: column; justify-content: center;
        align-items: center; position: absolute; top: 6px; right: 12px;
        min-width: 44px; min-height: 44px;
        padding: 9px 10px; cursor: pointer; z-index: 11;
        border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 8px;
    }
    .nav-burger span {
        display: block; width: 20px; height: 2px; margin: 4px 0;
        border-radius: 1px; background: #f2f3f5;
    }
    .navbar { position: relative; }   /* sticky + open burger list scrolls badly */
    .navbar > ul { padding: 0 56px 0 12px; }
    .navbar a.nav-brand { font-size: 1.35rem; padding: 12px 12px; }
    .navbar > ul:not(.nav-open) > li { display: none; }
    .navbar > ul:not(.nav-open) > li:first-child { display: flex; }
    /* The two counters stay in the bar beside the burger (2026-09-02):
       unread mail and the bell are the one thing a phone should show
       without opening the menu. Dropdowns are off here, so a tap simply
       follows each link (/messages/, /friends/). */
    .navbar > ul:not(.nav-open) > li.nav-msg,
    .navbar > ul:not(.nav-open) > li.nav-bell { display: flex; }
    /* The ticker stays in that row too, BTC only (wave 3): one 44px link at
       the row's left edge, the counters pushed right of it. In the open
       burger list it is hidden — the list is for going somewhere. */
    .navbar > ul:not(.nav-open) > li.nav-ticker { display: flex; margin-left: 0; margin-right: auto; }
    .navbar > ul.nav-open > li.nav-ticker { display: none; }
    .navbar .nav-ticker a.tk.tk-strc { display: none; }
    .navbar .tk-box { padding: 0; }
    .navbar .nav-ticker a.tk { font-size: .9rem; min-height: 44px; align-content: center;
        padding: 0 6px; }
    .navbar > ul.nav-open { flex-direction: column; align-items: stretch; }
    .navbar > ul.nav-open > li {
        display: flex; width: 100%; border-top: 1px solid rgba(255,255,255,0.15);
    }
    .navbar > ul.nav-open > li:first-child { border-top: 0; }
    .navbar > ul.nav-open > li > a { padding: 12px 14px; font-size: 1rem; width: 100%; }
    .navbar > ul.nav-open > li.nav-brandpair > a { width: auto; }
    .navbar > ul.nav-open > li.nav-right { margin-left: 0; }
    .navbar .dropdown { display: none !important; }
    .navbar > ul > li + li:not(.nav-right)::before { content: none; }
    .navbar a.nav-cta { margin: 8px 14px; }
}
