/* print.css - shared stylesheet for all redesigned test files
   Matches the layout direction in design demos/test-content-examples.html
   Print-first: white backgrounds, black/gray rules, no decorative color. */


* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: #ddd9d0;
  padding: 40px 24px 80px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  font-kerning: normal;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

/* ── A4 paper ── */
.paper {
  width: 794px;
  margin: 0 auto 48px;
  background: #fff;
  box-shadow: 0 4px 32px rgba(0,0,0,0.14), 0 1px 4px rgba(0,0,0,0.07);
  padding: 56px 64px;
  min-height: 1000px;
}

/* ── Page-break divider (between test and answer guide) ── */
.page-break {
  border: none;
  border-top: 2px dashed #bbb;
  margin: 0;
}
.answer-guide {
  background: #fafafa;
}
.answer-guide-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #aaa;
  text-align: center;
  padding: 14px 0 10px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 20px;
}

/* ── Test header ── */
.test-header {
  text-align: center;
  border-bottom: 2.5px solid #111;
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.test-header .subject {
  font-size: 15px;
  font-weight: 800;
  color: #111;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.test-header .meta-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 10px;
  font-weight: 600;
  color: #555;
}
.test-header .meta-row span { white-space: nowrap; }
.meta-sep { color: #ccc; }

/* ── Student info ── */
.student-info {
  display: flex;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
}
.info-field { flex: 1; }
.info-field.narrow { max-width: 140px; }
.info-field label {
  display: block;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #aaa;
  margin-bottom: 6px;
}
.info-field .field-line {
  height: 1px;
  background: #bbb;
  width: 100%;
}

/* ── Section header ── */
.section-hdr {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #111;
  border-bottom: 1px solid #ccc;
  padding-bottom: 5px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.section-hdr .marks {
  font-size: 9px;
  font-weight: 600;
  color: #888;
  text-transform: none;
  letter-spacing: 0;
}
.section-divider {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 24px 0;
}

/* ── Instructions ── */
.instr {
  font-size: 10px;
  color: #555;
  font-style: italic;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* ── Passage (reading) ── */
.passage {
  border: 1px solid #ddd;
  padding: 12px 16px;
  margin-bottom: 15px;
  border-radius: 2px;
  background: #fdfcfa;
  font-size: 11.2px;
  color: #222;
  line-height: 1.62;
}
.passage p + p { margin-top: 7px; }

.passage,
.cloze-passage,
.prompt-box,
.task-bullets,
.tf-table td,
.sa-item .q-text,
.mc-item .q-text,
.mc-opt {
  letter-spacing: 0;
  word-spacing: 0;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1;
}

/* ── True/False table ── */
.tf-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
}
.tf-table th {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  padding: 5px 8px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}
.tf-table th.center { text-align: center; }
.tf-table td {
  font-size: 11.5px;
  color: #222;
  padding: 9px 8px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
  line-height: 1.4;
}
.tf-table td.num {
  font-weight: 700;
  color: #111;
  width: 22px;
  font-size: 10.5px;
}
.tf-table td.bubble-cell {
  text-align: center;
  width: 52px;
}
.bubble-oval {
  display: inline-block;
  width: 30px;
  height: 17px;
  border-radius: 10px;
  border: 1.5px solid #bbb;
  font-size: 8.5px;
  font-weight: 700;
  color: #aaa;
  line-height: 15px;
  text-align: center;
}

/* ── Short-answer questions ── */
.sa-list { list-style: none; margin-bottom: 8px; }
.sa-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.sa-item .q-num {
  font-size: 11px;
  font-weight: 700;
  color: #111;
  min-width: 20px;
  padding-top: 1px;
}
.sa-item .q-body { flex: 1; }
.sa-item .q-text {
  font-size: 11.5px;
  color: #222;
  margin-bottom: 8px;
  line-height: 1.4;
}
.sa-item .ans-line {
  height: 1px;
  background: #ccc;
  width: 100%;
}

/* ── Cloze passage (grammar) ── */
.cloze-passage {
  border: 1px solid #ddd;
  padding: 14px 18px;
  margin-bottom: 20px;
  border-radius: 2px;
  background: #fdfcfa;
  font-size: 11.5px;
  color: #222;
  line-height: 2;
}
.blank {
  display: inline-block;
  border-bottom: 1.5px solid #111;
  min-width: 44px;
  text-align: center;
  font-weight: 700;
  color: #111;
  font-size: 9.5px;
  vertical-align: bottom;
  margin: 0 3px;
  padding: 0 4px;
}

/* ── Multiple-choice options ── */
.mc-list { list-style: none; margin-bottom: 8px; }
.mc-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.mc-item .q-num {
  font-size: 11px;
  font-weight: 700;
  color: #111;
  min-width: 20px;
  padding-top: 3px;
}
.mc-item .q-body {
  flex: 1;
  min-width: 0;
}
.mc-opts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 14px;
  row-gap: 5px;
  padding-top: 2px;
  width: 100%;
}
.mc-opt {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  align-items: start;
  column-gap: 7px;
  font-size: 11.2px;
  color: #222;
  line-height: 1.3;
  min-width: 0;
  break-inside: avoid;
}
.mc-circle {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid #bbb;
  flex-shrink: 0;
}

/* ── Writing lines ── */
.writing-lines { margin-top: 4px; }
.w-line {
  height: 1px;
  background: #ccc;
  margin-bottom: 24px;
}
.w-line:last-child { margin-bottom: 0; }

/* ── Word bank ── */
.word-box {
  border: 1px dashed #bbb;
  border-radius: 3px;
  padding: 10px 16px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.word-box .box-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #aaa;
}
.word-box .word {
  font-size: 11px;
  font-weight: 600;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 2px 9px;
  background: #fafafa;
}

/* ── Writing task bullet list ── */
.task-bullets {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
}
.task-bullets li {
  font-size: 11px;
  color: #333;
  padding: 3px 0 3px 16px;
  position: relative;
  line-height: 1.5;
}
.task-bullets li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #888;
}

/* ── Prompt box ── */
.prompt-box {
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 12px 16px;
  margin-bottom: 18px;
  background: #fdfcfa;
}
.prompt-box .prompt-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #aaa;
  margin-bottom: 6px;
}
.prompt-box .prompt-text {
  font-size: 11.5px;
  color: #222;
  line-height: 1.6;
  margin-bottom: 4px;
}
.prompt-box .prompt-task {
  font-size: 11px;
  color: #444;
  font-weight: 600;
  margin-top: 8px;
  line-height: 1.5;
}

