/* ============================================================================
   blog.css — Honeybee Fulfillment blog
   Article typography + blog index cards. Built entirely on the design tokens in
   site.css (--honey-*, --ink-*, --line, --radius-*, --shadow*, Fraunces/Inter).
   Loaded after site.css, so same-specificity overrides here win.
   ========================================================================== */

/* ---- Shared article/index scaffolding ---------------------------------- */
.blog-page main { position: relative; z-index: 1; }

/* Single-column posts (no TOC) stay a comfortable reading measure. */
.blog-layout { max-width: 760px; }
.blog-main { min-width: 0; }

/* Posts with a TOC become a two-column grid: article + sticky sidebar. */
/* Three columns: TOC (left) · article (center) · sticky CTA (right).
   The center column carries the reading experience, so it gets the width;
   the side rails are kept slim. */
.blog-layout--has-toc {
  max-width: 1500px;
  display: grid;
  grid-template-columns: 200px minmax(0, 840px) 224px;
  justify-content: space-between;
  gap: 56px;
  /* NOTE: do NOT set align-items:start here — the sidebars must stretch to the
     full row height so the sticky rails inside them have room to travel. */
  align-items: stretch;
}
/* Article stays first in the DOM (SEO / screen readers); grid columns set the
   visual order: TOC left, article center, CTA right. */
.blog-layout--has-toc .blog-toc-aside { grid-column: 1; grid-row: 1; }
.blog-layout--has-toc .blog-main      { grid-column: 2; grid-row: 1; }
.blog-layout--has-toc .blog-promo     { grid-column: 3; grid-row: 1; }
@media (max-width: 1199px) {
  .blog-layout--has-toc { display: block; max-width: 860px; }
  .blog-toc-aside, .blog-promo { display: none; }
}

/* ---- Sticky sidebars ---------------------------------------------------- */
/* Each aside stretches to the article's full height (grid stretch); the rail
   inside sticks, staying pinned as the reader scrolls. */
.blog-toc-aside, .blog-promo { position: relative; align-self: stretch; }
.toc {
  position: sticky;
  top: 104px;
  max-height: calc(100vh - 128px);
  overflow-y: auto;
}

/* ---- Sticky conversion CTA (right rail) — black, simple, direct -------- */
.promo-card {
  position: sticky;
  top: 104px;
  background: var(--ink-900);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  box-shadow: var(--shadow);
}
.promo-head {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 19px;
  line-height: 1.25;
  color: #fff;
  margin: 0 0 18px;
}
.promo-btn { display: flex; width: 100%; justify-content: center; }
.toc-title {
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-200);
  margin: 0 0 12px;
  padding-left: 15px;
}
.toc-list, .toc-sub { list-style: none; margin: 0; padding: 0; }
.toc-list > li { margin: 0; }
/* Muted by default so the TOC recedes behind the article; a faint continuous
   rail gives the active section's honey marker something to sit against. */
.toc-link {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-300);
  text-decoration: none;
  padding: 6px 0 6px 15px;
  border-left: 2px solid var(--line);
  transition: color .15s ease, border-color .15s ease;
}
.toc-link--sub { padding-left: 28px; font-size: 12.5px; color: var(--ink-200); }
.toc-link:hover { color: var(--ink-700); }
.toc-link--active,
.toc-link--sub.toc-link--active {
  color: var(--honey-700);
  font-weight: 600;
  border-left-color: var(--honey-400);
}

.blog-article { padding-top: 132px; padding-bottom: 80px; }
@media (max-width: 640px) { .blog-article { padding-top: 108px; } }

/* ---- Breadcrumb -------------------------------------------------------- */
.blog-breadcrumb {
  font-size: 13px;
  color: var(--ink-300);
  margin-bottom: 22px;
  font-family: 'Inter', sans-serif;
}
.blog-breadcrumb a { color: var(--ink-500); text-decoration: none; }
.blog-breadcrumb a:hover { color: var(--honey-600); }
.blog-breadcrumb span[aria-hidden] { margin: 0 6px; color: var(--ink-200); }

