/* =========================================================================
   Realism pilot — NESA-convention practice-paper stylesheet
   Print-first (A4 paged CSS); the screen view is a preview of the printed
   page, not a web layout. Conventions implemented from documented NSW HSC
   exam-paper structure; see papers/pilot-realism/README.md for which
   decisions are convention and which are guesses pending the PO's
   reference PDFs in docs/reference/.
   ========================================================================= */

@page {
  size: A4;
  margin: 18mm 20mm 16mm 20mm;
}

:root {
  --ink: #000000;
  --rule: #9a9a9a;        /* answer ruling */
  --hair: #000000;        /* structural rules */
  --grid: #444444;        /* MC answer-grid strokes */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #f4f2ee;
  color: var(--ink);
  font-family: "Times New Roman", Times, Georgia, serif;
  font-size: 11pt;
  line-height: 1.45;
}

/* Screen preview: centre a paper-width column */
.paper {
  max-width: 176mm;
  margin: 0 auto;
  background: #ffffff;
  padding: 18mm 20mm;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.18);
}
@media print {
  html, body { background: #ffffff; }
  .paper {
    max-width: none;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }
  .screen-only { display: none !important; }
}

.screen-only {
  max-width: 176mm;
  margin: 16px auto;
  font-family: system-ui, sans-serif;
  font-size: 10pt;
  color: #555;
}

sub, sup { line-height: 0; }

/* ---- Cover page ------------------------------------------------------- */
.cover {
  break-after: page;
  display: flex;
  flex-direction: column;
  min-height: 240mm;
}
.cover-site {
  font-size: 9pt;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 2mm;
}
.cover-rule {
  border: 0;
  border-top: 1.2pt solid var(--hair);
  margin: 1mm 0 10mm;
}
.cover-series {
  text-align: center;
  font-size: 12pt;
  margin: 10mm 0 2mm;
}
.cover-course {
  text-align: center;
  font-size: 22pt;
  font-weight: bold;
  margin: 2mm 0 1mm;
}
.cover-scope {
  text-align: center;
  font-size: 14pt;
  margin: 0 0 12mm;
}
.cover-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8mm;
  margin-top: 6mm;
}
.cover h2 {
  font-size: 11pt;
  font-weight: bold;
  margin: 0 0 2mm;
}
.cover ul {
  margin: 0 0 5mm;
  padding-left: 5mm;
}
.cover li { margin-bottom: 1.6mm; }
.cover-total { margin: 0 0 4mm; }
.cover-total strong { font-size: 12pt; }
.cover-section-block {
  border-left: 1.6pt solid var(--hair);
  padding-left: 4mm;
  margin-bottom: 5mm;
}
.cover-section-block p { margin: 0 0 1.2mm; }
.cover-footnote {
  margin-top: auto;
  padding-top: 6mm;
  font-size: 9pt;
  border-top: 0.6pt solid var(--rule);
}

/* ---- Section headings ------------------------------------------------- */
.section-head {
  break-before: page;
  margin: 0 0 4mm;
}
.section-head h2 {
  font-size: 14pt;
  font-weight: bold;
  margin: 0 0 1mm;
}
.section-head .section-meta { margin: 0 0 1mm; }
.section-head .section-instructions {
  margin: 2mm 0 0;
  padding: 2.5mm 4mm;
  border: 0.8pt solid var(--hair);
}
.section-head .section-instructions p { margin: 0 0 1mm; }
.section-head .section-instructions p:last-child { margin-bottom: 0; }

/* ---- Section I: multiple choice --------------------------------------- */
.mc-question {
  break-inside: avoid;
  margin: 0 0 6mm;
  display: grid;
  grid-template-columns: 10mm 1fr;
  column-gap: 2mm;
}
.mc-number { font-weight: bold; }
.mc-body p.mc-stem { margin: 0 0 2mm; }
.mc-options {
  margin: 0;
  padding: 0;
  list-style: none;
}
.mc-options li {
  display: grid;
  grid-template-columns: 8mm 1fr;
  column-gap: 1mm;
  margin-bottom: 1.2mm;
}
.mc-letter { font-weight: normal; }

/* ---- Section II: short answer ----------------------------------------- */
.sa-question {
  break-inside: avoid;
  margin: 0 0 8mm;
}
.sa-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 0.8pt solid var(--hair);
  padding-top: 2mm;
  margin-bottom: 2mm;
}
.sa-head h3 {
  font-size: 11pt;
  font-weight: bold;
  margin: 0;
}
.sa-marks-margin {
  font-weight: bold;
  white-space: nowrap;
  padding-left: 6mm;
}
.sa-stem { margin: 0 0 3mm; }
.sa-stem p { margin: 0 0 2mm; }