/* ── Score box ── */
.score-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}
.score-box {
  border: 1.5px solid #ccc;
  padding: 5px 16px;
  text-align: center;
  border-radius: 2px;
  min-width: 100px;
}
.score-box .s-label {
  font-size: 7.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #aaa;
  display: block;
  margin-bottom: 2px;
}
.score-box .s-val {
  font-size: 15px;
  font-weight: 800;
  color: #111;
}

/* ── Marking rubric table ── */
.rubric-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 11px;
}
.rubric-table th {
  background: #f4f4f4;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #666;
  padding: 7px 10px;
  border: 1px solid #e0e0e0;
  text-align: left;
}
.rubric-table td {
  padding: 8px 10px;
  border: 1px solid #e8e8e8;
  color: #333;
  vertical-align: top;
  line-height: 1.5;
}
.rubric-table td.score-cell {
  font-weight: 800;
  font-size: 13px;
  color: #111;
  text-align: center;
  width: 40px;
}

/* ── Answer list ── */
.answer-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 14px;
}
.answer-list li {
  font-size: 11px;
  color: #333;
}
.answer-list li .a-num {
  font-weight: 700;
  color: #111;
  margin-right: 4px;
}
.answer-list li .a-val {
  font-weight: 700;
  color: #111;
  text-decoration: underline;
}

/* ── Sample answer box ── */
.sample-answer {
  border: 1px solid #e0e0e0;
  border-radius: 2px;
  padding: 14px 16px;
  background: #fafafa;
  margin-top: 8px;
}
.sample-answer .sa-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #aaa;
  margin-bottom: 10px;
}
.sample-answer p {
  font-size: 11px;
  color: #333;
  line-height: 1.7;
  margin-bottom: 4px;
}

@page { size: A4; margin: 0; }

/* ── Print media ── */
@media print {
  body { background: #fff; padding: 0; }
  .paper {
    box-shadow: none;
    margin: 0;
    padding: 20mm 18mm;
    width: 100%;
    min-height: auto;
    page-break-after: always;
  }
  .answer-guide { page-break-before: always; }
  .page-break { display: none; }
}
