/* Styles for worksheet pages (site/<level>/worksheets/). Load after main.css and starter.css.
   A worksheet is a page of questions answered in jotters: easy to read on an iPad,
   and it prints on A4 (the Print button, or the browser's own print). */

.worksheet { padding-bottom: 56px; }
.ws-lead { margin: 14px 0 0; font-size: 1.1rem; color: var(--muted); }

.ws-card {
  margin: 18px 0 0;
  padding: 16px 20px;
  border: var(--edge-w) solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--pop-sm);
}

/* The method: numbered steps beside a worked line of arrows */
.ws-method { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; border-left: 8px solid var(--level-colour, var(--accent)); }
.ws-method ol { flex: 1 1 300px; margin: 0; padding-left: 1.3em; font-size: 1.1rem; line-height: 1.5; }
.ws-method svg { flex: 0 1 380px; width: 100%; max-width: 380px; height: auto; }
.ws-method svg .ws-val { fill: var(--text); font-weight: 700; font-size: 17px; }
.ws-method svg .ws-time { fill: var(--bad); font-weight: 700; font-size: 13px; }
.ws-method svg path { stroke: var(--bad); }
.ws-method svg marker path { fill: var(--bad); stroke: none; }

/* Sections A, B, C… */
.ws-section { margin-top: 30px; }
.ws-section > h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 12px; font-size: 1.6rem; line-height: 1.2; }
.ws-letter {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--level-colour, var(--accent)); color: var(--on-level); font-size: 1.3rem;
}
.ws-section > h2 small { flex-basis: 100%; font-size: 1.05rem; font-weight: 400; color: var(--muted); }
.ws-note { margin: 10px 0 0; color: var(--muted); }

/* Question tables: one question per row */
.ws-scroll { overflow-x: auto; border: var(--edge-w) solid var(--edge); border-radius: var(--radius); background: var(--surface); box-shadow: var(--pop-sm); }
.ws-table { width: 100%; border-collapse: collapse; font-size: 1.1rem; }
.ws-table th { padding: 10px 12px; background: var(--level-colour, var(--accent)); color: var(--on-level); font-size: 0.95rem; text-align: center; }
.ws-table td { padding: 11px 12px; border-top: 1px solid var(--border); text-align: center; }
.ws-table td + td, .ws-table th + th { border-left: 1px solid var(--border); }
.ws-table .ws-n { width: 44px; font-weight: 700; color: var(--level-colour, var(--accent)); }
.ws-table .ws-src { text-align: left; font-weight: 700; white-space: nowrap; }
.ws-table .ws-use { text-align: left; color: var(--muted); font-size: 1rem; }
.ws-table .ws-use ~ td { white-space: nowrap; }
.ws-table tr.ws-more td { background: color-mix(in srgb, var(--level-colour, var(--accent)) 8%, var(--surface)); }

/* Questions in words */
.ws-qs { margin: 0; padding: 0; list-style: none; }
.ws-qs li { display: flex; gap: 14px; padding: 12px 0; font-size: 1.1rem; line-height: 1.45; }
.ws-qs li + li { border-top: 1px solid var(--border); }
.ws-qs li > b { flex: none; width: 1.4em; color: var(--level-colour, var(--accent)); }
.ws-card > h3 { margin: 0 0 4px; font-size: 0.9rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bad); }

/* The relationships pupils need for the recall section */
.ws-sheet { display: flex; flex-wrap: wrap; gap: 8px 34px; align-items: center; margin: 0 0 12px; font-size: 1.15rem; font-weight: 600; }

