/* =============================================================================
   Editorial article styles — premium SaaS blog (Linear / Vercel / Descript vibe)
   Self-contained. No dependencies on blog.css or admin styles.
   Pair with style.css (container + Inter font already loaded site-wide).
   ============================================================================= */

:root {
  --ba-bg: #fafaf9;
  --ba-surface: #ffffff;
  --ba-text: #0f172a;
  --ba-text-soft: #334155;
  --ba-muted: #64748b;
  --ba-border: #e5e7eb;
  --ba-border-soft: #f1f5f9;
  --ba-primary: #6d28d9;
  --ba-primary-soft: #f5f3ff;
  --ba-primary-line: #ddd6fe;
  --ba-accent: #4338ca;
  --ba-dark: #0b1020;
  --ba-radius: 14px;
}

body.ba-body {
  background: var(--ba-bg);
  color: var(--ba-text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}

main.ba-main {
  padding: 28px 0 64px;
}

/* --- Back link --------------------------------------------------------------- */
.ba-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ba-muted);
  text-decoration: none;
  margin-bottom: 18px;
  transition: color 0.15s ease;
}
.ba-back:hover { color: var(--ba-primary); }
.ba-back svg { width: 14px; height: 14px; }

/* --- Hero -------------------------------------------------------------------- */
.ba-hero { max-width: 880px; margin: 0 auto; }
.ba-hero-eyebrow {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ba-primary-soft);
  border: 1px solid var(--ba-primary-line);
  color: var(--ba-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ba-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 4.8vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--ba-text);
}
.ba-hero-deck {
  margin: 0 0 18px;
  font-size: clamp(16px, 2.1vw, 20px);
  line-height: 1.55;
  color: var(--ba-text-soft);
  max-width: 700px;
}
.ba-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-size: 13px;
  color: var(--ba-muted);
  padding-top: 10px;
  border-top: 1px solid var(--ba-border);
}
.ba-meta-author {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ba-text);
}
.ba-meta-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa 0%, #6366f1 100%);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ba-meta-dot { color: #cbd5e1; }

/* --- Hero image placeholder -------------------------------------------------- */
.ba-hero-image {
  margin: 26px auto 0;
  max-width: 1000px;
}
.ba-hero-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--ba-radius);
  object-fit: cover;
}
.ba-image-placeholder {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 56px 24px;
  border-radius: var(--ba-radius);
  border: 1px dashed #c7d2fe;
  background:
    linear-gradient(135deg, rgba(167,139,250,0.06) 0%, rgba(99,102,241,0.05) 60%, rgba(244,114,182,0.04) 100%),
    repeating-linear-gradient(135deg, #faf5ff 0px, #faf5ff 14px, #f5f3ff 14px, #f5f3ff 28px);
  color: #4c1d95;
  text-align: center;
}
.ba-image-placeholder--hero { padding: 96px 24px; }
.ba-image-placeholder-eyebrow {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: #ede9fe;
  border: 1px solid #c4b5fd;
  color: var(--ba-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ba-image-placeholder-text {
  font-size: 14px;
  font-weight: 600;
  color: #4c1d95;
  max-width: 520px;
  line-height: 1.5;
}

/* --- Layout: TOC + article --------------------------------------------------- */
.ba-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  max-width: 1180px;
  margin: 36px auto 0;
}
.ba-toc-wrap {
  position: sticky;
  top: 96px;
  align-self: start;
}
.ba-toc {
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--ba-border);
  background: var(--ba-surface);
  font-size: 13px;
}
.ba-toc-label {
  display: block;
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ba-muted);
}
.ba-toc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ba-toc-list a {
  display: block;
  padding: 7px 10px;
  margin: 0 -6px;
  border-radius: 8px;
  color: var(--ba-text-soft);
  text-decoration: none;
  line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease;
  font-weight: 500;
}
.ba-toc-list a:hover {
  background: var(--ba-primary-soft);
  color: var(--ba-primary);
}
.ba-toc-list a.is-active {
  background: var(--ba-primary-soft);
  color: var(--ba-accent);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--ba-primary-line);
}

