/* chapter-paper.css: the chapter pages of the book online (read/ and the family area), on paper and between pages.
   Linked by the chapter builder on chapter pages only (not on the contents page). No word is set here.
   1. A soft cross-fade from one chapter to the next (the browser's own page transition). Both pages must carry this
      rule, so it works between chapters and nowhere else. Off when the reader asks for less motion; a browser that
      does not know the rule simply opens the next page as before.
   2. A printed chapter is set like the book: the book's type (Iowan Old Style, then Palatino), old-style figures,
      the chapter's roundel and title in ink, the text, then the notes at the end, and after each link to another site
      its address in brackets. The menus, the row of buttons, the reading bar, the reader's buttons, the cards and the
      site's foot are left off the paper. The selectors carry two ids' weight so the site's own screen rules
      (which load later) do not win on paper. */

/* ---- 1. between chapters ---- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.3s; animation-timing-function: ease-in-out; }
}

/* ---- 2. on paper ---- */
@media print {
  @page {
    margin: 0.9in 1.1in;
    @bottom-center { content: counter(page); font-family: "Iowan Old Style", "Palatino", "Palatino Linotype", "Book Antiqua", Georgia, serif; font-size: 9pt; font-variant-numeric: oldstyle-nums; color: #000; }
  }
  html:not(#_):not(#__), html:not(#_):not(#__) body { background: #fff !important; color: #000 !important; }

  /* what stays on the screen */
  html:not(#_):not(#__) :is(.site-nav-shared, .skip-link, nav.stx-pills, nav.chx-pillbar, .fam-bar, .site-foot-shared, .theme-toggle-fab, .brx-progress, .brx-bar, .brx-note, .brx-panel, .brx-resume, .bkn, .bk-pager, .bk-supp, .chx-toc, .bk-crumb, header.chx-hero .stx-brow, main.bk-wrap button) { display: none !important; }

  /* the chapter's head: roundel, title and fleuron in ink on white */
  html:not(#_):not(#__) header.chx-hero { background: none !important; color: #000 !important; border: 0 !important; box-shadow: none !important; margin: 0 0 14pt !important; padding: 0 !important; text-align: center !important; break-after: avoid; break-inside: avoid; }
  html:not(#_):not(#__) header.chx-hero::before, html:not(#_):not(#__) header.chx-hero::after { content: none !important; display: none !important; }
  html:not(#_):not(#__) header.chx-hero .chx-roundel { display: block; width: 0.85in; height: auto; margin: 0 auto 8pt; filter: grayscale(1) brightness(0.3) !important; }
  html:not(#_):not(#__) header.chx-hero .chx-fleuron { display: block; width: 1.1in; height: auto; margin: 8pt auto 0; opacity: 1; filter: grayscale(1) brightness(0.3) !important; }
  html:not(#_):not(#__) header.chx-hero:not(#___) h1:not(#_), html:not(#_):not(#__) main.bk-wrap:not(#___) > h1:not(#_), html:not(#_):not(#__) main.bk-wrap:not(#___) > header.auto-hero h1:not(#_) { font-family: "Iowan Old Style", "Palatino", "Palatino Linotype", "Book Antiqua", Georgia, serif !important; font-size: 21pt !important; font-weight: 600 !important; line-height: 1.2 !important; letter-spacing: 0 !important; color: #000 !important; -webkit-text-fill-color: #000 !important; text-shadow: none !important; background: none !important; margin: 0 !important; font-variant-numeric: oldstyle-nums proportional-nums; break-after: avoid; }

  /* a page without the dressed head (the family area): the same roundel, the chapter's number and title, centred */
  html:not(#_):not(#__) main.bk-wrap > .bk-roundel { display: block !important; margin: 0 0 8pt; text-align: center; }
  html:not(#_):not(#__) main.bk-wrap > .bk-roundel .chx-roundel { display: inline-block; width: 0.85in; height: auto; filter: grayscale(1) brightness(0.3) !important; }
  html:not(#_):not(#__) main.bk-wrap > .bk-roundel .chx-fleuron { display: none; }
  html:not(#_):not(#__) main.bk-wrap > :is(.bk-label, h1) { text-align: center !important; }
  html:not(#_):not(#__) main.bk-wrap > header.auto-hero { background: none !important; color: #000 !important; border: 0 !important; box-shadow: none !important; margin: 0 0 12pt !important; padding: 0 !important; text-align: center !important; break-after: avoid; }
  html:not(#_):not(#__) main.bk-wrap > header.auto-hero .crumbs { display: none !important; }
  html:not(#_):not(#__) main.bk-wrap > header.auto-hero .sub { text-align: left; }
  html:not(#_):not(#__) main.bk-wrap > .bk-roundel { order: -3 !important; }
  html:not(#_):not(#__) main.bk-wrap > .bk-label { order: -2 !important; }
  html:not(#_):not(#__) main.bk-wrap > header.auto-hero { order: -1 !important; }

  /* the text: the book's type and figures, justified, one column */
  html:not(#_):not(#__) main.bk-wrap { display: flex !important; flex-direction: column; max-width: none !important; margin: 0 !important; padding: 0 !important; background: #fff !important; color: #000 !important; font-family: "Iowan Old Style", "Palatino", "Palatino Linotype", "Book Antiqua", Georgia, serif !important; font-size: 11pt !important; line-height: 1.45 !important; font-variant-numeric: oldstyle-nums proportional-nums; hyphens: auto; -webkit-hyphens: auto; }
  html:not(#_):not(#__) main.bk-wrap *:not(code, pre, kbd, samp) { font-family: inherit !important; }
  html:not(#_):not(#__) main.bk-wrap :is(p, li, blockquote, dd, dt, h2, h3, h4, h5, h6, figcaption, summary) { color: #000 !important; -webkit-text-fill-color: #000 !important; }
  html:not(#_):not(#__) main.bk-wrap p { text-align: justify; orphans: 3; widows: 3; }
  html:not(#_):not(#__) main.bk-wrap :is(h2, h3, h4) { break-after: avoid; }
  html:not(#_):not(#__) main.bk-wrap :is(figure, table tr, blockquote) { break-inside: avoid; }
  html:not(#_):not(#__) main.bk-wrap figure { background: none !important; box-shadow: none !important; }
  html:not(#_):not(#__) main.bk-wrap figure img { max-height: 4.6in; width: auto; max-width: 100%; filter: none !important; mix-blend-mode: normal !important; outline: 0 !important; }
  html:not(#_):not(#__) main.bk-wrap :is(table, sup) { font-variant-numeric: lining-nums tabular-nums; }
  html:not(#_):not(#__) main.bk-wrap p.chx-tail img { filter: none !important; width: 1.6in !important; height: auto !important; }   /* as the book prints it */
  html:not(#_):not(#__) main.bk-wrap p.chx-tail.chx-tail-end img { width: 2.2in !important; }

  /* the notes at the end, then the line on the edition; anything kept online beside the chapter comes before them */
  html:not(#_):not(#__) main.bk-wrap > * { order: 0; }
  html:not(#_):not(#__) main.bk-wrap > .bk-notes { order: 1; }
  html:not(#_):not(#__) main.bk-wrap > .chx-edition { order: 2; margin-top: 12pt; font-size: 9pt; }
  html:not(#_):not(#__) main.bk-wrap .bk-notes { font-size: 9.5pt; line-height: 1.4; }
  html:not(#_):not(#__) main.bk-wrap details.chx-fold { margin: 20pt 0 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; }
  html:not(#_):not(#__) main.bk-wrap details.chx-fold > summary { list-style: none; padding: 0 0 4pt !important; border: 0 !important; break-after: avoid; }
  html:not(#_):not(#__) main.bk-wrap details.chx-fold > summary::-webkit-details-marker { display: none; }
  html:not(#_):not(#__) main.bk-wrap details.chx-fold > :not(summary) { margin-left: 0 !important; margin-right: 0 !important; }
  html:not(#_):not(#__) main.bk-wrap details.chx-fold > summary small { color: #000 !important; }
  html:not(#_):not(#__) main.bk-wrap sup { line-height: 0; }
  html:not(#_):not(#__) main.bk-wrap details.bk-notes > ol { padding-left: 2.8em !important; list-style-position: outside !important; }

  /* links: no colour or underline; a link to another site prints its address */
  html:not(#_):not(#__) main.bk-wrap a { color: #000 !important; -webkit-text-fill-color: #000 !important; text-decoration: none !important; background: none !important; }
  html:not(#_):not(#__) main.bk-wrap a[href^="http"]:not(.bare, .fig-full)::after { content: " (" attr(href) ")"; font-size: 0.86em; overflow-wrap: anywhere; word-break: break-all; }
}
/* a folded part (the notes, the parts kept online) prints open even without the script that opens it.
   On its own: a browser that does not know the part's name drops only this rule. */
@media print {
  html:not(#_):not(#__) main.bk-wrap details::details-content { content-visibility: visible !important; display: block !important; }
}
/* a line of about 75 letters on paper; a picture that is in the book but not on the website prints as its caption,
   with the line saying where the picture is, in italic, after the credit (no empty frame) */
@media print {
  /* D-044 (24 Nov 2026): the running text is 5.2in wide (about 75 letters a line at 11pt); a table, a figure, a box and the
     lines above and below a table keep the width of 5.9in, which is the page column */
  html:not(#_):not(#__) main.bk-wrap.chx { max-width: 5.2in !important; margin: 0 auto !important; font-size: 11pt !important; line-height: 1.45 !important; }
  html:not(#_):not(#__) main.bk-wrap.chx :is(figure, aside.sidebar, table, .tbl-title, .tbl-src, .tbl-note):not(aside *) { max-width: none !important; margin-left: -0.35in !important; margin-right: -0.35in !important; }
  html:not(#_):not(#__) main.bk-wrap.chx table:not(aside *) { width: calc(100% + 0.7in) !important; }
  html:not(#_):not(#__) main.bk-wrap.chx figure.fig.fig-offline { display: block !important; padding: 0 !important; border: 0 !important; background: none !important; }
  html:not(#_):not(#__) main.bk-wrap.chx figure.fig.fig-offline::before { content: none !important; display: none !important; }
  html:not(#_):not(#__) main.bk-wrap.chx figure.fig.fig-offline .fig-offline-note { margin-top: 0.2em !important; padding-top: 0 !important; border-top: 0 !important; font-style: italic !important; font-size: inherit !important; letter-spacing: 0 !important; }
}
