/* ============================================================================
   blog.css — styles specific to /blog/ and blog article pages.
   Load AFTER style.css. Only contains blog-unique rules.
   ============================================================================ */

/* ─── Blog hero ───────────────────────────────────────────────────────────── */
.blog-hero {
  padding: 48px 0 36px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.blog-hero h1 {
  font-size: clamp(28px, 4.2vw, 42px);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin-bottom: 12px;
}
.blog-hero p {
  font-size: 15px;
  color: var(--text-2);
  max-width: 540px;
  line-height: 1.7;
}
.blog-count {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 10px;
}

/* ─── Article list ────────────────────────────────────────────────────────── */
.article-list { display: flex; flex-direction: column; gap: 0; }

.article-item {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  align-items: center;
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
}
.article-item.reverse { grid-template-columns: 280px 1fr; }
.article-item.reverse .article-thumb { order: 0; }
.article-item.reverse .article-body { order: 1; }

@media (max-width: 720px) {
  .article-item, .article-item.reverse {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .article-thumb { order: -1 !important; }
}

.article-body .meta {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}
.article-body .meta .category {
  color: var(--accent);
  font-weight: 600;
}
.article-body h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.3;
  margin-bottom: 10px;
}
.article-body h2 a { color: var(--text); }
.article-body h2 a:hover { color: var(--accent); text-decoration: none; }
.article-body .excerpt {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 12px;
}
.article-body .read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}
.article-body .read-more svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: transform .15s;
}
.article-body .read-more:hover svg { transform: translateX(3px); }

.article-thumb {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
  position: relative;
  overflow: hidden;
}

/* ─── Blog article page ───────────────────────────────────────────────────── */
.article-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px 60px;
}
.article-header {
  padding: 44px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.breadcrumb {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 6px; opacity: .6; }

.article-meta {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 14px;
}
.article-meta .category {
  color: var(--accent);
  font-weight: 600;
  margin-right: 8px;
}

.article-header h1 {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.25;
  margin-bottom: 14px;
}
.article-lede {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 8px;
}

.article-body h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.018em;
  margin: 36px 0 12px;
  color: var(--text);
}
.article-body h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--text);
}
.article-body p {
  font-size: 15px;
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 14px;
}
.article-body ul, .article-body ol {
  margin: 0 0 14px 22px;
}
.article-body li {
  font-size: 15px;
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 6px;
}
.article-body li strong { color: var(--text); font-weight: 600; }
.article-body strong { font-weight: 600; }
.article-body em { font-style: italic; color: var(--text-2); }

.article-body code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text);
}
.article-body pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  margin-bottom: 16px;
}
.article-body pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.55;
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 16px;
  margin: 20px 0;
  color: var(--text-2);
  font-style: italic;
}

/* Step / callout boxes used in tutorials */
.step-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 16px 0;
}
.step-box .step-n {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 3px 8px;
  border-radius: 99px;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.step-box h3 { margin-top: 6px; margin-bottom: 4px; font-size: 15px; }

.callout {
  background: var(--blue-bg);
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 18px 0;
}
.callout p { margin: 0; color: var(--blue-text); font-size: 14px; line-height: 1.7; }
.callout.warning { background: var(--orange-bg); border-color: var(--orange); }
.callout.warning p { color: var(--orange-text); }

/* CTA inside article pointing to the tool */
.article-cta {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  text-align: center;
  margin: 32px 0;
}
.article-cta h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #fff;
}
.article-cta p { color: rgba(255,255,255,.9); font-size: 14px; margin-bottom: 14px; line-height: 1.6; }
.article-cta a {
  display: inline-block;
  background: #fff;
  color: var(--accent);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
}
.article-cta a:hover { background: var(--accent-bg); text-decoration: none; }

