/* headwater.css — the generated half of https://headwater.tools/, set in the
 * same visual register as the hand-built half.
 *
 * IT NAMES NO COLOR AND NO FONT STACK
 *
 * Every value below is `var(--…)` out of `css/site-tokens.css`, which
 * `mkdocs/hooks/site_tokens.py` serves from `tools/site/site-tokens.css` — the one
 * copy HW-DR-0050 rules. Writing any of those literals out here would be a
 * second copy of the register, and clause 4 of that record refuses it.
 * `tools/site/refresh-site-tokens.sh --check` reads every file in this directory for
 * a declared value and fails on one. Its first run failed on this comment,
 * which had quoted a color to explain the rule.
 *
 * A NUMBER IS NOT A COLOR
 *
 * Spacing, rules and sizes are set here, and that is on purpose: HW-DR-0050
 * names the register as the seven colors, the three stacks and the two classes
 * that name the stacks, and it says the measure is deliberately not in it,
 * because a comparison table is not set to the width of a prose column. The
 * same reasoning applies to a two-column documentation page.
 *
 * WHAT IT LOADS AFTER
 *
 * The theme's `css/base.css` and Bootstrap. The first block below re-points
 * Bootstrap's own custom properties at the register, so a Bootstrap component
 * this file never mentions — the search modal, a table, a blockquote — is
 * already in register rather than needing a rule of its own.
 */

:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--fg);
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--rule);
  --bs-link-color: var(--accent);
  --bs-link-hover-color: var(--accent);
  --bs-emphasis-color: var(--fg);
  --bs-body-font-family: var(--serif);
  --bs-font-monospace: var(--mono);
  --bs-code-color: var(--fg);
}

/* The theme paints a repeating grid image behind the page through
 * `body::before`. It is the one piece of the stock look that no variable
 * reaches, and it is not in the register. */
body::before { background: var(--bg); }

body {
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 var(--serif);
  overflow-wrap: break-word;
}

a { color: var(--accent); text-underline-offset: 2px; }

code, pre, kbd, samp { font-family: var(--mono); }
code { background: var(--code-bg); color: var(--fg); font-size: 0.87em; padding: 0.12em 0.36em; border-radius: 3px; }
pre { background: var(--code-bg); border: 1px solid var(--rule); border-radius: 4px; padding: 0.9rem 1rem; overflow-x: auto; }
pre code { background: none; padding: 0; }

h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 2.4rem; line-height: 1.12; margin: 0 0 1.2rem; }
h2 { font-size: 1.6rem; margin: 2.2rem 0 0.9rem; }
h3 { font-size: 1.2rem; margin: 1.8rem 0 0.7rem; }

blockquote { border-left: 3px solid var(--rule); color: var(--muted); margin: 1.2rem 0; padding: 0 0 0 1.2rem; }
table { border-collapse: collapse; }
table th, table td { border: 1px solid var(--rule); padding: 0.4rem 0.7rem; }
table th { font-family: var(--sans); font-size: 0.85rem; text-align: left; }

/* THE HEADER
 *
 * `base.html` in this directory replaces the theme's and wraps the brand and
 * the links in `header.hw-header`. This is the flat top bar the hand-built
 * pages carry, and the accent rule above it is the `.topbar` of those pages.
 * These rules were written on the theme's `.navbar`. They matched nothing
 * from the day that wrapper was removed (#566) until they were re-pointed. */
.hw-header {
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  border-top: 4px solid var(--accent);
  padding: 1.2rem 0;
  margin-bottom: 1.4rem;
}
.hw-header > .container {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1.5rem; flex-wrap: wrap;
}
.hw-brand {
  font-family: var(--serif); font-weight: 600; font-size: 1.1rem;
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--fg); text-decoration: none;
}
.hw-glyph { color: var(--accent); font-size: 1.3rem; }
.hw-navlinks {
  display: flex; gap: 1.7rem; flex-wrap: wrap;
  font-family: var(--sans); font-size: 0.82rem;
}
.hw-navlinks a { color: var(--muted); text-decoration: none; }
.hw-navlinks a:hover { color: var(--accent); }
.navbar-toggler { border-color: var(--rule); }

