/* The bar: the wordmark, the four places, and on a page of words the button that goes straight
   to colouring. Its own sheet, because every page carries it: the pages of words, and the
   canvases, where a wide screen shows it as a strip above the design. The tokens fall back to
   the site's own values on a page that defines none. */

/* ------------------------------------------------------------------ the bar */

/* One quiet bar on every page: the wordmark, and four places. Furniture, not a feature. */
#bar:not(.folded) {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 22px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  font-family: var(--serif, Baskerville, "Libre Baskerville", "Times New Roman", Georgia, serif);
  font-size: clamp(15px, 1.1vw, 20px);
  border-bottom: 1px solid var(--line, #e6e6e6);
}
#bar:not(.folded) a { color: var(--ink, #111); text-decoration: none; background: none; border: none; padding: 0; font-size: inherit; }
#bar:not(.folded) .mark { font-size: 1.1em; color: var(--ink, #111); }
#bar:not(.folded) .items { display: flex; flex-wrap: wrap; gap: 4px 18px; }
#bar:not(.folded) .items a { color: var(--muted, #777); }
#bar:not(.folded) .items a[aria-current="page"] { color: var(--ink, #111); }
#bar:not(.folded) a:hover { color: var(--green, #2f4f3a); }
/* The bar's one action: straight to colouring (colour-now.js). Filled, so it reads as a thing to
   do rather than a fifth place; on a narrow screen it sits on the wordmark's line. */
#bar:not(.folded) a#colour-now {
  order: 2;
  padding: .32em .95em;                 /* aligned by its words, on the bar's baseline, like the places */
  border-radius: 6px;
  color: #fff;
  background: var(--green, #2f4f3a);
  white-space: nowrap;
}
#bar:not(.folded) a#colour-now:hover { color: #fff; background: #24402e; }
#bar:not(.folded) a#colour-now:focus-visible { outline: 2px solid var(--pop, #5f9a72); outline-offset: 2px; }
#bar:not(.folded) .items { order: 1; }
#bar:not(.folded) .mark { margin-right: auto; }      /* the places and the button keep together, right */

/* Over a canvas the bar shows on a wide screen only, as a strip of its own at the top: the design
   is drawn below it, never under it (colour.css offsets everything by --bar-h). On a narrow
   screen the canvas keeps every pixel and the menu holds the places. */
#bar.on-canvas { display: none; }
@media (min-width: 900px) {
  :root:has(#bar.on-canvas) { --bar-h: 56px; }
  #bar.on-canvas:not(.folded) {
    display: flex;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 6;                       /* over the canvas and the finished screen, under the menu's sheet */
    height: var(--bar-h);
    align-items: center;
    padding-block: 0;
    background: var(--paper, #fff);
  }
}
@media (max-width: 640px) {
  #bar:not(.folded) .items { order: 3; flex-basis: 100%; }
}
