/* ==========================================================================
   paper.css: the scholar papers on screen.

   Linked with media="screen", after each paper's own <style> block. That
   block is the paper's print design and the source of its PDF, so nothing in
   this file can reach the printed page. The site layer before it
   (partials/paper-head.html) is screen only for the same reason.

   On screen a paper is a sheet laid on the drawing table: the site's nav,
   work scenes and footer around it, and the paper itself one sheet of light
   paper in either theme. .theme-light on the sheet carries the light palette
   (tokens.css), so the paper's own ink colours, written for white paper,
   stay right in the dark theme too. The sheet is set in the paper face,
   Libertinus, in one reading column; print keeps its two Times columns.
   ========================================================================== */

/* --------------------------------------------------------------------------
   The page around the sheet reads like every other page. Each paper's own
   element rules (body, p, p + p, a) were written for the paper alone, so
   the site chrome takes the site's values back, at the same specificity and
   later in the cascade, which still lets every class rule win.
   -------------------------------------------------------------------------- */
body.paper {
  background: var(--canvas);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
}
html :where(body.paper :is(.nav-island, .site-footer)) p {
  text-align: start;
  text-indent: 0;
  margin-bottom: 0;
}
html :where(body.paper :is(.nav-island, .site-footer)) a { color: inherit; }

/* --------------------------------------------------------------------------
   The sheet. Its pt sizes are the print sizes; zoom scales the whole paper
   to a screen reading size without rewriting a single one of them.
   -------------------------------------------------------------------------- */
body.paper .paper-sheet {
  max-width: 660px;
  margin: var(--space-32) auto 0;
  padding: 48px 56px 56px;
  zoom: 1.2;
  /* Paper in both themes, on purpose: the sheet is a light island. */
  background: #FFFFFF;
  color: var(--fg);
  font-family: var(--font-display);
  border: 1px solid var(--hair);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 24px 64px -24px rgba(0, 0, 0, 0.28);
}
html[data-theme="dark"] body.paper .paper-sheet {
  border-color: transparent;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 32px 80px -24px rgba(0, 0, 0, 0.9);
}
@media (max-width: 760px) {
  body.paper .paper-sheet {
    zoom: 1.08;
    margin: var(--space-12) var(--space-8) 0;
    padding: 28px 16px 36px;
  }
}

/* One column on screen: a two-column article on a scrolling page sends the
   reader down one column and back up for the next. */
body.paper .paper-sheet .two-col { column-count: 1; }
/* The paper sets its own measure: the site's paragraph cap does not apply. */
body.paper .paper-sheet p { max-width: none; hyphens: auto; -webkit-hyphens: auto; }
/* The title's hand-set break was placed for the print column. */
body.paper .paper-sheet .paper-title { text-wrap: balance; }
body.paper .paper-sheet .paper-title br { display: none; }

/* The paper face: Libertinus Serif for the text, Inconsolata where the print
   uses Courier. Mathematics keeps its own fonts. */
body.paper .paper-sheet :is(.paper-title, .equation) { font-family: var(--font-display); }
body.paper .paper-sheet :is(.paper-id, .author-email, .tt) { font-family: var(--font-mono); }
/* Inconsolata is set larger than Courier at the same size (size-adjust in
   fonts.css), so the paper's mono lines step down to sit with the serif. */
body.paper .paper-sheet .author-email { font-size: 9pt; }
body.paper .paper-sheet .paper-id { font-size: 8pt; }
body.paper .paper-sheet .tt { font-size: 84%; }
body.paper .paper-sheet .paper-cite { font-family: var(--font-mono); }

/* Links read as links on the sheet: the site's base rule makes them inherit
   their colour, which on paper would hide them. Class rules still win. */
:where(body.paper .paper-sheet) a {
  color: #8A2E0A;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* A wide table scrolls inside its own box rather than pushing the sheet. */
body.paper .paper-sheet table { max-width: 100%; }
