/* Scribbly By Hand — blog theme.
   Self-contained, hand-written CSS (NOT Tailwind). The blog is generated as
   static HTML decoupled from the SPA bundle, so it can't rely on Tailwind's
   purged utility classes. Brand tokens mirror src/index.css @theme. */

@font-face {
  font-family: 'QEiAuto018A';
  src: url('/fonts/quantum/QEiAuto018A.ttf') format('truetype');
  font-display: swap;
}

:root {
  --cream: #FDF6EC;
  --cream-dark: #FBF3E6;
  --paper-alt: #FEFAF2;
  --sand: #E8D5B7;
  --sand-dark: #C4A882;
  --eucalyptus: #4A7C59;
  --eucalyptus-dark: #3A6147;
  --eucalyptus-light: #E8F0EB;
  --bark: #5C4033;
  --charcoal: #3D3D3D;
  --coral: #C75C3A;
  --font-display: 'QEiAuto018A', 'Segoe Script', cursive;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--cream);
  color: var(--charcoal);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--eucalyptus-dark); }
a:hover { color: var(--eucalyptus); }

/* ---- Top bar ---- */
.site-bar {
  background: var(--cream);
  border-bottom: 1px solid var(--sand);
}
.site-bar__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--bark);
  text-decoration: none;
}
.brand:hover { color: var(--eucalyptus); }
.site-bar__cta {
  display: inline-block;
  background: var(--eucalyptus);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 10px 18px;
  border-radius: 999px;
}
.site-bar__cta:hover { background: var(--eucalyptus-dark); color: #fff; }

/* ---- Layout ---- */
.wrap { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.wrap--wide { max-width: 1120px; }

main { padding: 48px 0 24px; }

/* ---- Article header ---- */
.eyebrow {
  color: var(--eucalyptus);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 13px;
  margin: 0 0 14px;
}
.post-title {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--bark);
  font-weight: 800;
  margin: 0 0 16px;
}
.post-meta {
  color: var(--charcoal);
  opacity: 0.62;
  font-size: 14px;
  margin: 0 0 8px;
}
.post-lede {
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--charcoal);
  opacity: 0.85;
  margin: 18px 0 0;
}
.divider { border: 0; border-top: 1px solid var(--sand); margin: 36px 0; }

/* ---- Article body ---- */
.prose { font-size: 1.0625rem; }
.prose h2 {
  font-size: 1.75rem;
  color: var(--bark);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 2.4em 0 0.6em;
  line-height: 1.2;
}
.prose h3 {
  font-size: 1.3rem;
  color: var(--bark);
  font-weight: 700;
  margin: 1.8em 0 0.5em;
}
.prose p { margin: 0 0 1.2em; }
.prose ul, .prose ol { margin: 0 0 1.3em; padding-left: 1.4em; }
.prose li { margin: 0 0 0.5em; }
.prose strong { color: var(--bark); font-weight: 700; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--eucalyptus);
  color: var(--bark);
  font-style: italic;
}
.prose blockquote p { margin: 0.3em 0; }
.prose code {
  background: var(--eucalyptus-light);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 0.92em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.prose hr { border: 0; border-top: 1px solid var(--sand); margin: 2.2em 0; }

/* ---- Tables ---- */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8em 0;
  font-size: 0.95rem;
  background: var(--paper-alt);
  border: 1px solid var(--sand);
  border-radius: 12px;
  overflow: hidden; /* clip cell backgrounds to the rounded corners */
}
.prose thead { background: var(--eucalyptus-light); }
.prose th {
  text-align: left;
  padding: 11px 16px;
  color: var(--bark);
  font-weight: 700;
  border-bottom: 2px solid var(--sand-dark);
}
.prose td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--sand);
  vertical-align: top;
}
/* First column reads as a row label */
.prose tbody td:first-child { font-weight: 600; color: var(--bark); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:nth-child(even) { background: rgba(232, 213, 183, 0.12); }

/* On narrow screens let a wide table scroll rather than crush its columns. */
@media (max-width: 560px) {
  .prose table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ---- Pull-out / template box inside prose ---- */
.callout {
  background: var(--paper-alt);
  border: 1px solid var(--sand);
  border-radius: 14px;
  padding: 22px 24px;
  margin: 1.8em 0;
}
.callout p:last-child { margin-bottom: 0; }

/* ---- CTA block ---- */
.cta {
  background: var(--eucalyptus-light);
  border: 2px solid rgba(74, 124, 89, 0.25);
  border-radius: 18px;
  padding: 32px;
  margin: 48px 0 8px;
  text-align: center;
}
.cta h2 {
  font-family: var(--font-display);
  color: var(--bark);
  font-size: 1.9rem;
  margin: 0 0 10px;
  line-height: 1.15;
}
.cta p { margin: 0 auto 22px; max-width: 46ch; opacity: 0.85; }
.btn {
  display: inline-block;
  background: var(--eucalyptus);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 16px;
}
.btn:hover { background: var(--eucalyptus-dark); color: #fff; }
.btn--ghost {
  background: transparent;
  color: var(--eucalyptus-dark);
  border: 1.5px solid var(--eucalyptus);
  margin-left: 8px;
}
.btn--ghost:hover { background: var(--eucalyptus-light); color: var(--eucalyptus-dark); }

/* ---- Related links ---- */
.related { margin: 40px 0 0; }
.related h2 { font-size: 1.25rem; color: var(--bark); margin: 0 0 14px; }
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { margin: 0 0 10px; }
.related a { font-weight: 600; }

/* ---- Index / listing ---- */
.index-head { text-align: center; margin: 8px 0 48px; }
.index-head h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  color: var(--bark);
  font-weight: 800;
  line-height: 1.1;
  margin: 10px 0 14px;
}
.index-head p { font-size: 1.15rem; opacity: 0.8; max-width: 58ch; margin: 0 auto; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}
.card {
  display: block;
  background: #fff;
  border: 1px solid var(--sand);
  border-radius: 16px;
  padding: 26px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--eucalyptus); transform: translateY(-2px); }
.card__tag {
  color: var(--eucalyptus);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}
.card__title {
  color: var(--bark);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 8px 0 10px;
}
.card__desc { font-size: 0.95rem; opacity: 0.78; margin: 0; }
.card__meta { font-size: 13px; opacity: 0.55; margin: 14px 0 0; }

/* ---- Footer ---- */
.site-foot {
  background: var(--bark);
  color: var(--cream);
  margin-top: 64px;
  padding: 40px 0;
}
.site-foot .wrap--wide {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.site-foot a { color: var(--sand); text-decoration: none; }
.site-foot a:hover { color: #fff; }
.site-foot__brand { font-family: var(--font-display); font-size: 24px; color: #fff; }
.site-foot__links a { margin-left: 18px; font-size: 14px; }
.site-foot__legal {
  max-width: 1120px;
  margin: 24px auto 0;
  padding: 18px 24px 0;
  border-top: 1px solid rgba(232, 213, 183, 0.2);
  font-size: 12px;
  color: rgba(232, 213, 183, 0.6);
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  main { padding: 32px 0 16px; }
  .site-bar__cta { display: none; }
  .btn--ghost { margin-left: 0; margin-top: 10px; }
}
