/* Print: Cmd+P on the Mac, Share > Print on the iPhone. index.html links this file with media="print", so nothing
   here touches the screen. The page on screen prints as a clean document: a note's title, its bullets and its
   Linked references; Today prints today's section - its heading, its To do (today's tasks, Still open in full and
   Coming up's one line) and today's bullets - and not the earlier days; a tag's page prints its heading and its
   list. The bars, buttons, menus and the canvas are left out. Few rules, each saying why; the Dilli House look
   stays: the brand faces, dots, hairlines, nothing bold. One stylesheet for every device: the phone's finger-sized
   rows go back to reading size below. */

/* A4, 18 mm all round: the brand's document margin. (Safari prints on the paper the printer has.) */
@page {
  size: A4;
  margin: 18mm;
}

/* White paper, near-black ink, whatever the screen shows. A page printed from dark mode must not come out as pale
   text on a dark ground the browser then leaves out (backgrounds are not printed unless asked). The dark block in
   css/tokens.css is written for :root:not([data-theme='light']): the same selector here, later in the cascade,
   wins over it. The greys are darker than on screen, where a 42% hairline would hardly leave a mark on paper.
   Lime Green stays the one highlight colour and a #tag keeps its Prussian Blue. */
:root,
:root:not([data-theme='light']) {
  --bg: #fff;
  --surface: #fff;
  --surface-2: #f2f2ee;
  --ink: #111;
  --ink-2: #333;
  --muted: #666;
  --line: #bbb;
  --line-2: #888;
  --accent: #111;
  --accent-ink: #111;
  --accent-soft: #d6debb;
  --violet: #043758;
  --shadow-2: none;
  --shadow-3: none;
  color-scheme: light;
}

/* The page flows onto as many sheets as it needs. On screen the app is one window-high frame whose page scrolls
   inside it (.ol-scroll), and a frame that scrolls prints only what it shows: every box on the way down becomes
   as tall as its content, and the outliner's view leaves its absolute position in the stage. */
html,
body,
#app,
.app,
.body,
.outliner,
.ol-scroll {
  height: auto;
  overflow: visible;
}
body {
  background: #fff;
  color: var(--ink);
}
.app,
.body {
  display: block;
}
.stage {
  position: static;
}
.app .view-outliner {
  display: block;
  position: static;
  background: #fff;
}
/* the sheet's margin is the only margin: the page takes the whole width between them */
.page-wrap {
  max-width: none;
  margin: 0;
  padding: 0;
}
.page-body {
  margin-left: 0;
}

/* Not the document: the top bar, the sidebar and its scrim, banners, the status pill, every button (Pin, Mark as
   person, Delete…, the day arrows, Show more days), the phone's editing bar, dialogs and the search palette, the
   '[[' picker and the '/' menu, pop-up menus, toasts, the canvas, the 'Today' pill (the date says it), a person's
   initials disc. Under Today the earlier days and their one line stay on screen only. A reference list with
   nothing in it ('Nothing links here yet') says so on screen, not on paper; so does an empty bullet's prompt. */
.topbar,
.side-host,
.scrim,
.banner,
.state-host,
.sync,
.btn,
.icon-btn,
.pill,
.keybar,
.modal-backdrop,
.pop-menu,
.ac,
.toasts,
.app[data-view] .view-canvas,
.page.compact,
.earlier-slot,
.refs.empty,
.avatar,
.outline-tail {
  display: none;
}
.blk-content[data-ph]:not(.editing)::before {
  content: none;
}
.blk-input::placeholder {
  color: transparent;
}
/* the fold chevrons go, but keep their room: the dots stay in line and the nest's hairline runs under them */
.chev {
  visibility: hidden;
}

/* Today on paper is one column with To do above the note, as it always printed: on screen To do comes after the
   note in the page (under it on a narrow screen, beside it on a wide one), so here it is put first, near the
   heading as it was. */