/* ---- Article header ---------------------------------------------------- */
.blog-eyebrow {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--honey-700);
  background: var(--honey-100);
  border: 1px solid var(--honey-200);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.blog-head h1 {
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.blog-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--ink-500);
}
.blog-byline span[aria-hidden] { color: var(--ink-200); }

/* ---- Hero image -------------------------------------------------------- */
.blog-hero-media {
  margin: 32px 0 8px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.blog-hero-media img { display: block; width: 100%; height: auto; }

/* ---- Prose (rendered Markdown) ----------------------------------------- */
.prose {
  margin-top: 36px;
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink-700);
}
.prose > *:first-child { margin-top: 0; }
.prose h2 {
  font-size: clamp(24px, 3.4vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 2.2em 0 0.6em;
  scroll-margin-top: 120px;
}
.prose h3 {
  font-size: clamp(19px, 2.6vw, 22px);
  line-height: 1.3;
  margin: 1.8em 0 0.5em;
  scroll-margin-top: 120px;
}
.prose h2 + p, .prose h3 + p { margin-top: 0; }
.prose p { margin: 0 0 1.25em; }
.prose a {
  color: var(--honey-700);
  text-decoration: underline;
  text-decoration-color: var(--honey-300);
  text-underline-offset: 2px;
  transition: color .15s ease;
}
.prose a:hover { color: var(--honey-900); text-decoration-color: var(--honey-500); }
.prose strong { color: var(--ink-900); font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 1.25em; padding-left: 1.4em; }
.prose li { margin: 0.4em 0; padding-left: 0.2em; }
.prose li::marker { color: var(--honey-500); }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 1.5em 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }

.prose blockquote {
  margin: 1.8em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--honey-300);
  color: var(--ink-500);
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-style: italic;
}
.prose blockquote p { margin: 0.4em 0; }

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.12em 0.4em;
}
.prose pre {
  background: var(--ink-900);
  color: #f4f1e8;
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
  margin: 1.6em 0;
  font-size: 14px;
  line-height: 1.6;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8em 0;
  font-size: 15px;
}
.prose th, .prose td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.prose th { background: var(--bg-soft); font-weight: 600; color: var(--ink-900); }

/* ---- Tags -------------------------------------------------------------- */
.blog-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 36px 0 0;
  padding: 0;
}
.blog-tags li {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-500);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
}

/* ---- End-of-post CTA --------------------------------------------------- */
.blog-cta {
  position: relative;
  overflow: hidden;
  margin: 48px 0 0;
  padding: 40px;
  border-radius: var(--radius-xl);
  background: var(--grad-ink);
  color: #fff;
}
.blog-cta h2 {
  color: #fff;
  font-size: clamp(23px, 3.2vw, 30px);
  line-height: 1.2;
  margin: 0 0 12px;
}
.blog-cta p { color: rgba(255,255,255,.78); font-family: 'Inter', sans-serif; font-size: 16px; line-height: 1.6; margin: 0 0 24px; max-width: 52ch; }
.blog-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 640px) { .blog-cta { padding: 28px 22px; } }

/* ---- Related posts ----------------------------------------------------- */
.blog-related { padding: 72px 0 96px; background: var(--bg-soft); border-top: 1px solid var(--line); }
.blog-related-head {
  font-size: clamp(22px, 3vw, 28px);
  margin: 0 0 28px;
  letter-spacing: -0.015em;
}

/* ---- Blog index -------------------------------------------------------- */
.blog-hero-lede { max-width: 620px; margin-left: auto; margin-right: auto; }
.blog-list { padding: 8px 0 100px; }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.blog-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.blog-card-link { display: block; padding: 26px 24px; text-decoration: none; color: inherit; height: 100%; }
.blog-card-chip {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--honey-700);
  margin-bottom: 12px;
}
.blog-card-title {
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--ink-900);
}
.blog-card:hover .blog-card-title { color: var(--honey-700); }
.blog-card-excerpt {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-500);
  margin: 0 0 18px;
}
.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--ink-300);
}
.blog-empty { text-align: center; color: var(--ink-500); font-family: 'Inter', sans-serif; padding: 40px 0; }

