/*
  LeadsBot Blog — Editorial CSS Layer
  Replaces BASE_STYLES for all blog routes.
  
  Design direction: Flat editorial. Off-white ground. 
  One typeface family used with discipline. No shadows, no gradients, 
  no glow. Ink on paper. Signal over decoration.
  
  Font stack: "Instrument Serif" for article headings (gravitas, readable),
  "DM Sans" for all UI, meta, navigation (neutral, workhorse).
  Both loaded from Google Fonts in buildHead().
  
  Usage: replace BASE_STYLES constant in render.ts with this file's contents
  for all blog routes, OR import as a separate <link> after shared.css.
*/

/* ─── Reset & Ground ─────────────────────────────────────────── */

body.blog-doc {
  background: #f7f6f3;
  color: #1a1916;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── Navigation ─────────────────────────────────────────────── */

.blog-nav {
  background: #f7f6f3;
  border-bottom: 1px solid #e2e0da;
  position: sticky;
  top: 0;
  z-index: 50;
}

.blog-nav .nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 40px;
}

.blog-nav .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #1a1916;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.blog-nav .nav-links {
  display: flex;
  gap: 28px;
  flex: 1;
}

.blog-nav .nav-links a {
  font-size: 14px;
  color: #6b6860;
  text-decoration: none;
  letter-spacing: 0;
  transition: color 0.15s;
}

.blog-nav .nav-links a:hover { color: #1a1916; }

.blog-nav .nav-links a.active {
  color: #1a1916;
  font-weight: 500;
}

.blog-nav .nav-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.blog-nav .nav-cta a {
  font-size: 13px;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.blog-nav .nav-cta .btn-ghost-sm {
  color: #6b6860;
  background: transparent;
}

.blog-nav .nav-cta .btn-ghost-sm:hover {
  background: #eeece8;
  color: #1a1916;
}

.blog-nav .nav-cta .btn-primary-sm {
  background: #1a1916;
  color: #f7f6f3;
}

.blog-nav .nav-cta .btn-primary-sm:hover {
  background: #2d2b27;
}

/* ─── Container ──────────────────────────────────────────────── */

.blog-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ─── Blog Index — Hero ──────────────────────────────────────── */

.blog-hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid #e2e0da;
}

.blog-hero-inner {
  max-width: 640px;
}

.blog-hero .blog-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9b9890;
  margin-bottom: 16px;
}

.blog-hero h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 48px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #1a1916;
  margin: 0 0 16px;
}

.blog-hero .blog-lede {
  font-size: 17px;
  line-height: 1.65;
  color: #6b6860;
  margin: 0;
  max-width: 520px;
}

/* ─── Blog Index — Layout ────────────────────────────────────── */

.blog-index-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 64px;
  padding: 56px 0 80px;
  align-items: start;
}

/* ─── Post List ──────────────────────────────────────────────── */

.post-list {
  display: flex;
  flex-direction: column;
}

/* Featured post — first item gets special treatment */
.post-list .post-item:first-child {
  padding-bottom: 40px;
  margin-bottom: 0;
  border-bottom: 2px solid #1a1916;
}

.post-list .post-item:first-child .post-title {
  font-size: 28px;
}

.post-item {
  padding: 32px 0;
  border-bottom: 1px solid #e2e0da;
}

.post-item:last-child {
  border-bottom: none;
}

.post-item-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.post-category-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b6860;
  text-decoration: none;
}

.post-category-tag:hover { color: #1a1916; }

.post-item-meta .meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c9c7c1;
  flex-shrink: 0;
}

.post-date {
  font-size: 13px;
  color: #9b9890;
}

.post-read-time {
  font-size: 13px;
  color: #9b9890;
}

.post-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: #1a1916;
  margin: 0 0 10px;
  text-decoration: none;
  display: block;
  transition: color 0.15s;
}

.post-title:hover { color: #4a4845; }

.post-excerpt {
  font-size: 15px;
  line-height: 1.65;
  color: #6b6860;
  margin: 0 0 14px;
  /* Clamp to 3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.post-author {
  font-size: 13px;
  color: #9b9890;
}

.post-read-link {
  font-size: 13px;
  font-weight: 500;
  color: #1a1916;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.15s;
}

.post-read-link:hover { gap: 8px; }

/* ─── Sidebar ────────────────────────────────────────────────── */

.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 40px;
  position: sticky;
  top: 76px;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9b9890;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e0da;
}

.sidebar-category-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-category-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  color: #4a4845;
  text-decoration: none;
  transition: color 0.15s;
}

.sidebar-category-link:hover { color: #1a1916; }

.sidebar-category-link .count {
  font-size: 12px;
  color: #9b9890;
}

.sidebar-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sidebar-tag {
  font-size: 12px;
  color: #6b6860;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid #e2e0da;
  border-radius: 3px;
  background: #f7f6f3;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sidebar-tag:hover {
  background: #1a1916;
  border-color: #1a1916;
  color: #f7f6f3;
}

/* ─── Blog Post Page ─────────────────────────────────────────── */

.post-hero {
  padding: 60px 0 48px;
  border-bottom: 1px solid #e2e0da;
  max-width: 760px;
}

.post-hero .post-category-tag {
  display: inline-block;
  margin-bottom: 20px;
}

.post-hero h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 44px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: #1a1916;
  margin: 0 0 20px;
}

.post-hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.post-hero-meta span {
  font-size: 13px;
  color: #9b9890;
}

.post-hero-meta .author-name {
  color: #4a4845;
  font-weight: 500;
}

