/* Blog pages (index and posts). The rest of the site keeps its styles inline in each
   page, so the fonts, colour tokens and base rules the blog needs are repeated here. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/inter-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/bricolage-800-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --purple-text: #6338E6;
  --purple:      #7D52FF;
  --deep-purple: #693EEB;
  --yellow:      #FADE51;
  --bg:          #F5FAFF;
  --surface:     #FFFFFF;
  --border:      #E7ECF3;
  --grey-cool:   #535E6B;
  --grey-mid:    #5F6A77;
  --ink:         #0F1624;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  padding-top: 68px; /* fixed header */
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--purple-text); }
a:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.blog-wrap { max-width: 720px; margin: 0 auto; padding: 0 24px; }

.blog-tag {
  display: inline-block;
  margin-bottom: 20px;
  padding: 5px 14px;
  border-radius: 100px;
  background: var(--yellow);
  color: var(--purple-text);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}

.blog-title {
  margin: 0 0 16px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 5.5vw, 3.2rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  text-wrap: balance;
}

/* ---------- Index ---------- */
.blog-hero { padding: 64px 0 24px; }
.blog-lede { margin: 0; max-width: 560px; font-size: 1.125rem; color: var(--grey-cool); }

.post-list { list-style: none; margin: 0; padding: 24px 0 96px; display: grid; gap: 20px; }
.post-card {
  display: block;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.12s;
}
.post-card:hover { border-color: var(--purple); transform: translateY(-2px); }
.post-card h2 { margin: 6px 0 8px; font-size: 1.375rem; line-height: 1.25; color: var(--ink); }
.post-card p { margin: 0; color: var(--grey-cool); }
.post-meta { font-size: 0.875rem; color: var(--grey-mid); }

.blog-empty { padding: 96px 0 120px; }
.blog-empty p { max-width: 520px; font-size: 1.125rem; color: var(--grey-cool); }

/* ---------- Post ---------- */
.post-head { padding: 64px 0 8px; }
.post-head .post-meta { margin-top: 4px; }
.post-cover { margin: 32px auto 0; max-width: 960px; padding: 0 24px; }
.post-cover img { display: block; width: 100%; height: auto; border-radius: 20px; border: 1px solid var(--border); }

.post-body { padding: 32px 0 24px; font-size: 1.0625rem; }
.post-body > *:first-child { margin-top: 0; }
.post-body h2, .post-body h3, .post-body h4 { line-height: 1.25; margin: 2.2em 0 0.6em; color: var(--ink); }
.post-body h2 { font-size: 1.65rem; }
.post-body h3 { font-size: 1.3rem; }
.post-body h4 { font-size: 1.1rem; }
.post-body p, .post-body ul, .post-body ol, .post-body blockquote, .post-body pre, .post-body table { margin: 0 0 1.2em; }
.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body li + li { margin-top: 0.35em; }
.post-body img { display: block; max-width: 100%; height: auto; margin: 1.6em 0; border-radius: 14px; }
.post-body blockquote { padding: 4px 0 4px 20px; border-left: 4px solid var(--purple); color: var(--grey-cool); }
.post-body hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--border); }
.post-body code { padding: 2px 6px; border-radius: 6px; background: #ECEBFB; font-size: 0.92em; }
.post-body pre { overflow-x: auto; padding: 16px; border-radius: 12px; background: var(--ink); color: #fff; }
.post-body pre code { padding: 0; background: none; color: inherit; }
.post-body table { display: block; overflow-x: auto; border-collapse: collapse; }
.post-body th, .post-body td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; }

.post-cta {
  margin: 24px 0 96px;
  padding: 32px;
  border-radius: 24px;
  background: var(--deep-purple);
  color: #fff;
}
.post-cta h2 { margin: 0 0 8px; font-size: 1.5rem; line-height: 1.2; }
.post-cta p { margin: 0 0 20px; }
.post-cta a {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 100px;
  background: #fff;
  color: var(--purple-text);
  font-weight: 700;
  text-decoration: none;
}
.post-cta a:focus-visible { outline-color: #fff; }

.post-back { display: inline-block; margin-top: 8px; font-weight: 600; text-decoration: none; }
.post-back:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .blog-hero, .post-head { padding-top: 40px; }
  .post-card { padding: 20px; }
  .post-cta { padding: 24px; }
}
