/* Coloring pages (built by tools/kleurplaten.py): overview, theme pages and the coloring page itself. */
html, body { height: auto; }
.kp { max-width: 980px; margin: 0 auto; padding-top: 12px; padding-bottom: 40px; line-height: 1.55; }
.kp .top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.kp .top img { width: 140px; height: auto; display: block; }
.kp h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 6vw, 2.6rem); line-height: 1.15; margin: 6px 0; }
.kp h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; margin: 26px 0 8px; }
.kp h2 a, .kp .crumbs a, .kp .lede a, .kp .text a:not(.btn), .kp .legal a { color: var(--gold); }
.kp .lede { color: var(--muted); margin: 0 0 14px; }
.kp .lede a { margin-left: 6px; white-space: nowrap; }
.kp .muted { color: var(--muted); margin: 0 0 10px; }
.kp .crumbs { font-size: .9rem; color: var(--muted); }
.kp .legal { margin-top: 36px; font-size: .85rem; color: var(--muted); text-align: center; }

/* the way into the color book, on the overview */
.cbk { display: flex; align-items: center; gap: 12px; margin: 4px 0 8px; padding: 12px 14px; border-radius: 18px; text-decoration: none; color: var(--ink);
  background: rgba(255,201,60,.12); border: 2px solid rgba(255,201,60,.4); }
.cbk:hover { border-color: rgba(255,201,60,.8); }
.cbk-ico { font-size: 1.8rem; line-height: 1; flex: none; }
.cbk-txt { flex: 1; min-width: 0; font-size: .95rem; line-height: 1.35; }
.cbk-txt b { font-family: var(--font-display); font-weight: 400; font-size: 1.2rem; margin-right: 6px; }
.cbk-go { flex: none; }

/* thumbnails */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.cards.big { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.kcard { display: grid; gap: 6px; text-decoration: none; color: var(--ink); font-weight: 800; text-align: center; font-size: .95rem; }
.kcard img { width: 100%; height: auto; aspect-ratio: 2 / 3; background: #fff; border-radius: 12px; box-shadow: 0 6px 16px rgba(0,0,0,.35); transition: transform .15s; }
.kcard:hover img { transform: translateY(-3px) rotate(-1deg); }

/* the coloring studio: the paper with the colors under the lines, and the tools next to it (under it on a phone) */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.paper { position: relative; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.4), 0 0 0 6px #fff8ec;
  aspect-ratio: 2 / 3; max-height: 82vh; margin: 0 auto; width: 100%; touch-action: manipulation; }
.paper canvas, .paper img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.paper img { mix-blend-mode: multiply; pointer-events: none; user-select: none; -webkit-user-select: none; }
.paper canvas { cursor: crosshair; }
.paper.busy::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.5); }
.side { display: grid; gap: 12px; position: sticky; top: 12px; }
.colors { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; background: rgba(0,0,0,.25); border-radius: 16px; padding: 10px; }
.colors button { aspect-ratio: 1; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); cursor: pointer; padding: 0; min-width: 0; }
.colors button[aria-checked="true"] { border-color: #fff; box-shadow: 0 0 0 3px var(--gold); transform: scale(1.08); }
.colors button.erase { background: #fff; position: relative; }
.colors button.erase::after { content: ""; position: absolute; left: 18%; right: 18%; top: 50%; height: 3px; background: #e2365a; transform: rotate(-45deg); }
.colors label.own { aspect-ratio: 1; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); cursor: pointer; overflow: hidden; position: relative;
  background: conic-gradient(#ff4d6d, #ffc93c, #2fd86f, #2f9bff, #a46bff, #ff4d6d); }
.colors label.own.on { border-color: #fff; box-shadow: 0 0 0 3px var(--gold); }
.colors label.own input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; }
.acts .btn { flex: 1 1 auto; }
.earn { margin: 0; font-size: .85rem; color: var(--muted); }
.text { max-width: 720px; }
@media (max-width: 760px) {
  .studio { grid-template-columns: 1fr; }
  .paper { max-height: none; }
  /* on a phone the colors stay in reach: one row that sticks to the top of the screen above the drawing */
  .side { display: contents; }
  .colors { order: -1; position: sticky; top: 0; z-index: 5; display: flex; overflow-x: auto; gap: 6px; padding: 8px;
    background: rgba(23,15,56,.94); border-radius: 0 0 16px 16px; scrollbar-width: none; }
  .colors::-webkit-scrollbar { display: none; }
  .colors button, .colors label.own { flex: 0 0 40px; width: 40px; height: 40px; }
}

/* printing shows only the A4 picture the page made, nothing else */
#printPage { display: none; }
@media print {
  body > *, .kp > *:not(#printPage) { display: none !important; }
  body > main.kp { display: block !important; padding: 0; }
  body { background: #fff !important; }
  #printPage { display: block !important; }
  #printPage img { display: block; width: 100%; height: auto; }
}
