/* coloring.gripe shared styles (the colouring app on / and the category and page pages) */
:root { --bg:#faf8f5; --fg:#1a1a1a; --muted:#8a8a8a; --soft:#5c5c5c; --line:#e4e0da; --hover:#efebe5; --panel:#f3efe9; --accent:#e5484d; --ok:#1a7f37;
        --paper:#fff; --shadow:0 1px 2px rgba(0,0,0,.08), 0 4px 14px rgba(0,0,0,.06); color-scheme:light dark }
@media (prefers-color-scheme: dark) { :root { --bg:#111; --fg:#f2f2f2; --muted:#8a8a8a; --soft:#b5b5b5; --line:#2a2a2a; --hover:#1d1d1d; --panel:#171717; --ok:#3fb950;
        --shadow:0 1px 2px rgba(0,0,0,.5), 0 4px 14px rgba(0,0,0,.35) } }
* { box-sizing:border-box; margin:0 }
html { -webkit-text-size-adjust:100% }
body { background:var(--bg); color:var(--fg); font:16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
       display:flex; flex-direction:column; min-height:100vh; min-height:100dvh }
#app { flex:1 1 auto; width:100%; max-width:1100px; margin:0 auto; padding:clamp(16px,3vw,36px) clamp(16px,3vw,36px) 24px }
a { color:var(--accent) }
img { max-width:100%; height:auto }
button, input, select, textarea { font:inherit; color:inherit }
:focus-visible { outline:2px solid var(--accent); outline-offset:2px }
button, label, summary, a, select, input { touch-action:manipulation }   /* no double-tap zoom on controls */
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap }
.hidden, [hidden] { display:none !important }
.muted { color:var(--muted) }

header.site { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:8px 20px; margin-bottom:16px }
header.site h1, .brand { font-size:clamp(1.6rem,4vw,2.4rem); font-weight:700; letter-spacing:-.03em; line-height:1.2; color:var(--fg); text-decoration:none }
header.site h1 span, .brand span { color:var(--accent) }
.tag { color:var(--muted); font-size:.95rem }
nav.top { display:flex; flex-wrap:wrap; gap:6px 16px; font-weight:600; font-size:.95rem }
nav.top a { color:var(--fg); text-decoration:none }
nav.top a:hover, nav.top a[aria-current] { color:var(--accent) }

.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; border:1px solid var(--line); background:var(--bg); border-radius:10px; padding:8px 14px;
       cursor:pointer; font-weight:600; font-size:.92rem; text-decoration:none; color:var(--fg); min-height:40px; white-space:nowrap }
.btn:hover:not(:disabled) { border-color:var(--accent) }
.btn.primary { background:var(--accent); border-color:var(--accent); color:#fff }
.btn.primary:hover:not(:disabled) { filter:brightness(1.07) }
.btn.danger:hover:not(:disabled) { color:var(--accent) }
.btn:disabled { opacity:.45; cursor:default }
.btn svg { width:20px; height:20px; flex:none; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round }
.row { display:flex; flex-wrap:wrap; gap:8px; align-items:center }

.card { margin-top:16px; border:1px solid var(--line); border-radius:14px; background:var(--panel); padding:16px; min-width:0 }
.card-head { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px 12px; margin-bottom:12px }
.card-head h2 { font-size:.8rem; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); font-weight:600 }

/* page thumbnails */
.grid { list-style:none; padding:0; display:grid; grid-template-columns:repeat(auto-fill, minmax(120px, 1fr)); gap:16px 12px }
@media (max-width:420px) { .grid { grid-template-columns:repeat(3, minmax(0,1fr)); gap:12px 8px } }
.grid a, .grid button { display:block; width:100%; color:var(--fg); text-decoration:none; font-size:.85rem; font-weight:600; line-height:1.25; text-align:center;
       background:none; border:0; padding:0; cursor:pointer }
.thumb { display:block; aspect-ratio:850/1100; background:var(--paper); border-radius:8px; overflow:hidden; box-shadow:var(--shadow); margin-bottom:6px;
         border:1px solid var(--line); transition:transform .15s }
.thumb img { display:block; width:100%; height:100%; object-fit:contain }
.grid a:hover .thumb, .grid button:hover .thumb { transform:translateY(-2px) }
.grid a:hover span, .grid button:hover > span:last-child { color:var(--accent) }
@media (prefers-reduced-motion: reduce) { .thumb { transition:none } .grid a:hover .thumb, .grid button:hover .thumb { transform:none } }

.prose { max-width:46em }
.prose h2 { font-size:1.15rem; letter-spacing:-.01em; margin:22px 0 6px }
.prose p, .prose li { opacity:.9; font-size:.95rem; margin-top:8px }
.prose ul { padding-left:1.2em }
.crumbs { font-size:.9rem; color:var(--muted); margin-bottom:8px }
.crumbs a { color:var(--muted) } .crumbs a:hover { color:var(--accent) }

/* single page */
.pagewrap { display:grid; grid-template-columns:minmax(0, 1.1fr) minmax(0, 1fr); gap:24px; align-items:start }
@media (max-width:760px) { .pagewrap { grid-template-columns:minmax(0,1fr) } }
.sheet { background:var(--paper); border:1px solid var(--line); border-radius:10px; box-shadow:var(--shadow); overflow:hidden }
.sheet img { display:block; width:100%; height:auto }
.pagewrap h1 { font-size:clamp(1.5rem,3.6vw,2.1rem); letter-spacing:-.02em; line-height:1.2 }
.pagewrap .actions { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0 }
.note { margin-top:12px; font-size:.88rem; color:var(--muted) }

#print { display:none }
@media print {
  @page { margin:10mm }
  body { background:#fff; display:block }
  body > *:not(#print) { display:none !important }
  #print { display:block !important }
  #print img { display:block; width:100%; height:auto; max-height:270mm; object-fit:contain; margin:0 auto; break-inside:avoid }
}

/* gripe network badge (same on every site) */
.gn-wrap { display:flex; flex-direction:column; align-items:center; gap:10px; padding:18px 16px 22px }
.gn-terms { color:var(--muted,#8a8a8a); font:.8rem/1.3 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; text-decoration:none; text-align:center }
.gn-terms:hover { color:var(--accent,#e5484d); text-decoration:underline }
.gn { display:inline-flex; align-items:center; gap:10px; padding:6px 6px 6px 14px; border:1px solid var(--line,#e4e0da); border-radius:999px;
      background:var(--panel,var(--hover,#f3efe9)); color:var(--fg,#1a1a1a); text-decoration:none;
      font:500 .9rem/1.2 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; transition:border-color .15s, transform .15s }
.gn:hover { border-color:var(--accent,#e5484d); transform:translateY(-1px) }
.gn:focus-visible { outline:2px solid var(--accent,#e5484d); outline-offset:2px }
.gn-dot { width:8px; height:8px; border-radius:50%; background:var(--accent,#e5484d); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent,#e5484d) 22%, transparent) }
.gn b { color:var(--accent,#e5484d); font-weight:700 }
.gn-more { padding:5px 11px; border-radius:999px; background:var(--accent,#e5484d); color:#fff; font-size:.8rem; font-weight:600; white-space:nowrap }
@media (prefers-reduced-motion: reduce) { .gn { transition:none } .gn:hover { transform:none } }