/* Ruled answer space: one .answer-line per rule, sized to marks by the
   generator. 8.5mm pitch approximates exam writing-line spacing. */
.answer-space { margin-top: 2mm; }
.answer-line {
  height: 8.5mm;
  border-bottom: 0.5pt solid var(--rule);
}

/* ---- Stimulus material (figures and tables) ---------------------------
   Exam-stimulus form: no frames, no fills, no shaded header bars. Real
   papers present stimulus as bare line work with a plain caption. */
.stimulus {
  break-inside: avoid;
  padding: 1mm 0 2mm;
  margin: 0 0 3mm;
}
.stimulus-framing {
  font-style: italic;
  margin: 0 0 2mm;
}
.stimulus-figure {
  display: block;
  width: 100%;
  max-width: 152mm;
  margin: 0 auto;
}
.stimulus-caption {
  font-size: 10pt;
  text-align: center;
  margin: 2mm 0 0;
}
.stimulus .stimulus-caption:first-child { margin: 0 0 2mm; text-align: left; }
.stimulus-table {
  border-collapse: collapse;
  margin: 0 auto;
  font-size: 10.5pt;
}
.stimulus-table th, .stimulus-table td {
  border: 0.6pt solid var(--hair);
  padding: 1.6mm 3mm;
  text-align: left;
  vertical-align: top;
}
.stimulus-table th { font-weight: bold; }

/* ---- Detachable MC answer sheet --------------------------------------- */
.answer-sheet {
  break-before: page;
}
.detach-rule {
  border: 0;
  border-top: 1pt dashed var(--grid);
  margin: 0 0 1.5mm;
}
.detach-hint {
  font-size: 8.5pt;
  color: #333;
  margin: 0 0 5mm;
  font-family: system-ui, sans-serif;
}
.answer-sheet h2 {
  font-size: 13pt;
  margin: 0 0 1mm;
}
.answer-sheet .sheet-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4mm 10mm;
  margin: 4mm 0 5mm;
}
.answer-sheet .sheet-fields span {
  border-bottom: 0.5pt solid var(--ink);
  padding: 0 2mm 1mm;
  min-height: 7mm;
  display: inline-block;
}
.sheet-instructions {
  font-size: 10pt;
  margin: 0 0 4mm;
}
.sheet-instructions p { margin: 0 0 1.5mm; }
.grid-table {
  border-collapse: collapse;
  margin-top: 2mm;
}
.grid-table td, .grid-table th {
  padding: 1.6mm 3mm;
  text-align: center;
  font-size: 11pt;
}
.grid-table th { font-weight: bold; }
.oval {
  display: inline-block;
  width: 7mm;
  height: 4.2mm;
  border: 0.7pt solid var(--grid);
  border-radius: 50%;
  font-size: 8pt;
  line-height: 4.2mm;
  color: #555;
}

/* ---- Marking guidelines ----------------------------------------------- */
.marking {
  break-before: page;
}
.marking-banner {
  border: 1pt solid var(--hair);
  padding: 3mm 4mm;
  margin: 0 0 6mm;
}
.marking-banner h2 {
  font-size: 14pt;
  margin: 0 0 1mm;
}
.marking-banner p { margin: 0; font-size: 10pt; }
.marking h3 {
  font-size: 12pt;
  margin: 6mm 0 2mm;
}
.mc-key-table, .criteria-table {
  border-collapse: collapse;
  width: 100%;
  margin: 2mm 0 4mm;
  font-size: 10.5pt;
}
.mc-key-table { width: auto; min-width: 60mm; }
.mc-key-table th, .mc-key-table td,
.criteria-table th, .criteria-table td {
  border: 0.6pt solid var(--hair);
  padding: 1.6mm 3mm;
  text-align: left;
  vertical-align: top;
}
.mc-key-table td:last-child { text-align: center; }
.criteria-table th { background: #eeeeee; }
.criteria-table .crit-marks {
  width: 18mm;
  text-align: center;
  white-space: nowrap;
}
.marking .mg-question {
  break-inside: avoid;
  margin-bottom: 6mm;
}
.sample-answer {
  border-left: 1.2pt solid var(--rule);
  padding: 1mm 0 1mm 4mm;
  margin: 2mm 0 0;
  font-size: 10.5pt;
}
.sample-answer p { margin: 0 0 2mm; }
.sample-answer .sample-label {
  font-weight: bold;
  font-variant: small-caps;
}
.mg-meta {
  font-size: 9pt;
  color: #333;
  margin: 1mm 0 0;
}

@media print {
  .mc-question, .sa-question, .marking .mg-question { break-inside: avoid; }
}
