/* The line above a story: the collection title from prose/published.json ("Iron and Salt") in tracked small capitals, linking back
   to the index.

   c-running-head--contents: the running head of a public page with a contents list (stories/_book). Below --bp-book-toc it stays
   at the top of the window, on a rule like c-topbar's, with Contents (c-running-head__button, a small-capital word in the ink) at
   the right (and the title at the left on a phone), which opens the list (c-toc--book) as a panel under it; the panel's top is --topbar-height, so the bar is that
   high, and the headings' scroll-margin-top (c-markdown) clears it. From --bp-book-toc up the list is fixed beside the text, the
   button is hidden, and the running head is a story's.
   <header class="c-running-head c-running-head--contents"><a href="/">Iron and Salt</a><button class="c-running-head__button"
   type="button" aria-controls="toc" aria-expanded="false">Contents</button></header> */

.c-running-head { padding: 1.75rem 1rem 0; text-align: center; font-size: 1.05rem; font-variant-caps: all-small-caps; letter-spacing: 0.16em; }
.c-running-head a { color: var(--color-ink-muted); text-decoration: none; }
.c-running-head a:hover { color: var(--color-ink); }

.c-running-head__button { display: none; padding: var(--space-1) var(--space-2); border: 0; background: transparent; font-variant-caps: all-small-caps; letter-spacing: var(--tracking-caps); }

@media (width < 80rem) {
  .c-running-head--contents {
    position: sticky;
    top: 0;
    z-index: var(--z-topbar);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: var(--topbar-height);
    padding: 0 var(--space-3);
    border-bottom: var(--stroke-hair) solid var(--color-rule);
    background-color: var(--color-paper);
    background-image: var(--paper-grain);
  }
  .c-running-head--contents > a { grid-column: 2; }
  .c-running-head--contents .c-running-head__button { display: block; grid-column: 3; justify-self: end; }
}

/* On a phone the centred title would run into Contents: the title goes to the left, as the site name in c-topbar. */
@media (width <= 36rem) {
  .c-running-head--contents { grid-template-columns: 1fr auto; }
  .c-running-head--contents > a { grid-column: 1; justify-self: start; }
  .c-running-head--contents .c-running-head__button { grid-column: 2; }
}

@media print {
  .c-running-head__button { display: none; }
}
