/* ===== ARTICLE PAGE STYLES ===== */
.article-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 34px 32px 38px;
}

.article-header-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.a-cat-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 14px;
  word-break: break-all;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.a-cat-badge.cat-tips {
  background: #00d4ff;
}

.a-cat-badge.cat-column {
  background: #ff00a2;
}

.article-header h1 {
  font-family: var(--ff-heading);
  font-size: 32px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 16px;
  max-width: 700px;
  min-width: 0;
  /* Override any content-driven min-width */
  overflow-wrap: anywhere;
  word-break: break-all;
  line-break: anywhere;
  /* Hard wrap even for symbols/long dashes */
}

.a-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.a-meta {
  font-size: 12px;
  color: var(--ink-faint);
}

.a-meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-mid);
}

.article-main-thumb {
  margin-top: 30px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border);
  background: var(--white);
}

.article-main-thumb img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.article-main-thumb:hover img {
  transform: scale(1.02);
}

/* TOC */
.toc-box {
  background: var(--blue-ghost);
  border: 1px solid var(--blue-pale);
  border-left: 3px solid var(--blue);
  border-radius: 0 6px 6px 0;
  padding: 8px 0;
  margin-bottom: 32px;
}

.toc-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 8px 20px 10px;
}

.toc-list {
  list-style: none;
  position: relative;
}

.toc-list li {
  position: relative;
  border-bottom: 1px dashed var(--border);
}

.toc-list li:last-child {
  border-bottom: none;
}

.toc-list li a {
  font-size: 13px;
  color: var(--ink-mid);
  text-decoration: none;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
}

.toc-list li a::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  background: var(--white);
  border: 1px solid var(--blue-pale);
  border-radius: 50%;
  flex-shrink: 0;
  z-index: 2;
  position: relative;
}

.toc-list li a:hover {
  color: var(--blue);
  background: rgba(37, 99, 235, 0.03);
}

.toc-list li a.active {
  color: var(--blue);
  font-weight: 700;
  background: var(--blue-ghost);
}

