/*
 * STYLESHEET: blog.css  (the static /blog surface only)
 *
 * Lives in public/blog/ so Vite copies it VERBATIM to dist/blog/blog.css. That
 * gives every generated post + the index a STABLE, un-hashed path
 * (/blog/blog.css) — unlike the SPA's CSS, which Vite content-hashes. The blog
 * is an intentionally decoupled static surface and must not depend on the app's
 * hashed bundle.
 *
 * ⚠ TOKEN DUPLICATION BY DESIGN: the colours/fonts below are copied from the
 * landing page + src/lib/styles/tokens.css (Timeline-navy palette, warm cream
 * surfaces, Newsreader/Lora/Work Sans) rather than referenced, precisely because
 * this surface is decoupled. tokens.css is the SOURCE OF TRUTH — if the brand
 * palette changes there, mirror the change here to keep them in visual sync.
 *
 * LIGHT-ONLY by design: like every public / pre-auth Janus surface, the blog is
 * always light. Do NOT wire data-theme / dark mode in here.
 *
 *   Palette        heading slate #383d42 (a DESATURATED navy — intentional for
 *                  all content headings; NOT a mistake, don't "restore" it to
 *                  brand navy), brand navy #0A3D6B (logo wordmark + links),
 *                  navy-hover #185FA5, cream canvas #efebe3,
 *                  ink #1d1d1f, muted #7a7a76, hairline rgba(0,0,0,.08).
 *                  The article itself has NO white card (sits on the cream
 *                  page); the index list items still use white panels (#fff).
 *   Type           Newsreader (serif display), Lora (serif body),
 *                  Work Sans (UI / meta)
 */

