/* ============================================
   ohrg.org — the palette, and the few rules only this site needs

   Every rule the two sites share lives in `/_lib/site.css`, alongside
   weeknotes.ohrg.org. What stays here is what they do not share: the fonts
   this site publishes, the blue, and the three rules below that are about
   this site's own idea structure rather than about how a page looks.

   A rheo manifest allows exactly one `css_stylesheet`, so the shared sheet
   cannot be a second `<link>` — it is `@import`ed below instead. Both
   `@import`s have to come before every other rule in the file, the
   `@font-face` blocks included, or browsers drop them.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;400;500;600;700&display=swap');

/* Root-absolute, and it has to be: this sheet publishes at
   `/nest/blog/style.css`, so a relative url would resolve against that
   directory rather than the site root. `site.toml`'s
   `copy = [.., "_lib/*.css"]` is what puts the file at `/_lib/site.css`, and
   it is a copy glob rather than a build hook so that `--dev`'s watch loop
   republishes it too — a hook runs after `rheo compile` and a watch never
   gets there, which would leave every dev rebuild importing a 404. */
@import url('/_lib/site.css');

/* ============================================
   Berkeley Mono

   The wordmark and every `[idea:<slug>]` id are set in it, so this site
   fetches and publishes the same four licensed faces weeknotes.ohrg.org
   does — `prebuild.sh` pulls them, `postbuild.sh` puts them where the urls
   below resolve. A relative url resolves against THIS STYLESHEET, which
   publishes at `/nest/blog/style.css`, so the files land at
   `/nest/blog/fonts/` and not at a bare `/fonts/`. Until the hooks have
   run — a contributor with no `FONTS_GITHUB_TOKEN`, which is a supported
   outcome — both fall back to the generic `monospace`.
   ============================================ */
@font-face {
  font-family: 'Berkeley Mono';
  src: url('./fonts/BerkeleyMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Berkeley Mono';
  src: url('./fonts/BerkeleyMono-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Berkeley Mono';
  src: url('./fonts/BerkeleyMono-Oblique.ttf') format('truetype');
  font-weight: 400;
  font-style: oblique;
}

@font-face {
  font-family: 'Berkeley Mono';
  src: url('./fonts/BerkeleyMono-Bold-Oblique.ttf') format('truetype');
  font-weight: 700;
  font-style: oblique;
}

/* ============================================
   The palette

   The full list `/_lib/site.css` reads is documented at the top of that
   file, and this is weeknotes.ohrg.org's list in this site's blue. Only the
   accent and the two values derived from it differ; everything else is the
   same ink on the same paper, which is the point of sharing the sheet.
   ============================================ */
:root {
  --background-color: #fdfdfd;
  --text-color: #1a1a1a;
  --link-color: #1a1a1a;
  --blockquote-border: #e6e6e6;
  --blockquote-text: #606060;
  --muted: #6b6b6b;
  /* THIS SITE'S ONE DIVERGENCE. #9ABDDC is ohrg.org's own colour and predates
     the shared sheet; keeping it is what stops the two sites reading as one
     site published twice. Everything keyed to it — the header rule, every
     idea's left rule, the panel frames, the search modal, the outbound-link
     hover — follows from this line alone. */
  --accent: #9ABDDC;
  --rule: #e6e6e6;
  /* Two families, split by what a thing IS rather than by where it sits —
     see the note at the top of `/_lib/site.css`, which is what acts on the
     split. Berkeley Mono is site furniture and identifiers; Inter is
     everything that is writing, headings and post titles included. */
  --mono-font: 'Berkeley Mono', monospace;
  --heading-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --label-size: 0.85rem;
  /* The same blue, translucent: the wash that goes behind a link on hover,
     where `--accent` above is the solid that draws every hairline. Keep it in
     step with `THEME.link-color` in template.typ, which is the value rookery
     injects on its own elements — the header has no `.idea-*` ancestor to
     inherit that from. */
  --hover-fill: rgba(154, 189, 220, 0.30);
  --idea-external-color: var(--accent);

  /* Must match the Typst `set text(font, size)` in template.typ — the KP
     justifier measures against these metrics (see that file's comment). */
  --body-font: Inter;
  --font-size: 16pt;
}

/* ============================================
   What only ohrg.org has

   Three rules, and each is about this site's own idea structure rather than
   about how a page looks — which is why they did not go into the shared
   sheet.
   ============================================ */

/* Every idea here is a post, so a `post` pill on all 44 rows says nothing and
   only dilutes the stream colour beside it. Hidden as a PILL only — the class
   stays on the heading and the box, where `#window(tagged: "post")` still
   relies on it. Delete this block to bring the pill back. */
span.idea-tag.idea-tag-post {
  display: none;
}

/* UPSTREAM BUG, still present in @rookery/core (re-checked: all 43 built
   pages carry one, every one empty): with a bibliography configured, every
   page gets a page-level references block whether or not it cites anything
   outside an idea. Drop the empty ones; a page that really does cite outside
   an idea still shows its references, the list not being empty then.

   Not in the shared sheet because it is contingent on a bibliography, and
   the weeknotes configure none. */
.idea-page-refs:has(ul:empty) {
  display: none;
}

/* UPSTREAM BUG, @rookery/search:
   `renderRow` appends `.rookery-search-title` and `.rookery-search-id` as
   adjacent siblings with NO whitespace between them, and the id is
   `white-space: nowrap` — so a title's last word and the whole `[idea:<slug>]`
   are one unbreakable run. A bracketed slug never fits in what is left of the
   line, so the breaker falls back to the last opportunity it has, the space
   before the title's final word, and takes that word down with the id:
   `Jane Gallop: Reading` / `Lacan`, `Terry Eagleton: Why Marx Was` / `Right`.
   MEASURED at a 1280px viewport: `Amanda Holmes and Adrian Johnston` is 229px
   wide in a 329px row and still broke at 169px.

   A generated space is the break opportunity the markup is missing. It bites
   here and not on the weeknotes because a week's id is five characters and a
   post's is its whole slug. Upstream will use `<wbr>` instead, which adds no
   advance width where this adds a word space; drop this rule when that
   version lands. */
.rookery-search-title::after {
  content: " ";
}

/* The post list's filter (`#window(display-filter: ..)` in index.typ), opened
   up: no box around the input, only a hairline under it in the site's accent,
   the same weight as every other rule on the page. @rookery/search draws the
   boxed `#filter-panel` look inside `@layer search`, so these unlayered rules
   win without needing to outrank it. */
[data-rookery="window-filter-input"] {
  border: none;
  border-bottom: 1px solid var(--accent);
  border-radius: 0;
  background: transparent;
  padding-inline: 0;
}

[data-rookery="window-filter-input"]:focus {
  outline: none;
  border-bottom-color: var(--text-color);
}
