/* ---- menu.css - the top bar, the same on both sites (Dave, 2026-10-28: one menu, whichever server draws the
        page). This file is the source: dev/outside/build-css.py puts it into outside.css, and the legacy app keeps a
        copy, versions/menu.css, linked from its web.master. Change it here and copy it there in the same edit; the
        copy must stay the same file. The markup is outside/_partials/topbar.html here and controls/Menu.ascx there.

        Signed out the bar is the guest's (.tw-bar-guest): the logo and the name, Grow, Learn, Browse, then Sign in.
        Signed in it is the member's (.tw-bar-member): the logo's square alone, Home, Learn, Browse, Feature
        Yourself, then their picture, which opens their menu. Twiends3 draws both and shows one by html.tw-in (the
        tw_hint cookie); the legacy app draws the one it knows and marks a member's bar tw-member. On a phone the
        logo is the square alone and the links are glyphs.

        Everything is held under .tw-bar with its own colours, so the legacy app's own styles can't reach in. No
        font-face here: each site declares Plus Jakarta Sans itself (its font lives at a different address on each) ---- */

.tw-bar {
    --mb-ink: #111111;
    --mb-ink-2: #4a4a48;
    --mb-ink-3: #62625f;
    --mb-grey: #f4f4f1;
    --mb-line: #e6e6e0;
    --mb-paper: #ffffff;
    --mb-mint: #7ee2b8;
    --mb-h: 60px;
    container: tw-bar / inline-size;
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 30;
    box-sizing: border-box;
    background: var(--mb-paper);
    color: var(--mb-ink);
    border-bottom: 2px solid var(--mb-ink);
    font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    text-align: left;
    -webkit-font-smoothing: antialiased;
}
.tw-bar *, .tw-bar *::before, .tw-bar *::after { box-sizing: border-box; }
.tw-bar a, .tw-bar a:hover, .tw-bar a:visited { text-decoration: none; }
/* the colour reset weighs no more than one class (:where), so the bar's own link colours below win over it, a visited
   link included: the links are the same shade whether or not someone has been to the page */
.tw-bar :where(a, a:hover, a:visited) { color: inherit; }
.tw-bar a:focus-visible, .tw-bar summary:focus-visible { outline: 2px solid var(--mb-ink); outline-offset: 2px; }

/* the row: lined up with the page (1220 wide, 32px in from each side, 16px on a phone) */
.tw-bar .tw-bar-in { display: flex; align-items: center; gap: 6px; width: 100%; max-width: 1220px; height: var(--mb-h); margin: 0 auto; padding: 0 max(32px, env(safe-area-inset-right, 0px)) 0 max(32px, env(safe-area-inset-left, 0px)); }
.tw-bar .tw-bar-member { display: none; }
.tw-in .tw-bar .tw-bar-guest, .tw-bar.tw-member .tw-bar-guest { display: none; }
.tw-in .tw-bar .tw-bar-member, .tw-bar.tw-member .tw-bar-member { display: flex; }

/* the logo: the outlined lockup, so no logo font loads. A member's is the square alone, the name clipped off */
.tw-bar .tw-bar-brand { display: flex; flex: none; align-items: center; }
.tw-bar .tw-bar-brand svg { display: block; flex: none; width: auto; max-width: none; height: 30px; }
.tw-bar .tw-bar-tile { width: 30px; overflow: hidden; }

/* the links: words on a computer, the page you're on in a grey pill */
.tw-bar .tw-bar-nav { display: flex; align-items: center; gap: 2px; margin: 0 auto 0 12px; }
.tw-bar .tw-bar-link { display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 14px; border-radius: 999px; color: var(--mb-ink-2); font-size: 14px; font-weight: 700; white-space: nowrap; }
.tw-bar .tw-bar-link:hover, .tw-bar .tw-bar-link[aria-current="page"] { background: var(--mb-grey); color: var(--mb-ink); }
.tw-bar .tw-bar-glyph { display: none; width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }

/* the black button */
.tw-bar .tw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; margin: 0; padding: 0 18px; border: 0; border-radius: 999px; background: var(--mb-ink); color: var(--mb-paper); font: inherit; font-size: 14px; font-weight: 800; line-height: 1; white-space: nowrap; cursor: pointer; }
.tw-bar a.tw-btn, .tw-bar a.tw-btn:hover, .tw-bar a.tw-btn:visited { color: var(--mb-paper); }

/* the two menus under the bar (Sign in's ways in, a member's own) are <details>, so they open with no script;
   each site's script closes them on a click elsewhere or Escape */
