/* ===================================================
   Blog Article Detail — matches main.css + blog-list.css
   =================================================== */

.article-page {
  padding-top: 0;
}

/* === Hero (breadcrumb + title) — same band as blog-hero === */
.article-hero {
  background: linear-gradient(160deg, var(--bg-dark) 0%, #0d2137 60%, var(--brand-blue) 100%);
  color: #fff;
  padding: 48px 0 56px;
  position: relative;
  overflow: hidden;
}

.article-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 70% 50%, rgba(45, 111, 175, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.article-hero-inner {
  position: relative;
  z-index: 1;
}

.article-hero .breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 28px;
}

.article-hero .breadcrumb a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s;
}

.article-hero .breadcrumb a:hover {
  color: #7cb8f5;
}

.article-hero .breadcrumb i {
  font-size: 8px;
  opacity: 0.6;
}

.article-hero .breadcrumb .bc-current {
  color: rgba(255, 255, 255, 0.9);
}

.article-header {
  max-width: 820px;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.article-tag {
  font-size: 11px;
  font-weight: 500;
  color: #7cb8f5;
  background: rgba(124, 184, 245, 0.12);
  border: 1px solid rgba(124, 184, 245, 0.35);
  padding: 4px 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.article-tag.tag-latest {
  color: #fff;
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}

.article-title {
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 200;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 20px;
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 13px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 22px;
}

.article-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.article-meta-item i {
  color: #7cb8f5;
  font-size: 12px;
}

.article-summary {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.78);
  max-width: 720px;
  padding: 18px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* === Main content band — same as .blog-main === */
.article-content-section {
  padding: 56px 0 80px;
  background: #f8f9fb;
}

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

.article-col-main {
  min-width: 0;
}

.article-card {
  background: #fff;
  border: 1px solid #e5e8ef;
  padding: 44px 48px 48px;
}

/* === Article body typography — site thin headings === */
.article-body {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.85;
  color: var(--text-gray);
  overflow-wrap: break-word;
  word-break: break-word;
}

.article-body h2 {
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 300;
  color: var(--text-dark);
  letter-spacing: -0.01em;
  margin: 48px 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e8ef;
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body h3 {
  font-size: 17px;
  font-weight: 400;
  color: var(--text-dark);
  margin: 28px 0 12px;
  scroll-margin-top: calc(var(--header-height) + 24px);
}

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

.article-body ul,
.article-body ol {
  padding-left: 22px;
  margin-bottom: 18px;
  list-style: disc;
}

.article-body ol {
  list-style: decimal;
}

.article-body li {
  margin-bottom: 8px;
  line-height: 1.8;
}

.article-body a {
  color: var(--brand-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body a:hover {
  color: var(--brand-blue-hover);
}

.article-body strong {
  font-weight: 500;
  color: var(--text-dark);
}

.article-body code {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.88em;
  background: #f0f2f5;
  border: 1px solid #e5e8ef;
  padding: 2px 6px;
  color: var(--brand-blue);
}

.article-body pre {
  background: var(--bg-dark);
  border: 1px solid #1a2530;
  padding: 20px 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  margin: 24px 0;
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: #b8d4f0;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}

.article-body th {
  background: #f5f6f8;
  font-weight: 500;
  color: var(--text-dark);
  padding: 10px 14px;
  border: 1px solid #e5e8ef;
  text-align: left;
  white-space: nowrap;
}

.article-body td {
  padding: 9px 14px;
  border: 1px solid #e5e8ef;
  color: var(--text-gray);
  vertical-align: top;
}

.article-body tr:nth-child(even) td {
  background: #fafbfc;
}

.article-body .inline-cta {
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* === Callouts — minimal, left-accent (site style) === */
.callout {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  margin: 22px 0;
  font-size: 14px;
  line-height: 1.75;
  border: 1px solid #e5e8ef;
  background: #fafbfc;
}

.callout-icon {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 15px;
}

.callout-info {
  border-left: 3px solid var(--brand-blue-light);
}

.callout-info .callout-icon {
  color: var(--brand-blue);
}

.callout-tip {
  border-left: 3px solid #2e8b57;
}

.callout-tip .callout-icon {
  color: #2e8b57;
}

.callout-warn {
  border-left: 3px solid #c9a227;
}

.callout-warn .callout-icon {
  color: #c9a227;
}

/* === Sidebar TOC === */
.article-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 20px);
  max-height: calc(100vh - var(--header-height) - 40px);
  overflow-y: auto;
}

.toc-card {
  background: #fff;
  border: 1px solid #e5e8ef;
  padding: 22px 20px;
}

.toc-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-blue);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin: 0;
}

.toc-list a {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-gray);
  padding: 8px 0 8px 12px;
  border-left: 2px solid transparent;
  text-decoration: none;
  line-height: 1.45;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.toc-list a:hover {
  color: var(--brand-blue);
  background: rgba(25, 57, 99, 0.04);
}

.toc-list a.toc-active {
  color: var(--brand-blue);
  border-left-color: var(--brand-blue);
  font-weight: 500;
  background: rgba(25, 57, 99, 0.06);
}

/* === Product recommend — blog-cta style === */
.product-recommend {
  margin-top: 32px;
  background: var(--bg-dark);
  border: 1px solid #1a2530;
  padding: 48px 44px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px 40px;
  align-items: center;
}

.pr-label {
  grid-column: 1 / -1;
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7cb8f5;
  margin-bottom: -8px;
}

.pr-label i {
  margin-right: 6px;
}

.pr-copy {
  grid-column: 1;
  grid-row: 2;
}

.pr-title {
  font-size: 24px;
  font-weight: 200;
  color: #fff;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.3;
}

.pr-desc {
  font-size: 14px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.7;
  margin: 10px 0 0;
  max-width: 520px;
}

.pr-features {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pr-features li {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}

.pr-features li i {
  color: #7cb8f5;
  margin-top: 3px;
  font-size: 11px;
}

.pr-cta {
  grid-row: 2;
  grid-column: 2;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--brand-blue);
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.pr-cta:hover {
  background: #e8effa;
  color: var(--brand-blue-hover);
  text-decoration: none;
}

/* === Prev / Next — blog-card style === */
.article-nav-prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 32px;
}

.nav-pn-item {
  background: #fff;
  border: 1px solid #e5e8ef;
  padding: 22px 24px;
  text-decoration: none;
  transition: box-shadow 0.3s, transform 0.3s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.nav-pn-item:hover {
  box-shadow: 0 8px 28px rgba(25, 57, 99, 0.1);
  transform: translateY(-2px);
  border-color: #cdd5e3;
  text-decoration: none;
}

.nav-pn-dir {
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-blue);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-pn-title {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nav-pn-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nav-pn-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--brand-blue);
  background: rgba(25, 57, 99, 0.08);
  padding: 3px 10px;
}

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

.nav-pn-item.nav-pn-next .nav-pn-dir,
.nav-pn-item.nav-pn-next .nav-pn-tags {
  justify-content: flex-end;
}

/* === Related articles === */
.article-related {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid #e5e8ef;
}

.related-title {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.related-title i {
  color: var(--brand-blue);
  font-size: 16px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.related-card {
  background: #fff;
  border: 1px solid #e5e8ef;
  padding: 22px 24px;
  text-decoration: none;
  transition: box-shadow 0.3s, transform 0.3s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.related-card:hover {
  box-shadow: 0 8px 28px rgba(25, 57, 99, 0.1);
  transform: translateY(-2px);
  text-decoration: none;
}

.related-card-title {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.related-card-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--brand-blue);
  background: rgba(25, 57, 99, 0.08);
  padding: 3px 10px;
}

/* === Floating widget === */
.float-widget {
  position: fixed;
  right: 24px;
  bottom: 72px;
  width: 280px;
  background: #fff;
  border: 1px solid #e5e8ef;
  padding: 20px 22px;
  box-shadow: 0 12px 40px rgba(25, 57, 99, 0.15);
  z-index: 900;
  transform: translateX(calc(100% + 32px));
  transition: transform 0.35s ease;
}

.float-widget.visible {
  transform: translateX(0);
}

.fw-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 1px solid #e5e8ef;
  background: #fff;
  color: var(--text-light-gray);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: border-color 0.2s, color 0.2s;
}

.fw-close:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

.fw-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-blue);
  margin-bottom: 8px;
}

.fw-title {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 8px;
  line-height: 1.4;
  padding-right: 24px;
}

.fw-desc {
  font-size: 13px;
  color: var(--text-gray);
  line-height: 1.6;
  margin-bottom: 16px;
}

.fw-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--brand-blue);
  color: #fff;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}

.fw-btn:hover {
  background: var(--brand-blue-hover);
  color: #fff;
  text-decoration: none;
}

/* === Responsive === */
@media (max-width: 1100px) {
  .article-layout {
    grid-template-columns: 1fr 240px;
    gap: 24px;
  }

  .product-recommend {
    grid-template-columns: 1fr;
  }

  .pr-cta {
    grid-row: auto;
    grid-column: 1;
    justify-self: start;
  }
}

@media (max-width: 900px) {
  .article-hero {
    padding: 36px 0 40px;
  }

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

  .article-sidebar {
    position: static;
    max-height: none;
    order: -1;
  }

  .article-card {
    padding: 28px 24px 32px;
  }

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

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

  .float-widget {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    transform: translateY(calc(100% + 8px));
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  .float-widget.visible {
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .article-content-section {
    padding: 40px 0 56px;
  }

  .article-card {
    padding: 22px 16px 26px;
  }

  .article-body {
    font-size: 14px;
  }

  .article-body pre {
    padding: 16px 14px;
    margin: 18px 0;
  }

  .article-body pre code {
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
  }

  .article-body code {
    font-size: 0.82em;
    word-break: break-all;
  }

  .article-body table {
    font-size: 13px;
  }

  .article-body th,
  .article-body td {
    padding: 8px 10px;
  }

  .article-body h2 {
    font-size: 20px;
  }

  .article-body h3 {
    font-size: 16px;
  }

  .callout {
    padding: 12px 14px;
    gap: 10px;
  }

  .product-recommend {
    padding: 32px 20px;
  }

  .pr-title {
    font-size: 20px;
  }

  .pr-cta {
    width: 100%;
    justify-content: center;
  }

  .nav-pn-item {
    padding: 18px 18px;
  }

  .nav-pn-item.nav-pn-next {
    text-align: left;
  }

  .nav-pn-item.nav-pn-next .nav-pn-dir,
  .nav-pn-item.nav-pn-next .nav-pn-tags {
    justify-content: flex-start;
  }
}
