/* =====================================================================
   TinyOutlines — Free Printable Coloring Pages
   Site-wide stylesheet / Design DNA
   Palette:  teal #2BB3A3 · coral #FF6B6B · sunny #FFC94D · ink #2E3A42
   Fonts:    Baloo 2 (headings) · Nunito (body) — loaded via Google Fonts
   ===================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --teal:      #2BB3A3;
  --teal-dark: #1E8C80;
  --coral:     #FF6B6B;
  --coral-dk:  #E85555;
  --sunny:     #FFC94D;
  --ink:       #2E3A42;
  --ink-soft:  #566069;
  --bg:        #FFFDF8;
  --panel:     #FFFFFF;
  --line:      #ECE7DC;
  --shadow:    0 6px 22px rgba(46, 58, 66, .08);
  --shadow-lg: 0 14px 40px rgba(46, 58, 66, .12);
  --radius:    18px;
  --radius-sm: 12px;
  --maxw:      1140px;
  --font-head: "Baloo 2", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); line-height: 1.15; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1rem; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.section { padding: 58px 0; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  padding: 13px 26px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--coral); color: #fff; box-shadow: 0 6px 16px rgba(255,107,107,.35); }
.btn-primary:hover { background: var(--coral-dk); }
.btn-teal { background: var(--teal); color: #fff; box-shadow: 0 6px 16px rgba(43,179,163,.32); }
.btn-teal:hover { background: var(--teal-dark); }
.btn-ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal-dark); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,253,248,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; max-width: var(--maxw); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 800; font-size: 1.35rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .logo-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--teal), var(--sunny));
  display: grid; place-items: center; color: #fff; font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(43,179,163,.35);
}
.nav-links { display: flex; gap: 22px; align-items: center; list-style: none; margin: 0; padding: 0; }
.nav-links a { font-family: var(--font-head); font-weight: 600; color: var(--ink); }
.nav-links a:hover { color: var(--teal-dark); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--ink); }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: #fff; border-bottom: 1px solid var(--line);
    padding: 8px 22px 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links li { padding: 8px 0; border-bottom: 1px solid var(--line); }
}

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, #FFF7E9 0%, var(--bg) 100%); padding: 66px 0 54px; text-align: center; }
.hero h1 { max-width: 780px; margin: 0 auto .4em; }
.hero p.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 620px; margin: 0 auto 1.6em; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Trust strip ---------- */
.trust {
  display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: center;
  padding: 16px 22px; background: var(--teal); color: #fff;
  font-family: var(--font-head); font-weight: 600; font-size: .98rem;
}
.trust span { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Category tiles ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.cat-tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 20px; text-align: center; box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease; color: var(--ink);
}
.cat-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }
.cat-tile .emoji { font-size: 2.4rem; line-height: 1; }
.cat-tile h3 { margin: 12px 0 4px; }
.cat-tile .count { color: var(--teal-dark); font-family: var(--font-head); font-weight: 600; font-size: .95rem; }
@media (max-width: 900px){ .cat-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px){ .cat-grid { grid-template-columns: 1fr; } }