@media print {
  @page { size: A4; margin: 13mm 14mm 12mm; }
  :root {
    --bg: #fff; --surface: #fff; --text: #111; --muted: #444; --border: #b9c0cb; --edge: #222;
    --edge-w: 1px; --pop-sm: none; --pop: none; --bad: #b45309; --on-level: #fff;
  }
  html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; font-size: 11.5pt; line-height: 1.3; }
  .wrap { padding: 0; }
  .site-header, .site-footer, .crumbs, .toolbar { display: none !important; }
  .worksheet { padding: 0; max-width: none; }
  .spec-ref { margin: 0 0 4px; font-size: 9.5pt; padding: 2px 8px; }
  .worksheet h1 { font-size: 21pt; margin: 0 0 4px; }
  .ws-lead { margin: 0; font-size: 11pt; }
  .ws-card { margin-top: 8px; padding: 6px 12px; border-radius: 8px; }
  .ws-method { gap: 4px 20px; flex-wrap: nowrap; }
  .ws-method ol { font-size: 11pt; line-height: 1.35; flex: 1 1 auto; }
  .ws-method svg { flex: 0 0 82mm; max-width: 82mm; }
  .ws-section { margin-top: 12px; }
  .ws-section.ws-break { break-before: page; margin-top: 0; }
  .ws-section > h2 { font-size: 14pt; margin-bottom: 5px; gap: 2px 8px; }
  .ws-section > h2 small { flex-basis: auto; font-size: 10.5pt; }
  .ws-letter { width: 7.5mm; height: 7.5mm; font-size: 12pt; }
  .ws-scroll { overflow: visible; border-radius: 0; }
  .ws-table { font-size: 11.5pt; }
  .ws-table th { padding: 4px 5px; font-size: 9.5pt; }
  .ws-table td { padding: 4.5px 5px; }
  .ws-table .ws-use { font-size: 9.5pt; }
  .ws-table tr.ws-more td { background: #eef2f7; }
  .ws-note { margin-top: 3px; font-size: 10.5pt; }
  .ws-qs li { padding: 3.5px 0; font-size: 11.5pt; line-height: 1.32; break-inside: avoid; gap: 8px; }
  .ws-qs li + li { border-top: 0; }
  .ws-sheet { font-size: 11.5pt; margin-bottom: 4px; }
  .ws-break .ws-qs li, .ws-break ~ .ws-section .ws-qs li { padding: 6px 0; font-size: 12.5pt; }
}

/* Graph worksheets (half-life graphs): static SVG decay curves on a grid.
   One block per question: the graph on the left, what to do beside it. */
.decay-graph { display: block; width: 100%; height: auto; }
.ws-intro { margin: 0 0 12px; font-size: 1.1rem; }
.ws-row {
  display: grid; grid-template-columns: minmax(260px, 420px) minmax(240px, 1fr); gap: 14px 28px; align-items: center;
  margin-top: 16px; padding: 16px 20px;
  border: var(--edge-w) solid var(--edge); border-radius: var(--radius); background: var(--surface); box-shadow: var(--pop-sm);
}
@media (max-width: 640px) { .ws-row { grid-template-columns: 1fr; } }
.ws-graph { margin: 0; }
.ws-task h3 { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 1.35rem; line-height: 1.2; }
.ws-qn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--level-colour, var(--accent));
  color: var(--level-colour, var(--accent)); font-size: 1.1rem;
}
.ws-task .ws-use { margin: 4px 0 8px; color: var(--muted); font-size: 1rem; }
.ws-method-graph { align-items: center; }
.ws-method-graph > div { flex: 1 1 300px; }
.ws-method-graph h3 { margin: 0 0 6px; }
.ws-method-graph ol { font-size: 1.1rem; }
.ws-method-graph .decay-graph { flex: 0 1 300px; max-width: 300px; }
.ws-data th { text-align: left; white-space: nowrap; }
.ws-section > .ws-scroll + .ws-card { margin-top: 12px; }
.ws-fill { margin: 4px 0 10px; border: 1px solid var(--border); }
.ws-fill td { height: 2.6em; }
.ws-fill td:first-child { width: 22%; font-weight: 700; }

