/* =========================================================
   blog.css — shared styling for /blog.
   Tokens mirror index.html's :root, which mirrors the app's
   space_dark theme (lib/core/theme/app_theme.dart).

   The marketing pages each carry their own inline copy of
   these tokens. A blog grows a page per post, so the copies
   would grow with it — hence one real stylesheet here rather
   than a fourth inline duplicate.
   ========================================================= */

:root {
  --bg:          #0B0E1A;
  --surface:     #131729;
  --card:        #171B2F;
  --primary:     #7C6EF5;
  --primary-400: #9B8FFA;
  --primary-200: #C9C1FE;
  --accent:      #34D399;
  --gold:        #FBBF24;
  --text:        #F5F4FF;
  --text-soft:   #B8B4D4;
  --text-muted:  #6B6989;
  --border:      rgba(124, 110, 245, 0.18);
  --radius-lg:   22px;
  --radius-md:   14px;
  --radius-sm:   10px;
  --shadow-lg:   0 20px 60px -20px rgba(124, 110, 245, 0.45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container { width: min(1120px, 92vw); margin: 0 auto; }

/* ---- header / footer, matching index.html ---------------------------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 14, 26, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  width: min(1120px, 92vw); margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  padding: 14px 0;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 700;
}
.brand-mark { width: 34px; height: 34px; border-radius: 9px; }
.links { display: flex; gap: 20px; margin-left: auto; flex-wrap: wrap; }
.links a { color: var(--text-soft); text-decoration: none; font-size: 15px; }
.links a:hover { color: var(--text); }
.btn {
  display: inline-block; padding: 10px 18px; border-radius: var(--radius-sm);
  font-weight: 600; text-decoration: none; font-size: 15px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-400); }

footer {
  border-top: 1px solid var(--border);
  margin-top: 80px; padding: 40px 0 28px;
  color: var(--text-muted); font-size: 14px;
}
footer a { color: var(--text-soft); text-decoration: none; }
footer a:hover { color: var(--text); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-top: 18px;
}

/* ---- blog index ------------------------------------------------------ */

.blog-head { padding: 64px 0 8px; }
.blog-head h1 { font-size: clamp(32px, 5vw, 46px); margin: 0 0 12px; }
.blog-head p { color: var(--text-soft); font-size: 18px; max-width: 62ch; margin: 0; }

.post-list { display: grid; gap: 18px; padding: 34px 0 0; }
.post-card {
  display: block; padding: 24px 26px; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.post-card:hover { border-color: rgba(124, 110, 245, 0.45); }
.post-card h2 { margin: 6px 0 8px; font-size: 22px; color: var(--text); }
.post-card p { margin: 0; color: var(--text-soft); }
.post-meta {
  color: var(--text-muted); font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.7px;
}

.empty {
  padding: 34px 0 0; color: var(--text-soft);
}

/* ---- an article ------------------------------------------------------ */

article.post { width: min(760px, 92vw); margin: 0 auto; padding: 56px 0 0; }
article.post h1 { font-size: clamp(30px, 4.6vw, 42px); line-height: 1.25; margin: 10px 0 14px; }
article.post h2 { font-size: 26px; margin: 44px 0 12px; }
article.post h3 { font-size: 20px; margin: 32px 0 8px; color: var(--primary-200); }
article.post p, article.post li { color: var(--text-soft); font-size: 17px; }
article.post a { color: var(--primary-200); }
article.post ul, article.post ol { padding-left: 22px; }
article.post li { margin-bottom: 8px; }

/* A lead paragraph doubles as the meta description — keeping them the same
   text means the search snippet matches what the reader actually sees. */
article.post .lead { font-size: 19px; color: var(--text); }

/* display:block is what lets a wide table scroll inside itself instead of
   scrolling the whole page on a phone — but it also makes the table shrink to
   its content, so min-width pulls it back out to the column. */
article.post table {
  border-collapse: collapse; margin: 22px 0; font-size: 15px;
  display: block; overflow-x: auto; min-width: 100%;
}
article.post th, article.post td {
  border: 1px solid var(--border); padding: 10px 12px; text-align: left;
}
article.post th { background: var(--surface); color: var(--text); }
article.post td { color: var(--text-soft); }

article.post blockquote {
  margin: 24px 0; padding: 14px 20px;
  border-left: 4px solid var(--primary);
  background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
article.post blockquote p { margin: 0; color: var(--text); }

.callout {
  margin: 26px 0; padding: 18px 22px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-md);
}
.callout h3 { margin-top: 0; color: var(--gold); }

.post-cta {
  margin: 48px 0 0; padding: 26px; text-align: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.post-cta h3 { margin: 0 0 8px; color: var(--text); }
.post-cta p { color: var(--text-soft); margin: 0 0 16px; }

.back-link { display: inline-block; margin-top: 40px; color: var(--text-soft); }

@media (max-width: 720px) {
  .links { display: none; }
  article.post { padding-top: 34px; }
}
