/* Printable books (colouring book and activity book).
   Every sheet is one US Letter page, black and white only. */
* { box-sizing: border-box; }
html, body { margin: 0; background: #f6e7cf; }
body { font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif; color: #000; overflow-x: hidden; }

/* ---------- the bar at the top (screen only) ---------- */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 10px 14px; background: #fff8ea; border-bottom: 2px solid #e2c99d; }
.bar a { color: #7a4b12; font-weight: bold; font-size: 18px; text-decoration: none; white-space: nowrap; }
.bar .t { flex: 1; min-width: 150px; text-align: center; font-size: 22px; font-weight: bold; color: #4a2c0a; }
.grades { display: flex; gap: 6px; }
.grades a { padding: 6px 14px; border: 2px solid #d9b77f; border-radius: 999px; font-size: 16px; }
.grades a.on { background: #7a4b12; border-color: #7a4b12; color: #fff; }
.bar button { font: inherit; font-size: 22px; font-weight: bold; padding: 10px 30px; border: 0; border-radius: 999px; background: #e8613c; color: #fff; cursor: pointer; }
.bar button:active { transform: scale(.97); }

/* ---------- the name, tick box and button above each sheet (screen only) ---------- */
.pick { max-width: 8.5in; margin: 0 auto 6px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 6px 10px; background: #fff8ea; border: 2px solid #e2c99d; border-radius: 12px; font-size: 17px; color: #4a2c0a; }
.pick label { display: flex; align-items: center; gap: 8px; cursor: pointer; flex: 1; min-width: 0; }
.pick input { width: 24px; height: 24px; flex: none; accent-color: #e8613c; }
.pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick button { font: inherit; font-size: 15px; font-weight: bold; padding: 7px 14px; border: 2px solid #e8613c; border-radius: 999px; background: #fff; color: #c2461f; cursor: pointer; white-space: nowrap; }
.pick button:active { transform: scale(.97); }

/* ---------- sheets on screen ---------- */
#sheets { padding: 18px 8px 40px; }
.sheetwrap { width: 8.5in; height: 11in; margin: 0 auto 22px; }          /* JS shrinks width and height on narrow screens */
.sheet { width: 8.5in; height: 11in; padding: .5in .5in .6in; background: #fff; box-shadow: 0 4px 18px rgba(80, 50, 10, .3); transform-origin: 0 0; overflow: hidden; }
.inner { width: 7.5in; height: 9.9in; display: flex; flex-direction: column; overflow: hidden; }
.sh, .sf { flex: none; display: flex; justify-content: space-between; font-size: 12px; letter-spacing: .3px; }
.sh { font-weight: bold; padding-bottom: 5px; margin-bottom: 8px; border-bottom: 1.5px solid #000; }
.sf { padding-top: 5px; margin-top: 8px; border-top: 1.5px solid #000; }
.pbody { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ---------- colouring pages ---------- */
.art { flex: 1; min-height: 0; position: relative; border: 3px solid #000; border-radius: 14px; overflow: hidden; }
.art svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
.cap { flex: none; margin: 10px 0 0; text-align: center; font-size: 30px; font-weight: 900; line-height: 1.15; color: #fff; -webkit-text-stroke: 1.3px #000; letter-spacing: .5px; }
.by { flex: none; margin: 10px 0 0; font-size: 20px; font-weight: bold; }
.by .ul { display: inline-block; width: 330px; border-bottom: 2px solid #000; margin-left: 6px; height: 1em; }

/* ---------- activity pages ---------- */
.pt { flex: none; margin: 0 0 4px; text-align: center; font-size: 30px; font-weight: 900; }
.pi { flex: none; margin: 0 0 10px; text-align: center; font-size: 17px; }
.puz { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; }
.puz svg { display: block; max-width: 100%; }
.wl { width: 100%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px 6px; margin-top: 16px; padding: 0 16px; font-size: 18px; font-weight: bold; text-align: center; }
.wl span { white-space: nowrap; }
/* secret code page */
.key { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 10px; border: 3px solid #000; border-radius: 14px; }
.kc { width: 58px; text-align: center; border: 2px solid #000; border-radius: 8px; }
.kc b { display: block; font-size: 24px; }
.kc i { display: block; font-style: normal; font-size: 20px; font-weight: bold; border-top: 2px solid #000; }
.code-fact { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin: 14px 0 0; }
.cw { display: inline-flex; gap: 3px; }
.cc { display: flex; flex-direction: column; align-items: center; width: 34px; }
.cc u { display: block; width: 34px; height: 40px; border-bottom: 3px solid #000; text-decoration: none; }
.cc i { font-style: normal; font-size: 20px; font-weight: bold; }
.dec { width: 360px; text-align: left; font-size: 13px; line-height: 1.4; }
.dec p { margin: 4px 0; }
.wl span::before { content: ""; display: inline-block; width: 13px; height: 13px; border: 2px solid #000; margin-right: 6px; vertical-align: -2px; }
.clues { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; margin-top: 10px; font-size: 16px; line-height: 1.3; }
.clues h3 { margin: 4px 0 5px; font-size: 18px; border-bottom: 2px solid #000; }
.clues ol { margin: 0; padding: 0; list-style: none; }
.clues li { margin: 0 0 5px; padding-left: 26px; text-indent: -26px; }
.clues li b { display: inline-block; width: 22px; text-indent: 0; }

/* ---------- answers page ---------- */
.ans-wrap { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 12px; }
.ans-box { text-align: center; font-size: 13px; font-weight: bold; }
.ans-box svg { margin: 3px auto 0; }

/* ---------- printing ---------- */
@page { size: letter; margin: 0.5in; }
@media print {
  html, body { background: #fff !important; }
  .bar { display: none !important; }
  .pick, .sheetwrap.skip { display: none !important; }
  .sheetwrap.lastp { break-after: auto !important; page-break-after: auto !important; }
  body > div[style*="position:fixed"] { display: none !important; } /* the PREVIEW badge is not printed */
  #sheets { padding: 0; }
  .sheetwrap { width: 7.5in !important; height: 9.9in !important; margin: 0 !important; break-after: page; page-break-after: always; }
  .sheetwrap:last-child { break-after: auto; page-break-after: auto; }
  .sheet { transform: none !important; width: 7.5in; height: 9.9in; padding: 0; box-shadow: none; overflow: hidden; }
}