/* --- Article body ------------------------------------------------------------ */
.ba-article {
  background: var(--ba-surface);
  border: 1px solid var(--ba-border);
  border-radius: 18px;
  padding: clamp(20px, 4vw, 40px);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ba-text-soft);
  max-width: 820px;
}
.ba-article p { margin: 0 0 1.1em; }
.ba-article p:last-child { margin-bottom: 0; }
.ba-article strong { color: var(--ba-text); font-weight: 700; }
.ba-article em { color: var(--ba-text); }
.ba-article a {
  color: var(--ba-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(109, 40, 217, 0.35);
  transition: text-decoration-color 0.15s ease;
}
.ba-article a:hover { text-decoration-color: var(--ba-primary); }
.ba-article ul, .ba-article ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.ba-article li { margin: 0 0 0.35em; }
.ba-article h2 {
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 2em 0 0.6em;
  font-weight: 800;
  color: var(--ba-text);
  scroll-margin-top: 100px;
}
.ba-article h2:first-of-type { margin-top: 0.4em; }
.ba-article h3 {
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.3;
  margin: 1.6em 0 0.4em;
  font-weight: 700;
  color: var(--ba-text);
  scroll-margin-top: 100px;
}
.ba-article hr {
  border: 0;
  border-top: 1px solid var(--ba-border);
  margin: 36px 0;
}

/* --- TL;DR ------------------------------------------------------------------- */
.ba-tldr {
  margin: 0 0 24px;
  padding: 18px 20px;
  border-radius: 14px;
  background: linear-gradient(140deg, #faf5ff 0%, #eef2ff 60%, #f0f9ff 100%);
  border: 1px solid var(--ba-primary-line);
}
.ba-tldr-label {
  display: none !important;
}
.ba-tldr p {
  margin: 4px 0 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: #1f2937;
}

/* --- Inline image placeholder ------------------------------------------------ */
.ba-article .ba-image-placeholder { margin: 24px 0; padding: 40px 22px; }

/* --- Callout / quote --------------------------------------------------------- */
.ba-callout {
  margin: 22px 0;
  padding: 16px 18px;
  border-radius: 12px;
  border-left: 3px solid var(--ba-primary);
  background: var(--ba-primary-soft);
  color: #1f2937;
  font-size: 15.5px;
  line-height: 1.6;
}
.ba-callout p { margin: 0; }
.ba-callout strong { color: #4c1d95; }

.ba-quote {
  margin: 24px 0;
  padding: 12px 22px;
  border-left: 3px solid #cbd5e1;
  font-style: italic;
  color: #475569;
  font-size: 17px;
  line-height: 1.55;
}
.ba-quote-attr {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 13px;
  color: var(--ba-muted);
  font-weight: 600;
}

/* --- Tool cards -------------------------------------------------------------- */
.ba-tool-card {
  margin: 22px 0;
  padding: 22px;
  border: 1px solid var(--ba-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02), 0 4px 18px rgba(15, 23, 42, 0.04);
}
.ba-tool-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  margin: 0 0 2px;
}
.ba-tool-card-head h3 {
  margin: 0 !important;
  font-size: clamp(22px, 2.6vw, 26px) !important;
  font-weight: 800 !important;
  letter-spacing: -0.015em;
}
.ba-tool-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--ba-primary-soft);
  border: 1px solid var(--ba-primary-line);
  color: var(--ba-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ba-tool-card-sub {
  margin: 4px 0 14px !important;
  color: var(--ba-muted) !important;
  font-size: 14px !important;
  font-weight: 600;
}
.ba-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 22px;
  margin: 16px 0 4px;
  padding-top: 14px;
  border-top: 1px solid var(--ba-border-soft);
}
.ba-tool-grid-row { font-size: 14px; line-height: 1.5; color: #1f2937; }
.ba-tool-grid-label {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ba-muted);
  margin-bottom: 2px;
}

/* --- Code sample ------------------------------------------------------------- */
.ba-code {
  margin: 20px 0;
  padding: 16px 18px;
  border-radius: var(--ba-radius);
  border: 1px solid var(--ba-border);
  background: var(--ba-surface);
  font-size: 13px;
  line-height: 1.55;
  overflow-x: auto;
  color: var(--ba-text-soft);
}
.ba-code code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* --- Comparison table -------------------------------------------------------- */
.ba-comparison {
  margin: 28px 0;
  border: 1px solid var(--ba-border);
  border-radius: 14px;
  overflow-x: auto;
  background: #fff;
}
.ba-comparison table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-size: 14px;
}
.ba-comparison th,
.ba-comparison td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--ba-border);
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}
.ba-comparison thead th {
  background: #f8fafc;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ba-muted);
}
.ba-comparison tbody tr:last-child td { border-bottom: 0; }
.ba-comparison tbody tr:hover { background: var(--ba-primary-soft); }
.ba-comparison td:first-child { font-weight: 700; color: var(--ba-text); }

