/* ════════════════════════════════════════════════════════════════
   blog.css — loads after assets/css/style.css
   Covers: blog index page, Phase 1 / Phase 2 / Phase 3 detail posts
   ════════════════════════════════════════════════════════════════ */

/* ── 0. CSS CUSTOM PROPERTIES & RESET ───────────────────────── */
:root {
  --nav-h:      84px;
  --blog-max:   1120px;
  --sidebar-w:  280px;
  --card-radius: 20px;
  --card-pad:   32px;
}
html { scroll-padding-top: 96px; }

/* ── 1. MOBILE NAV — div.nav-links open-state drawer ────────────
   style.css handles ul.nav-links drawer via .nav-links li a.
   post-main posts use div.nav-links > a (no li), so we add
   open-state styles for those direct-anchor children here.
   ────────────────────────────────────────────────────────────── */
@media(max-width:960px){
  div.nav-links.open > a {
    display: block;
    padding: 18px 28px;
    font-size: .95rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    color: var(--white);
    letter-spacing: .02em;
    text-decoration: none;
  }
  div.nav-links.open > a:hover,
  div.nav-links.open > a:focus { color: var(--purple); }
}

/* ── 2. BLOG INDEX HERO ──────────────────────────────────────── */
.blog-hero {
  padding: 96px 48px 40px;
  text-align: center;
  background: var(--surface);
}
.blog-hero h1 {
  font-size: clamp(1.9rem,3.4vw,2.6rem);
  font-weight: 900;
  color: #1a0050;
  margin-bottom: .75rem;
  letter-spacing: -.025em;
}
.blog-hero p {
  color: var(--gray);
  font-size: 1.05rem;
  max-width: 52ch;
  margin: 0 auto;
}
.blog-hero-kicker {
  display: inline-block;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--purple);
  margin-bottom: 12px;
}
.blog-hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}
.btn-primary-blog {
  background: var(--purple);
  color: #fff;
  padding: 11px 26px;
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 800;
  text-decoration: none;
  transition: opacity .15s;
}
.btn-primary-blog:hover { opacity: .88; }
.btn-secondary-blog {
  border: 2px solid var(--purple);
  color: var(--purple);
  padding: 9px 24px;
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 800;
  text-decoration: none;
  transition: background .15s;
}
.btn-secondary-blog:hover { background: rgba(91,33,245,.06); }

/* ── 3. FILTER BAR (JS-injected) ────────────────────────────── */
.blog-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  max-width: var(--blog-max);
  margin: 0 auto;
  padding: 0 48px 24px;
}
.blog-filter-btn {
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 700;
  padding: 6px 16px;
  background: #fff;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.blog-filter-btn:hover { border-color: var(--purple); color: var(--purple); }
.blog-filter-btn[aria-pressed="true"] {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}

/* ── 4. CARD GRID ────────────────────────────────────────────── */
.blog-grid {
  max-width: var(--blog-max);
  margin: 0 auto;
  padding: 40px 48px 96px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}
@media(min-width:1280px) {
  .blog-grid { grid-template-columns: repeat(3, 1fr); }
}
@media(min-width:600px) and (max-width:960px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

.blog-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: var(--card-pad);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: border-color .2s, box-shadow .2s;
  position: relative;
}
.blog-card:hover {
  border-color: var(--purple);
  box-shadow: inset 0 0 0 1px var(--purple), 0 8px 32px rgba(91,33,245,.14);
}
.blog-card-tag {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 10px;
}
.blog-card h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1a0050;
  line-height: 1.3;
  margin-bottom: 8px;
}
.blog-card h2::after {
  content: " →";
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .2s, transform .2s;
  display: inline-block;
}
.blog-card:hover h2::after { opacity: 1; transform: translateX(0); }
.blog-card p {
  font-size: .875rem;
  color: var(--gray);
  line-height: 1.65;
  flex: 1;
}
.blog-card-meta {
  font-size: .73rem;
  color: var(--gray);
  margin-top: 14px;
  opacity: .7;
}

/* ── 5. FEATURED STRIP ───────────────────────────────────────── */
@media(min-width:1280px) {
  .blog-card[data-featured="true"]:first-child { grid-column: span 2; }
  .blog-card[data-featured="true"]:first-child h2 { font-size: 1.3rem; }
}

