/* ============================================================
   LeafWiki custom.css — deployed IDENTICALLY to all four instances
   (public, rv1, roylu-public, roylu-rv1) at <data-dir>/custom.css.

   Enabled per instance via LEAFWIKI_CUSTOM_STYLESHEET=custom.css.
   Edits are LIVE ON SAVE (read from disk per request) — only turning
   the feature on requires a restart.

   ⚠ These class names are compiled into the leafwiki binary. Re-verify
   after any binary upgrade:
     grep -oE '[a-z-]+__[a-z-]+' index-*.js | sort -u
   ============================================================ */


/* ------------------------------------------------------------
   1. Theme-responsive logo
   branding/logo.png is a WHITE transparent pug. LeafWiki serves one
   logo for both themes, so recolor per theme with a filter.
   invert(1) is a true inversion — correct for single-color line art,
   wrong for a multicolor logo. The favicon is a separate static file
   (blue pug) and is deliberately NOT filtered: a browser tab icon
   cannot respond to page theme.
   ------------------------------------------------------------ */

.app-layout__logo-image {
  filter: invert(1);            /* light mode: white -> black */
}

.dark .app-layout__logo-image,
:root.dark .app-layout__logo-image {
  filter: none;                 /* dark mode: stays white */
}


/* ------------------------------------------------------------
   2. Hide wiki-bookkeeping chrome
   Cosmetic only — the data remains in the DOM and is still returned
   by the API. This is decluttering, NOT privacy.
   ------------------------------------------------------------ */

/* "Updated by X - N hours ago", rendered under the breadcrumbs.
   NOTE: this is .page-viewer__metadata — NOT __metadata-bar, which is
   a separate wide-screen element. Both are hidden. */
.page-viewer__metadata { display: none; }
.page-viewer__metadata-bar { display: none; }

/* "Referenced by / Broken links" pane at the page bottom */
.backlinks__pane { display: none; }

/* page properties table */
.page-metadata__properties { display: none; }

/* "On this page" table of contents: right-side rail + mobile popover */
.app-layout__toc-pane { display: none; }
.page-viewer__toc-button { display: none; }
.page-viewer__toc-panel { display: none; }


/* ------------------------------------------------------------
   3. Login button
   The logged-out toolbar holds a bare <Button> with no class of its
   own, so target the toolbar itself and use :has() to keep it visible
   when the avatar dropdown is present (logged in). Hiding the whole
   toolbar also stops it reserving layout width.

   (user-toolbar__not-logged-in is NOT this button — it is the label
   shown only under --disable-auth.)

   Safe on private instances too: a logged-out visitor there gets the
   full login page, never the browsing chrome, so this state never
   renders.
   ------------------------------------------------------------ */

.user-toolbar:not(:has(.user-toolbar__dropdown-trigger)) { display: none; }
.user-toolbar__dropdown-trigger { display: inline-flex !important; }

/* Breadcrumbs (breadcrumbs-nav__*) are deliberately KEPT — they are
   navigation, useful to ordinary visitors, not wiki bookkeeping. */