/* --- Inline CTA -------------------------------------------------------------- */
.ba-cta {
  margin: 30px 0;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid #312e81;
  background:
    radial-gradient(circle at top right, rgba(167,139,250,0.25), transparent 55%),
    linear-gradient(135deg, #1e1b4b 0%, #312e81 60%, #4c1d95 100%);
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}
.ba-cta-text { flex: 1 1 280px; }
.ba-cta-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c4b5fd;
  margin-bottom: 6px;
}
.ba-cta-title {
  margin: 0 !important;
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 700;
  color: #fff !important;
  line-height: 1.35;
}
.ba-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #1e1b4b !important;
  background: #fff;
  border: 1px solid #fff;
  text-decoration: none !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}
.ba-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}
.ba-cta-btn svg { width: 14px; height: 14px; }

/* --- Verdict ----------------------------------------------------------------- */
.ba-verdict {
  margin: 28px 0 12px;
  padding: 20px 22px;
  border-radius: 14px;
  border: 1px solid var(--ba-border);
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
}
.ba-verdict-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.ba-verdict p { margin: 6px 0 0; }

/* --- FAQ --------------------------------------------------------------------- */
.ba-faq {
  margin: 0;
  display: grid;
  gap: 12px;
}
.ba-faq-item {
  border: 1px solid var(--ba-border);
  border-radius: 12px;
  background: #fff;
  padding: 16px 18px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ba-faq-item:hover {
  border-color: var(--ba-primary-line);
  box-shadow: 0 4px 16px rgba(109, 40, 217, 0.06);
}
.ba-faq-item h3 {
  margin: 0 0 6px !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  color: var(--ba-text);
}
.ba-faq-item p {
  margin: 0;
  color: var(--ba-text-soft);
  font-size: 15px;
  line-height: 1.6;
}

/* --- Related articles -------------------------------------------------------- */
.ba-related {
  max-width: 1180px;
  margin: 56px auto 0;
}
.ba-related h2 {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.ba-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  overflow: hidden;
}
.ba-related-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--ba-border);
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.ba-related-card:hover {
  transform: translateY(-2px);
  border-color: var(--ba-primary-line);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}
.ba-related-card-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ba-primary);
}
.ba-related-card h3 {
  margin: 0 !important;
  font-size: 16px !important;
  line-height: 1.4 !important;
  font-weight: 700 !important;
  color: var(--ba-text);
}
.ba-related-card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ba-muted);
}

/* --- Responsive -------------------------------------------------------------- */
@media (max-width: 1024px) {
  .ba-layout { grid-template-columns: 1fr; gap: 24px; }
  .ba-toc-wrap { position: static; order: -1; }
  .ba-toc { display: flex; flex-direction: column; }
}
@media (max-width: 768px) {
  .ba-related-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    padding: 0 2px 10px;
    scrollbar-width: none;
  }
  .ba-related-grid::-webkit-scrollbar {
    display: none;
  }
  .ba-related-card {
    flex: 0 0 85vw;
    max-width: 85vw;
    scroll-snap-align: start;
  }
}
@media (max-width: 760px) {
  main.ba-main { padding: 20px 0 48px; }
  .ba-hero h1 { font-size: clamp(28px, 7vw, 38px); }
  .ba-tool-grid { grid-template-columns: 1fr; }
  .ba-cta { flex-direction: column; align-items: flex-start; }
  .ba-cta-btn { width: 100%; justify-content: center; }
  .ba-image-placeholder--hero { padding: 64px 18px; }
  .ba-article { padding: 18px; font-size: 16px; }
}
