.blog-article-bg {
  background: transparent;
}

html[data-bs-theme="dark"] .blog-article-bg {
  background: transparent;
}

.blog-article-bg.page-hero-bg::before {
  content: none;
}

.article-hero {
  --article-hero-text: var(--text);
  --article-hero-subtle: var(--text-dim);
  position: relative;
  padding-bottom: 18px;
}

.article-cover-wrap {
  position: relative;
  width: 100%;
  min-height: 320px;
  max-height: 440px;
  overflow: hidden;
  background:
    radial-gradient(140% 120% at 0% 0%, rgba(37, 99, 235, 0.18), transparent 55%),
    radial-gradient(140% 120% at 100% 100%, rgba(6, 182, 212, 0.16), transparent 50%),
    #0b1220;
}

.article-cover-img {
  width: 100%;
  min-height: 320px;
  max-height: 440px;
  display: block;
  object-fit: cover;
  filter: saturate(1.08) contrast(1.04);
}

.article-cover-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 7, 20, 0.14) 0%, rgba(5, 7, 20, 0.44) 42%, rgba(5, 7, 20, 0.92) 100%),
    linear-gradient(90deg, rgba(5, 7, 20, 0.2) 0%, transparent 42%);
}

.article-hero-content {
  position: relative;
  margin-top: -112px;
  padding-bottom: 0;
}

.article-hero-panel {
  padding: 28px 30px 26px;
  border-radius: 30px;
  border: 1px solid var(--blog-border);
  background:
    radial-gradient(140% 160% at 0% 0%, rgba(37, 99, 235, 0.12), transparent 58%),
    radial-gradient(120% 140% at 100% 100%, rgba(6, 182, 212, 0.12), transparent 56%),
    rgba(255, 255, 255, 0.92);
  box-shadow: var(--blog-shadow);
  backdrop-filter: blur(14px);
}

html[data-bs-theme="dark"] .article-hero-panel {
  background:
    radial-gradient(140% 160% at 0% 0%, rgba(47, 109, 246, 0.18), transparent 58%),
    radial-gradient(120% 140% at 100% 100%, rgba(31, 75, 184, 0.18), transparent 56%),
    rgba(23, 26, 30, 0.92);
}

.article-eyebrow-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.article-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--article-hero-subtle);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.article-back-link .arrow {
  font-size: 16px;
}

.article-back-link:hover {
  color: var(--article-hero-text);
}

.article-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--blog-border-strong);
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

html[data-bs-theme="dark"] .article-pill {
  background: rgba(23, 26, 30, 0.72);
  color: var(--article-hero-text);
}

.article-title {
  margin: 0 0 14px;
  max-width: 100%;
  font-size: clamp(34px, 4.5vw, 56px);
  line-height: 1.08;
  font-weight: 900;
  color: var(--article-hero-text);
  text-wrap: pretty;
}

.article-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.article-meta-row .article-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.article-meta-row .avatar-circle {
  width: 38px;
  height: 38px;
}

.article-meta-row .author-name {
  color: var(--article-hero-text);
}

.article-meta-row .author-role,
.article-meta-right {
  color: var(--article-hero-subtle);
}

.article-meta-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.article-body {
  padding: 20px 0 60px;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 340px);
  gap: 36px;
  align-items: flex-start;
}

.article-main {
  min-width: 0;
  color: var(--text-dim);
  font-size: 16px;
}

.article-intro,
.article-content {
  max-width: 760px;
}

.article-intro {
  margin: 0 0 20px;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
}

.article-subscribe-card {
  margin-top: 32px;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--blog-border-strong);
  background:
    radial-gradient(140% 160% at 0% 0%, rgba(37, 99, 235, 0.14), transparent 58%),
    radial-gradient(140% 160% at 100% 100%, rgba(6, 182, 212, 0.12), transparent 56%),
    var(--blog-surface-strong);
  box-shadow: var(--blog-shadow);
}

