/* Bible coloring pages (/coloring/): the hub and one page per picture. Pages are generated by
   scripts/build_coloring.py; this file and coloring.js are hand-written and shared by all of them. */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}
[hidden]{display:none!important}
:root{--base:#14100E;--card:#1c1613;--ink:#F4EDE1;--read:#C9BBA8;--dim:#8A7E6E;--accent:#E5A66B;--gold:#F2C572;--line:rgba(244,237,225,.13);--paper:#fffdf8;--mx:18px}
html{scroll-behavior:smooth}
body{background:radial-gradient(ellipse at 50% -10%,#2a1d14 0%,var(--base) 55%) fixed,var(--base);color:var(--ink);font-family:'Spline Sans Mono',ui-monospace,monospace;-webkit-font-smoothing:antialiased;overflow-x:hidden}
a{color:var(--gold)}
.eyebrow{font-size:11px;letter-spacing:.24em;text-transform:uppercase;color:var(--accent)}
.folio{display:flex;align-items:center;gap:14px;padding:max(16px,env(safe-area-inset-top)) var(--mx) 14px;font-size:10px;letter-spacing:.2em;text-transform:uppercase;color:var(--dim)}
.folio .mark{color:var(--ink);text-decoration:none;white-space:nowrap}
.folio .rule{flex:1;height:1px;background:var(--line)}
.folio nav{display:flex;gap:14px}
.folio nav a{color:var(--read);text-decoration:none}
main{max-width:1100px;margin:0 auto;padding:18px var(--mx) 40px}
h1{font-family:'Fraunces',Georgia,serif;font-variation-settings:'opsz'144,'wght'520,'SOFT'30;font-size:clamp(32px,7.4vw,56px);line-height:1.02;letter-spacing:-.01em;margin:10px 0 12px}
h2{font-family:'Fraunces',Georgia,serif;font-variation-settings:'opsz'96,'wght'540;font-size:clamp(24px,5vw,32px);line-height:1.1}
.lede{font-family:'Fraunces',Georgia,serif;font-size:clamp(17px,3.6vw,20px);line-height:1.5;color:var(--read);max-width:40em}
.crumbs{font-size:12px;color:var(--dim)}
.crumbs a{color:var(--read);text-decoration:none}
.crumbs span{margin:0 6px}

/* ── a picture page ── */
.stage{display:grid;gap:22px;margin-top:20px;align-items:start}
.art{position:relative;background:var(--paper);border-radius:14px;padding:10px;box-shadow:0 18px 50px rgba(0,0,0,.4);margin:0 auto;width:100%;max-width:min(560px,calc((100svh - 120px) * .667))}
.art img,.art canvas{display:block;width:100%;height:auto;aspect-ratio:2/3;border-radius:4px;background:#fff}
.art canvas{touch-action:manipulation;cursor:crosshair}
body.painting .art{max-width:min(720px,calc((100svh - 40px) * .667))}
.actions{display:flex;gap:10px;flex-wrap:wrap}
.go{font:600 15px/1 'Spline Sans Mono',monospace;letter-spacing:.06em;color:#1d1408;cursor:pointer;background:linear-gradient(180deg,#F7D58E,#DDA24E);border:0;border-radius:999px;padding:16px 26px;box-shadow:0 4px 0 #8f5f22;text-decoration:none;display:inline-flex;align-items:center;gap:6px}
.go:active{transform:translateY(2px);box-shadow:0 2px 0 #8f5f22}
.ghost{font:600 13px/1 'Spline Sans Mono',monospace;color:var(--ink);background:rgba(255,255,255,.04);border:1px solid rgba(244,237,225,.25);border-radius:999px;padding:13px 16px;cursor:pointer;min-height:46px;text-decoration:none;display:inline-flex;align-items:center;gap:6px}
.ghost:hover{border-color:var(--accent)}
.ghost[disabled]{opacity:.4;cursor:default}
.hint{margin-top:10px;font-size:12px;line-height:1.5;color:var(--dim)}
.tools{margin-top:16px;padding:14px;border:1px solid rgba(242,197,114,.25);border-radius:16px;background:rgba(0,0,0,.18)}
.swatches{display:grid;grid-template-columns:repeat(auto-fill,minmax(38px,1fr));gap:8px}
.sw{aspect-ratio:1;border-radius:50%;border:2px solid rgba(255,255,255,.18);cursor:pointer;position:relative;padding:0}
.sw[aria-checked="true"]{border-color:#fff;box-shadow:0 0 0 3px var(--gold)}
.sw.eraser{background:repeating-linear-gradient(45deg,#fff 0 6px,#ddd 6px 12px)!important}
.tool-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.sw.magic{background:conic-gradient(from 200deg,#f2c572,#e38b7a,#c79be0,#7fb4e0,#8fcf8f,#f2c572);font-size:18px;line-height:1;display:flex;align-items:center;justify-content:center}
.pan{position:relative;border-radius:4px}
.art.zoomed .pan{overflow:auto;aspect-ratio:2/3;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.art.zoomed canvas{width:200%!important;max-width:none}
.opt{display:flex;align-items:center;gap:8px;margin-top:10px;font-size:12px;color:var(--read);cursor:pointer}
.opt input{width:18px;height:18px;accent-color:var(--gold)}
.share{margin-top:16px;font-size:13px!important;font-family:'Spline Sans Mono',monospace!important;color:var(--dim)!important}
.share a,.share button{color:var(--gold);text-decoration:none;font:inherit;background:none;border:0;padding:4px 0;cursor:pointer}
.group-head{display:flex;align-items:center;justify-content:space-between;gap:10px 16px;flex-wrap:wrap}
.set{min-height:40px;padding:10px 14px;font-size:12px}
.find{margin-top:14px;max-width:440px}
.find input{width:100%;font:15px 'Spline Sans Mono',monospace;color:var(--ink);background:rgba(255,255,255,.05);border:1px solid rgba(244,237,225,.25);border-radius:999px;padding:12px 18px;outline:none}
.find input:focus{border-color:var(--gold)}
.find-none{margin-top:10px;font-size:13px;color:var(--dim)}
.prog{align-self:center;font-size:12px;color:var(--gold);margin-left:4px}
.story{margin-top:22px}
.story h2{margin:6px 0 10px}
.story p,.about p,.group>p,details p{font-family:'Fraunces',Georgia,serif;font-size:18px;line-height:1.6;color:var(--read)}
blockquote{border-left:3px solid var(--gold);padding:4px 0 4px 16px;margin:16px 0}
blockquote p{color:var(--ink)!important;font-style:italic;font-size:19px!important}
cite{display:block;font:12px/1.6 'Spline Sans Mono',monospace;letter-spacing:.06em;color:var(--accent);font-style:normal;margin-top:6px}
.note{font-size:15px!important;color:var(--dim)!important;margin-bottom:8px}
.read{font-size:16px!important}
.read b{color:var(--ink);font-weight:600}
ul.links{list-style:none;margin-top:12px}
ul.links li{padding:8px 0;border-top:1px solid var(--line)}
ul.links a{text-decoration:none;font-size:14px}
.more{margin-top:44px}
.more h2{margin-bottom:14px}
.all{margin-top:16px;font-size:14px;line-height:1.8}
.all a{text-decoration:none}

/* cards (hub + "more") */
.cards{list-style:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.cards a{display:block;text-decoration:none;color:var(--ink)}
.cards img{display:block;width:100%;height:auto;aspect-ratio:2/3;background:var(--paper);border-radius:10px;padding:6px;box-shadow:0 8px 22px rgba(0,0,0,.35);transition:transform .2s}
.cards a:hover img{transform:translateY(-3px)}
.cards span{display:block;margin-top:8px;font-family:'Fraunces',Georgia,serif;font-size:16px;line-height:1.3}

/* hub */
.hub-top{display:grid;gap:20px;align-items:center}
.jump{margin-top:14px;font-size:13px;line-height:2}
.jump a{text-decoration:none;color:var(--gold)}
.fan{list-style:none;display:flex;justify-content:center;padding:6px 0 16px}
.fan li{width:31%;max-width:150px;margin:0 -4%}
.fan img{display:block;width:100%;height:auto;background:var(--paper);border-radius:8px;padding:5px;box-shadow:0 10px 26px rgba(0,0,0,.45)}
.fan li:nth-child(1){transform:rotate(-7deg) translateY(10px)}
.fan li:nth-child(2){transform:translateY(-6px);z-index:1}
.fan li:nth-child(3){transform:rotate(7deg) translateY(10px)}
.group{margin-top:46px;scroll-margin-top:16px}
.group>p{margin:8px 0 16px;max-width:40em}
.about{margin-top:56px;max-width:760px}
.about h2{margin-bottom:10px}
details{border-top:1px solid var(--line);padding:14px 0}
details:last-of-type{border-bottom:1px solid var(--line)}
summary{cursor:pointer;font-size:14px;color:var(--ink)}
details p{margin-top:8px}
.foot{max-width:1100px;margin:0 auto;padding:26px var(--mx) 46px;font-size:11px;line-height:1.7;color:var(--dim);border-top:1px solid var(--line)}
.foot a{color:var(--read)}
.toast{position:fixed;z-index:70;left:50%;bottom:24px;transform:translate(-50%,20px);opacity:0;background:rgba(20,16,14,.95);border:1px solid var(--line);border-radius:999px;padding:12px 18px;font-size:13px;transition:opacity .3s,transform .3s;pointer-events:none;max-width:92vw}
.toast.on{opacity:1;transform:translate(-50%,0)}
.psheet{display:none}

@media (min-width:600px){.cards{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (min-width:880px){
  :root{--mx:28px}
  .stage{grid-template-columns:minmax(0,auto) minmax(300px,1fr);gap:36px}
  .art{margin:0}
  .story{margin-top:28px}
  .hub-top{grid-template-columns:1fr 360px}
  .cards{grid-template-columns:repeat(5,minmax(0,1fr))}
  .more .cards{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media (min-width:880px) and (max-width:1060px){.cards{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* phones: while coloring, the palette rides along the bottom of the screen */
@media (max-width:879px){
  body.painting .tools{position:fixed;left:0;right:0;bottom:0;z-index:40;margin:0;border-radius:16px 16px 0 0;border-bottom:0;background:#1c1613;padding:10px 12px calc(10px + env(safe-area-inset-bottom));box-shadow:0 -10px 30px rgba(0,0,0,.4)}
  body.painting .swatches{display:flex;overflow-x:auto;gap:8px;padding:3px 2px 6px;scrollbar-width:none}
  body.painting .sw{flex:none;width:40px;height:40px}
  body.painting .tool-row{margin-top:8px;gap:6px}
  body.painting .tool-row .ghost{padding:10px 12px;min-height:40px;font-size:12px}
  body.painting .tools .hint{display:none}
  body.painting main{padding-bottom:230px}
  body.painting .toast{bottom:190px}
}

/* print: the picture alone, one full page, black on white */
@page{margin:10mm}
@media print{
  html,body{background:#fff!important;color:#000}
  body>*{display:none!important}
  body.scene>main{display:block!important;padding:0;margin:0;max-width:none}
  body.scene>main>*{display:none!important}
  body.scene>main>.stage{display:block!important;margin:0}
  body.scene .side{display:none!important}
  body.scene .art{display:block!important;max-width:none;width:auto;box-shadow:none;padding:0;background:#fff;border-radius:0}
  body.scene .art img,body.scene .art canvas{width:auto;height:auto;max-width:100%;max-height:250mm;aspect-ratio:auto;margin:0 auto;border-radius:0;background:#fff}
  body.scene .art::after{content:attr(data-credit);display:block;text-align:center;font:8pt Georgia,serif;color:#777;margin-top:3mm}
  html.ppng body>*{display:none!important}
  html.ppng body>.psheet{display:block!important}
  .psheet img{display:block;width:auto;height:auto;max-width:100%;max-height:250mm;margin:0 auto}
  .psheet p{text-align:center;font:8pt Georgia,serif;color:#777;margin-top:3mm}
  .psheet .pverse{font:italic 12pt/1.4 Georgia,serif;color:#000;max-width:170mm;margin:4mm auto 0}
  .psheet:has(.pverse) img{max-height:228mm}
  .psheet figure{margin:0;break-after:page;page-break-after:always}
  .psheet figure:last-child{break-after:auto;page-break-after:auto}
  body.hub main{display:block!important}
  html.ppng body.hub main{display:none!important}
}

/* the original painting, shown over the page while colouring (See the painting) */
.ref{position:fixed;inset:0;z-index:70;background:rgba(10,8,7,.86);display:flex;align-items:center;justify-content:center;padding:16px}
.ref[hidden]{display:none}
.ref figure{margin:0;display:flex;flex-direction:column;align-items:center;gap:12px;max-height:100%}
.ref img{max-width:min(92vw,512px);max-height:calc(100dvh - 120px);width:auto;height:auto;border-radius:12px;box-shadow:0 20px 50px rgba(0,0,0,.6);background:#222}
.ref figcaption{color:#d9ccb8;font-size:14px;text-align:center;display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:center}
.ref figcaption button{font:inherit;font-weight:600;color:#14100E;background:var(--gold,#e0b255);border:0;border-radius:999px;padding:9px 16px;cursor:pointer}
