/* Styles for the pre-rendered blog (scripts/build-blog.tsx). Colors match the About page's green header. */
:root {
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --ink: #111827;
  --muted: #4b5563;
  --line: #e5e7eb;
  --bg: #ffffff;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.65;
}
a { color: var(--green-700); }
a:hover { color: var(--green-800); }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--green-600); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 740px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(to right, var(--green-700), var(--green-800));
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.15);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand img { display: block; height: 36px; width: auto; filter: brightness(0) invert(1); }
.header-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.header-nav a { color: #fff; text-decoration: none; font-size: 15px; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.header-nav a:hover { background: rgb(255 255 255 / 0.18); color: #fff; }

/* Buttons */
.btn { display: inline-block; font-weight: 600; font-size: 15px; text-decoration: none; padding: 10px 18px; border-radius: 8px; border: 1px solid transparent; }
.header-nav .btn-light, .btn-light { background: #fff; color: var(--green-800); }
.header-nav .btn-light:hover, .btn-light:hover { background: var(--green-50); color: var(--green-800); }
.btn-primary { background: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-800); color: #fff; }
.btn-outline { border-color: var(--green-700); color: var(--green-700); background: #fff; }
.btn-outline:hover { background: var(--green-50); }

/* Index */
.hero { background: var(--green-50); border-bottom: 1px solid var(--green-100); padding: 56px 0 40px; margin-bottom: 24px; }
.hero h1 { margin: 0 0 8px; font-size: clamp(32px, 6vw, 44px); line-height: 1.15; color: var(--green-800); letter-spacing: -0.02em; }
.hero p { margin: 0; color: var(--muted); font-size: 19px; }
.post-list { list-style: none; margin: 0 0 56px; padding: 0; }
.post-card { padding: 24px 0; border-bottom: 1px solid var(--line); }
.post-card h3 { margin: 0 0 4px; font-size: 22px; line-height: 1.3; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a:hover { color: var(--green-700); text-decoration: underline; }
.post-card p { margin: 6px 0 0; color: var(--muted); }
.post-card .post-meta { margin: 0; }
.empty { color: var(--muted); padding: 32px 0; }

/* Post */
.post { padding-top: 32px; padding-bottom: 64px; }
.breadcrumbs { font-size: 14px; margin-bottom: 12px; }
.breadcrumbs a { text-decoration: none; font-weight: 500; }
.breadcrumbs a::before { content: '← '; }
.post h1 { margin: 0 0 12px; font-size: clamp(30px, 5.5vw, 42px); line-height: 1.15; letter-spacing: -0.02em; }
.post-meta { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.draft-badge { margin-left: 8px; background: #fef3c7; color: #92400e; font-weight: 600; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.tags { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { background: var(--green-50); color: var(--green-800); border: 1px solid var(--green-100); font-size: 13px; font-weight: 500; padding: 2px 10px; border-radius: 999px; }

.prose h2 { font-size: 26px; line-height: 1.25; margin: 40px 0 12px; letter-spacing: -0.01em; }
.prose h3 { font-size: 20px; line-height: 1.3; margin: 28px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 18px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin: 6px 0; }
.prose blockquote { margin: 24px 0; padding: 4px 20px; border-left: 4px solid var(--green-600); background: var(--green-50); color: #1f2937; border-radius: 0 8px 8px 0; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.prose code { background: #f3f4f6; padding: 1px 6px; border-radius: 4px; font-size: 0.9em; }
.prose strong { color: #000; }
/* Block display lets wide tables scroll inside the column instead of widening the page on phones. */
.prose table { display: block; overflow-x: auto; border-collapse: collapse; margin: 0 0 24px; font-size: 15px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--green-50); color: var(--green-800); font-weight: 600; }
.prose tr:nth-child(even) td { background: #f9fafb; }
.prose h1, .prose h2, .prose h3, .post h1 { overflow-wrap: break-word; }

/* CTA */
.cta { margin: 48px 0 0; padding: 28px; border: 2px solid var(--green-200); background: rgb(240 253 244 / 0.6); border-radius: var(--radius); }
.cta h2 { margin: 0 0 8px; font-size: 24px; color: var(--green-800); }
.cta p { margin: 0 0 20px; color: #374151; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.related { margin-top: 48px; }
.related h2 { font-size: 20px; margin: 0; }
.related .post-list { margin-bottom: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: #6b7280; font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-inner a { color: #6b7280; text-decoration: none; }
.footer-inner a:hover { color: var(--green-700); }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .header-inner { justify-content: center; }
  .header-nav { justify-content: center; }
  .hero { padding: 40px 0 28px; }
  .cta { padding: 20px; }
}