html[data-bs-theme="dark"] .article-subscribe-card {
  background:
    radial-gradient(140% 160% at 0% 0%, rgba(47, 109, 246, 0.18), transparent 58%),
    radial-gradient(140% 160% at 100% 100%, rgba(31, 75, 184, 0.16), transparent 56%),
    var(--blog-surface-strong);
}

.article-subscribe-label {
  margin: 0 0 4px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.article-subscribe-card .article-subscribe-title {
  margin: 0 0 8px;
  color: var(--text);
  font-size: clamp(24px, 2vw, 30px);
  line-height: 1.18;
  font-weight: 850;
}

.article-subscribe-text {
  margin: 0 0 16px;
  color: var(--text-dim);
  line-height: 1.7;
}

.article-subscribe-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.article-subscribe-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--blog-border);
  background: var(--blog-search-bg);
  color: var(--text);
  font-size: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

html[data-bs-theme="dark"] .article-subscribe-input {
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.article-subscribe-input::placeholder {
  color: var(--text-dim);
}

.article-subscribe-btn {
  min-width: 220px;
  justify-content: center;
}

.article-subscribe-note {
  margin: 12px 0 0;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}

.article-main h2,
.ck-content h2 {
  margin: 36px 0 12px;
  font-size: clamp(26px, 2vw, 32px);
  line-height: 1.2;
  font-weight: 850;
  color: var(--text);
}

.article-main h3,
.ck-content h3 {
  margin: 28px 0 10px;
  font-size: clamp(21px, 1.7vw, 24px);
  line-height: 1.28;
  font-weight: 800;
  color: var(--text);
}

.article-main h4,
.ck-content h4 {
  margin: 24px 0 10px;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 800;
  color: var(--text);
}

.article-main p,
.ck-content p {
  margin: 0 0 14px;
}

.article-main ul,
.article-main ol,
.ck-content ul,
.ck-content ol {
  margin: 0 0 18px;
  padding-left: 1.35rem;
}

.article-main li,
.ck-content li {
  margin-bottom: 6px;
}

.article-outro {
  margin-top: 24px;
  font-weight: 600;
}

.article-quote {
  margin: 22px 0;
  padding: 18px 20px;
  border-left: 4px solid var(--primary);
  border-radius: 18px;
  background: var(--blog-surface-soft);
  color: var(--text);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

html[data-bs-theme="dark"] .article-quote {
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
}

.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar-card {
  padding: 18px 18px 16px;
  border-radius: 22px;
  border: 1px solid var(--blog-border);
  background: var(--blog-surface-strong);
  box-shadow: var(--blog-shadow);
  backdrop-filter: blur(12px);
}

.sidebar-label {
  margin: 0 0 12px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sidebar-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 16px;
  text-decoration: none;
  transition: background 0.16s ease;
}

.sidebar-link:hover {
  background: rgba(37, 99, 235, 0.08);
}

html[data-bs-theme="dark"] .sidebar-link:hover {
  background: rgba(47, 109, 246, 0.16);
}

.sidebar-thumb {
  width: 72px;
  height: 54px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--blog-cover-fallback);
}

.sidebar-thumb img,
.sidebar-thumb-fallback {
  width: 100%;
  height: 100%;
  display: block;
}

.sidebar-thumb img {
  object-fit: cover;
}

.sidebar-thumb-fallback {
  background: var(--blog-cover-fallback);
}

.sidebar-text {
  min-width: 0;
  flex: 1;
}

.sidebar-title {
  margin: 0 0 3px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
}

.sidebar-meta {
  margin: 0;
  color: var(--text-dim);
  font-size: 11px;
}

.sidebar-cta-title {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 16px;
  font-weight: 850;
}

.sidebar-cta-text {
  margin: 0 0 14px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
}

.sidebar-cta-btn {
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
}

html[data-bs-theme="dark"] :where(.article-content.ck-content, .article-content.ck-content *) {
  color: #e6e6e6 !important;
}

html[data-bs-theme="dark"] :where(.article-content.ck-content h1, .article-content.ck-content h2, .article-content.ck-content h3, .article-content.ck-content h4, .article-content.ck-content h5, .article-content.ck-content h6) {
  color: #f8f9fa !important;
}

.article-body a,
.ck-content a {
  color: var(--primary) !important;
  background: transparent !important;
  text-decoration-line: underline !important;
  text-decoration-color: rgba(37, 99, 235, 0.42) !important;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-skip-ink: auto;
  word-break: break-word;
  overflow-wrap: anywhere;
}

html[data-bs-theme="dark"] .article-body a,
html[data-bs-theme="dark"] .ck-content a {
  color: var(--blog-link) !important;
  text-decoration-color: rgba(147, 197, 253, 0.42) !important;
}

.article-body a *,
.ck-content a * {
  color: inherit !important;
  background: transparent !important;
  text-decoration: inherit !important;
}

.article-body a:hover,
.ck-content a:hover {
  color: var(--blog-link) !important;
}

html[data-bs-theme="dark"] .article-body a:hover,
html[data-bs-theme="dark"] .ck-content a:hover {
  color: var(--blog-link-hover) !important;
}

.ck-content {
  width: 100%;
  max-width: 100%;
  font-size: 1rem;
  line-height: 1.8;
  position: relative;
  overflow: visible;
}

.ck-content > :first-child {
  margin-top: 0;
}

.ck-content img,
.ck-content span img,
.article-content img {
  max-width: 100%;
  height: auto;
  display: block;
}

.article-content img {
  margin: 18px auto;
  border-radius: 20px;
  box-shadow: 0 20px 52px rgba(15, 23, 42, 0.12);
}

html[data-bs-theme="dark"] .article-content img {
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.28);
}

