/* ============================================================================
   GLEE — STANDARD NAVIGATION + PAGE SHELL          v1 (2026-08-06)
   ----------------------------------------------------------------------------
   One navigation across every page. Before this, 36 pages carried 5 different
   shells and 3 different top-bar element names with 3 different link sets —
   so "where am I / what else is there" had a different answer on every page.

   Built entirely on the canon tokens (--bg/--panel/--ink/--sand/--line and the
   --patina-* additions), so it re-skins with whatever style is mounted and
   never needs its own colours.

   Structure this file assumes (injected by inject_shell.py):

     <header class="gnav">            standard nav — same on every page
     <div class="gtrail">             breadcrumb: you are here
     ...page's own content...

   No JavaScript. Group menus are <details>, so they work with keyboard, with
   screen readers, and with JS disabled.
   ============================================================================ */

/* ---------- skip link: first tab stop on every page ---------- */
.gskip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: .7rem 1.1rem;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--sand);
  border-radius: 2px;
  font: 500 .8rem/1 var(--mono, ui-monospace, monospace);
}
.gskip:focus { left: 8px; top: 8px; }

/* ---------- the bar ---------- */
.gnav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono, ui-monospace, monospace);
}
.gnav-in {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  min-height: 52px;
}

.gbrand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--ink);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  flex: none;
}
.gbrand i { color: var(--sand); font-style: normal; }
.gbrand:hover { color: var(--sand); }

/* ---------- group menus ---------- */
.gmenu { display: flex; align-items: center; gap: .15rem; flex: 1 1 auto; }

.ggrp { position: relative; }
.ggrp > summary {
  list-style: none;
  cursor: pointer;
  padding: .48rem .72rem;
  border-radius: 2px;
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mist);
  border: 1px solid transparent;
  white-space: nowrap;
}
.ggrp > summary::-webkit-details-marker { display: none; }
.ggrp > summary:hover { color: var(--ink); background: var(--panel); }
.ggrp > summary:focus-visible { outline: 2px solid var(--sand); outline-offset: 1px; }
.ggrp[open] > summary {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--patina-hot, var(--sand)) 40%, var(--line));
  background: var(--panel);
}
/* the group that owns the current page */
.ggrp.is-here > summary { color: var(--sand); }
.ggrp.is-here > summary::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 4px;
  background: var(--sand);
}

.gpanel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 310px;
  padding: .55rem;
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--patina-hot, var(--sand)) 26%, var(--line));
  border-radius: 3px;
  box-shadow: 0 18px 40px color-mix(in srgb, var(--bg) 70%, transparent);
}
.gpanel-blurb {
  padding: .3rem .6rem .55rem;
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}
.gpanel a {
  display: block;
  padding: .5rem .6rem;
  border-radius: 2px;
  text-decoration: none;
  color: var(--ink);
  font-size: .82rem;
}
.gpanel a small {
  display: block;
  margin-top: .18rem;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: 0;
  font-family: var(--disp, system-ui, sans-serif);
}
.gpanel a:hover,
.gpanel a:focus-visible {
  background: color-mix(in srgb, var(--patina-hot, var(--sand)) 14%, var(--panel2));
  outline: none;
}
.gpanel a[aria-current="page"] {
  background: color-mix(in srgb, var(--patina-hot, var(--sand)) 20%, var(--panel2));
  color: var(--sand);
}

/* ---------- right side: page state + map ---------- */
.gstate { display: flex; align-items: center; gap: .4rem; flex: none; }
.gstate .gpill {
  font-size: .64rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .26rem .6rem;
  white-space: nowrap;
}
.gstate .gpill.g { color: var(--act); border-color: color-mix(in srgb, var(--act) 40%, var(--line)); }
.gmap {
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mist);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: .4rem .7rem;
  white-space: nowrap;
}
.gmap:hover { color: var(--ink); border-color: var(--sand); }

/* account action — the one thing that takes you off the public site */
.gsignin {
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  padding: .42rem .85rem;
  border-radius: 2px;
  color: var(--bg);
  background: var(--sand);
  border: 1px solid var(--sand);
  flex: none;
}
.gsignin:hover { background: var(--patina-hot, var(--sand)); border-color: var(--patina-hot, var(--sand)); }
.gsignin:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* leaves the public site — say so rather than surprising people */
.gext { color: var(--faint); font-size: .8em; }
.gpanel a:hover .gext { color: var(--sand); }

/* ---------- breadcrumb: "you are here", every page ---------- */
.gtrail {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 55%, transparent);
  font-family: var(--mono, ui-monospace, monospace);
}
.gtrail-in {
  max-width: 1180px;
  margin: 0 auto;
  padding: .5rem 20px;
  display: flex;
  align-items: baseline;
  gap: .55rem;
  font-size: .7rem;
  color: var(--faint);
  letter-spacing: .06em;
}
.gtrail a { color: var(--mist); text-decoration: none; }
.gtrail a:hover { color: var(--sand); }
.gtrail b { color: var(--ink); font-weight: 500; }
.gtrail .gtrail-what {
  color: var(--muted);
  font-family: var(--disp, system-ui, sans-serif);
  letter-spacing: 0;
}

/* ---------- the site map page ---------- */
.gmap-page { max-width: 1180px; margin: 0 auto; padding: 40px 20px 90px; }
.gmap-page h1 { letter-spacing: .1em; font-weight: 300; }
.gmap-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 28px;
}
.gmap-grp {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1.1rem 1.2rem;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}
.gmap-grp h2 {
  margin: 0 0 .2rem;
  font-size: .74rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--sand);
  font-family: var(--mono, ui-monospace, monospace);
}
.gmap-grp > p {
  margin: 0 0 .9rem;
  font-size: .78rem;
  color: var(--muted);
}
.gmap-grp a {
  display: block;
  padding: .5rem 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  font-size: .88rem;
}
.gmap-grp a small {
  display: block;
  color: var(--muted);
  font-size: .74rem;
  margin-top: .15rem;
}
.gmap-grp a:hover { color: var(--sand); }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .gnav-in { flex-wrap: wrap; gap: .5rem; padding: .5rem 14px; }
  /* thumbs are not cursors — every nav control gets a real tap target */
  .gnav a, .gnav summary {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }
  .gpanel a { min-height: 40px; align-items: flex-start; flex-direction: column;
              justify-content: center; }
  .gmenu { order: 3; width: 100%; flex-wrap: wrap; gap: .2rem; }
  .gstate { order: 2; margin-left: auto; }
  .gstate .gpill { display: none; }
  .gstate .gpill:first-child { display: inline-block; }
  .gpanel {
    position: static;
    min-width: 0;
    width: 100%;
    box-shadow: none;
    margin-top: .35rem;
  }
  .gtrail-in { padding: .45rem 14px; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .gnav { backdrop-filter: none; }
}
