/*
  Global wiki theme (VC rulings 2026-08-02).
  Scale + favicon sizes: canon is frame.wiki.dbbs.co (VC ruling superseding
  ward.dojo.fed.wiki as reference — measured identical for our client
  version: page 490px/8px margins, 30px paper gutters, 32px h1, 32x32
  favicons w/ -6px baseline tuck, Helvetica Neue 16px/1.3, 40px footer;
  frame.wiki runs stock fedwiki with no theme sheet, so stock 0.31.6 base
  + these overrides = its look). VC overrides: white body, NO distinction
  between canvas and page (no borders, no shadow), footer at ward/stock
  baseline (#eee + noise.png). Provenance mechanics per VC: remote pages
  blue, local pages yellow. Previous sheets: /var/www/wiki-themes.bak-260802/.

  Base-sheet quirks (the farm's custom /style/style.css, not stock):
  - Lineup is a flex row (.main) and .page is display:grid; width rides on
    flex-basis, so geometry needs !important.
  - It stamps "Typografische Wikiblätter" via .header::before and draws a
    vertical "memory line" via .page::before — both nulled here.
  - Footer flag imgs are classless (only img.favicon gets sized), so they
    must be constrained or a large favicon blows up the footer.
  - The !importants on body/header/links also outrank in-page <style>
    embeds (~217 pages carry them); page items keep their internal styling
    but may not repaint desktop-level surfaces.
*/

/* ---- DJR webfonts (VC picks 2026-08-02): Title=Baby Condor Bold,
   Story=Output Sans, Journal=Forma DJR Micro. Hosted on viki.wiki assets
   (served with ACAO: *, so they load on every farm domain). ---- */