/* Related articles */
.related-articles {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.related-articles h2 {
  font-size: 15px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  margin-bottom: 16px;
}
.related-articles ul { list-style: none; margin: 0; padding: 0; }
.related-articles li { margin-bottom: 8px; }
.related-articles a {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: var(--accent);
  line-height: 1.5;
}
.related-articles a:hover { text-decoration: underline; }

/* ============================================================================
   Article tables — responsive comparison & data tables
   ============================================================================
   Markup patterns supported:
     <table class="comparison-table"> ... </table>
     <div class="table-scroll"><table class="comparison-table">...</table></div>

   The wrapper `.table-scroll` gives horizontal-scroll on narrow viewports
   without squishing table cells. The raw .comparison-table still looks
   correct on desktop even without the wrapper.
   ============================================================================ */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 20px 0 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.article-body .comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.55;
  margin: 20px 0 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-scroll .comparison-table {
  margin: 0;
  border: none;
  border-radius: 0;
  min-width: 540px; /* forces scroll on mobile rather than squeezing cells */
}

.article-body .comparison-table thead th,
.article-body .comparison-table tr:first-child th {
  background: var(--accent-bg);
  color: var(--accent-text);
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.article-body .comparison-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}
.article-body .comparison-table tr:last-child td { border-bottom: none; }
.article-body .comparison-table tr:nth-child(even) td { background: var(--surface-2); }
.article-body .comparison-table tr:hover td { background: var(--accent-bg); }

/* First column (label column) — slightly heavier so it reads as a row header */
.article-body .comparison-table td:first-child {
  font-weight: 600;
  color: var(--text);
}

/* Positive / negative cell styling — any cell containing ✓ or ✗ gets tone */
.article-body .comparison-table td:has(> :is()),
.article-body .comparison-table td { /* fallback: no :has, rely on content */ }

/* Mobile: keep table scrollable, don't shrink text below 13px */
@media (max-width: 640px) {
  .article-body .comparison-table { font-size: 13px; min-width: 520px; }
  .article-body .comparison-table thead th,
  .article-body .comparison-table tr:first-child th,
  .article-body .comparison-table td { padding: 10px 12px; }
}

/* ============================================================================
   Step-box enhancements — bigger number badge, clearer hierarchy
   ============================================================================ */
.step-box {
  position: relative;
  padding: 18px 20px 16px 60px; /* left padding reserves space for the number */
}
.step-box .step-n {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  margin: 0;
}
.step-box h3 {
  margin-top: 0 !important;
  margin-bottom: 6px !important;
  font-size: 16px;
  color: var(--accent-text);
}
.step-box p:last-child { margin-bottom: 0; }

/* Inline "Step N" label variant — for when you don't want the full box */
.article-body .step-inline {
  display: inline-block;
  background: var(--accent-bg);
  color: var(--accent-text);
  font-family: var(--mono, monospace);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 10px;
  border-radius: 99px;
  margin-right: 8px;
  vertical-align: middle;
}

/* ============================================================================
   Enhanced callouts — info / warning / tip / success variants
   ============================================================================ */
.callout {
  position: relative;
  padding-left: 46px; /* space for icon */
}
.callout::before {
  content: "i";
  position: absolute;
  top: 14px;
  left: 14px;
  width: 22px;
  height: 22px;
  border-radius: 99px;
  background: var(--blue);
  color: #fff;
  font-family: var(--mono, monospace);
  font-size: 13px;
  font-weight: 700;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
}
.callout.warning::before { content: "!"; background: var(--orange); font-style: normal; }
.callout.tip::before     { content: "✦"; background: var(--accent); font-style: normal; }
.callout.success::before { content: "✓"; background: var(--accent); font-style: normal; }

.callout.tip     { background: var(--accent-bg); border-color: var(--accent); }
.callout.tip p   { color: var(--accent-text); }
.callout.success { background: var(--accent-bg); border-color: var(--accent); }
.callout.success p { color: var(--accent-text); }

/* ============================================================================
   Pull quote — for emphasis within long-form articles
   ============================================================================ */
.article-body .pullquote {
  font-size: 20px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--text);
  border-left: 4px solid var(--accent);
  padding: 8px 0 8px 20px;
  margin: 28px 0;
  font-style: normal;
}
.article-body .pullquote cite {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  font-style: normal;
  margin-top: 8px;
  letter-spacing: .02em;
}

/* ============================================================================
   Key takeaways block — end-of-section summary
   ============================================================================ */
.article-body .key-takeaways {
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 24px 0;
}
.article-body .key-takeaways h4 {
  font-family: var(--mono, monospace);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-text);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 10px;
}
.article-body .key-takeaways ul {
  margin: 0 0 0 18px;
}
.article-body .key-takeaways li {
  color: var(--accent-text);
  font-size: 14px;
  margin-bottom: 6px;
}
.article-body .key-takeaways li:last-child { margin-bottom: 0; }

/* ============================================================================
   Stronger paragraph emphasis + lead paragraph
   ============================================================================ */
.article-body p strong {
  color: var(--text);
  font-weight: 700;
}
.article-body p em {
  color: var(--accent-text);
  font-style: italic;
}
.article-body .lead {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 22px;
}

/* Stronger section headings — a subtle accent underline */
.article-body h2 {
  position: relative;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.article-body h2::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--accent);
}

/* Subtle dark-mode hardening for the new components (inherits tokens but
   tables need explicit hover contrast) */
html[data-theme="dark"] .article-body .comparison-table tr:hover td {
  background: rgba(26, 107, 74, 0.12);
}

/* ============================================================================
   FAQ section — used at the bottom of every article
   ============================================================================ */
.article-body .faq-section {
  margin: 36px 0 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.article-body .faq-section > h2 {
  font-size: 20px;
  margin-top: 0;
  margin-bottom: 18px;
}
.article-body .faq-item {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.article-body .faq-item:last-child { border-bottom: none; }
.article-body .faq-item h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
  position: relative;
  padding-left: 18px;
}
.article-body .faq-item h3::before {
  content: "?";
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  color: var(--accent);
  font-weight: 700;
}
.article-body .faq-item p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-2);
  margin: 0;
}
