/* ─────────────────────────────────────────────────────────────
   PodAnalyst — Blog
   Same fixed palette, type and card language as the home page
   (home.css). Only the blog-specific pieces live here: the post
   index, the article card, and the markdown prose inside it.
   ───────────────────────────────────────────────────────────── */

/* ── Hero ── */

/* A post title runs longer than a marketing headline, so it gets a smaller
   clamp and a wider measure than the home hero's 760px content box. */
.hero-post .content { max-width: 880px; }
.post-headline { font-size: clamp(34px, 4.4vw, 58px); line-height: 1.08; margin-bottom: 22px; }
.post-subtext { max-width: 640px; font-size: 18px; margin-bottom: 0; }

.post-byline-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 34px;
}
.byline-photo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.16);
}
.byline-name { font-size: 14px; font-weight: 600; color: #fff; line-height: 1.3; }
.byline-meta {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-top: 3px;
}
.byline-sep { width: 1px; height: 30px; background: rgba(255,255,255,0.16); margin: 0 10px; }

/* ── Category tag ── */

/* Colors come from the post's category (set inline from lib/blog.js), the same
   way the Radar blips carry their category color. */
.post-cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.post-cat .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  flex-shrink: 0;
}

/* ── Post index ── */

.section-posts { background: #F4F5F7; padding: 128px 48px; }
.posts-inner { max-width: 1180px; margin: 0 auto; }

.post-featured {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
  align-items: stretch;
  background: #ffffff;
  border: 1px solid #E4E5EA;
  border-radius: 20px;
  padding: 44px;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  margin-bottom: 72px;
}
.post-featured:hover { border-color: #C7C9F5; box-shadow: 0 30px 80px -40px rgba(20,20,40,0.3); }

/* A post with no cover image gets the full card width for its copy. */
.post-featured.no-cover { grid-template-columns: 1fr; }

.post-featured-body { display: flex; flex-direction: column; }
.post-featured-title {
  font-size: clamp(26px, 2.8vw, 38px);
  font-weight: 700;
  color: #22232B;
  letter-spacing: -0.02em;
  line-height: 1.14;
  margin: 20px 0 18px;
  transition: color 0.15s;
}
.post-featured:hover .post-featured-title { color: #4F46E5; }
.post-featured-excerpt {
  font-size: 16.5px;
  color: #5B5D6B;
  line-height: 1.65;
  max-width: 580px;
  margin-bottom: 28px;
}

/* Cover image, when the post sets one. Fills the cover column at any aspect
   ratio; posts without one don't render the column at all. */
.post-featured-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid #E4E5EA;
}
.posts-kicker { margin-bottom: 28px; }
.post-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.post-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #E4E5EA;
  border-radius: 16px;
  padding: 32px;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.post-card:hover { border-color: #C7C9F5; box-shadow: 0 24px 60px -40px rgba(20,20,40,0.28); }
.post-title {
  font-size: 21px;
  font-weight: 700;
  color: #22232B;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 18px 0 12px;
  transition: color 0.15s;
}
.post-card:hover .post-title { color: #4F46E5; }
.post-excerpt { font-size: 15px; color: #5B5D6B; line-height: 1.65; margin-bottom: 24px; }

/* Pushed to the bottom of the card so the meta line sits on one baseline
   across a row of cards, whatever the title and excerpt lengths. */
.post-byline {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8A8C99;
  margin-top: auto;
}

/* ── Article ── */

.section-article { background: #F4F5F7; padding: 96px 48px 0; }
.article-inner { max-width: 840px; margin: 0 auto; }

/* Optional cover, above the article card. */
.article-cover {
  display: block;
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid #E4E5EA;
  margin-bottom: 24px;
}

.article-card {
  background: #ffffff;
  border: 1px solid #E4E5EA;
  border-radius: 20px;
  padding: 64px 72px;
  box-shadow: 0 40px 90px -60px rgba(20,20,40,0.4);
}

.article-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 30px 4px 0;
}
.post-back {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #5B5D6B;
  text-decoration: none;
  transition: color 0.15s;
}
.post-back:hover { color: #4F46E5; }
.article-foot .cta-primary { padding: 11px 22px; }

.section-related { background: #F4F5F7; padding: 72px 48px 128px; }

/* ── Markdown prose ──
   Posts render as raw markdown output (h2, p, ul, table…) with no classes on
   the elements, so everything is styled here and scoped to .blog-prose. */

.blog-prose { color: #3F4250; font-size: 17px; line-height: 1.75; }

.blog-prose > *:first-child { margin-top: 0; }

/* Opening paragraph reads as a standfirst, the way a magazine sets one. */
.blog-prose > p:first-of-type { font-size: 19.5px; color: #5B5D6B; line-height: 1.65; }

.blog-prose h2 {
  font-size: 27px;
  font-weight: 700;
  color: #22232B;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 56px 0 18px;
}
.blog-prose h3 {
  font-size: 19px;
  font-weight: 600;
  color: #22232B;
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
}
.blog-prose h4 {
  font-size: 16px;
  font-weight: 600;
  color: #22232B;
  margin: 32px 0 10px;
}

.blog-prose p { margin: 0 0 24px; }
.blog-prose strong { color: #22232B; font-weight: 600; }
.blog-prose em { font-style: italic; }

.blog-prose a {
  color: #4F46E5;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(99,102,241,0.3);
  transition: border-color 0.15s;
}
.blog-prose a:hover { border-bottom-color: #4F46E5; }

.blog-prose ul,
.blog-prose ol { margin: 0 0 24px; padding-left: 26px; }
.blog-prose ul { list-style: disc; }
.blog-prose ol { list-style: decimal; }
.blog-prose li { margin-bottom: 10px; }
.blog-prose li::marker { color: #A5A9F5; }
.blog-prose li > ul,
.blog-prose li > ol { margin: 10px 0 0; }

/* Pull quote — the same indigo rule the home page uses for its Radar quote. */
.blog-prose blockquote {
  border-left: 2px solid #6366F1;
  padding: 4px 0 4px 28px;
  margin: 40px 0;
}
.blog-prose blockquote p {
  font-size: 22px;
  font-weight: 600;
  color: #22232B;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.blog-prose blockquote p:last-child { margin-bottom: 0; }

.blog-prose hr {
  border: 0;
  border-top: 1px solid #E4E5EA;
  margin: 56px 0;
}

.blog-prose code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.86em;
  background: #F1F2F6;
  color: #3730A3;
  border-radius: 4px;
  padding: 0.1em 0.35em;
}
.blog-prose pre {
  background: #0A0E14;
  border: 1px solid #1A2230;
  border-radius: 12px;
  padding: 22px 24px;
  overflow-x: auto;
  margin: 0 0 28px;
}
.blog-prose pre code {
  background: none;
  color: #E8EEF4;
  padding: 0;
  font-size: 13px;
  line-height: 1.7;
}

/* Tables: the shared renderer wraps them so they can scroll on narrow screens. */
.blog-prose .docs-table-wrap { overflow-x: auto; margin: 0 0 28px; }
.blog-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.blog-prose thead th {
  text-align: left;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #8A8C99;
  border-bottom: 1px solid #E4E5EA;
  padding: 0 16px 12px 0;
  white-space: nowrap;
}
.blog-prose tbody td {
  color: #5B5D6B;
  line-height: 1.6;
  border-bottom: 1px solid #EEF0F3;
  padding: 14px 16px 14px 0;
  vertical-align: top;
}
.blog-prose tbody tr:last-child td { border-bottom: 0; }
.blog-prose tbody td:first-child { color: #22232B; font-weight: 600; }

.blog-prose img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid #E4E5EA;
  margin: 32px 0;
}

/* ── Responsive ── */

@media (max-width: 960px) {
  .section-posts, .section-related { padding: 88px 24px; }
  .section-article { padding: 72px 24px 0; }
  .section-related { padding-top: 56px; }

  .post-featured { grid-template-columns: 1fr; gap: 32px; padding: 32px; margin-bottom: 56px; }
  /* The cover follows the copy on narrow screens, where it's decoration. */
  .post-featured-image { min-height: 200px; }
  .post-grid { grid-template-columns: 1fr; gap: 20px; }

  .article-card { padding: 40px 36px; }
  .article-cover { max-height: 320px; border-radius: 16px; margin-bottom: 20px; }
}

@media (max-width: 640px) {
  .section-posts, .section-related { padding: 72px 20px; }
  .section-article { padding: 56px 20px 0; }
  .section-related { padding-top: 44px; }

  .post-featured { padding: 24px; border-radius: 16px; }
  .post-card { padding: 24px; }

  .byline-sep { display: none; }
  .post-byline-row { margin-top: 26px; gap: 12px; }

  .article-card { padding: 28px 22px; border-radius: 16px; }
  .blog-prose { font-size: 16.5px; }
  .blog-prose > p:first-of-type { font-size: 18px; }
  .blog-prose h2 { font-size: 23px; margin-top: 44px; }
  .blog-prose blockquote { margin: 32px 0; padding-left: 20px; }
  .blog-prose blockquote p { font-size: 19px; }
  .blog-prose pre { padding: 18px; }
  .article-foot { padding-top: 24px; }
}
