/* ============================================================================
   Obsidian Publish custom styles — Neighborhood Notes wiki
   (neighborhoodsf.com / publish.obsidian.md/neighborhood-notes)

   Lives at the vault root; Obsidian Publish serves it automatically. Desktop
   Obsidian ignores it. Pushed with `obsidian publish:add path=publish.css`
   (see the obsidian-publish skill in the Vespers repo).

   Purpose: render the small-print footer (*Research*, *Changelog*, and the
   relocated footnotes) as one consistent, de-emphasized block — recovering the
   desktop look now that those blocks are plain markdown / real footnotes
   instead of the empty-label [^]: hack (which Publish can't parse).

   DOM facts (verified against the live site):
   - Publish wraps every markdown block in a `div.el-*` (`.el-p`, `.el-ul`,
     `.el-hr`, `.el-section`). `hr ~ p` selectors do NOT work — target `.el-*`.
   - Real footnotes are relocated into a generated `.el-section .footnotes` at
     the bottom of the note, with ↩︎ backrefs (Publish has no "Footnotes"
     heading — we add one below).
   - The footer is everything after the note's LAST `---`.
     `.el-hr:not(:has(~ .el-hr))` matches that last `.el-hr`, so a mid-body `---`
     never mutes the body above it. The wiki convention + /wiki-lint require the
     footer to be preceded by a `---`.
   ============================================================================ */

.published-container {
  /* Single source of truth for the footer's look. Size matches the footnotes;
     one gray for all footer text. */
  --wiki-footer-size: 0.8em;
  --wiki-footer-fg: var(--text-muted);
}

/* Scope: every footer block after the note's last rule, minus the auto
   "Links to this page" backlinks block. The relocated footnotes live in an
   `.el-section` here, so they inherit this size/color (no separate rule, which
   would compound the em and shrink them). */
.el-hr:not(:has(~ .el-hr)) ~ div:not(.mod-footer) {
  font-size: var(--wiki-footer-size);
  color: var(--wiki-footer-fg);
  line-height: 1.5;
}

/* All footer text is the same gray — including the italic *Research* /
   *Changelog* labels and the italic Research cluster questions. */
.el-hr:not(:has(~ .el-hr)) ~ div.el-p em {
  color: var(--wiki-footer-fg);
  font-style: italic;
}

/* Bullet lists hug the text above them (no gap), and read as a tight list. */
.el-hr:not(:has(~ .el-hr)) ~ div.el-ul {
  margin-top: 0;
}
.el-hr:not(:has(~ .el-hr)) ~ div.el-ul ul {
  margin: 0;
  padding-left: 1.2em;
}
.el-hr:not(:has(~ .el-hr)) ~ div.el-ul li {
  margin: 0.1em 0;
}

/* Relocated footnotes: Publish drops the section in with no heading, but with a
   built-in <hr> separator and an 0.875em shrink. Neutralize both so the section
   reads like the *Research* / *Changelog* blocks: a label + a tight list. */
.el-section {
  margin-top: 1.2em;   /* space above the "Footnotes" heading (changelog -> footnotes) */
}
.el-section .footnotes {
  font-size: 1em;      /* cancel Obsidian's 0.875em so it matches the rest of the footer */
}
.el-section .footnotes hr {
  display: none;       /* drop the stray separator rule between heading and list */
}
.el-section .footnotes::before {
  content: "Footnotes";
  display: block;
  font-style: italic;
  margin-bottom: 0.3em;
}
.el-section .footnotes ol {
  padding-left: 1.2em;
}
