/* ═══════════════════════════════════════════
   blog-article.css — SF-SPEC v4.6 compliant
   Prefix: ba- | Body: body.single-post
   Content area: 780px centered
   ═══════════════════════════════════════════ */

/* base.css sets overflow-x:hidden which breaks position:sticky */
body.single-post {
  overflow-x: visible;
  overflow-y: visible;
}

/* ── Article shell ── */
.ba-article {
  background: var(--bg-white);
}

/* ── Header ── */
.ba-header {
  padding: 56px 48px 40px;
  background: var(--bg-faint);
  border-bottom: 1px solid var(--border);
}
.ba-header__inner {
  max-width: 1200px;
  margin: 0 auto;
}
.ba-breadcrumb {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
}
.ba-breadcrumb a {
  color: var(--brand);
  text-decoration: none;
}
.ba-breadcrumb a:hover {
  text-decoration: underline;
}
.ba-breadcrumb__sep {
  color: var(--text-hint);
}
.ba-breadcrumb__current {
  color: var(--text-secondary);
}
.ba-header__title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 12px;
  line-height: 1.2;
}
.ba-header__meta {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ba-header__meta-sep {
  color: var(--text-hint);
}

/* ── Body layout ── */
.ba-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 20px 0;
}
.ba-body__layout {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}
.ba-body__content {
  flex: 1;
  min-width: 0;
}

/* ── Card ── */
.ba-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card-lg);
  box-shadow: var(--shadow-card);
  padding: 32px 36px;
}

/* ── Content typography ── */
.ba-content {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
}
.ba-content h2 {
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 12px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 100px;
}
.ba-content h3 {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 8px;
  scroll-margin-top: 100px;
}
.ba-content h4 {
  color: var(--text-primary);
  margin: 24px 0 12px;
  font-weight: 600;
}
.ba-content p {
  margin-bottom: 16px;
  color: var(--text-primary);
}
.ba-content a {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}
.ba-content a:hover {
  border-bottom-color: var(--brand);
}
.ba-content ul,
.ba-content ol {
  margin: 0 0 14px;
  padding-left: 20px;
}
.ba-content ul { list-style: disc; }
.ba-content ol { list-style: decimal; }
.ba-content li {
  margin-bottom: 6px;
  color: var(--text-primary);
}
.ba-content blockquote {
  background: var(--tag-blue-bg);
  padding: 10px 16px;
  border-left: 3px solid var(--brand);
  border-radius: 0 6px 6px 0;
  margin: 0 0 14px;
  color: var(--tag-blue-text);
}
.ba-content blockquote p { margin: 0; }
.ba-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-card);
  margin: 20px 0;
}
.ba-content code {
  background: var(--bg-faint);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: monospace;
}
.ba-content pre {
  background: var(--bg-faint);
  color: var(--text-primary);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
}
.ba-content hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 36px 0;
}
.ba-content figure {
  margin: 24px 0;
  max-width: 100%;
}
.ba-content figure img {
  display: block;
  margin: 0 auto;
}
.ba-content figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ── Tags ── */
.ba-tags {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.ba-tag {
  display: inline-flex;
  padding: 8px 16px;
  background: var(--bg-faint);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
}
.ba-tag:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* ── Share ── */
.ba-share {
  padding: 24px;
}
.ba-share__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--text-primary);
}
.ba-share__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.ba-share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  text-decoration: none;
  transition: var(--transition);
}
.ba-share__btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.ba-share__btn-icon {
  display: block;
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.ba-share__btn--instagram  { color: #E4405F; }
.ba-share__btn--youtube    { color: #FF0000; }
.ba-share__btn--twitter    { color: #000000; }
.ba-share__btn--linkedin   { color: #0A66C2; }
.ba-share__btn--facebook   { color: #1877F2; }

/* ── CTA ── */
.ba-cta {
  text-align: center;
  padding: 36px 40px;
}
.ba-cta__title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text-primary);
}
.ba-cta__text {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0 0 20px;
  line-height: 1.6;
}

/* ── Sidebar ── */
.ba-sidebar {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.ba-sidebar__widget {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.ba-sidebar__widget-title {
  background: var(--brand);
  color: var(--bg-white);
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
.ba-sidebar__widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--brand);
  padding: 14px 20px;
}
.ba-sidebar__widget-header .ba-sidebar__widget-title {
  background: none;
  padding: 0;
  flex: 1;
}
.ba-sidebar__widget-content {
  padding: 16px 20px;
}
.ba-sidebar__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ba-sidebar__list li {
  border-bottom: 1px solid var(--border);
}
.ba-sidebar__list li:last-child {
  border-bottom: none;
}
.ba-sidebar__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color var(--transition);
}
.ba-sidebar__link:hover,
.ba-sidebar__link.is-active {
  color: var(--brand);
  font-weight: 500;
}
.ba-sidebar__count {
  background: var(--brand-light);
  color: var(--brand-text);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 12px;
}
.ba-sidebar__posts {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ba-sidebar__posts li {
  margin-bottom: 14px;
}
.ba-sidebar__posts li:last-child {
  margin-bottom: 0;
}
.ba-sidebar__post {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.5;
  transition: color var(--transition);
}
.ba-sidebar__post:hover {
  color: var(--brand);
}
.ba-sidebar__post-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

/* ── TOC ── */
.ba-toc {
  position: relative;
}
.ba-toc__close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.95);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ba-toc__nav {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ba-toc__nav a {
  display: block;
  padding: 8px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}
.ba-toc__nav a:hover,
.ba-toc__nav a.active {
  background: var(--brand-light);
  color: var(--brand);
}
.ba-toc__nav a.active {
  font-weight: 500;
}
.ba-toc__nav .toc-h2 {
  padding-left: 12px;
  font-weight: 500;
}
.ba-toc__nav .toc-h3 {
  padding-left: 24px;
  font-size: 13px;
  color: var(--text-muted);
}
.ba-toc__toggle {
  display: none;
  position: fixed;
  left: 20px;
  bottom: 90px;
  z-index: 1001;
  background: var(--text-primary);
  color: var(--bg-white);
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 24px;
  cursor: pointer;
  box-shadow: var(--shadow-hover);
  transition: transform var(--transition), box-shadow var(--transition);
  align-items: center;
  justify-content: center;
}
.ba-toc__toggle:hover {
  transform: scale(1.05);
}

/* ── Back to top ── */
.ba-back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--text-primary);
  color: var(--bg-white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-hover);
  transition: opacity 0.3s, visibility 0.3s, transform var(--transition);
  opacity: 0;
  visibility: hidden;
  z-index: 100;
}
.ba-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
}
.ba-back-to-top:hover {
  transform: translateY(-4px);
}

/* ── Responsive ── */
@media (max-width: 1023px) {
  .ba-body__layout {
    flex-direction: column;
  }
  .ba-sidebar {
    width: 100%;
    position: static;
  }
  .ba-toc__toggle {
    display: flex;
  }
  .ba-toc {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: var(--bg-white);
    z-index: 1000;
    padding: 0;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }
  .ba-toc.is-visible {
    transform: translateX(320px);
  }
  .ba-toc__close {
    display: flex !important;
  }
}

@media (max-width: 767px) {
  .ba-header {
    padding: 40px 24px;
  }
  .ba-header__title {
    font-size: 26px;
  }
  .ba-body {
    padding: 24px 16px 0;
  }
  .ba-card {
    padding: 30px 20px;
  }
  .ba-cta {
    padding: 28px 20px;
  }
  .ba-cta__title {
    font-size: 20px;
  }
}
