/* A printable worksheet page of the Year 10 course (mathcourse/worksheet.html).
   On screen it is a sheet of paper on a cream ground with a small tool bar;
   printed, only the sheet is left. Tokens come from core/theme.css. */

@page { size: A4; margin: 13mm 13mm 15mm; }

body.mw-body {
    margin: 0;
    background: var(--cream);
    font-family: Inter, system-ui, sans-serif;
    font-size: 11pt;
    line-height: 1.5;
    color: var(--ink);
}
.mw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.mw-bar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    padding: 10px 16px;
    border-bottom: 2px solid var(--ink);
    background: var(--paper);
}
.mw-bar-gap { flex: 1 1 auto; }
.mw-link { font-weight: 600; color: var(--teal-deep); text-decoration: none; }
.mw-link:hover { text-decoration: underline; }
.mw-link small { font-weight: 500; color: var(--muted); }
.mw-btn {
    min-height: 44px;
    padding: 0 20px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--ink);
    font: inherit;
    font-weight: 700;
    color: var(--paper);
    cursor: pointer;
}
.mw-btn:focus-visible, .mw-link:focus-visible { outline: 3px solid var(--tangerine); outline-offset: 2px; }

/* A visitor who is not signed in reads the sheet on screen; printing asks
 * for an account. */
.mw-btn-ask { display: inline-flex; align-items: center; text-decoration: none; }
.mw-btn-ask:hover { color: var(--paper); }
.mw-printnote { display: none; }
@media print {
    .mw-screen-only .mw-page { display: none; }
    .mw-screen-only .mw-printnote { display: block; margin: 20mm; font-size: 14pt; font-weight: 600; }
}

.mw-page {
    box-sizing: border-box;
    max-width: 210mm;
    margin: 18px auto 40px;
    padding: 14mm 13mm;
    border: 1px solid var(--line);
    background: var(--paper);
}
.mw-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 20px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.mw-head p { margin: 0; }
.mw-brand { font-family: "Bricolage Grotesque", Inter, sans-serif; font-size: 16pt; font-weight: 800; line-height: 1; color: var(--teal-deep); }
.mw-where { margin-top: 2px; font-size: 8.5pt; color: var(--muted); }
.mw-name { font-size: 9.5pt; white-space: nowrap; }
.mw-name span { display: inline-block; width: 52mm; margin: 0 4mm 0 1mm; border-bottom: 1px solid var(--ink); }
.mw-name span.mw-short { width: 24mm; margin-right: 0; }
.mw-title { margin: 10px 0 2px; font-family: "Bricolage Grotesque", Inter, sans-serif; font-size: 20pt; font-weight: 800; line-height: 1.15; }
.mw-tag { margin-left: 6px; padding: 2px 10px; border: 2px solid var(--tangerine); border-radius: 999px; font-family: Inter, sans-serif; font-size: 9pt; font-weight: 700; vertical-align: middle; display: inline-block; white-space: nowrap; }
.mw-intro { margin: 0 0 6px; max-width: 150mm; }

.mw-part { margin-top: 16px; }
.mw-part h2 { margin: 0 0 8px; font-size: 11.5pt; font-weight: 700; line-height: 1.3; break-after: avoid; }
.mw-part h2 span { margin-right: 6px; padding: 1px 8px; border-radius: 4px; background: var(--ink); font-size: 9pt; color: var(--paper); }
.mw-letter { width: 7mm; font-weight: 700; color: var(--teal-deep); }

.mw-scroll { overflow-x: auto; }
.mw-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.mw-table th, .mw-table td { height: 9mm; padding: 0 2mm; border: 1px solid var(--ink); text-align: center; }
.mw-table thead th { height: 8mm; background: var(--mint); font-size: 9.5pt; font-weight: 600; }
.mw-table .mw-letter { border-color: transparent var(--ink) transparent transparent; background: none; text-align: left; }
.mw-table td.mw-rule, .mw-table th.mw-rule { min-width: 34mm; }
.mw-table b, .mw-terms b, .mw-how b { font-weight: 700; color: var(--teal-deep); }

.mw-grows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 10mm; margin: 0; padding: 0; list-style: none; }
.mw-grows li { display: flex; gap: 2mm; break-inside: avoid; }
.mw-grows p { margin: 0; }
.mw-terms { display: flex; flex-wrap: nowrap; align-items: flex-end; gap: 1.5mm 2mm; font-size: 12pt; font-variant-numeric: tabular-nums; }
.mw-gap { display: inline-block; flex: 0 1 10mm; min-width: 7mm; min-height: 6mm; border-bottom: 1px solid var(--ink); text-align: center; }
.mw-how { display: flex; align-items: flex-end; gap: 2mm; margin-top: 3mm; font-size: 9.5pt; color: var(--muted); }
.mw-how b { font-size: 10pt; }
.mw-line { flex: 1 1 auto; min-height: 5mm; border-bottom: 1px solid var(--ink); }

.mw-written { display: grid; gap: 10px; margin: 0; padding-left: 5mm; }
.mw-written li { break-inside: avoid; }
.mw-written p { margin: 0; }
.mw-space { height: 30mm; margin-top: 2mm; border-bottom: 1px solid var(--line); }
.mw-answer { margin-top: 2mm; padding: 2mm 3mm; border-left: 3px solid var(--teal-deep); background: var(--mint); }

.mw-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 8pt; color: var(--muted); }
.mw-foot span:first-child { font-weight: 700; color: var(--tangerine); }

.mw-table td.mw-off, .mw-mini td.mw-off { background: var(--line); font-size: 8pt; font-weight: 600; color: var(--ink); }

