/* Free printables (scripts/printables.mjs, docs/printables.md): the worksheet page and the "Free printable" section
   on topic pages. The sheet is sized in container units, so the same markup is the on-screen preview and the print. */

/* ---------- the "Free printable" section on a topic page ---------- */
.pr-teaser-card{display:grid;grid-template-columns:minmax(0,220px) minmax(0,1fr);gap:22px;align-items:center;background:#fff;border:4px solid var(--ink);border-radius:34px;padding:14px 22px 14px 14px;color:inherit;text-decoration:none;box-shadow:0 8px 0 rgba(20,33,43,.18)}
.pr-teaser-card:active{transform:translateY(4px);box-shadow:0 4px 0 rgba(20,33,43,.18)}
.pr-teaser-art{display:block;border-radius:24px;padding:6px}
.pr-teaser-art svg{display:block;width:100%;height:auto}
.pr-teaser-text{display:flex;flex-direction:column;gap:6px}
.pr-teaser-text strong{font:800 clamp(22px,2.6vw,28px)/1.15 var(--display)}
.pr-teaser-go{font-weight:800;color:#2a7f9e}
@media (max-width:620px){.pr-teaser-card{grid-template-columns:1fr;padding:12px 16px 16px}}

/* ---------- the worksheet page ---------- */
.pr-main{display:flex;flex-direction:column;gap:28px}
.pr-intro{display:flex;flex-direction:column;gap:14px;max-width:44em}
.pr-intro h1{font-size:clamp(32px,4.6vw,48px)}
.pr-actions{display:flex;flex-wrap:wrap;gap:12px 16px;align-items:center}
.pr-print{padding:10px 30px;cursor:pointer}
.pr-mode{display:inline-flex;border:3px solid var(--ink);border-radius:999px;overflow:hidden;background:#fff}
.pr-mode button{font:800 16px/1 var(--body,inherit);padding:12px 16px;min-height:48px;border:0;background:transparent;color:var(--ink);cursor:pointer}
.pr-mode button[aria-pressed="true"]{background:var(--sun,#ffc94a)}
.pr-mode button+button{border-left:3px solid var(--ink)}
@media (max-width:520px){.pr-mode{display:flex;width:100%}.pr-mode button{flex:1;padding:10px 8px;font-size:15px;line-height:1.15}}
.pr-more{margin:18px 0 0;font-weight:800}
.pr-more a{color:#2a7f9e}
.pr-hub-list{display:flex;flex-direction:column;gap:22px;max-width:860px}
.pr-hub-note{margin:0;max-width:44em;color:#4d5b66}
.pr-tips ul{margin:0 0 18px;padding-left:22px;display:flex;flex-direction:column;gap:8px;max-width:44em}

/* The sheet is one A4 page (210 × 297 mm). Every size inside is a multiple of --u (1/100 of the sheet width):
   on screen --u follows the preview width, in print it is 2.1 mm, so the print does not depend on how a browser
   resolves container units while printing. A4 only; Letter printers shrink it a little ("fit to page"). */
.pr-sheet-wrap{container-type:inline-size;width:100%;max-width:760px;margin:0 auto}
.pr-sheet{--u:1cqw;width:100cqw;aspect-ratio:210/297;background:#fff;color:#14212b;border-radius:10px;
  box-shadow:0 2px 0 rgba(20,33,43,.08),0 14px 34px rgba(20,33,43,.16);padding:calc(var(--u)*5.6) calc(var(--u)*5.6) calc(var(--u)*4.4);
  display:flex;flex-direction:column;gap:calc(var(--u)*1.6);overflow:hidden;box-sizing:border-box;
  -webkit-print-color-adjust:exact;print-color-adjust:exact}
.pr-head{display:flex;justify-content:space-between;align-items:center;gap:calc(var(--u)*4)}
.pr-brand{display:inline-flex;align-items:center;gap:calc(var(--u)*1.4);font:800 calc(var(--u)*3.2)/1 'Baloo 2',system-ui,sans-serif}
.pr-brand svg{width:calc(var(--u)*6.4);height:calc(var(--u)*6.4)}
.pr-name{display:inline-flex;align-items:flex-end;gap:calc(var(--u)*1.6);font:700 calc(var(--u)*2.6)/1 'Nunito',system-ui,sans-serif;flex:1;max-width:calc(var(--u)*52)}
.pr-line{flex:1;border-bottom:calc(var(--u)*.3) solid #14212b;height:calc(var(--u)*3)}
.pr-title{font:800 calc(var(--u)*6.4)/1.05 'Baloo 2',system-ui,sans-serif;margin:calc(var(--u)*1.2) 0 0}
.pr-instr{font:700 calc(var(--u)*2.8)/1.3 'Nunito',system-ui,sans-serif;margin:0;color:#3f4b55}
/* the activity fills all the height that is left: equal rows, each drawing centred in its box */
.pr-grid{display:grid;grid-template-columns:repeat(var(--cols,2),minmax(0,1fr));grid-auto-rows:minmax(0,1fr);gap:calc(var(--u)*2);flex:1;min-height:0;margin-top:calc(var(--u)*1)}
.pr-card{display:block;width:100%;height:100%;box-sizing:border-box;border:calc(var(--u)*.36) solid #14212b;border-radius:calc(var(--u)*2.8);background:#fff}
.pr-trace{font-family:'Baloo 2',system-ui,sans-serif;font-weight:800;fill:none;stroke:#7d8a94;stroke-width:2.2;stroke-dasharray:5 5;stroke-linecap:round;stroke-linejoin:round}
.pr-trace path,path.pr-trace{stroke-width:2.6;stroke-dasharray:6 6}
.pr-word{font:800 15px 'Nunito',system-ui,sans-serif;fill:#4d5b66}
.pr-word-big{font-size:22px;fill:#14212b}
.pr-div{stroke:#14212b;stroke-width:1.4;stroke-dasharray:1 6;stroke-linecap:round;opacity:.45}
/* a picture to colour in: every coloured fill white, the ink stays (eyes, dots, outlines) — in both versions */
.pr-colorin [fill]:not([fill="none"]):not([fill="#14212b"]){fill:#fff}
.pr-colorin [stroke]:not([stroke="none"]):not([stroke="#14212b"]){stroke:#fff}
.pr-colorin [opacity]{opacity:0}
.pr-letters-capitals .pr-grid{gap:calc(var(--u)*1.4)}
.pr-letters-capitals .pr-card{border-radius:calc(var(--u)*2)}
.pr-letters-capitals .pr-word{font-size:17px}
/* pack sheets (scripts/printables/packs/): numbers, places to write, the ten-frame's empty places, graph boxes */
.pr-num{font-family:'Baloo 2',system-ui,sans-serif;font-weight:800;fill:#14212b}
.pr-halo{paint-order:stroke;stroke:#fff;stroke-width:2.4;stroke-linejoin:round}
.pr-place{fill:#fff;stroke:#7d8a94;stroke-width:1.3;stroke-dasharray:2.6 2.6}
.pr-nbox{fill:#fff;stroke:#14212b;stroke-width:2}
.pr-wbox{fill:#fff;stroke:#7d8a94;stroke-width:2.4;stroke-dasharray:6 5}
.pr-wline{stroke:#14212b;stroke-width:2.4;stroke-linecap:round}
.pr-gbox{fill:#fff;stroke:#14212b;stroke-width:1.6}
.pr-foot{margin:0;font:700 calc(var(--u)*2.2)/1.3 'Nunito',system-ui,sans-serif;color:#4d5b66;text-align:center}
.pr-foot strong{color:#14212b;white-space:nowrap}

/* ---------- worksheets with several pages, the pack hub ---------- */
.pr-sheet-wrap{display:flex;flex-direction:column;gap:30px}
.pr-page{display:flex;flex-direction:column;gap:10px}
.pr-page-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;font-weight:800}
.pr-page-print{font:800 15px/1 var(--body,inherit);padding:10px 16px;min-height:44px;border:3px solid var(--ink);border-radius:999px;background:#fff;color:var(--ink);cursor:pointer}
.pr-meta{display:flex;flex-wrap:wrap;gap:6px 18px;margin:0;font-weight:800;color:#4d5b66}
.pr-facts{margin:0 0 18px;display:grid;grid-template-columns:minmax(0,11em) minmax(0,1fr);gap:8px 18px;max-width:52em}
.pr-facts dt{font-weight:800}
.pr-facts dd{margin:0}
@media (max-width:620px){.pr-facts{grid-template-columns:1fr;gap:2px}.pr-facts dd{margin-bottom:8px}}
.pr-game{margin:0 0 18px;max-width:52em}
.pr-game a,.pr-open,.pr-jump{color:#2a7f9e;font-weight:800}
.pr-more{display:flex;flex-wrap:wrap;gap:8px 24px}
.pr-text{max-width:46em}
.pr-text p{margin:0 0 12px}
.pr-week{margin:0 0 12px;padding-left:22px;display:flex;flex-direction:column;gap:8px}
.pr-items{display:flex;flex-direction:column;gap:30px}
.pr-item{display:grid;grid-template-columns:minmax(0,230px) minmax(0,1fr);gap:26px;align-items:start;background:#fff;border:4px solid var(--ink);border-radius:34px;padding:20px;box-shadow:0 8px 0 rgba(20,33,43,.18)}
.pr-item h3{margin:0 0 6px;font:800 clamp(22px,2.6vw,28px)/1.15 var(--display)}
.pr-item h3 a{color:inherit;text-decoration:none}
.pr-item .pr-facts{grid-template-columns:minmax(0,9.5em) minmax(0,1fr);margin:12px 0}
.pr-mini{display:block;color:inherit;text-decoration:none}
.pr-mini .pr-sheet-wrap{max-width:230px}
.pr-mini .pr-sheet{border:1px solid #d8dde1;box-shadow:0 2px 0 rgba(20,33,43,.08),0 8px 18px rgba(20,33,43,.12)}
@media (max-width:700px){.pr-item{grid-template-columns:1fr}.pr-mini .pr-sheet-wrap{margin:0 auto;max-width:260px}}
.pr-sources ul{margin:0;padding-left:22px;display:flex;flex-direction:column;gap:6px}
.pr-sources a{color:#2a7f9e}

/* coloring page: every coloured fill of the figures turns white, the ink stays (dots, eyes, spots, outlines) */
.pr-ink .pr-things [fill]:not([fill="none"]):not([fill="#14212b"]){fill:#fff}
.pr-ink .pr-brand svg [fill]:not([fill="none"]):not([fill="#14212b"]){fill:#fff}

@media print{
  /* no page margin: the browser has no room for its own date / title / URL lines; the sheet brings its own border */
  @page{size:A4;margin:0}
  html,body{background:#fff!important;padding:0!important;margin:0!important}
  body.pr .gp-wrap{padding:0!important;max-width:none;gap:0;display:block}
  body.pr .gp-wrap>:not(main),body.pr main>:not(.pr-sheet-wrap){display:none!important}
  .pr-sheet-wrap{container-type:normal;max-width:none;width:210mm;margin:0}
  .pr-sheet{--u:2.1mm;width:210mm;height:296.5mm;aspect-ratio:auto;box-shadow:none;border-radius:0;margin:0;break-inside:avoid;page-break-after:avoid}
  /* a worksheet with several pages: one A4 page each; "Print this page" prints only that one (core/printable.js) */
  .pr-sheet-wrap{display:block}
  .pr-page{display:block}
  .pr-page-bar{display:none!important}
  .pr-page:not(:last-child) .pr-sheet{break-after:page;page-break-after:always}
  body.pr-only .pr-page:not(.pr-print-this){display:none}
  body.pr-only .pr-page .pr-sheet{break-after:auto;page-break-after:auto}
}