/* ---------- Page / design grid ---------- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
@media (max-width: 900px){ .grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px){ .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }
.card .thumb {
  aspect-ratio: 17 / 22; background: #fff; border-bottom: 1px solid var(--line);
  display: grid; place-items: center; overflow: hidden;
}
.card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.card .thumb.placeholder {
  background:
    repeating-linear-gradient(45deg, #FAF7EF, #FAF7EF 14px, #F3EEE1 14px, #F3EEE1 28px);
  color: var(--ink-soft); font-family: var(--font-head); font-weight: 600; text-align: center; padding: 14px; font-size: .9rem;
}
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.card .body h3 { font-size: 1.08rem; margin: 0; color: var(--ink); }
.card .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }

/* difficulty + age pills */
.pill { font-family: var(--font-head); font-weight: 600; font-size: .72rem; padding: 3px 10px; border-radius: 999px; letter-spacing: .02em; }
.pill.easy     { background: #E3F6F1; color: var(--teal-dark); }
.pill.medium   { background: #FFF1D6; color: #B77B00; }
.pill.detailed { background: #FFE4E4; color: var(--coral-dk); }
.pill.age      { background: #EEF1F4; color: var(--ink-soft); }

/* ---------- Filter bar ---------- */
.filterbar { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 30px; }
.filterbar button {
  font-family: var(--font-head); font-weight: 600; font-size: .92rem;
  padding: 8px 18px; border-radius: 999px; border: 2px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; transition: all .12s ease;
}
.filterbar button:hover { border-color: var(--teal); }
.filterbar button.active { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ---------- Breadcrumb ---------- */
.crumb { font-size: .92rem; color: var(--ink-soft); padding: 18px 0 0; }
.crumb a { color: var(--ink-soft); }
.crumb a:hover { color: var(--teal-dark); }

/* ---------- Drawing-page layout ---------- */
.page-lead { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; padding-top: 34px; }
@media (max-width: 860px){ .page-lead { grid-template-columns: 1fr; gap: 26px; } }
.preview {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.preview .frame {
  aspect-ratio: 17 / 22; display: grid; place-items: center; padding: 8px;
  background:
    repeating-linear-gradient(45deg, #FCFAF4, #FCFAF4 16px, #F4EFE2 16px, #F4EFE2 32px);
}
.preview .frame img { width: 100%; height: 100%; object-fit: contain; background:#fff; }
.preview .frame .slotnote {
  text-align: center; color: var(--ink-soft); font-family: var(--font-head); font-weight: 600; padding: 20px;
}
.dl-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0 6px; }
.spec-list { list-style: none; padding: 0; margin: 14px 0 0; font-size: .95rem; color: var(--ink-soft); }
.spec-list li { padding: 5px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 12px; }
.spec-list li span:last-child { color: var(--ink); font-weight: 600; }

.prose h2 { margin-top: 1.6em; }
.prose { font-size: 1.02rem; }

/* how-to steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 8px 0 0; }
.steps li { position: relative; padding: 4px 0 14px 44px; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 2px; width: 30px; height: 30px;
  background: var(--sunny); color: var(--ink); border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 700;
}

/* ---------- Related section ---------- */
.related-mini { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
@media (max-width: 900px){ .related-mini { grid-template-columns: repeat(2,1fr); } }

/* ---------- Newsletter band ---------- */
.newsletter {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff; border-radius: var(--radius); padding: 40px 30px; text-align: center;
}
.newsletter h2 { color: #fff; }
.newsletter p { color: rgba(255,255,255,.9); }
.nl-form { display: flex; gap: 10px; max-width: 460px; margin: 18px auto 0; flex-wrap: wrap; justify-content: center; }
.nl-form input {
  flex: 1 1 240px; padding: 13px 18px; border-radius: 999px; border: 0;
  font-family: var(--font-body); font-size: 1rem;
}

/* ---------- Section heading helper ---------- */
.sec-head { text-align: center; margin-bottom: 34px; }
.sec-head p { color: var(--ink-soft); max-width: 620px; margin: 6px auto 0; }
.eyebrow { font-family: var(--font-head); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; color: var(--coral); }

/* ---------- Blog teaser ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
@media (max-width: 820px){ .post-grid { grid-template-columns: 1fr; } }
.post-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.post-card .tag { font-family: var(--font-head); font-weight: 600; font-size: .78rem; color: var(--teal-dark); }
.post-card h3 { margin: 6px 0 8px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #cfd6db; padding: 50px 0 28px; margin-top: 40px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
@media (max-width: 820px){ .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px){ .foot-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 12px; }
.site-footer a { color: #cfd6db; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 4px 0; }
.foot-brand .brand { color: #fff; }
.foot-brand p { color: #9aa4ab; font-size: .95rem; max-width: 300px; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 30px; padding-top: 18px; text-align: center; color: #9aa4ab; font-size: .88rem; }

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.pagebar { padding: 40px 0; }

/* ---------- Cookie consent banner ---------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
  background: var(--ink); color: #e9edf0; padding: 14px 18px;
  display: none; box-shadow: 0 -6px 20px rgba(0,0,0,.18);
}
.cookie-banner.show { display: block; }
.cookie-banner .cb-inner {
  max-width: var(--maxw); margin: 0 auto; display: flex; gap: 14px;
  align-items: center; flex-wrap: wrap; justify-content: center; font-size: .92rem;
}
.cookie-banner a { color: #fff; text-decoration: underline; }
.cookie-banner .cb-btns { display: flex; gap: 8px; }
.cookie-banner .btn { padding: 9px 20px; }
@media (max-width: 600px){ .cookie-banner .cb-inner { justify-content: flex-start; } }

/* =====================================================================
   Lightbox popup (coloring image → click to zoom; shows AI prompt
   until the real image is dropped in)
   ===================================================================== */
.frame.js-lightbox {
  border: 0; font: inherit; width: 100%; cursor: zoom-in;
  position: relative;
}
.frame.js-lightbox::after {
  content: "🔍 Tap to enlarge";
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(46,58,66,.78); color: #fff;
  font-family: var(--font-head); font-weight: 600; font-size: .72rem;
  padding: 4px 10px; border-radius: 999px;
}
.card .thumb.js-lightbox { border: 0; width: 100%; font: inherit; cursor: zoom-in; }

.lb-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(46,58,66,.82);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; visibility: hidden; transition: opacity .18s ease;
}
.lb-overlay.open { opacity: 1; visibility: visible; }
.lb-box {
  background: #fff; border-radius: 16px; width: 100%; max-width: 640px;
  max-height: 90vh; overflow: auto; padding: 24px 22px; position: relative;
  box-shadow: var(--shadow-lg);
}
.lb-box img { width: 100%; height: auto; border-radius: 10px; background: #fff; }
.lb-close {
  position: absolute; top: 8px; right: 12px; font-size: 1.7rem; line-height: 1;
  border: 0; background: none; cursor: pointer; color: var(--ink-soft);
}
.lb-close:hover { color: var(--ink); }
.lb-title { font-family: var(--font-head); font-weight: 700; margin: 0 0 12px; padding-right: 24px; }
.prompt-box {
  background: #F7F4EC; border: 1px dashed var(--line); border-radius: 10px;
  padding: 14px 16px; font-size: .9rem; line-height: 1.55; white-space: pre-wrap;
  color: var(--ink); font-family: var(--font-body);
}

/* =====================================================================
   Blog article layout (single column, no sidebar)
   ===================================================================== */
.article { max-width: 768px; margin: 0 auto; }
.article .post-meta { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; color: var(--ink-soft); font-size: .92rem; margin: 4px 0 2px; }
.article .byline { font-family: var(--font-head); font-weight: 600; color: var(--ink); }
.article h1 { margin-top: .3em; }
.article h2 { margin-top: 1.7em; }
.article h3 { margin-top: 1.25em; font-size: 1.12rem; }
.article p, .article li { font-size: 1.05rem; }
.article ul, .article ol { padding-left: 1.15em; margin: 0 0 1rem; }
.article li { margin-bottom: .5em; }
.article blockquote {
  margin: 1.4em 0; padding: 14px 20px; border-left: 4px solid var(--sunny);
  background: #FFF7E9; border-radius: 0 10px 10px 0; color: var(--ink);
}
.post-hero {
  display: block; width: 100%; position: relative;
  aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); margin: 20px 0 10px;
  background: repeating-linear-gradient(45deg, #F1F6F5, #F1F6F5 18px, #E6EFED 18px, #E6EFED 36px);
}
.post-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-hero.js-lightbox {
  border: 0; font: inherit; cursor: zoom-in; display: grid; place-items: center;
}
.post-hero .slotnote { text-align: center; color: var(--ink-soft); font-family: var(--font-head); font-weight: 600; padding: 16px; }
.post-hero.js-lightbox::after {
  content: "🔍 Tap for image prompt"; position: absolute; bottom: 8px; right: 8px;
  background: rgba(46,58,66,.78); color: #fff; font-family: var(--font-head); font-weight: 600;
  font-size: .72rem; padding: 4px 10px; border-radius: 999px;
}
.hero-caption { font-size: .82rem; color: var(--ink-soft); margin: 0 0 20px; }
.random-posts.post-grid { margin-top: 8px; }
.random-posts .post-card h3 { margin: 6px 0 0; }

/* =====================================================================
   Mobile spacing / responsive hardening
   (no edge-sticking, consistent side gutters, breathable spacing)
   ===================================================================== */
html, body { overflow-x: hidden; }
img, svg, video { max-width: 100%; height: auto; }

@media (max-width: 700px) {
  body { font-size: 16px; }
  .section { padding: 42px 0; }
  .hero { padding: 46px 0 38px; }
  h1 { font-size: 1.95rem; }
  h2 { font-size: 1.5rem; }
  .trust { font-size: .9rem; gap: 8px 16px; padding: 14px 18px; }
  .dl-row .btn { flex: 1 1 100%; text-align: center; }
  .spec-list { margin-top: 18px; }
  .newsletter { padding: 32px 20px; }
  .lb-box { padding: 20px 16px; }
}

@media (max-width: 600px) {
  .wrap, .nav { padding-left: 18px; padding-right: 18px; }
  .page-lead { padding-left: 18px; padding-right: 18px; gap: 22px; }
  .related-mini { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

@media (max-width: 380px) {
  .wrap, .nav, .page-lead { padding-left: 15px; padding-right: 15px; }
  .grid, .cat-grid, .related-mini { grid-template-columns: 1fr; }
}