/* THE SHELF SWITCHER
 *
 * Eleven links, one per shelf, on every generated page. This is the whole of
 * what a page says about the rest of the corpus, and it replaces the 354
 * anchors the stock navbar carried. */
.hw-shelves {
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.4rem; padding-bottom: 0.8rem;
}
.hw-shelves nav { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; }
.hw-shelves a {
  font-family: var(--sans); font-size: 0.78rem;
  color: var(--muted); text-decoration: none;
}
.hw-shelves a:hover { color: var(--accent); }
.hw-shelves a.here { color: var(--fg); border-bottom: 2px solid var(--accent); }

/* THE SHELF LIST, above the page's own table of contents. */
.hw-shelfhead { font-family: var(--sans); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; margin: 0 0 0.6rem; }
.hw-shelfhead a { color: var(--accent); text-decoration: none; }
.hw-shelflist { list-style: none; margin: 0 0 0.8rem; padding: 0; font-family: var(--sans); font-size: 0.8rem; line-height: 1.4; }
.hw-shelflist li { margin: 0 0 0.45rem; }
.hw-shelflist a { color: var(--muted); text-decoration: none; }
.hw-shelflist a:hover { color: var(--accent); }
.hw-shelflist li.here > a { color: var(--fg); font-weight: 600; }
.hw-shelfmore { font-family: var(--sans); font-size: 0.78rem; margin: 0 0 1.6rem; }
.hw-side { border-right: 1px solid var(--rule); }
.hw-side .bs-sidebar, .hw-side .navbar { background: none !important; border: 0; padding: 0; }
.hw-side .nav-link { font-family: var(--sans); font-size: 0.8rem; color: var(--muted) !important; padding: 0.2rem 0; }
.hw-side .nav-link:hover, .hw-side .nav-link.active { color: var(--accent) !important; }

/* THE PROVENANCE BAND. Spec 7: a projection says what it is a projection of. */
.hw-provenance {
  font-family: var(--sans); font-size: 0.78rem; color: var(--muted);
  background: var(--code-bg); border-left: 3px solid var(--accent);
  margin: 0 0 1.8rem; padding: 0.6rem 0.9rem;
}
.hw-provenance code { background: none; padding: 0; color: var(--fg); }

/* THE SEQUENCE LINKS, which replace the theme's Previous/Next navbar buttons. */
.hw-seq {
  display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  border-top: 1px solid var(--rule); margin-top: 3rem; padding-top: 1.2rem;
  font-family: var(--sans); font-size: 0.85rem;
}

/* THE FOOTER
 *
 * The block between the markers is `tools/site/site-footer.css`, the one copy
 * of the footer's styles, written here by `tools/site/refresh-site-tokens.sh`
 * and never by hand. The rule under it is this half's own: it undoes what the
 * theme's `css/base.css` sets on `footer`. */
  /* headwater:footer */
  footer { border-top: 1px solid var(--rule); }
  .foot {
    padding-top: 1.5rem; padding-bottom: 2.5rem;
    font-family: var(--sans); font-size: 0.87rem;
    color: var(--muted);
  }
  .foot p { margin: 0 0 1rem; max-width: 46rem; }
  .footgroups { display: flex; gap: 2.5rem; flex-wrap: wrap; margin-top: 0.4rem; }
  .footgroup { flex: 1 1 14rem; min-width: 0; }
  .footlabel {
    font-family: var(--sans); font-size: 0.72rem; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.7rem;
  }
  .footlinks { display: flex; gap: 0.5rem 1.25rem; flex-wrap: wrap; }
  @media (max-width: 62rem) {
    .footlinks { flex-direction: column; gap: 0.75rem; }
    .footlinks a { display: block; }
  }
  /* headwater:footer end */
footer { font-weight: 400; margin-top: 3rem; margin-bottom: 0; text-align: left; }

@media (max-width: 62rem) {
  .hw-side { border-right: 0; }
}
