/* World Model · print. Loads last. Every rule here sits inside @media print, or in the @page rules that set the paper. */

/* the paper: 14mm on every side, Letter or A4. The four corner boxes replace the browser's own date, title and address lines with a quiet document footer */
@page {
  margin: 14mm;
  @top-left { content: ""; }
  @top-right { content: ""; }
  @bottom-left { content: "Fate/EXTRA Record World Model · Powered by Chronicle"; font: 500 8pt 'Archivo', system-ui, sans-serif; color: #5B6577; }
  @bottom-right { content: counter(page) " / " counter(pages); font: 500 8pt 'Archivo', system-ui, sans-serif; font-variant-numeric: tabular-nums; color: #5B6577; }
}
/* the cover page carries no footer */
@page :first {
  @bottom-left { content: ""; }
  @bottom-right { content: ""; }
}

@media print {
  /* only the sheet prints: no header, rail, tabs, panels, tooltips, back-to-top or footer */
  .ds-head, .ds-rail, .ds-top, .ds-composer, .ds-loadbar, .ds-veil, .ds-totop-w, .ds-cmp, .ds-foot, .ds-ai, .ds-menu, .ds-pbar, .ds-tip, .ds-audp, .ds-audp-dim, .ds-dim, .ds-askp, .ds-sr, #ds-pane-root, .ds-rep-acts { display: none !important; }

  /* the shell is plain blocks on white paper, so nothing holds a screen's height and pages break where the content says */
  html, body { height: auto; overflow: visible; background: #fff !important; }
  .ds-shell, .ds-col, .ds-main, .ds-page:has(> .ds-rep) { display: block; min-height: 0; margin: 0; padding: 0 !important; background: none !important; }

  /* a printed page is about 710px wide, which the screen rules read as a phone. The report is drawn at four fifths instead, so the desktop grid fits the paper and 17px body copy lands at 10pt */
  .ds-rep { zoom: .8; border: 0; background: #fff; }

  /* every bar, plate and tint prints in colour, with or without the browser's "Background graphics" box, and nothing is caught mid-animation */
  .ds-rep { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ds-rep *, .ds-rep *::before, .ds-rep *::after { animation: none !important; transition: none !important; }

  /* the cover takes the top of page one as a poster: the art across the upper half, the project name below it on solid navy, where it stays legible whatever the picture does */
  .ds-rep-cover { min-height: 60vh; padding: 72px 44px 32px; }
  .ds-rep-cover-bg { inset: 0; height: auto; }
  .ds-rep-cover-bg::after { background: linear-gradient(180deg, rgba(6, 13, 28, .2) 0%, rgba(6, 13, 28, 0) 12%, rgba(6, 13, 28, .86) 42%, #060D1C 60%); }
  .ds-rep-k { letter-spacing: .16em; }
  .ds-rep-cover h1 { font-size: var(--ds-fs-13); }
  .ds-rep-q { font-size: var(--ds-fs-7); }
  .ds-rep-meta { gap: 14px 44px; }

  /* sections: the label column at the left, the content at the right. Plain blocks and a float rather than a grid, because a grid row strands its rule and label at the foot of a page. The spacing is a step tighter than the screen's, which is what lets two or three sections share a page */
  .ds-rep-sec { display: flow-root; padding: 26px 0; }
  .ds-rep-side { display: block; float: left; width: 116px; }
  .ds-rep-side b { margin: 8px 0 0; }
  .ds-rep-body { margin-left: 140px; }
  .ds-rep-body h2 { font-size: var(--ds-fs-10); margin-bottom: 18px; }
  .ds-rep-p { margin-bottom: 20px; }

  /* about this project, under the cover on page one: the primer and its four facts at the left, the contents at the right, as on the desktop */
  .ds-rep-about { grid-template-columns: minmax(0, 1fr) 252px; gap: 28px; }
  .ds-rep-about .ds-rep-lede { font-size: var(--ds-fs-6); }
  /* the four facts print as a fact sheet, label at the left and answer at the right: a 2 by 2 grid in this column leaves each answer a 30-character line and the longest one too many lines to balance */
  .ds-rep-facts { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 22px; padding-top: 4px; }
  .ds-rep-facts > div { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 10px 0; }
  .ds-rep-facts > div + div { border-top: 1px solid var(--ds-line); }
  .ds-rep-facts dd { margin: 0; }
  /* the contents list is plain text on paper: ink, no link colour, its numbers kept */
  .ds-rep-toc { padding: 18px 16px 10px; }
  .ds-rep-toc a { color: var(--ds-ink); text-decoration: none; }

  /* the answer reads as a statement, then its figure: a full measure for the lede, and the figure's bars get the width of the column */
  .ds-rep-split { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .ds-rep-lede { max-width: 34em; font-size: var(--ds-fs-7); }
  /* the name column is set in px: the heading row and the bar rows are different sizes, so an em column puts the headings off their bars */
  .ds-rep .ds-rep-fig .ds-vtrade-h, .ds-rep .ds-rep-fig .ds-vtrade-r { grid-template-columns: 128px minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; }
  .ds-rep .ds-rep-fig .ds-vtrade-r .nv, .ds-rep .ds-rep-fig .ds-vtrade-r .ck { grid-template-columns: minmax(56px, 1fr) 3.3em; gap: 8px; }
  /* and it keeps its desktop rows: the Concept heading, the name beside its bars, "Recommended" under the name */
  .ds-rep .ds-vtrade-h > span:first-child { display: block; }
  .ds-rep .ds-vtrade-r > b { grid-column: auto; }
  .ds-rep .ds-vtrade-r.rec > b::after { display: block; margin: 2px 0 0; }

  /* the desktop grids inside a section: three cards across or two by two, three big figures across */
  .ds-rep-two { grid-template-columns: 1fr 1fr; gap: 36px; }
  .ds-rep-two p { margin-top: 10px; }
  .ds-rep-made { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; }
  .ds-rep-finds { grid-template-columns: 1fr 1fr; gap: 0 40px; }
  .ds-rep-finds a { padding: 16px 0; }
  .ds-rep-reasons { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 24px; padding-top: 22px; }
  .ds-rep-big { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; padding: 18px 0; }
  .ds-rep-big b { font-size: var(--ds-fs-10); }
  .ds-rep-cons { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 24px; }
  .ds-rep-cons.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
  .ds-rep-con { display: grid; grid-template-rows: subgrid; grid-row: span 6; margin-bottom: 0; }
  .ds-rep-cons.n4 .ds-rep-con { margin-bottom: 32px; }
  .ds-rep-cons.n3 .ds-rep-nums { grid-template-columns: auto minmax(0, 1fr); gap: 20px; }
  .ds-rep-next a { grid-template-columns: 44px minmax(0, 20em) minmax(0, 1fr); }
  .ds-rep-next span { grid-column: auto; }

  /* four audiences across the full sheet, under the label: each card keeps its desktop width, so its facts fit one line and its copy stays readable. Equal columns, with the rule between them */
  .ds-rep-auds { clear: left; margin-left: -140px; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 21px; }
  .ds-rep-auds > .ds-rep-aud { margin: 0; padding: 18px 0; border: 0; }
  .ds-rep-auds > .ds-rep-aud + .ds-rep-aud { margin-left: -11px; padding-left: 10px; border-left: 1px solid var(--ds-line); }
  .ds-rep .ds-rep-aud b { font-size: var(--ds-fs-5); }
  .ds-rep .ds-rep-aud .n { font-size: var(--ds-fs-2); white-space: nowrap; }
  .ds-rep .ds-rep-aud p { font-size: var(--ds-fs-2); }

  /* a plate with no picture stays a small caption block, with room above the name for its tag */
  .ds-rep-plate:not(.has) { min-height: 96px; padding: 44px 14px 12px; }
  .ds-rep-plate:not(.has) span { font-size: var(--ds-fs-7); }

  /* figures keep their desktop rows: one line per name, a 34px track, the small figure labels */
  .ds-rep .ds-vgoal-r { height: 34px; min-height: 0; grid-template-columns: 24px minmax(0, 11em) minmax(0, 1fr) 2em; }
  .ds-rep .ds-vgoal-r b { font-size: inherit; line-height: inherit; white-space: nowrap; }
  .ds-rep .ds-vgoal-r .tk { align-self: auto; height: 34px; min-height: 0; }
  .ds-rep .ds-vtrack .tl, .ds-rep .ds-vtrack .tgl { font-size: var(--ds-fs-2); }
  .ds-rep .ds-vtrack .tv { font-size: var(--ds-fs-6); }
  .ds-rep .ds-vtrack .tv.hit { font-size: var(--ds-fs-7); }
  .ds-rep .ds-log li { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 10px 0; }

  /* a page breaks between sections, never inside one: in this grid every section is under a page, so no card, figure or row is cut. Page one holds the cover and About this project, and the answer opens page two */
  .ds-rep-cover, .ds-rep-sec { break-inside: avoid; }

  /* no stub lines: headline copy, card copy, captions and titles are balanced, so no line is left with one or two words */
  .ds-rep .ds-rep-q, .ds-rep .ds-rep-lede, .ds-rep .ds-rep-facts dt, .ds-rep .ds-rep-facts dd, .ds-rep .ds-rep-toc a, .ds-rep .ds-rep-p, .ds-rep .ds-rep-two p, .ds-rep .ds-rep-reasons li, .ds-rep .ds-rep-log, .ds-rep .ds-rep-verd, .ds-rep .ds-rep-why li, .ds-rep .ds-rep-note, .ds-rep .ds-rep-nums span, .ds-rep .ds-rep-big span, .ds-rep .ds-rep-finds b, .ds-rep .ds-rep-finds p, .ds-rep .ds-rep-aud b, .ds-rep .ds-rep-aud p, .ds-rep .ds-rep-next b, .ds-rep .ds-rep-next span, .ds-rep .ds-log li > div { text-wrap: balance; }
}

/* the report's "How this was made" section is for the screen: it leaves the printed report and its contents list (Daystrom, Oct 15) */
@media print { .ds-rep-made-sec, .ds-rep-made-toc { display: none !important; } }