@font-face {
  font-family: "Baby Condor";
  src: url("https://viki.wiki/assets/fonts/djr/BabyCondor-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Output Sans";
  src: url("https://viki.wiki/assets/fonts/djr/OutputSans-Regular-Testing.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Output Sans";
  src: url("https://viki.wiki/assets/fonts/djr/OutputSans-Italic-Testing.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Output Sans";
  src: url("https://viki.wiki/assets/fonts/djr/OutputSans-Bold-Testing.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Output Sans";
  src: url("https://viki.wiki/assets/fonts/djr/OutputSans-BoldItalic-Testing.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Forma DJR Micro";
  src: url("https://viki.wiki/assets/fonts/djr/FormaDJRMicro-Regular-Testing.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

:root {
  --footer-height: 41px; /* ward: 20px + 2x10px padding + 1px border */
  --page-width: 490px;
  /* VC 2026-08-02: near-white split — WARM canvas (toned down from ivory),
     COOL page; ink is almost-black with a warm hue to contrast the cool
     paper. Barely perceptible by ruling: channel deltas ~3. */
  --canvas: #f9f9f9; /* dead-neutral grey — ivory ruled out entirely (VC) */
  --page: #fcfdfe;
  --text: #1a1817;
  --accent: #1c71d8;
  --accent-visited: #662c91;
  --font-wiki: "Output Sans", "Helvetica Neue", Verdana, helvetica, Arial, sans-serif;
  --font-title: "Baby Condor", "Helvetica Neue", Arial, sans-serif;
  --font-micro: "Forma DJR Micro", "Helvetica Neue", Verdana, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

body {
  background-color: var(--canvas) !important;
  background-image: none !important;
  color: var(--text) !important;
  font-family: var(--font-wiki) !important;
  font-size: 16px;
  line-height: 1.3;
  position: static !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
}

body,
button,
input,
select,
textarea {
  font-family: var(--font-wiki);
}

code,
pre,
.story code {
  font-family: var(--font-mono);
}

/* Neutralize in-page header repaints (old skins made HEADER a black bar). */
header {
  position: static !important;
  background-color: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  font-size: inherit !important;
}

/* html body prefix: outranks in-page <style> embeds that also use
   !important — DOM order puts embeds after this sheet, so only higher
   specificity keeps the farm's link graphics consistent. */
html body a { color: var(--accent) !important; background-color: transparent !important; text-decoration: none; }
html body a:visited { color: var(--accent-visited) !important; }
html body a:hover, html body a:focus { color: var(--accent) !important; text-decoration: underline; }

/* The lineup: row of EQUAL full-height pages (tops and bottoms align);
   extended content scrolls inside each page. */
.main {
  width: 100vw !important;
  height: calc(100vh - var(--footer-height)) !important;
  min-height: 0 !important;
  display: flex !important;
  align-items: stretch !important;
  overflow: auto hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  bottom: auto;
}

/* Pages: 490px white columns, 8px margins, no border, ward's shadow. */
.page {
  flex: 0 0 var(--page-width) !important;
  width: min(calc(100vw - 16px), var(--page-width)) !important;
  max-width: none !important;
  height: calc(100% - 16px) !important;
  max-height: none !important;
  grid-template-rows: minmax(0, 1fr) !important;
  margin: 8px !important;
  padding: 0;
  background: var(--page);
  border: none !important;
  border-radius: 0;
  /* VC: no hard edge between canvas and page — the page's own color
     feathers outward so the boundary fades instead of cutting. */
  box-shadow: 0 0 10px 4px var(--page) !important;
  overflow: hidden;
  position: relative;
}

.page::marker {
  content: none;
}

/* The base sheet stamps its own brand label above every title — remove. */
.header::before {
  content: none !important;
}

/* Ornamental grey rules removed (VC): the vertical memory line, the header
   underline, and the journal/backlinks separators. Provenance reads via
   the blue/yellow page tints. */
.page::before {
  content: none !important;
}
.header {
  border-bottom: none !important;
}
.backlinks,
.journal {
  border-top: none !important;
}

/* VC: no background on the journal (stock paints .journal/.backlinks #eee
   and each .action cell #ccc). Icons in stock grey, fork black, farm-wide —
   html body prefix beats per-page embeds as above. */
html body .journal,
html body .backlinks {
  background: transparent !important;
}
html body .action {
  background: transparent !important;
  color: #666666 !important;
}
html body .action.fork {
  color: #000000 !important;
}

/* Favicons display at 32x32 per ward (base sheet had 14px). */
img.favicon,
.header h1 img.favicon {
  width: 32px !important;
  height: 32px !important;
}

/* Title: Baby Condor at the frame.wiki 32px scale. Softened per VC with
   flat transparency (72% ink). NB: gradient text via background-clip:text
   silently fails here — the h1 is a flex box with the text nested two
   spans deep, a known Chromium no-paint case. Don't retry it. */
.header h1,
.story h1 {
  font-size: 32px;
  font-family: var(--font-title);
  font-weight: 700;
  color: rgba(26, 24, 23, 0.72);
}

/* Journal + backlinks + footer: Forma DJR Micro (cut for tiny sizes). */
html body .journal,
html body .backlinks,
html body footer {
  font-family: var(--font-micro);
}

.page.active {
  box-shadow: 0 0 10px 4px var(--page) !important;
}

/* Provenance mechanics (VC ruling): pages from foreign servers are BLUE,
   browser-local (unsaved/forked) pages are YELLOW. The base sheet marks
   these with .remote / .local classes on .page. */
/* Provenance as HALO only (VC): the page fill stays plain paper; the
   blue/yellow lives in the feathered glow so it signals without shouting. */
.page.remote,
.page.remote.active {
  background: var(--page);
  box-shadow: 0 0 14px 6px #cfe2f6 !important;
}

.page.local,
.page.local.active {
  background: var(--page);
  box-shadow: 0 0 14px 6px #f6eeb4 !important;
}

/* Paper: ward's 30px side gutters; extended content scrolls INSIDE the
   page, dissolving in a bottom fade gradient rather than clipping (VC).
   Scrollbar hidden — the fade is the "more below" signal. */
.paper {
  padding: 8px 30px 5px !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden auto !important;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 calc(100% - 32px), transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 calc(100% - 32px), transparent 100%);
}

.paper::-webkit-scrollbar {
  width: 0;
}

.story {
  max-width: 100%;
  column-count: 1;
  column-gap: 0;
  column-rule: none;
  padding-bottom: 5px;
}

.story code {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  font-size: 0.85em;
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

.factory,
.factory-panel,
.panel.factory {
  max-width: 320px;
  width: 100%;
  background: transparent;
}

/* Footer: ward baseline exactly — #eee + noise texture, inset shadow, border. */
footer {
  position: fixed !important;
  left: 0;
  right: 0;
  bottom: 0;
  height: 20px !important;
  padding: 10px !important;
  box-sizing: content-box !important;
  background: #eeeeee url("/images/noise.png") !important;
  border-top: 1px solid #3d3c43 !important;
  box-shadow: inset 0px 0px 7px rgba(0, 0, 0, 0.8) !important;
  color: #ccdcd2 !important;
  font-size: 80%;
  text-align: left;
  margin: 0 !important;
  z-index: 1000;
  overflow: hidden !important;
}

/* Footer flags constrained (they are classless in the base sheet). */
footer img {
  width: 16px !important;
  height: 16px !important;
  object-fit: contain;
  vertical-align: middle;
}