/* The three sides: shapes, the same patterns as numbers, numbers on their own. */
.mw-side { margin-top: 14px; }
.mw-sidehead { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-family: "Bricolage Grotesque", Inter, sans-serif; font-size: 14pt; font-weight: 800; break-after: avoid; }
.mw-sidehead span { padding: 2px 10px; border-radius: 999px; background: var(--tangerine); font-family: Inter, sans-serif; font-size: 9pt; font-weight: 700; color: var(--ink); }
.mw-do { margin: 0 0 8px; max-width: 165mm; font-size: 10pt; }
.mw-newside { padding-top: 14px; border-top: 2px dashed var(--line); }
.mw-shapes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6mm 9mm; margin: 0; padding: 0; list-style: none; }
.mw-shapes li { display: flex; flex-direction: column; gap: 2mm; min-width: 0; break-inside: avoid; }
.mw-shapehead { display: flex; gap: 2mm; align-items: flex-start; }
.mw-shapehead .mw-letter { font-size: 12pt; }
.mw-drawing { display: flex; flex: 1 1 auto; align-items: flex-end; justify-content: center; height: 31mm; min-width: 0; }
.mw-drawing svg { width: auto; max-width: 100%; height: auto; max-height: 31mm; }
.mw-mini { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.mw-mini th { height: 5.5mm; border: 1px solid var(--ink); background: var(--mint); font-size: 8.5pt; font-weight: 600; text-align: center; }
.mw-mini td { height: 8mm; border: 1px solid var(--ink); text-align: center; }
.mw-mini .mw-rule { width: 34%; }
.mw-mini b { font-weight: 700; color: var(--teal-deep); }
.mw-shapes .mw-how { margin: 0; }
.mw-both { margin-top: 12px; }
.mw-both .mw-space { height: 48mm; }
.mw-both-note { margin: 12px 0 0; padding: 3mm 4mm; border: 2px solid var(--ink); border-radius: 3mm; font-size: 11pt; }

@media (max-width: 640px) {
    .mw-page { margin: 0; padding: 18px 16px; border: 0; }
    .mw-grows, .mw-shapes { grid-template-columns: minmax(0, 1fr); }
    .mw-name { white-space: normal; }
    .mw-name span { width: 34mm; }
    .mw-table { min-width: 620px; }
}
@media print {
    body.mw-body { background: none; }
    .mw-bar { display: none; }
    .mw-page { max-width: none; margin: 0; padding: 0; border: 0; }
    .mw-scroll { overflow: visible; }
    .mw-newside { padding-top: 0; border-top: 0; break-before: page; }
    .mw-off, .mw-mini th, .mw-sidehead span { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .mw-table thead th, .mw-part h2 span, .mw-answer { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* A problem set: numbered questions, sub-parts side by side, done in an
   exercise book so there is no writing space. */
.mw-tag-soft { background: none; border: 1.5px solid currentColor; }
.mw-qs { display: grid; gap: 14px; margin: 0; padding-left: 1.6em; }
.mw-qs > li { padding-left: 4px; break-inside: avoid; }
.mw-qs > li::marker { font-weight: 700; }
.mw-q { margin: 0; line-height: 1.75; }
.mw-subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px 22px; margin: 10px 0 0; padding: 0; list-style: none; }
.mw-subs > li { display: flex; gap: 6px; align-items: baseline; break-inside: avoid; }
.mw-subs-ans { margin-top: 0; }
.mw-work-subs { margin: 6px 0 0; padding: 0; list-style: none; }
.mw-work-subs > li { margin-top: 10px; break-inside: avoid; }
/* A question whose parts each have working may run over a page: its parts stay whole. */
.mw-qs > li:has(.mw-work-subs) { break-inside: auto; }
.mw-qs > li:has(.mw-work-subs) > .mw-q { break-after: avoid; }
.mw-work { margin: 4px 0 0 22px; padding: 0 0 0 12px; border-left: 2px solid var(--tangerine); list-style: none; }
.mw-work > li { line-height: 1.9; }
.mw-fig { margin: 8px 0 4px; break-inside: avoid; }
.mw-fig svg { max-width: min(100%, 300px); height: auto; }
.mw-marks { float: right; font-weight: 700; }
.mw-sub { flex: 0 0 auto; font-weight: 700; }
.mw-ps .mw-side + .mw-side { margin-top: 20px; }
.mw-dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.mw-dots i { width: 8px; height: 8px; border: 1.5px solid currentColor; border-radius: 50%; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.mw-dots i.is-on { background: currentColor; }
.mw-sidehead .mw-dots { margin-left: 6px; color: var(--ink); }
.mw-key { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin: 4px 0 0; font-size: 9pt; color: var(--muted); }
.mw-key .mw-dots { margin-left: 8px; }

/* One question at a time (journey.js): the working opens a line at a time. */
.mw-journey .mw-qs > li { break-inside: auto; }
.mw-jbar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 22px; padding: 12px 14px; background: var(--paper); border: 2px solid var(--ink); border-radius: 14px; }
.mw-jcount { margin: 0; font-weight: 700; color: var(--teal-deep); }
.mw-jactions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.mw-btn-quiet { background: var(--paper); color: var(--ink); border: 2px solid var(--line); }
.mw-jend { margin-top: 18px; padding: 18px; background: var(--mint); border: 2px solid var(--ink); border-radius: 14px; }
.mw-jtitle { margin: 0 0 6px; font-family: "Bricolage Grotesque", Inter, sans-serif; font-size: 16pt; }
.mw-jscore { margin: 0 0 8px; font-size: 13pt; font-weight: 700; color: var(--tangerine); }
.mw-jmissed { margin: 0 0 8px; }
@media print { .mw-jbar, .mw-jend { display: none; } }
.mw-jbar[hidden], .mw-jend[hidden] { display: none; }