.toc-list li a.active::before {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Vertical connection line */
.toc-list::after {
  content: '';
  position: absolute;
  left: 22.5px;
  top: 15px;
  bottom: 15px;
  width: 1px;
  border-left: 1px solid var(--blue-pale);
  z-index: 1;
}

.article-body {
  width: 100%;
  max-width: 850px;
  margin: 0 auto;
  padding: 0 24px 100px;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 16px;
  color: var(--ink);
  line-height: 1.85;
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-title {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-all;
  line-break: anywhere;
  line-height: 1.4;
}



.article-body img,
.article-body video,
.article-body iframe {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 8px;
  display: block;
  margin: 20px auto;
}

.article-body {
  font-size: 16px;
  color: var(--ink);
  line-height: 1.85;
}

.article-body h2 {
  font-family: var(--ff-heading);
  font-size: 10px;
  font-weight: 700;
  color: var(--black);
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.article-body h3 {
  font-family: var(--ff-heading);
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin: 26px 0 10px;
}

.article-body p {
  margin-bottom: 16px;
}

/*.article-body code {
  font-family: var(--ff-mono);
  font-size: 13px;
  background: var(--blue-ghost);
  padding: 2px 5px;
  border-radius: 3px;
  color: var(--navy-light);
  border: 1px solid var(--blue-pale);
}*/

.code-block {
  background: #0d1421;
  border-radius: 6px;
  overflow: hidden;
  margin: 22px 0;
  border: 1px solid #1e2d4a;
  max-width: 100%;
  min-width: 0;
  /* Ensure container doesn't expand */
  word-break: break-all;
  overflow-wrap: anywhere;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #0a1019;
  border-bottom: 1px solid #1e2d4a;
}

.code-lang {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: #4a7fc1;
  letter-spacing: 0.06em;
}

.copy-btn {
  font-family: var(--ff-body);
  font-size: 11px;
  color: #4a6080;
  background: none;
  border: 1px solid #1e2d4a;
  padding: 3px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.copy-btn:hover {
  color: #93c5fd;
  border-color: #2563eb;
}

.code-block pre {
  padding: 16px;
  font-family: var(--ff-mono);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  color: #cdd9e5;
  white-space: pre-wrap; /* Force wrap for long lines if needed, but horizontal scroll is preferred */
  word-break: break-all;
  overflow-wrap: anywhere;
}

.code-block pre .kw {
  color: #79c0ff;
}

.code-block pre .str {
  color: #a5d6a7;
}

.code-block pre .com {
  color: #3d5065;
  font-style: italic;
}

.code-block pre .sel {
  color: #cdd9e5;
}

.code-block pre .prop {
  color: #79c0ff;
}

.code-block pre .val {
  color: #ffa657;
}

.code-block pre .fn {
  color: #d2a8ff;
}

.article-body blockquote,
.callout,
.summary-box,
.demo-area {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-wrap: anywhere !important;
  word-break: break-all !important;
}

.article-body blockquote {
  border-left: 3px solid var(--blue-mid);
  padding: 12px 20px;
  margin: 22px 0;
  background: var(--blue-ghost);
  border-radius: 0 6px 6px 0;
  font-family: var(--ff-heading);
  font-style: italic;
  color: var(--ink-mid);
  font-size: 16px;
}

/* Prev/Next nav */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.article-nav-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.article-nav-item:hover {
  border-color: var(--blue-light);
  background: var(--blue-ghost);
}

.nav-dir {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 5px;
}

.nav-title {
  font-family: var(--ff-heading);
  font-size: 13px;
  color: var(--navy);
  line-height: 1.45;
}

.article-nav-item.next {
  text-align: right;
}

/* Related */
.related-section {
  margin-top: 36px;
}

.related-section h3 {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.related-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.related-card:hover {
  border-color: var(--blue-light);
  background: var(--blue-ghost);
}

.r-cat {
  font-size: 10px;
  color: var(--blue);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.r-title {
  font-size: 13px;
  color: var(--navy);
  line-height: 1.4;
  font-family: var(--ff-heading);
  font-weight: 700;
}

.sidebar {
  position: -webkit-sticky;
  position: sticky;
  top: 24px;
  align-self: start;
}

/* article footer meta */
.article-footer-meta {
  max-width: 850px;
  margin: 40px auto 0;
  padding: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Custom Hero Layout Base */
.article-main-thumb.is-hero-mode {
  max-width: 850px;
  margin: 40px auto !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.article-main-thumb.is-hero-mode img {
  margin: 0 !important;
  border-radius: 12px !important;
  width: 100% !important;
}


.share-label {
  font-size: 11px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-right: 8px;
}

@media (max-width: 768px) {
  .article-header {
    padding: 24px 16px;
  }

  .layout-wrap {
    padding: 20px 12px;
    /* Reduced layout padding on mobile */
  }


  .article-header h1 {
    font-size: clamp(21px, 7vw, 24px);
    max-width: 100%;
    min-width: 0;
    margin-bottom: 12px;
    line-break: anywhere;
    word-break: break-all;
  }

  .article-body {
    padding: 0 12px 60px;
    font-size: 15px;
    line-height: 1.8;
  }

  .callout,
  .summary-box,
  .demo-area,
  .code-block {
    margin-left: -12px !important;
    margin-right: -12px !important;
    border-radius: 0 !important;
    padding: 20px 12px !important;
    width: calc(100% + 24px) !important;
    max-width: none !important;
  }

  .article-footer-meta {
    flex-wrap: wrap;
    padding: 24px 16px;
  }

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

  .related-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .article-main-thumb.is-hero-mode {
    margin: 20px 0 !important;
    /* Remove negative margins if they cause issues */
    border-radius: 8px;
    width: 100% !important;
    max-width: 100%;
    border: none !important;
    background: transparent !important;
    box-sizing: border-box;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .article-main-thumb.is-hero-mode img {
    margin: 0 !important;
    border-radius: 0 !important;
    width: 100% !important;
  }
}

/* Custom Hero (Premium Articles) Adjustments */
.site-bg.is-custom {
  background: var(--white);
  /* Prevent article hero style from pushing page width */
}

/* Ensure any internal style that uses .article-body .article-hero 
   behaves correctly on mobile even if selectors are redundant */
.article-hero {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  .article-hero {
    padding: 30px 16px !important;
    /* Reduced hero padding */
  }

  .article-hero .article-title {
    font-size: clamp(20px, 8vw, 24px) !important;
    line-height: 1.35 !important;
    word-break: break-all !important;
    line-break: anywhere !important;
    overflow-wrap: anywhere !important;
    min-width: 0 !important;
  }
}

.layout-wrap.is-custom main {
  padding-top: 0;
  width: 100%;
}



/* scoping base */
.article-inner-content {
  width: 100%;
}

.article-inner-content img {
  max-width: 100%;
  height: auto;
}