.article-content figure {
  margin: 22px 0;
}

.article-content figure.image > img {
  max-width: 100%;
  height: auto;
}

figure.image {
  display: block;
  margin: 1.4rem auto;
}

.image-style-align-left {
  float: left;
  margin-right: 20px;
  margin-left: 0;
}

.image-style-align-right {
  float: right;
  margin-left: 20px;
  margin-right: 0;
}

.image-style-align-center {
  display: block;
  float: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.article-body blockquote,
.ck-content blockquote {
  position: relative;
  margin: 22px 0;
  padding: 22px 22px 22px 54px;
  border-left: 4px solid var(--primary);
  border-radius: 20px;
  background: var(--blog-surface-soft);
  color: var(--text);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
}

html[data-bs-theme="dark"] .article-body blockquote,
html[data-bs-theme="dark"] .ck-content blockquote {
  border-left-color: #93c5fd;
  background: rgba(42, 47, 54, 0.88);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
}

.article-body blockquote::before,
.ck-content blockquote::before {
  content: '"';
  position: absolute;
  top: 14px;
  left: 18px;
  font-size: 38px;
  line-height: 1;
  color: var(--primary);
  opacity: 0.8;
  pointer-events: none;
}

.article-body blockquote > :first-child,
.ck-content blockquote > :first-child {
  margin-top: 0;
}

.article-body blockquote > :last-child,
.ck-content blockquote > :last-child {
  margin-bottom: 0;
}

html[data-bs-theme="dark"] .article-content.ck-content code,
html[data-bs-theme="dark"] .article-content.ck-content kbd {
  padding: 0.15rem 0.45rem;
  border: 1px solid rgba(147, 197, 253, 0.18);
  border-radius: 0.5rem;
  background: rgba(148, 163, 184, 0.16);
  color: #f8f9fa !important;
}

html[data-bs-theme="dark"] .article-content.ck-content pre {
  margin: 22px 0;
  padding: 18px 20px;
  border: 1px solid rgba(147, 197, 253, 0.18);
  border-radius: 20px;
  background: #161b22;
  color: #f8f9fa !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
}

html[data-bs-theme="dark"] .article-content.ck-content pre code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit !important;
}