.today-cols {
  display: flex;
  flex-direction: column;
}
.todo-slot {
  order: -1;
}
.refs.to-do {
  margin-top: 14px;
}

/* The head: the title is an <input> on a note's page and prints its text; no field look around it. */
.page-title {
  margin-left: 0;
  padding-left: 0;
  background: none;
}
input.page-title {
  border: 0;
  outline: 0;
}
.chip-link {
  padding: 0;
}
/* a title, a list's label (To do's 'Today' and 'Still open' too) or a source note's name is never left alone at
   the foot of a sheet */
.page-head,
.refs-title,
.refs-sub,
.ref-source {
  break-after: avoid;
  page-break-after: avoid;
}

/* A bullet is never cut in two by a page break, on the page or among the references. */
.blk-row,
.ref-block,
.static-blk {
  break-inside: avoid;
  page-break-inside: avoid;
}
/* A dot, the --- rule and the ==highlight== are drawn as background colour, which a browser leaves out of a print
   unless told to keep it; a to-do's box keeps its tick the same way. Nothing else asks for its background. */
.bullet i,
.rule,
.outline .hl,
.static-text .hl,
input.todo {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.bullet i {
  background: var(--ink-2); /* a dot at the screen's 42% would be a smudge on paper */
}
/* links are underlined words in the ink; no address is printed after them (a note is not a bibliography) */
a.wikilink,
a.ext {
  color: var(--ink);
  text-decoration-color: var(--ink-2);
}
/* a bullet being edited prints as its text, as written (a text box prints what is in it): only its field look
   goes, and the caret, which Chrome would otherwise print as a stray bar in the word it stands in */
.blk-content.editing .blk-input {
  border: 0;
  outline: 0;
  resize: none;
  background: none;
  box-shadow: none;
  caret-color: transparent;
}

/* Linked references, To do, a tag's list: the hairline above and the mono label as on screen; a source note's
   name (a button on screen) is plain text over its hairline. */
.ref-source,
.ref-head {
  background: none;
}
/* To do on paper: Still open in full, even when it is folded on screen (its rows are in the page, out of sight);
   Coming up as its one line, even when it is open; no 'Also mentioned today' at all - it is not to do. The folds'
   chevrons go: on paper nothing folds. */
.todo-part.still-open.folded > .todo-rows {
  display: block;
}
.todo-part.coming-up > .todo-rows,
.also-slot,
.todo-fold .ico {
  display: none;
}

/* From a phone, the same document: the finger-sized rows, dots and boxes css/editor.css gives a touch screen
   ((pointer: coarse) holds while printing there) go back to their reading size, so a page printed from the iPhone
   matches one printed from the Mac. The selectors repeat editor.css's, so they weigh the same and, later, win. */
.outline-page .blk-row {
  min-height: 26px;
}
.outline-page .chev {
  width: 18px;
  height: 26px;
}
.outline-page .bullet {
  width: 20px;
  height: 26px;
}
.outline-page .blk-row:has(> .chev.hidden) > .bullet {
  width: 20px;
  margin-left: 0;
}
.outline-page .blk-content {
  min-height: 26px;
  padding: 1px 0;
}
.outline-page .blk-content.editing {
  padding: 0;
}
.outline-page .blk > .blk-list {
  margin-left: 27px;
}
.outline input.todo {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}
/* the fold labels of To do (Still open, Coming up) print at their reading size, not the phone's 44 px tap height */
.todo-fold {
  min-height: 0;
  margin: 2px 0 8px;
}

/* Attachments: a picture prints at its screen size (editor.css: 320 x 240 at most), a file as its name - no chip
   border, no paperclip, the body's face; the full-size overlay is screen only. */
.att-chip {
  padding: 0;
  margin: 0;
  border: 0;
  font: inherit;
  color: var(--ink);
}
.att-chip .ico,
.att-overlay {
  display: none;
}
