/* ────────────────────────────────────────────────────────────────
   Blog — extends ../style.css (tokens, base, nav, footer already defined)
   ──────────────────────────────────────────────────────────────── */

/* ── Breadcrumb ───────────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--brand); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--muted-2); }

/* ── Article header ───────────────────────────────────────────── */
.article-header {
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line-2);
  padding: 56px 24px 48px;
}
.article-header .wrap-narrow { max-width: 820px; margin: 0 auto; }
.article-category {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 16px;
}
.article-category.cat-comparison { color: #8b5cf6; }
.article-category.cat-tutorial   { color: var(--ok); }
.article-category.cat-editorial  { color: var(--warn); }

.article-header h1 {
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.15; letter-spacing: -.025em;
}
.article-meta {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 20px; font-size: 13px; color: var(--muted);
}
.article-meta .author { display: flex; align-items: center; gap: 8px; }
.author-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, #6b87ff 100%);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.article-meta .divider { color: var(--line); }

/* ── Blog layout ──────────────────────────────────────────────── */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 56px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 64px 24px 80px;
  align-items: start;
}

/* ── Prose ────────────────────────────────────────────────────── */
.prose { color: var(--ink-2); font-size: 17px; line-height: 1.75; }
.prose > *:first-child { margin-top: 0 !important; }

.prose h2 {
  font-size: clamp(20px, 2.2vw, 26px);
  color: var(--ink);
  margin: 2.6em 0 .7em;
  letter-spacing: -.02em;
  padding-top: .6em;
  border-top: 1px solid var(--line-2);
}
.prose h3 {
  font-size: 18px; color: var(--ink);
  margin: 2em 0 .5em; letter-spacing: -.015em;
}
.prose p { margin: 0 0 1.15em; }
.prose ul, .prose ol { padding-left: 1.5em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; line-height: 1.65; }
.prose li ul, .prose li ol { margin-top: .4em; margin-bottom: .4em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--brand-600); }

.prose blockquote {
  border-left: 3px solid var(--brand);
  background: var(--brand-50);
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.8em 0; color: var(--ink-2);
}
.prose blockquote p { margin: 0; font-style: italic; }

.prose code {
  font-family: var(--font-mono); font-size: .85em;
  background: var(--bg-alt); padding: 2px 6px;
  border-radius: 4px; color: var(--brand-700);
}
.prose pre {
  background: var(--ink); color: #e8ebf5;
  border-radius: var(--radius); padding: 20px 24px;
  font-family: var(--font-mono); font-size: 14px; line-height: 1.6;
  overflow-x: auto; margin: 1.8em 0;
}
.prose pre code { background: none; padding: 0; color: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--line-2); margin: 2.4em 0; }

