/* Shared styles for the DoodleBox blog (index + every post).
   Tokens mirror index.html so the blog reads as the same site. */
:root {
  --red: #FF5C00; --red-light: #FF6B3D; --warm: #FF9A5C; --gold: #FFDB4D;
  --dark: #1A1100; --cream: #FFF3EE; --gray: #6B7280; --surface: #ffffff;
  --body-text: #2E2A24; --rule: rgba(255,92,0,0.12);
  --shadow-sticker: 0 1px 2px rgba(160,60,0,0.05), 0 6px 16px rgba(160,60,0,0.08), 0 14px 34px rgba(160,60,0,0.06);
  --shadow-sticker-lift: 0 2px 4px rgba(160,60,0,0.06), 0 12px 24px rgba(255,92,0,0.14), 0 28px 60px rgba(160,60,0,0.16);
}
[data-theme="dark"] {
  --dark: #F3F4F6; --cream: #141008; --gray: #B0B8C4; --surface: #1E1810;
  --body-text: #D6D9DE; --rule: rgba(255,92,0,0.18);
  --shadow-sticker: 0 1px 2px rgba(0,0,0,0.4), 0 10px 28px rgba(0,0,0,0.45);
  --shadow-sticker-lift: 0 2px 4px rgba(0,0,0,0.4), 0 16px 40px rgba(255,92,0,0.22), 0 30px 60px rgba(0,0,0,0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Comic Relief', system-ui, sans-serif;
  background: var(--cream); color: var(--dark); line-height: 1.75;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); }

/* ---- Header ---- */
.blog-nav {
  position: sticky; top: 0; z-index: 50; background: var(--cream);
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; height: 80px;
}
.blog-nav .logo img { height: 64px; width: auto; }
.blog-nav .links { display: flex; align-items: center; gap: 28px; }
.blog-nav .links a { color: var(--dark); text-decoration: none; font-weight: 700; font-size: 15px; }
.blog-nav .links a:hover, .blog-nav .links a[aria-current="page"] { color: var(--red); }
.blog-nav .links a.btn-primary {
  background: #FF5C00; color: #fff; padding: 10px 22px; border-radius: 16px;
  box-shadow: 0 2px 8px rgba(255,92,0,0.2);
}
.theme-toggle {
  background: none; border: 1.5px solid var(--rule); border-radius: 50%;
  width: 38px; height: 38px; cursor: pointer; font-size: 16px; line-height: 1;
}
[data-theme="dark"] .icon-sun, :root:not([data-theme="dark"]) .icon-moon { display: none; }

/* ---- Blog index ---- */
.blog-hero { text-align: center; padding: 72px 24px 40px; max-width: 760px; margin: 0 auto; }
.blog-hero h1, .post-header h1, .post-body h2, .post-card h2, .post-cta h2 {
  font-family: 'Luckiest Guy', cursive; font-weight: 400; letter-spacing: 0.5px;
}
.blog-hero h1 { font-size: clamp(38px, 6vw, 64px); line-height: 1.05; margin-bottom: 14px; }
.blog-hero h1 span { color: var(--red); }
.blog-hero p { font-size: 18px; color: var(--gray); }