.article-content .ck-media__wrapper {
  width: 100%;
  max-width: 100%;
  margin: 22px 0;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 20px 52px rgba(15, 23, 42, 0.12);
}

html[data-bs-theme="dark"] .article-content .ck-media__wrapper {
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.28);
}

.article-content .ck-media__wrapper iframe {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.sidebar-toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.sidebar-toc-link {
  position: relative;
  display: block;
  padding: 8px 10px 8px 18px;
  border-radius: 12px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.sidebar-toc-link::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 16px;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
}

.sidebar-toc-link:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--text);
}

html[data-bs-theme="dark"] .sidebar-toc-link:hover {
  background: rgba(47, 109, 246, 0.16);
}

.sidebar-card a,
.sidebar-toc-link,
.sidebar-list .sidebar-link {
  text-decoration: none !important;
}

[id] {
  scroll-margin-top: 112px;
}

html {
  scroll-behavior: smooth;
}

.cb-share-rail {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cb-share-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--blog-border);
  border-radius: 14px;
  background: var(--blog-surface);
  color: var(--primary);
  transition: filter 0.15s ease, border-color 0.15s ease, background 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease;
}

.cb-share-btn i {
  font-size: 18px;
  line-height: 1;
}

.cb-share-btn:hover {
  border-color: var(--blog-border-strong);
  background: var(--blog-surface-strong);
}

.cb-share-btn .icon-done {
  display: none;
}

.cb-share-btn.copied .icon-main {
  display: none !important;
}

.cb-share-btn.copied .icon-done {
  display: inline-block !important;
}

.cb-share-btn.copied {
  color: var(--success);
  border-color: var(--success);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.18);
}

.theme-img {
  display: none;
}

[data-bs-theme="light"] .theme-img.light {
  display: block;
}

[data-bs-theme="dark"] .theme-img.dark {
  display: block;
}

.article-cta-wrap {
  padding-bottom: 24px;
}

.article-cta {
  margin-top: 0;
}

.img-lightbox.hidden {
  display: none;
}

.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.85);
}

#img-lightbox-img {
  width: auto;
  height: auto;
  max-width: 70vw;
  max-height: 70vh;
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.46);
  cursor: zoom-out;
}

.img-lightbox-close {
  position: absolute;
  top: 36px;
  right: 36px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.ck-content img[data-lightbox-ready="1"] {
  cursor: zoom-in;
}

@media (max-width: 991.98px) {
  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-content,
  .article-intro {
    max-width: 100%;
  }

  .article-sidebar {
    order: -1;
  }
}

@media (max-width: 820.98px) {
  .cb-share-rail {
    position: static;
    flex-direction: row;
  }
}

@media (max-width: 767.98px) {
  .article-hero-content {
    margin-top: -90px;
  }

  .article-hero-panel {
    padding: 22px 20px;
  }

  .article-title {
    max-width: 100%;
    font-size: 32px;
  }

  .article-meta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-subscribe-form {
    grid-template-columns: 1fr;
  }

  .article-subscribe-btn {
    width: 100%;
    min-width: 0;
  }

  .image-style-align-left,
  .image-style-align-right {
    float: none;
    margin-left: 0;
    margin-right: 0;
  }

  #img-lightbox-img {
    max-width: 90vw;
    max-height: 88vh;
  }

  .img-lightbox-close {
    top: 18px;
    right: 18px;
  }
}

@media (max-width: 575.98px) {
  .article-cover-wrap,
  .article-cover-img {
    min-height: 280px;
  }

  .article-hero-content {
    margin-top: -72px;
  }

  .article-body {
    padding-top: 18px;
  }

  .article-body blockquote,
  .ck-content blockquote {
    padding: 20px 18px 18px 46px;
  }

  .sidebar-card {
    padding-inline: 16px;
  }

  .article-subscribe-card {
    margin-top: 28px;
    padding: 18px;
  }

  .article-title {
    font-size: 30px;
  }
}