.post-hero-meta .meta-sep {
  color: #d4d2cc;
}

/* ─── Article Layout ─────────────────────────────────────────── */

.article-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 64px;
  padding: 56px 0 80px;
  align-items: start;
}

/* ─── Article Body ───────────────────────────────────────────── */

.article-content {
  max-width: 680px;
  min-width: 0;
}

.article-content p {
  font-size: 17px;
  line-height: 1.8;
  color: #2d2b27;
  margin: 0 0 24px;
}

.article-content h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #1a1916;
  margin: 48px 0 16px;
  padding-top: 48px;
  border-top: 1px solid #e2e0da;
}

.article-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.article-content ul {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.article-content li {
  font-size: 17px;
  line-height: 1.75;
  color: #2d2b27;
  padding: 6px 0 6px 20px;
  position: relative;
}

.article-content li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: #c9c7c1;
}

.article-content strong {
  font-weight: 600;
  color: #1a1916;
}

/* FAQ inside article */
.article-faq-section h2 {
  border-top: 1px solid #e2e0da;
  padding-top: 48px;
}

.article-faq-section h3 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 20px;
  font-weight: 400;
  color: #1a1916;
  margin: 28px 0 8px;
  letter-spacing: -0.01em;
}

.article-faq-section p {
  font-size: 16px;
  color: #6b6860;
  margin: 0 0 8px;
  line-height: 1.7;
}

/* ─── Article Sidebar ────────────────────────────────────────── */

.article-sidebar {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9b9890;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e0da;
}

.toc-nav a {
  font-size: 13px;
  line-height: 1.5;
  color: #6b6860;
  text-decoration: none;
  padding: 5px 0;
  border-left: 2px solid transparent;
  padding-left: 12px;
  transition: color 0.15s, border-color 0.15s;
  display: block;
}

.toc-nav a:hover {
  color: #1a1916;
  border-left-color: #1a1916;
}

.article-author-block {
  padding-top: 24px;
  border-top: 1px solid #e2e0da;
}

.article-author-block .author-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9b9890;
  margin-bottom: 12px;
  display: block;
}

.article-author-block .author-name-lg {
  font-size: 15px;
  font-weight: 500;
  color: #1a1916;
  margin: 0 0 2px;
}

.article-author-block .author-role {
  font-size: 12px;
  color: #9b9890;
  margin: 0 0 10px;
}

.article-author-block .author-bio {
  font-size: 13px;
  line-height: 1.6;
  color: #6b6860;
  margin: 0 0 10px;
}

.article-author-block a {
  font-size: 13px;
  color: #4a4845;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.article-author-block a:hover { color: #1a1916; }

/* ─── Related Posts ──────────────────────────────────────────── */

.related-section {
  border-top: 2px solid #1a1916;
  padding: 48px 0 80px;
}

.related-section h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  color: #1a1916;
  margin: 0 0 32px;
  letter-spacing: -0.01em;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.related-post-item .post-title {
  font-size: 18px;
}

/* ─── Collection Pages (category / tag / author) ─────────────── */

.collection-hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid #e2e0da;
}

.collection-hero .blog-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9b9890;
  margin-bottom: 12px;
}

.collection-hero h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 40px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #1a1916;
  margin: 0 0 12px;
}

.collection-hero .collection-desc {
  font-size: 16px;
  color: #6b6860;
  line-height: 1.6;
  margin: 0;
  max-width: 520px;
}

.collection-post-list {
  padding: 48px 0 80px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 48px;
}

.collection-post-list .post-item {
  border-bottom: 1px solid #e2e0da;
}

/* ─── Breadcrumbs ────────────────────────────────────────────── */

.blog-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #9b9890;
  margin-bottom: 20px;
}

.blog-breadcrumbs a {
  color: #9b9890;
  text-decoration: none;
  transition: color 0.15s;
}

.blog-breadcrumbs a:hover { color: #1a1916; }

.blog-breadcrumbs .sep {
  color: #d4d2cc;
  font-size: 11px;
}

/* ─── Footer ─────────────────────────────────────────────────── */

.blog-footer {
  border-top: 1px solid #e2e0da;
  background: #f7f6f3;
  padding: 40px 0;
}

.blog-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.blog-footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #4a4845;
  font-size: 14px;
  font-weight: 500;
}

.blog-footer-links {
  display: flex;
  gap: 24px;
}

.blog-footer-links a {
  font-size: 13px;
  color: #9b9890;
  text-decoration: none;
  transition: color 0.15s;
}

.blog-footer-links a:hover { color: #1a1916; }

.blog-footer-copy {
  font-size: 12px;
  color: #9b9890;
}

/* ─── Empty state ────────────────────────────────────────────── */

.blog-empty {
  padding: 64px 0;
  font-size: 15px;
  color: #9b9890;
}

/* ─── Responsive ─────────────────────────────────────────────── */

@media (max-width: 900px) {
  .blog-index-layout,
  .article-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .blog-sidebar,
  .article-sidebar {
    position: static;
    top: auto;
    border-top: 1px solid #e2e0da;
    padding-top: 32px;
  }

  .related-grid,
  .collection-post-list {
    grid-template-columns: 1fr;
  }

  .blog-hero h1 {
    font-size: 36px;
  }

  .post-hero h1 {
    font-size: 32px;
  }
}

@media (max-width: 640px) {
  .blog-container {
    padding: 0 20px;
  }

  .blog-nav .nav-inner {
    padding: 0 20px;
  }

  .blog-nav .nav-links {
    display: none;
  }

  .blog-footer-inner {
    padding: 0 20px;
  }
}