.post-grid {
  list-style: none; max-width: 1100px; margin: 0 auto; padding: 0 24px 96px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px;
}
.post-card {
  background: var(--surface); border-radius: 24px; overflow: hidden;
  box-shadow: var(--shadow-sticker); transition: box-shadow 0.3s, transform 0.3s;
}
.post-card:hover { box-shadow: var(--shadow-sticker-lift); transform: translateY(-3px); }
.post-card a { color: inherit; text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.post-card .thumb { aspect-ratio: 16 / 10; background: #FFE4D3; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }
[data-theme="dark"] .post-card .thumb { background: #2A1E12; }
.post-card .card-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card .tag { align-self: flex-start; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--red); background: rgba(255,92,0,0.1); padding: 4px 10px; border-radius: 999px; }
.post-card h2 { font-size: 22px; line-height: 1.2; }
.post-card p { font-size: 15px; color: var(--gray); }
.post-card time { font-size: 13px; color: var(--gray); margin-top: auto; }

.empty-state { grid-column: 1 / -1; text-align: center; padding: 48px 24px; color: var(--gray); }
.empty-state img { width: 120px; margin: 0 auto 16px; }
/* The empty state hides itself once a real post card exists */
.post-grid:has(.post-card) .empty-state { display: none; }

/* ---- Single post ---- */
.post { max-width: 720px; margin: 0 auto; padding: 56px 24px 40px; }
.breadcrumb { font-size: 14px; margin-bottom: 28px; }
.breadcrumb a { text-decoration: none; font-weight: 700; }
.post-header .tag { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--red); background: rgba(255,92,0,0.1); padding: 4px 10px; border-radius: 999px; margin-bottom: 14px; }
.post-header h1 { font-size: clamp(32px, 5.5vw, 52px); line-height: 1.08; margin-bottom: 14px; }
.post-header .meta { color: var(--gray); font-size: 14px; margin-bottom: 32px; }
.post-hero { background: #FFE4D3; border-radius: 24px; padding: 24px; margin-bottom: 40px; box-shadow: var(--shadow-sticker); }
[data-theme="dark"] .post-hero { background: #2A1E12; }
.post-hero img { max-height: 360px; margin: 0 auto; object-fit: contain; }

.post-body { font-size: 18px; color: var(--body-text); }
.post-body p, .post-body ul, .post-body ol { margin-bottom: 20px; }
.post-body ul, .post-body ol { padding-left: 26px; }
.post-body li { margin-bottom: 8px; }
.post-body h2 { font-size: 28px; line-height: 1.15; color: var(--dark); margin: 44px 0 14px; }
.post-body h3 { font-size: 20px; margin: 28px 0 10px; }
.post-body blockquote { border-left: 4px solid var(--red); padding: 4px 0 4px 18px; margin: 0 0 20px; color: var(--gray); }
.post-body figure { margin: 32px 0; }
.post-body figure img { border-radius: 16px; margin: 0 auto; max-height: 420px; }
.post-body figcaption { font-size: 14px; color: var(--gray); text-align: center; margin-top: 8px; }
.post-body strong { color: var(--dark); }

.sources { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--rule); font-size: 15px; color: var(--gray); }
.sources h2 { font-family: 'Comic Relief', sans-serif; font-weight: 700; font-size: 16px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; color: var(--dark); }
.sources ol { padding-left: 22px; }
.sources li { margin-bottom: 6px; word-break: break-word; }

.post-cta {
  margin: 48px 0 0; background: #1A1100; color: #FFF3EE; border-radius: 24px;
  padding: 36px 32px; text-align: center; box-shadow: var(--shadow-sticker);
}
.post-cta h2 { font-size: 30px; margin-bottom: 8px; }
.post-cta p { color: #D1C7BD; margin-bottom: 20px; }
.post-cta a { display: inline-block; background: #FF5C00; color: #fff; font-weight: 700; text-decoration: none; padding: 12px 28px; border-radius: 16px; }

.more-posts { max-width: 720px; margin: 0 auto; padding: 8px 24px 80px; }
.more-posts a { font-weight: 700; text-decoration: none; }

/* ---- Footer ---- */
.blog-footer { background: #1A1100; color: #B0B8C4; text-align: center; padding: 32px 24px; font-size: 14px; }
.blog-footer a { color: #E5E7EB; margin: 0 10px; text-decoration: none; }
.blog-footer a:hover { color: var(--red-light); }
.blog-footer p { margin-top: 12px; }

@media (max-width: 720px) {
  .blog-nav { padding: 0 16px; height: 68px; }
  .blog-nav .logo img { height: 52px; }
  .blog-nav .links { gap: 12px; }
  .blog-nav .links a:not(.btn-primary) { display: none; }
  .blog-nav .links a.btn-primary { padding: 8px 14px; font-size: 14px; }
  .post-body { font-size: 17px; }
  .post-cta { padding: 28px 20px; }
}

.post-hero .photo-credit { font-size: 13px; color: var(--gray); text-align: center; margin: 10px 0 0; }
.post-hero .photo-credit a, .post-body figcaption a { color: inherit; text-decoration: underline; }