@media print {
  .ws-intro { margin-bottom: 2mm; font-size: 11.5pt; }
  .ws-row { grid-template-columns: 72mm 1fr; gap: 0 8mm; margin-top: 2.5mm; padding: 1.5mm 3mm; border-radius: 8px; break-inside: avoid; }
  .ws-task h3 { font-size: 14pt; gap: 2.5mm; }
  .ws-qn { width: 7mm; height: 7mm; font-size: 11pt; border-width: 1.2pt; }
  .ws-task .ws-use { font-size: 10.5pt; margin: 1mm 0 2mm; }
  .ws-pages .ws-qs li, .ws-pages .ws-break .ws-qs li, .ws-pages .ws-break ~ .ws-section .ws-qs li { padding: 1.1mm 0; font-size: 11.5pt; }
  .ws-method-graph .decay-graph { flex: 0 0 52mm; max-width: 52mm; }
  .ws-method-graph h3 { margin-bottom: 1mm; }
  .ws-data td, .ws-data th { padding: 4px 3px; }
  .ws-fill td { height: 7.5mm; }
  .ws-pages .ws-section { margin-top: 4mm; }
  .ws-pages .ws-section.ws-break { margin-top: 0; }
}

/* Circuit questions (BGE electricity revision): a grid of cards, each a question above its diagram.
   Symbols come from assets/js/circuit-symbols.js. */
.ws-circuits { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.ws-circuit {
  display: flex; flex-direction: column; gap: 10px; padding: 14px 18px;
  border: var(--edge-w) solid var(--edge); border-radius: var(--radius); background: var(--surface); box-shadow: var(--pop-sm);
}
.ws-circuit p { display: flex; gap: 12px; margin: 0; font-size: 1.1rem; line-height: 1.45; }
.ws-circuit p > b { flex: none; width: 1.2em; color: var(--level-colour, var(--accent)); }
.ws-circuit .circuit { max-width: 330px; margin: auto auto 0; }

@media print {
  .ws-circuits { grid-template-columns: 1fr 1fr; gap: 3mm; }
  .ws-circuit { gap: 2mm; padding: 2.5mm 3.5mm; border-radius: 8px; break-inside: avoid; }
  .ws-circuit p { font-size: 11.5pt; line-height: 1.3; gap: 8px; }
  .ws-circuit .circuit { max-width: 62mm; }
}

/* A one-row data table above the questions (g on each planet), with a formula line under it */
.ws-gtable { overflow-x: auto; }
.ws-formula { margin: 0.7rem 0 0; font-size: 1.05rem; text-align: center; }

/* Speed, distance and time (N5 dynamics): a big equation and a worked example in the method card,
   a question mark in the cell to find, and exam questions with a source tag and marks */
.ws-big { flex: none; margin: 0; font-size: 2.6rem; font-weight: 800; line-height: 1; color: var(--level-colour, var(--accent)); }
.ws-eg { flex: 0 1 240px; padding: 8px 14px; border-radius: 10px; background: color-mix(in srgb, var(--level-colour, var(--accent)) 8%, var(--surface)); }
.ws-eg h3 { margin: 0 0 2px; font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bad); }
.ws-eg p { margin: 0; font-size: 1.1rem; line-height: 1.5; }
.ws-eg b { color: var(--bad); }
.ws-table .ws-q { font-size: 1.3rem; font-weight: 800; color: var(--bad); }
.ws-tag { display: block; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--level-colour, var(--accent)); }
.ws-mk { white-space: nowrap; color: var(--muted); }

@media print {
  .ws-big { font-size: 24pt; }
  .ws-eg { flex: 0 0 52mm; padding: 2px 8px; border-radius: 6px; background: #eef2f7; }
  .ws-eg h3 { font-size: 8.5pt; }
  .ws-eg p { font-size: 10.5pt; line-height: 1.3; }
  .ws-table .ws-q { font-size: 12.5pt; }
  .ws-tag { font-size: 8.5pt; }
}