/* Comparison table */
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 1.8em 0; }
.prose th {
  background: var(--bg-alt); text-align: left; font-weight: 600; color: var(--ink);
  padding: 10px 14px; border-bottom: 2px solid var(--line); font-size: 13px;
}
.prose td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose tr:hover td { background: var(--bg-soft); }
.prose .check { color: var(--ok); font-weight: 700; }
.prose .cross { color: #e53e3e; font-weight: 700; }
.prose .partial { color: var(--warn); font-weight: 700; }

/* Callout boxes */
.callout {
  border-radius: var(--radius); padding: 18px 20px;
  margin: 1.8em 0; display: flex; gap: 14px; align-items: flex-start;
}
.callout-tip  { background: var(--brand-50); border: 1px solid var(--brand-100); }
.callout-warn { background: #fff8ec; border: 1px solid #f5d68a; }
.callout-ok   { background: #e8f6ef; border: 1px solid #a8dfc8; }
.callout-icon { font-size: 20px; line-height: 1; flex-shrink: 0; margin-top: 1px; }
.callout-body { font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.callout-body strong { color: var(--ink); }
.callout-body p { margin: 0; }

/* Step list */
.step-list { list-style: none; padding: 0; margin: 1.6em 0; counter-reset: step; }
.step-list li {
  counter-increment: step;
  display: flex; gap: 16px; margin-bottom: 1.4em; align-items: flex-start;
}
.step-list li::before {
  content: counter(step);
  min-width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 700;
  display: grid; place-items: center; flex-shrink: 0; margin-top: 2px;
}
.step-content { flex: 1; }
.step-content strong { color: var(--ink); display: block; margin-bottom: 4px; font-size: 16px; }

/* Answer box (direct answer at top) */
.answer-box {
  background: var(--brand-50); border: 1px solid var(--brand-100);
  border-radius: var(--radius); padding: 20px 24px; margin-bottom: 2em;
}
.answer-box-label {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 8px;
}
.answer-box p { margin: 0; font-size: 16px; color: var(--ink-2); line-height: 1.6; }
.answer-box strong { color: var(--ink); }

/* ── FAQ section ─────────────────────────────────────────────── */
.faq-section { margin-top: 3.5em; }
.faq-section h2 { border-top: 0; padding-top: 0; }
.faq-item { border-bottom: 1px solid var(--line-2); }
.faq-item:last-child { border-bottom: 0; }
.faq-q {
  font-weight: 600; color: var(--ink); font-size: 16px;
  cursor: pointer; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  background: none; border: 0; text-align: left; width: 100%;
  padding: 18px 0; font-family: inherit; line-height: 1.4;
}
.faq-icon {
  color: var(--brand); font-size: 22px; flex-shrink: 0; line-height: 1;
  transition: transform .2s ease;
}
.faq-a { display: none; padding-bottom: 18px; color: var(--ink-2); font-size: 15px; line-height: 1.65; }
.faq-item.open .faq-a { display: block; }
.faq-item.open .faq-icon { transform: rotate(45deg); }

/* ── Tags ─────────────────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center;
  padding: 4px 12px; background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: 99px; font-size: 12px; font-weight: 500; color: var(--ink-2);
  text-decoration: none; white-space: nowrap;
}
.tag:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line-2); }

/* ── Related articles ────────────────────────────────────────── */
.related-section { border-top: 1px solid var(--line-2); padding: 48px 0 80px; margin-top: 0; }
.related-section h3 { font-size: 22px; margin-bottom: 28px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.related-card {
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  overflow: hidden; transition: transform .2s ease, box-shadow .2s ease;
  display: flex; flex-direction: column;
}
.related-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.related-card-stripe {
  height: 6px;
  background: linear-gradient(90deg, var(--brand) 0%, #6b87ff 100%);
}
.related-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.related-card-category {
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 8px;
}
.related-card h4 { font-size: 15px; line-height: 1.35; margin-bottom: 8px; }
.related-card h4 a { color: var(--ink); }
.related-card h4 a:hover { color: var(--brand); }
.related-card p { font-size: 13px; color: var(--muted); line-height: 1.5; flex: 1; margin: 0 0 12px; }
.related-card-read {
  font-size: 13px; font-weight: 600; color: var(--brand);
  display: inline-flex; align-items: center; gap: 4px;
  text-decoration: none; margin-top: auto;
}
.related-card-read:hover { color: var(--brand-600); }

/* ── Sidebar ─────────────────────────────────────────────────── */
.blog-sidebar { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 20px; }

.sidebar-widget {
  background: var(--bg); border: 1px solid var(--line-2);
  border-radius: var(--radius-lg); padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.sidebar-widget-title {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted-2); margin-bottom: 14px;
}
.sidebar-cta {
  background: linear-gradient(140deg, var(--brand) 0%, #6b87ff 100%);
  border: 0; border-radius: var(--radius-lg); padding: 28px 24px;
  color: #fff; text-align: center; box-shadow: var(--shadow-blue);
}
.sidebar-cta h4 { color: #fff; font-size: 17px; margin-bottom: 8px; letter-spacing: -.015em; }
.sidebar-cta p { color: rgba(255,255,255,.8); font-size: 14px; margin: 0 0 20px; line-height: 1.5; }
.sidebar-cta .btn { width: 100%; justify-content: center; }

.sidebar-toc { display: flex; flex-direction: column; gap: 2px; }
.sidebar-toc a {
  font-size: 13px; color: var(--ink-2); padding: 6px 10px;
  border-radius: 8px; display: block; line-height: 1.35;
  text-decoration: none; transition: all .12s ease;
}
.sidebar-toc a:hover { background: var(--bg-alt); color: var(--brand); }
.sidebar-toc a.active { color: var(--brand); background: var(--brand-50); font-weight: 500; }
.sidebar-toc a.h3 { padding-left: 20px; font-size: 12px; }

.sidebar-posts { display: flex; flex-direction: column; gap: 16px; }
.sidebar-post a { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.35; text-decoration: none; }
.sidebar-post a:hover { color: var(--brand); }
.sidebar-post-meta { font-size: 12px; color: var(--muted-2); margin-top: 3px; }

/* ── Blog listing (index.html) ───────────────────────────────── */
.blog-hero {
  padding: 72px 24px 64px;
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line-2); text-align: center;
}
.blog-hero .eyebrow { margin-bottom: 20px; }
.blog-hero h1 { font-size: clamp(32px, 4.2vw, 52px); margin-bottom: 16px; }
.blog-hero p { font-size: 18px; color: var(--muted); max-width: 560px; margin: 0 auto; line-height: 1.6; }

.blog-filters {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  margin: 40px auto 0; padding: 0 24px;
}
.blog-filter-btn {
  padding: 8px 20px; border-radius: 99px; border: 1px solid var(--line);
  background: #fff; font-size: 14px; font-weight: 500; color: var(--ink-2);
  cursor: pointer; font-family: inherit; transition: all .15s ease;
}
.blog-filter-btn:hover { border-color: var(--brand); color: var(--brand); }
.blog-filter-btn.active { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }

.blog-section { padding: 56px 0 96px; }
.blog-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 24px; max-width: 1160px; margin: 48px auto 0; padding: 0 24px;
}

.blog-card {
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  overflow: hidden; transition: transform .2s ease, box-shadow .2s ease;
  display: flex; flex-direction: column; text-decoration: none;
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.blog-card-banner {
  height: 156px; display: flex; align-items: center; justify-content: center;
  font-size: 36px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--brand) 0%, #6b87ff 100%);
}
.blog-card-banner.cat-comparison { background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%); }
.blog-card-banner.cat-editorial  { background: linear-gradient(135deg, #d97706 0%, #fbbf24 100%); }
.blog-card-banner.cat-tutorial   { background: linear-gradient(135deg, #059669 0%, #34d399 100%); }
.blog-card-banner::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 24px 24px;
}
.blog-card-banner-icon { position: relative; z-index: 1; }

.blog-card-body { padding: 20px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.blog-card-category-label {
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  margin-bottom: 10px;
}
.blog-card-category-label.cat-comparison { color: #7c3aed; }
.blog-card-category-label.cat-editorial  { color: #d97706; }
.blog-card-category-label.cat-tutorial   { color: var(--ok); }
.blog-card h2 { font-size: 17px; line-height: 1.35; margin-bottom: 10px; color: var(--ink); }
.blog-card p { font-size: 14px; color: var(--muted); line-height: 1.55; flex: 1; margin: 0 0 16px; }
.blog-card-meta { display: flex; gap: 12px; font-size: 12px; color: var(--muted-2); margin-top: auto; }

/* Featured card (first item) */
.blog-card.featured { grid-column: span 2; }
.blog-card.featured .blog-card-banner { height: 200px; font-size: 48px; }
.blog-card.featured h2 { font-size: 21px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .blog-layout { grid-template-columns: 1fr 260px; gap: 40px; }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-card.featured { grid-column: span 2; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .blog-layout { grid-template-columns: 1fr; padding: 40px 20px 60px; }
  .blog-sidebar { position: static; display: flex; flex-direction: column; gap: 16px; }
  .blog-sidebar .sidebar-widget:has(.sidebar-toc) { display: none; }
  .related-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; padding: 0 16px; }
  .blog-card.featured { grid-column: span 1; }
  .blog-card.featured .blog-card-banner { height: 156px; }
  .article-header { padding: 40px 20px 36px; }
  .article-header h1 { font-size: clamp(24px, 6vw, 32px); }
}