/* ── 6. PILLAR BADGE ─────────────────────────────────────────── */
.blog-card[data-pillar] {
  border: 2px solid transparent;
  box-shadow: 0 0 0 2px #5b21f5, 0 0 0 4px rgba(124,58,237,.27);
}
.blog-card[data-pillar] h2 { font-size: 1.1rem; }

/* ── 7. COLOR-CODED KICKERS (specificity 0,1,1 > 0,1,0) ─────── */
.blog-card-tag[data-cat="local-seo"]         { color: #1a6535; }
.blog-card-tag[data-cat="ai-automation"]     { color: #5b21f5; }
.blog-card-tag[data-cat="gbp"]               { color: #b45309; }
.blog-card-tag[data-cat="aeo-geo"]           { color: #0369a1; }
.blog-card-tag[data-cat="whatsapp-ai"]       { color: #15803d; }
.blog-card-tag[data-cat="google-ads"]        { color: #dc2626; }
.blog-card-tag[data-cat="advanced-seo"]      { color: #1d4ed8; }
.blog-card-tag[data-cat="case-study"]        { color: #92400e; }
.blog-card-tag[data-cat="digital-marketing"] { color: #7c3aed; }
.blog-card-tag[data-cat="industry-vertical"] { color: #0e7490; }
.blog-card-tag[data-cat="thought-leadership"]{ color: #6d28d9; }
.blog-card-tag[data-cat="web-dev"]           { color: #0284c7; }

/* ── 8. FOLD / LOAD MORE ─────────────────────────────────────── */
.is-hidden-fold { display: none; }
.load-more-btn {
  display: block;
  margin: 0 auto 48px;
  padding: 12px 32px;
  border: 2px solid var(--purple);
  border-radius: 100px;
  background: #fff;
  color: var(--purple);
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.load-more-btn:hover { background: var(--purple); color: #fff; }

/* ── 9. BREADCRUMB ───────────────────────────────────────────── */
/* style.css targets all <nav> with position:fixed — override here */
.breadcrumb {
  position: static;
  left: auto;
  right: auto;
  z-index: auto;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
  font-size: .76rem;
  color: var(--gray);
  padding: calc(var(--nav-h) + 24px) 48px 0;
  max-width: var(--blog-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.5;
}
.breadcrumb a { color: var(--purple); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { opacity: .45; }

/* ── 10. PHASE 1 — ARTICLE LAYOUT (.article-body / .prose) ─── */
.article-header {
  padding: 24px 48px 40px;
  max-width: var(--blog-max);
  margin: 0 auto;
}
.article-kicker {
  display: inline-block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 14px;
}
.article-title {
  font-size: clamp(1.8rem,3.5vw,2.8rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: #1a0050;
  margin-bottom: 14px;
}
div.article-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: .78rem;
  color: var(--gray);
  flex-wrap: wrap;
}
div.article-meta span { display: flex; align-items: center; gap: 5px; }

.article-body {
  max-width: var(--blog-max);
  margin: 0 auto;
  padding: 8px 48px 80px;
  display: grid;
  grid-template-columns: 1fr 272px;
  gap: 60px;
  align-items: start;
}

/* Prose column */
.prose {
  font-size: 1.0625rem;
  line-height: 1.78;
  color: #1a0050;
  min-width: 0;
}
.prose h2 {
  font-size: clamp(1.5rem,2.4vw,1.85rem);
  font-weight: 800;
  margin: 2.5rem 0 .85rem;
  color: #1a0050;
  scroll-margin-top: 96px;
  letter-spacing: -.015em;
}
.prose h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.75rem 0 .5rem;
  color: #1a0050;
  scroll-margin-top: 96px;
}
.prose p { margin-bottom: 1.2rem; }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.prose li { margin-bottom: .4rem; }
.prose a { color: var(--purple); }
.prose a:hover { text-decoration: underline; }
.prose strong { font-weight: 800; }
.prose blockquote {
  border-left: 4px solid var(--purple);
  padding: .75rem 1rem;
  margin: 1.75rem 0;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 1.05rem;
  background: var(--surface);
  border-radius: 0 8px 8px 0;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .9rem;
}
.prose th {
  background: var(--surface);
  padding: .65rem 1rem;
  text-align: left;
  font-weight: 700;
  border-bottom: 2px solid var(--border);
}
.prose td { padding: .6rem 1rem; border-bottom: 1px solid var(--border); }
.prose tbody tr:nth-child(even) { background: var(--surface); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.5rem 0; }
.table-scroll table { margin: 0; width: 100%; }
.prose code {
  font-family: 'DM Mono', monospace;
  background: var(--surface);
  padding: .15rem .4rem;
  border-radius: 4px;
  font-size: .88em;
}
.prose pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: .88rem;
}
.prose pre code { background: none; padding: 0; }

/* Answer block */
.answer-block {
  background: #F5F1FF;
  border-left: 4px solid var(--purple);
  padding: 1.25rem 1.5rem;
  border-radius: 0 10px 10px 0;
  margin-bottom: 2rem;
  font-size: 1rem;
  line-height: 1.7;
  color: #1a0050;
}
.answer-block::before {
  content: "Quick answer";
  display: block;
  font-size: .63rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--purple);
  letter-spacing: .09em;
  margin-bottom: .5rem;
}

/* Phase 1 sidebar */
.article-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  align-self: start;
}

/* ── 11. PHASE 2 — POST-MAIN LAYOUT ─────────────────────────── */
.post-main {
  max-width: var(--blog-max);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 24px) 48px 0;
  display: grid;
  grid-template-columns: 1fr 280px;
  column-gap: 60px;
  align-items: start;
}
.post-main > .breadcrumb {
  grid-column: 1 / -1;
  padding: 0;
  max-width: none;
  margin-bottom: 28px;
}
.post-main > article {
  grid-column: 1;
  min-width: 0;
  padding-bottom: 80px;
  font-size: 1.0625rem;
  line-height: 1.78;
  color: #1a0050;
}
.post-main > article h1 {
  font-size: clamp(1.8rem,3.5vw,2.8rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: #1a0050;
  margin-bottom: 14px;
}
.post-main > article h2 {
  font-size: clamp(1.5rem,2.4vw,1.85rem);
  font-weight: 800;
  margin: 2.5rem 0 .85rem;
  color: #1a0050;
  scroll-margin-top: 96px;
  letter-spacing: -.015em;
}
.post-main > article h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.75rem 0 .5rem;
  color: #1a0050;
  scroll-margin-top: 96px;
}
.post-main > article p { margin-bottom: 1.2rem; }
.post-main > article ul, .post-main > article ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.post-main > article li { margin-bottom: .4rem; }
.post-main > article a { color: var(--purple); }
.post-main > article a:hover { text-decoration: underline; }
.post-main > article strong { font-weight: 800; }
.post-main > article blockquote {
  border-left: 4px solid var(--purple);
  padding: .75rem 1rem;
  margin: 1.75rem 0;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 1.05rem;
  background: var(--surface);
  border-radius: 0 8px 8px 0;
}
.post-main > article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .9rem;
  display: block;
  overflow-x: auto;
}
.post-main > article thead { display: table-header-group; }
.post-main > article tbody { display: table-row-group; }
.post-main > article tr   { display: table-row; }
.post-main > article th {
  background: var(--surface);
  padding: .65rem 1rem;
  text-align: left;
  font-weight: 700;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.post-main > article td { padding: .6rem 1rem; border-bottom: 1px solid var(--border); }
.post-main > article tbody tr:nth-child(even) { background: var(--surface); }
.post-main > article code {
  font-family: 'DM Mono', monospace;
  background: var(--surface);
  padding: .15rem .4rem;
  border-radius: 4px;
  font-size: .88em;
}
.post-main > article pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: .88rem;
}
.post-main > article pre code { background: none; padding: 0; }
.post-main > aside.blog-sidebar {
  grid-column: 2;
  grid-row: 2;
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  align-self: start;
}
.post-main .article-header { padding: 0; max-width: none; margin: 0 0 28px; }
.article-tag {
  display: inline-block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 14px;
}

/* ── 12. PHASE 3 — POST-WRAP LAYOUT ─────────────────────────── */
.post-wrap {
  max-width: var(--blog-max);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 24px) 48px 0;
  display: grid;
  grid-template-columns: 1fr 280px;
  column-gap: 60px;
  align-items: start;
}
.post-wrap > .breadcrumb,
.post-wrap > nav.breadcrumb {
  grid-column: 1 / -1;
  padding: 0;
  max-width: none;
  margin-bottom: 28px;
}
.post-wrap > article {
  grid-column: 1;
  min-width: 0;
  padding-bottom: 80px;
  line-height: 1.82;
  font-size: 1.02rem;
  color: #1a0050;
}
.post-wrap > aside.sidebar {
  grid-column: 2;
  grid-row: 2 / span 4;
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: start;
}
.post-wrap > section.author-block,
.post-wrap > section.faq-section,
.post-wrap > nav.related-posts { grid-column: 1; min-width: 0; }
.post-wrap .article-header { padding: 0; max-width: none; margin: 0 0 28px; }

.post-tag {
  display: inline-block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 14px;
}
.post-meta { font-size: .78rem; color: var(--gray); margin-top: 4px; display: block; }

.post-wrap article h1 {
  font-size: clamp(1.8rem,3.5vw,2.8rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: #1a0050;
  margin-bottom: 14px;
}
.post-wrap article h2 {
  font-size: clamp(1.5rem,2.4vw,1.85rem);
  font-weight: 800;
  margin: 2.25rem 0 .75rem;
  color: #1a0050;
  letter-spacing: -.015em;
  scroll-margin-top: 96px;
}
.post-wrap article h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.75rem 0 .5rem;
  color: #1a0050;
  scroll-margin-top: 96px;
}
.post-wrap article > p { margin-bottom: 1.2rem; }
.post-wrap article ul,
.post-wrap article ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.post-wrap article > ul > li,
.post-wrap article > ol > li { margin-bottom: .4rem; }
.post-wrap article > p a { color: var(--purple); }
.post-wrap article > p a:hover { text-decoration: underline; }
.post-wrap article strong { font-weight: 800; }
.post-wrap article blockquote {
  border-left: 4px solid var(--purple);
  padding: .75rem 1rem;
  margin: 1.75rem 0;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 1.05rem;
  background: var(--surface);
  border-radius: 0 8px 8px 0;
}
.post-wrap article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .9rem;
  display: block;
  overflow-x: auto;
}
.post-wrap article thead { display: table-header-group; }
.post-wrap article tbody { display: table-row-group; }
.post-wrap article tr   { display: table-row; }
.post-wrap article th {
  background: var(--surface);
  padding: .65rem 1rem;
  text-align: left;
  font-weight: 700;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.post-wrap article td { padding: .6rem 1rem; border-bottom: 1px solid var(--border); }
.post-wrap article tbody tr:nth-child(even) { background: var(--surface); }
.post-wrap article code {
  font-family: 'DM Mono', monospace;
  background: var(--surface);
  padding: .15rem .4rem;
  border-radius: 4px;
  font-size: .88em;
}
.post-wrap article pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: .88rem;
}
.post-wrap article pre code { background: none; padding: 0; }

/* ── 13. SIDEBAR CARDS (all layouts) ────────────────────────── */
.sidebar-cta {
  background: linear-gradient(135deg,#5b21f5,#7c3aed);
  border: none;
  border-radius: 14px;
  padding: 24px;
  color: #fff;
  text-align: center;
  display: block;
  text-decoration: none;
  margin-bottom: 16px;
}
.sidebar-cta-title {
  font-size: .78rem;
  font-weight: 800;
  color: rgba(255,255,255,.85);
  text-transform: uppercase;
  letter-spacing: .06em;
  display: block;
  margin-bottom: 8px;
}
.sidebar-cta p { font-size: .78rem; color: rgba(255,255,255,.8); line-height: 1.55; margin-bottom: 16px; }
.sidebar-cta-btn {
  display: inline-block;
  background: #fff;
  color: var(--purple);
  padding: 9px 22px;
  border-radius: 100px;
  font-size: .76rem;
  font-weight: 800;
  text-decoration: none;
}
.sidebar-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}
.sidebar-box-title {
  font-size: .78rem;
  font-weight: 800;
  color: #1a0050;
  text-transform: uppercase;
  letter-spacing: .06em;
  display: block;
  margin-bottom: 12px;
}
.sidebar-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-box ul li a {
  font-size: .82rem;
  color: var(--purple);
  text-decoration: none;
  line-height: 1.4;
}
.sidebar-box ul li a::before { content: "› "; }
.sidebar-box ul li a:hover { text-decoration: underline; }

/* Post-wrap sidebar blocks */
.sidebar-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.sidebar-title {
  font-size: .8rem;
  font-weight: 800;
  color: #1a0050;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  display: block;
}
.sidebar-block:first-of-type {
  background: linear-gradient(135deg,#5b21f5,#7c3aed);
  border-color: transparent;
}
.sidebar-block:first-of-type .sidebar-title { color: #fff; opacity: .87; }
.sidebar-block:first-of-type > p {
  font-size: .8rem;
  color: rgba(255,255,255,.85);
  line-height: 1.55;
  margin-bottom: 16px;
}
a.sidebar-cta-link {
  display: inline-block;
  background: #fff;
  color: var(--purple) !important;
  padding: 10px 22px;
  border-radius: 100px;
  font-size: .76rem;
  font-weight: 800;
  text-decoration: none !important;
}
a.sidebar-cta-link:hover { background: #f0ebff; }

ul.sidebar-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
ul.sidebar-links li a {
  font-size: .82rem;
  color: var(--purple);
  text-decoration: none;
  line-height: 1.4;
}
ul.sidebar-links li a::before { content: "› "; }
ul.sidebar-links li a:hover { text-decoration: underline; }

/* ── 14. READING PROGRESS BAR ────────────────────────────────── */
.reading-bar {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--purple2));
  z-index: 199;
  transition: width .1s linear;
  pointer-events: none;
}

/* ── 15. TABLE OF CONTENTS ───────────────────────────────────── */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
}
.toc-title {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray);
  display: block;
  margin-bottom: 10px;
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.toc li {
  border-left: 2px solid transparent;
  padding-left: 8px;
  transition: border-color .15s;
}
.toc li.toc-active { border-left-color: var(--purple); }
.toc a {
  font-size: .81rem;
  color: var(--gray);
  text-decoration: none;
  line-height: 1.45;
  display: block;
}
.toc a:hover { color: var(--purple); }
.toc li[data-level="3"] { padding-left: 20px; }

/* ── 16. SHARE ROW ───────────────────────────────────────────── */
.share-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 28px 0 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.share-btn {
  padding: 7px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--gray);
  transition: border-color .15s, color .15s;
}
.share-btn:hover { border-color: var(--purple); color: var(--purple); }
.share-btn--copy.copied { color: #15803d; border-color: #15803d; }

/* ── 17. FOOTER CTA BAND ─────────────────────────────────────── */
.footer-cta-band {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 48px;
  text-align: center;
}
.footer-cta-label {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1a0050;
  margin-bottom: 14px;
  display: block;
}

/* ── 18. AUTHOR BLOCK ────────────────────────────────────────── */
.author-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 2rem 0;
}
div.author-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg,#5b21f5,#7c3aed);
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.author-name { font-weight: 800; color: #1a0050; font-size: .92rem; }
.author-bio { font-size: .82rem; color: var(--gray); line-height: 1.55; margin-top: 4px; }

/* ── 19. FAQ SECTION ─────────────────────────────────────────── */
.faq-section { margin: 2rem 0; }
.faq-section > h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1a0050;
  margin-bottom: 1.25rem;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 12px;
}
.faq-q { font-size: .95rem; font-weight: 800; color: #1a0050; margin-bottom: 8px; }
.faq-a { font-size: .875rem; color: var(--gray); line-height: 1.6; }
.faq-a a { color: var(--purple); }

/* ── 20. RELATED POSTS ───────────────────────────────────────── */
.related-posts { margin: 2rem 0; }
.related-posts h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1a0050;
  margin-bottom: 1rem;
}
.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.related-list li a {
  font-size: .88rem;
  color: var(--purple);
  text-decoration: none;
}
.related-list li a::before { content: "→ "; }
.related-list li a:hover { text-decoration: underline; }
.related-posts ul:not(.related-list) {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.related-posts ul:not(.related-list) li a {
  font-size: .88rem;
  color: var(--purple);
  text-decoration: none;
}
.related-posts ul:not(.related-list) li a::before { content: "→ "; }
.related-posts ul:not(.related-list) li a:hover { text-decoration: underline; }

/* Post-wrap related grid */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 4px;
}
.related-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  text-decoration: none;
  transition: box-shadow .2s, transform .2s;
}
.related-card:hover {
  box-shadow: 0 6px 24px rgba(91,33,245,.1);
  transform: translateY(-2px);
}
.related-tag {
  display: inline-block;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 8px;
}
.related-title { font-size: .87rem; font-weight: 700; color: #1a0050; line-height: 1.35; }

/* ── 21. BLOG FOOTER ─────────────────────────────────────────── */
.blog-footer {
  background: #0c0023;
  color: rgba(255,255,255,.6);
  padding: 36px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: .78rem;
  margin-top: auto;
}
.blog-footer a { color: rgba(255,255,255,.6); text-decoration: none; }
.blog-footer a:hover { color: #fff; }
.blog-footer-links { display: flex; gap: 20px; }

/* ── 22. MOBILE SIDEBAR (details/summary) ────────────────────── */
.sidebar-details {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
  background: var(--surface);
}
.sidebar-details summary {
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #1a0050;
  cursor: pointer;
  list-style: none;
}
.sidebar-details summary::after { content: " ▾"; }
.sidebar-details[open] summary::after { content: " ▴"; }

/* ── 23. BACK-TO-BLOG PILL (mobile) ──────────────────────────── */
.back-to-blog-pill {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a0050;
  color: #fff;
  padding: 10px 22px;
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
  z-index: 200;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  white-space: nowrap;
}

/* ── 24. RESPONSIVE ≤960px ───────────────────────────────────── */
@media(max-width:960px){
  /* Phase 1 */
  .breadcrumb { position:static; left:auto; right:auto; z-index:auto; background:transparent; backdrop-filter:none; border-bottom:none; padding: calc(var(--nav-h) + 12px) 20px 0; }
  .article-header { padding: 16px 20px 28px; }
  .article-body { grid-template-columns: 1fr; padding: 0 20px 60px; gap: 36px; }
  .article-sidebar { position: static; top: auto; }

  /* Phase 2 */
  .post-main { grid-template-columns: 1fr; padding: 0 20px 0; column-gap: 0; }
  .post-main > .breadcrumb { padding-top: calc(var(--nav-h) + 12px); margin-bottom: 16px; }
  .post-main > article { padding-bottom: 48px; }
  .post-main > aside.blog-sidebar { position: static; grid-column: auto; grid-row: auto; margin-bottom: 48px; top: auto; }

  /* Phase 3 */
  .post-wrap { grid-template-columns: 1fr; padding: 0 20px 0; column-gap: 0; }
  .post-wrap > .breadcrumb,
  .post-wrap > nav.breadcrumb { padding-top: calc(var(--nav-h) + 12px); margin-bottom: 16px; }
  .post-wrap > article { padding-bottom: 48px; }
  .post-wrap > aside.sidebar { position: static; grid-column: auto; grid-row: auto; margin-bottom: 48px; top: auto; }
  .post-wrap > section.author-block,
  .post-wrap > section.faq-section,
  .post-wrap > nav.related-posts { grid-column: auto; }

  /* Blog index */
  .blog-grid { grid-template-columns: 1fr; padding: 28px 20px 60px; }
  .blog-filter-bar { padding: 0 20px 20px; }
  .blog-hero { padding: calc(var(--nav-h) + 20px) 20px 32px; }

  /* Footer */
  .blog-footer { padding: 28px 20px; flex-direction: column; text-align: center; }
  .blog-footer-links { justify-content: center; flex-wrap: wrap; }
  .footer-cta-band { padding: 32px 20px; }

  /* Related grid */
  .related-grid { grid-template-columns: 1fr; }
}

/* ── 25. RESPONSIVE ≤600px ───────────────────────────────────── */
@media(max-width:600px){
  .answer-block { padding: 1rem 1.15rem; font-size: .95rem; }
  .article-title,
  .post-main > article h1,
  .post-wrap article h1 { font-size: clamp(1.45rem,6vw,1.9rem); }
  .prose h2,
  .post-main > article h2,
  .post-wrap article h2 { font-size: 1.25rem; }
  .prose table,
  .post-main > article table,
  .post-wrap article table { font-size: .8rem; }
  .prose th,.prose td,
  .post-main > article th,.post-main > article td,
  .post-wrap article th,.post-wrap article td { padding: .5rem .65rem; }
  .blog-card { padding: 20px; }
  .share-row { gap: 8px; }
}

/* ── 26. ACCESSIBILITY + REDUCED MOTION ──────────────────────── */
:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }

@media(prefers-reduced-motion:reduce){
  .blog-card,
  .blog-card h2::after,
  .reading-bar,
  .toc li,
  .related-card,
  .load-more-btn,
  .share-btn { transition: none !important; animation: none !important; }
}
