/* print.css: the result on paper. Linked with media="print" and also embedded verbatim as the only
   stylesheet of the downloaded HTML copy (app.js download()), so it is self-contained: no tokens.css
   variables, no self-hosted fonts, no interactive controls. Black text, no shadows, bars as outlined
   boxes with the percentage in text, details open, page breaks before the moves and the offer block.

   Constraint: app.js serializes the downloaded copy with XMLSerializer, which entity-escapes the
   greater-than, less-than, and ampersand characters inside the style element; HTML then reads the style
   element as raw text and drops every selector containing an escaped character. So this file uses no
   child combinators and none of those three characters anywhere; descendant combinators only. */

@page { margin: 18mm; }

:root { color-scheme: light; }
body {
  color: #000;
  background: #fff;
  font: 11pt/1.45 "Roboto", "Helvetica Neue", Arial, sans-serif;
  margin: 0;
}
main, article { max-width: 100%; margin: 0; padding: 0; }
article { max-width: 44em; margin: 0 auto; padding: 1em; }

h1, h2, h3 {
  font-family: "Castoro", Georgia, "Times New Roman", serif;
  font-weight: 700;
  color: #000;
  line-height: 1.2;
  margin: 0 0 0.4em;
  break-after: avoid;
}
h1 { font-size: 22pt; margin-top: 1.2em; }
h2 { font-size: 15pt; margin-top: 1.4em; }
h3 { font-size: 11.5pt; margin-top: 0.8em; }
p { margin: 0 0 0.7em; }
a { color: #000; text-decoration: underline; overflow-wrap: anywhere; }
a[href]::after { content: " (" attr(href) ")"; font-size: 9pt; }

/* Nothing interactive prints. The opt-in section is only a form: on the live page it is the section that
   holds a form; in the downloaded copy the form is already removed and it is the last section. */
.interactive, form, button, nav, noscript,
article section:has(form),
article section:last-of-type { display: none; }

/* The Dusty panel (DD-313) never prints: the paper copy is the result alone. The two-panel wrapper falls back to a
   plain block so the result keeps its single-column measure. The downloaded HTML copy carries neither element. */
.panel-dusty, .panel-toggle { display: none; }
.two-panel { display: block; }

/* app.css is linked without a media attribute, so it also applies on paper. This catch-all sits at id-level
   specificity (:is takes its strongest argument) and matches the live page under main#assessment and the
   downloaded copy under a bare body: black text, no surfaces, anywhere inside the result. */
:is(#assessment, body) article *,
:is(#assessment, body) article *::before { color: #000; background: none; box-shadow: none; transition: none; }
article section:has(h1) { padding: 0; border-radius: 0; }
:is(#assessment, body) article section a { display: inline; min-height: 0; padding: 0; border: 0; border-radius: 0; font-weight: 400; text-decoration: underline; }

section, li, .bar, details { break-inside: avoid; }
section { margin: 1.2em 0; }

/* Verdict and scores */
article section h1 + p { font-size: 13pt; }
.scores { display: flex; gap: 2em; }
.scores div { flex: 1; border: 0; border-top: 1px solid #000; border-radius: 0; padding: 0.5em 0 0; }
.scores h2 { font-family: inherit; font-size: 9pt; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 0.3em; }
.score-value { font-family: "Castoro", Georgia, "Times New Roman", serif; font-size: 28pt; font-weight: 700; line-height: 1; margin: 0 0 0.3em; }
.scores p:last-child { font-size: 9.5pt; }

/* Bars: outlined box, black fill, percentage already present as text. */
.bar { display: grid; grid-template-columns: 1fr auto; column-gap: 1em; align-items: end; margin: 0 0 0.9em; }
.bar p:first-child { grid-column: 1; margin: 0 0 0.25em; font-weight: 700; }
.bar span { grid-column: 2; margin-bottom: 0.25em; font-weight: 700; }
.bar progress, .bar progress + p, .bar details, .bar p:first-child + p { grid-column: 1 / -1; }
.bar progress + p { display: block; font-size: 9.5pt; font-weight: 700; margin: 0.3em 0 0; }
.bar progress + p::before { content: ""; display: inline; width: auto; height: auto; border-radius: 0; transform: none; }
.missing progress + p::before { content: "\25A0  "; }
.wedge progress + p::before, .weakest progress + p::before { content: "\25B2  "; }
progress {
  display: block;
  width: 100%;
  height: 0.5em;
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
progress::-webkit-progress-bar { background: #fff; }
progress::-webkit-progress-value { background: #000; }
progress::-moz-progress-bar { background: #000; }

/* Measurement details always open on paper. */
details summary { list-style: none; font-size: 9.5pt; margin-top: 0.4em; min-height: 0; display: block; padding: 0; }
details summary::-webkit-details-marker { display: none; }
details :not(summary) { display: block; }
details .bar { display: grid; margin: 0.5em 0 0.4em 1.2em; }
details .bar p:first-child, details .bar span { font-weight: 400; }
details .bar progress { height: 0.35em; }

/* Three moves: new page, numbered. */
article section:has(ol) { break-before: page; }
article ol { list-style: none; counter-reset: move; margin: 0.8em 0 0; padding: 0; }
article ol li { counter-increment: move; display: grid; grid-template-columns: auto 1fr; column-gap: 0.9em; margin: 0 0 1.2em; padding-top: 0.6em; border-top: 1px solid #000; }
article ol li::before { content: counter(move); grid-row: 1 / span 4; font-family: "Castoro", Georgia, "Times New Roman", serif; font-size: 20pt; font-weight: 700; line-height: 1; min-width: 1.5ch; }
article ol li p, article ol li h3 { grid-column: 2; }
article ol li h3 { font-family: inherit; font-size: 9pt; letter-spacing: 0.12em; text-transform: uppercase; margin: 0.2em 0 0.3em; }

/* Offer block: new page, each rung a boxed pair. Only this section has h3 headings outside a list. */
article section:has(h3):not(:has(ol)) { break-before: page; display: block; padding: 0; }
article section:has(h3):not(:has(ol)) h3 { border: 1px solid #000; border-bottom: 0; border-radius: 0; margin: 0.8em 0 0; padding: 0.6em 0.8em 0.1em; }
article section:has(h3):not(:has(ol)) h3 + p { border: 1px solid #000; border-top: 0; border-radius: 0; margin: 0; padding: 0 0.8em 0.7em; }

/* Footer carries the assessment URL. */
footer { border-top: 1px solid #000; margin-top: 2em; padding-top: 0.8em; font-size: 9.5pt; }
footer::before { content: "https://dusty.collideascope.co"; display: block; font-weight: 700; margin-bottom: 0.4em; }
footer a[href]::after { content: ""; }