/* ── Reset / base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: #efebe3;
  color: #1d1d1f;
  font-family: 'Lora', Georgia, serif;
  font-size: 19px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Top nav (mirrors the landing page header) ───────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 48px;
  background: rgba(245, 243, 238, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(15, 15, 15, 0.12);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 600;
  font-size: 26px;
  color: #0A3D6B;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.nav-logo-icon {
  width: 30px;
  height: 30px;
  display: block;
  position: relative;
  top: -2px; /* sit on the serif wordmark's optical centre */
}
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-link {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #0A3D6B;
  text-decoration: none;
  padding: 12px 8px;
}
.nav-link:hover { text-decoration: underline; }
.nav-cta {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #f5f3ee;
  background: #0A3D6B;
  padding: 12px 24px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s;
}
.nav-cta:hover { background: #185FA5; }

/* ── Main column ─────────────────────────────────────────────────────────── */
.blog-main {
  max-width: 780px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

/* ── Post page ───────────────────────────────────────────────────────────── */
/* No white card — the article sits directly on the warm page. The reading
 * width comes from .blog-main's max-width; the side gutter from its padding. */
.post {
  padding: 0;
}
.post-back, .post-foot-back {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 14px;
  margin: 0 0 28px;
}
.post-back a, .post-foot-back a { color: #185FA5; text-decoration: none; }
.post-back a:hover, .post-foot-back a:hover { text-decoration: underline; }

.post-head { margin-bottom: 36px; }
.post-title {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 600;
  font-size: 44px;
  line-height: 1.12;
  color: #383d42;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}
.post-meta {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 14px;
  color: #7a7a76;
  margin: 0;
}

/* ── Rendered markdown body ──────────────────────────────────────────────── */
.post-body { font-size: 19px; line-height: 1.75; color: #2b2b29; }
.post-body > *:first-child { margin-top: 0; }
.post-body h2 {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 600;
  font-size: 30px;
  line-height: 1.2;
  color: #383d42;
  margin: 48px 0 16px;
}
.post-body h3 {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 600;
  font-size: 23px;
  color: #383d42;
  margin: 36px 0 12px;
}
.post-body h4 {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: #1d1d1f;
  margin: 28px 0 10px;
}
.post-body p { margin: 0 0 22px; }
.post-body a { color: #185FA5; text-decoration: underline; text-underline-offset: 2px; }
.post-body a:hover { color: #0A3D6B; }
.post-body strong { font-weight: 600; color: #1d1d1f; }
.post-body ul, .post-body ol { margin: 0 0 22px; padding-left: 1.4em; }
.post-body li { margin: 0 0 8px; }
.post-body li::marker { color: #7a7a76; }

.post-body blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid #0A3D6B;
  color: #555550;
  font-style: italic;
}
.post-body blockquote p:last-child { margin-bottom: 0; }

.post-body hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  margin: 44px 0;
}

/* Code: Work Sans body pairs with a normal mono for code. Sunken warm bg. */
.post-body code {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.85em;
  background: #f6f3ed;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 5px;
  padding: 0.12em 0.4em;
}
.post-body pre {
  background: #f6f3ed;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 0 0 22px;
}
.post-body pre code { background: none; border: none; padding: 0; font-size: 14px; line-height: 1.6; }

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 12px 0;
}

/* Highlights — yellow via Obsidian's ==text==, blue via <mark class="blue">.
 * box-decoration-break: clone keeps the rounded background intact when a
 * highlight wraps across two lines. */
.post-body mark {
  background: #fdef9a;          /* warm highlighter yellow */
  color: inherit;
  padding: 0.05em 0.22em;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.post-body mark.blue { background: #cfe3fb; }  /* light landing-blue tint */

/* Figures (captioned images) + responsive video. Self-hosted <video> scales
 * like an image; for a YouTube/Loom/Vimeo embed, wrap the <iframe> in
 * <div class="video"> for a 16:9 box that scales on phones. */
.post-body figure { margin: 24px 0; }
.post-body figure img { margin: 0; }
.post-body figcaption {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 13px;
  color: #7a7a76;
  text-align: center;
  margin-top: 8px;
}
.post-body video { max-width: 100%; border-radius: 10px; margin: 12px 0; }
.post-body .video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 24px 0;
  border-radius: 10px;
  overflow: hidden;
}
.post-body .video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 15px;
}
.post-body th, .post-body td {
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.post-body th { background: #f6f3ed; font-weight: 600; }

/* ── Post footer (quiet CTA) ─────────────────────────────────────────────── */
.post-foot {
  margin-top: 52px;
  padding-top: 28px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}
.post-cta {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #555550;
  margin: 0;
}
.post-cta a { color: #185FA5; text-decoration: none; font-weight: 500; white-space: nowrap; }
.post-cta a:hover { text-decoration: underline; }

/* ── Index page ──────────────────────────────────────────────────────────── */
.index-head { margin-bottom: 44px; }
.index-title {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 600;
  font-size: 46px;
  line-height: 1.1;
  color: #383d42;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}
.index-intro {
  font-size: 19px;
  line-height: 1.6;
  color: #555550;
  margin: 0;
  max-width: 60ch;
}

.post-list { list-style: none; margin: 0; padding: 0; }
.post-card { margin: 0 0 18px; }
.post-card-link {
  display: block;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;            /* clip the banner image to the card's rounded corners */
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
/* Optional banner image at the top of a card (set via a post's `image:` field). */
.post-card-img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;           /* crop to a tidy banner regardless of image size */
}
.post-card-body { padding: 26px 30px; }
.post-card-link:hover {
  border-color: rgba(10, 61, 107, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}
.post-card-title {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 600;
  font-size: 27px;
  line-height: 1.2;
  color: #383d42;
  margin: 0 0 8px;
}
.post-card-meta {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 13px;
  color: #7a7a76;
  margin: 0 0 12px;
}
.post-card-desc { font-size: 17px; line-height: 1.55; color: #555550; margin: 0; }
.post-empty {
  list-style: none;
  font-family: 'Work Sans', system-ui, sans-serif;
  color: #7a7a76;
}

/* ── Site footer ─────────────────────────────────────────────────────────── */
.site-footer {
  padding: 32px 24px 48px;
  border-top: 1px solid rgba(15, 15, 15, 0.12);
  display: flex;
  justify-content: center;
}
.footer-links {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.footer-links a { color: #185FA5; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-sep { color: #c9c4ba; }

/* ── Responsive: single comfortable column on phones ─────────────────────── */
@media (max-width: 640px) {
  .site-nav { padding: 14px 20px; }
  .nav-logo { font-size: 22px; }
  .nav-logo-icon { width: 26px; height: 26px; }
  .nav-link { display: none; } /* keep just the CTA on small screens */

  .blog-main { padding: 32px 16px 56px; }
  .post-title { font-size: 32px; }
  .post-body, .post-body p { font-size: 18px; }
  .post-body h2 { font-size: 25px; }
  .post-body h3 { font-size: 20px; }

  .index-title { font-size: 34px; }
  .post-card-body { padding: 20px 22px; }
  .post-card-img { height: 160px; }
  .post-card-title { font-size: 23px; }

  .site-footer { padding: 28px 20px; }
}