.tw-bar .tw-bar-more { position: relative; flex: none; margin: 0; }
.tw-bar .tw-bar-more > summary { display: flex; list-style: none; user-select: none; cursor: pointer; }
.tw-bar .tw-bar-more > summary::-webkit-details-marker { display: none; }
.tw-bar .tw-bar-menu { position: absolute; top: calc(100% + 12px); right: 0; z-index: 2; width: 300px; padding: 8px; border-radius: 10px; background: var(--mb-paper); color: var(--mb-ink); box-shadow: 0 0 0 1.5px var(--mb-ink), 3px 3px 0 var(--mb-ink); }
.tw-bar .tw-bar-menu a { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px; border-radius: 8px; color: var(--mb-ink); font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.tw-bar .tw-bar-menu a:hover, .tw-bar .tw-bar-menu a:focus-visible { background: var(--mb-grey); }
.tw-bar .tw-bar-menu small { display: block; margin-top: 2px; color: var(--mb-ink-3); font-size: 12.5px; font-weight: 500; }
.tw-bar .tw-bar-menu [hidden] { display: none; }
.tw-bar .tw-bar-menu-glyph { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--mb-grey); color: var(--mb-ink); }
.tw-bar .tw-bar-menu-glyph svg { display: block; width: 17px; height: 17px; }
.tw-bar .tw-bar-menu-x .tw-bar-menu-glyph { background: var(--mb-ink); color: var(--mb-paper); }

/* Sign in: the button goes straight to X, its arrow opens the two ways in */
.tw-bar .tw-signin { display: inline-flex; flex: none; align-items: center; }
.tw-bar .tw-signin > .tw-btn { border-radius: 999px 0 0 999px; padding-right: 14px; }
.tw-bar .tw-signin .tw-bar-more > summary { border-radius: 0 999px 999px 0; padding: 0 12px 0 10px; box-shadow: inset 1.5px 0 0 rgba(255, 255, 255, .3); }
.tw-bar .tw-bar-caret { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.tw-bar .tw-bar-more[open] .tw-bar-caret { transform: rotate(180deg); }

/* a member: their X picture (their initial until it loads), a mint dot on it while Support has a reply they
   haven't read. A grey ring behind it while the menu is open */
.tw-bar .tw-bar-acct > summary { align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 999px; }
.tw-bar .tw-bar-acct > summary:hover, .tw-bar .tw-bar-acct[open] > summary { background: var(--mb-grey); }
.tw-bar .tw-bar-face { position: relative; display: grid; flex: none; place-items: center; width: 34px; height: 34px; border-radius: 999px; background: var(--mb-mint); color: var(--mb-ink); box-shadow: 0 0 0 2px var(--mb-ink); font-size: 14px; font-weight: 800; line-height: 1; }
.tw-bar .tw-bar-face img { display: block; width: 100%; height: 100%; margin: 0; border: 0; border-radius: 999px; object-fit: cover; }
.tw-bar .tw-bar-dot { position: absolute; top: -2px; right: -3px; width: 12px; height: 12px; border-radius: 999px; background: var(--mb-mint); box-shadow: 0 0 0 2px var(--mb-paper), 0 0 0 3px var(--mb-ink); }
.tw-bar .tw-bar-dot[hidden] { display: none; }
.tw-bar .tw-bar-who { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 12px; margin-bottom: 6px; padding: 8px 10px 12px; border-bottom: 1px solid var(--mb-line); font-size: 14.5px; font-weight: 800; overflow-wrap: anywhere; }
.tw-bar .tw-bar-who .tw-bar-face { width: 40px; height: 40px; font-size: 16px; }
.tw-bar .tw-bar-new { padding: 3px 8px; border-radius: 999px; background: var(--mb-mint); color: var(--mb-ink); font-size: 12px; font-weight: 800; }

/* a phone: the logo's square, the links as glyphs in equal columns (the words stay for a screen reader), and the
   menus as a sheet across the page under the bar */
@container tw-bar (max-width: 759px) {
    .tw-bar .tw-bar-in { padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
    .tw-bar .tw-bar-brand { width: 30px; overflow: hidden; }
    .tw-bar .tw-bar-nav { display: grid; flex: 1 1 0; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); justify-items: center; gap: 0; max-width: 180px; margin-left: 16px; }
    .tw-bar .tw-bar-member .tw-bar-nav { max-width: 240px; }
    .tw-bar .tw-bar-link { position: relative; width: 44px; height: 44px; padding: 0; }
    .tw-bar .tw-bar-glyph { display: block; }
    .tw-bar .tw-bar-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .tw-bar .tw-btn { padding: 0 14px; }
    .tw-bar .tw-bar-more { position: static; }
    .tw-bar .tw-bar-menu { top: calc(100% + 8px); right: 8px; left: 8px; width: auto; }
}
/* a member's menu opens the dashboard's two other views on a phone (View your stats, View by country); wider, the
   dashboard shows them itself, so the items go */
@container tw-bar (min-width: 600px) {
    .tw-bar .tw-bar-menu .tw-bar-phone { display: none; }
}
@container tw-bar (max-width: 359px) {
    .tw-bar .tw-bar-nav { margin-left: 8px; }
    .tw-bar .tw-bar-link { width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) { .tw-bar .tw-bar-caret { transition: none; } }