/* ---- Figures (Markdown images with captions) --------------------------- */
.prose-figure { margin: 2em 0; }
.prose-figure img { display: block; width: 100%; height: auto; border-radius: var(--radius); margin: 0; }
.prose-figure figcaption {
  margin-top: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-300);
  text-align: center;
}

/* ---- Charts (generated from ```chart blocks) --------------------------- */
.chart {
  margin: 2em 0;
  padding: 26px 28px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
}
.chart-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 18px;
  color: var(--ink-900);
  margin: 0 0 18px;
  line-height: 1.3;
}
.chart-bars { display: flex; flex-direction: column; gap: 14px; }
.chart-row {
  display: grid;
  grid-template-columns: minmax(90px, 34%) 1fr auto;
  align-items: center;
  gap: 14px;
}
.chart-key {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-700);
  line-height: 1.3;
}
.chart-track {
  height: 14px;
  border-radius: 999px;
  background: var(--honey-50);
  border: 1px solid var(--honey-100);
  overflow: hidden;
}
.chart-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--honey-300) 0%, var(--honey-400) 100%);
  animation: chart-grow .9s cubic-bezier(.22,.61,.36,1) both;
  transform-origin: left center;
}
.chart-fill--hi { background: linear-gradient(90deg, var(--honey-400) 0%, var(--honey-600) 100%); }
.chart-num {
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-900);
  white-space: nowrap;
}
.chart-caption, .chart-source {
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-300);
  margin: 16px 0 0;
}
.chart-source { font-style: italic; }
@keyframes chart-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .chart-fill { animation: none; } }
@media (max-width: 520px) {
  .chart { padding: 20px 18px; }
  .chart-row { grid-template-columns: 1fr auto; }
  .chart-track { grid-column: 1 / -1; order: 3; }
}

/* ---- FAQ (generated from frontmatter `faq:`) --------------------------- */
/* Accessible <details> accordion. Answers live in the DOM whether expanded or
   not, so they're fully crawlable and match the FAQPage JSON-LD. */
.blog-faq { margin: 3em 0 0; padding-top: 2.4em; border-top: 1px solid var(--line); }
/* Match .prose h2 sizing; font family/weight/color inherit the global heading. */
.blog-faq-head {
  font-size: clamp(24px, 3.4vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.8em;
  scroll-margin-top: 120px;
}
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.faq-item[open] { border-color: var(--honey-200); box-shadow: var(--shadow-sm); }
.faq-q {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink-900);
  transition: color .15s ease;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q:hover { color: var(--honey-700); }
/* Chevron that rotates down when the item is open. */
.faq-q::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: -3px;
  border-right: 2px solid var(--honey-500);
  border-bottom: 2px solid var(--honey-500);
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.faq-item[open] .faq-q::after { transform: rotate(-135deg); margin-top: 3px; }
.faq-a {
  padding: 0 20px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-700);
}
.faq-a > *:first-child { margin-top: 0; }
.faq-a > *:last-child { margin-bottom: 0; }
.faq-a p { margin: 0 0 1em; }
.faq-a a {
  color: var(--honey-700);
  text-decoration: underline;
  text-decoration-color: var(--honey-300);
  text-underline-offset: 2px;
  transition: color .15s ease;
}
.faq-a a:hover { color: var(--honey-900); text-decoration-color: var(--honey-500); }
.faq-a strong { color: var(--ink-900); font-weight: 600; }
.faq-a ul, .faq-a ol { margin: 0 0 1em; padding-left: 1.4em; }
.faq-a li { margin: 0.35em 0; }
.faq-a li::marker { color: var(--honey-500); }
@media (prefers-reduced-motion: reduce) { .faq-q::after { transition: none; } }
@media (max-width: 520px) {
  .faq-q { padding: 15px 16px; font-size: 16px; }
  .faq-a { padding: 0 16px 16px; }
}
