/* ==========================================================================
   PureMed Knowledge Center — Article page styles
   Loaded ONLY on /blog/*.html pages, on top of css/style.css (same design
   tokens, same navbar/footer). Nothing here affects the homepage.
   ========================================================================== */

/* ---------- page fade-in / transition ---------- */
body.article-body { opacity: 0; animation: articleFadeIn .35s var(--ease) forwards; }
@keyframes articleFadeIn { to { opacity: 1; } }
body.is-leaving { opacity: 0; transition: opacity .18s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  body.article-body { animation: none; opacity: 1; }
  body.is-leaving { transition: none; }
}

/* ---------- reading progress bar ---------- */
.reading-progress {
  position: fixed; top: 0; inset-inline: 0; height: 3px;
  background: transparent; z-index: 200;
}
.reading-progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--blue-deep));
  transition: width .1s linear;
}

/* ---------- breadcrumb ---------- */
.article-breadcrumb {
  padding: 20px 0 0;
  font-size: 13px;
  color: var(--ink-faint);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.article-breadcrumb a { color: var(--ink-muted); }
.article-breadcrumb a:hover { color: var(--blue); }
.article-breadcrumb span[aria-current] { color: var(--ink); font-weight: 500; }

/* ---------- article hero ---------- */
.article-hero { padding: 28px 0 40px; border-bottom: 1px solid var(--gray-line); margin-bottom: 40px; }
.article-hero .blog-tag { margin-bottom: 16px; }
.article-hero h1 { font-size: clamp(28px, 4.2vw, 42px); line-height: 1.2; max-width: 820px; margin-bottom: 16px; }
.article-subtitle { font-size: 18px; color: var(--ink-muted); max-width: 720px; margin-bottom: 22px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13.5px; color: var(--ink-faint); }
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }
.article-meta svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ---------- layout: sticky TOC + content ---------- */
.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  padding-bottom: 56px;
}
@media (min-width: 960px) {
  .article-layout { grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
}

.article-toc {
  display: none;
}
@media (min-width: 960px) {
  .article-toc {
    display: block;
    position: sticky;
    top: 104px;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
  }
}
.toc-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); margin-bottom: 14px; }
.article-toc nav { display: flex; flex-direction: column; gap: 2px; border-inline-start: 2px solid var(--gray-line); }
.article-toc a {
  padding: 7px 0 7px 16px;
  font-size: 13.5px;
  color: var(--ink-muted);
  border-inline-start: 2px solid transparent;
  margin-inline-start: -2px;
  transition: color .15s, border-color .15s;
}
html[dir="rtl"] .article-toc a { padding: 7px 16px 7px 0; }
.article-toc a:hover { color: var(--navy); }
.article-toc a.is-active { color: var(--blue); font-weight: 600; border-inline-start-color: var(--blue); }

/* mobile TOC (collapsible, above content) */
.article-toc-mobile { display: block; margin-bottom: 32px; border: 1px solid var(--gray-line); border-radius: var(--radius-md); overflow: hidden; }
@media (min-width: 960px) { .article-toc-mobile { display: none; } }
.article-toc-mobile summary {
  padding: 14px 18px; cursor: pointer; font-weight: 600; font-size: 14.5px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--gray-soft);
  list-style: none;
}
.article-toc-mobile summary::-webkit-details-marker { display: none; }
.article-toc-mobile nav { padding: 6px 18px 14px; display: flex; flex-direction: column; gap: 4px; }
.article-toc-mobile a { font-size: 14px; color: var(--ink-muted); padding: 6px 0; }

/* ---------- article content typography ---------- */
.article-content { max-width: 760px; color: var(--ink); font-size: 16.5px; line-height: 1.75; }
.article-content section { margin-bottom: 44px; scroll-margin-top: 96px; }
.article-content h2 { font-size: 24px; line-height: 1.3; margin: 0 0 18px; color: var(--navy); }
.article-content h3 { font-size: 18.5px; line-height: 1.35; margin: 26px 0 12px; color: var(--navy); }
.article-content p { margin-bottom: 16px; color: var(--ink-muted); }
.article-content ul, .article-content ol { margin: 0 0 18px; padding-inline-start: 22px; color: var(--ink-muted); }
.article-content li { margin-bottom: 8px; }
.article-content strong { color: var(--ink); font-weight: 600; }
.article-content a:not(.btn) { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }

/* callout box */
.callout {
  display: flex; gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--blue-tint);
  border: 1px solid rgba(27,95,168,0.14);
  margin: 20px 0 24px;
  font-size: 15px;
  color: var(--navy-soft);
}
.callout svg { width: 19px; height: 19px; color: var(--blue); flex-shrink: 0; margin-top: 2px; }
.callout strong { color: var(--navy); }
.callout.callout-warn { background: #FFF6EC; border-color: rgba(196,120,20,0.18); color: #6b4310; }
.callout.callout-warn svg { color: #C47814; }

/* comparison / data table */
.article-content table {
  width: 100%; border-collapse: collapse;
  margin: 8px 0 24px;
  font-size: 14.5px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--gray-line);
}
.article-content th {
  background: var(--navy);
  color: #fff;
  text-align: start;
  padding: 11px 14px;
  font-weight: 600;
  font-size: 13.5px;
}
html[dir="rtl"] .article-content th { text-align: right; }
.article-content td { padding: 11px 14px; border-top: 1px solid var(--gray-line); color: var(--ink-muted); vertical-align: top; }
.article-content tr:nth-child(even) td { background: var(--gray-soft); }

/* checklist */
.checklist { list-style: none; padding: 0; margin: 0 0 8px; }
.checklist li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-line);
  color: var(--ink);
}
.checklist li:last-child { border-bottom: none; }
.checklist li svg { width: 19px; height: 19px; color: var(--success); flex-shrink: 0; margin-top: 1px; }

/* soft CTA box */
.article-cta-box {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  padding: 28px 30px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue-deep) 100%);
  color: #fff;
  margin: 40px 0;
}
.article-cta-box h3 { color: #fff; margin: 0 0 6px; font-size: 19px; }
.article-cta-box p { color: rgba(255,255,255,0.82); margin: 0; font-size: 14.5px; max-width: 440px; }
.article-cta-box .btn-on-navy { flex-shrink: 0; }

/* FAQ */
.article-faq-item { border-bottom: 1px solid var(--gray-line); padding: 18px 0; }
.article-faq-item:first-child { border-top: 1px solid var(--gray-line); }
.article-faq-item h3 { margin: 0 0 8px; font-size: 16px; color: var(--navy); }
.article-faq-item p { margin: 0; color: var(--ink-muted); font-size: 15px; }

/* share buttons */
.article-share { display: flex; align-items: center; gap: 10px; margin: 36px 0 8px; flex-wrap: wrap; }
.article-share-label { font-size: 13px; font-weight: 600; color: var(--ink-faint); margin-inline-end: 4px; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--gray-line);
  background: #fff;
  color: var(--navy-soft);
  transition: border-color .15s, color .15s, background .15s;
  cursor: pointer;
}
.share-btn svg { width: 16px; height: 16px; }
.share-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-tint); }
.share-btn.is-copied { border-color: var(--success); color: var(--success); }

/* prev / next */
.article-prevnext {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin: 36px 0 8px;
  padding-top: 28px;
  border-top: 1px solid var(--gray-line);
}
.prevnext-link {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-line);
  transition: border-color .15s, box-shadow .15s;
}
.prevnext-link:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); }
.prevnext-link.is-next { text-align: end; }
.prevnext-dir { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-faint); }
.prevnext-title { font-size: 14.5px; font-weight: 600; color: var(--navy); }
@media (max-width: 640px) { .article-prevnext { grid-template-columns: 1fr; } }

/* related articles */
.related-articles { padding: 8px 0 64px; }
.related-articles h2 { font-size: 22px; margin-bottom: 22px; }
.related-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .related-grid { grid-template-columns: repeat(3, 1fr); } }

/* back-to-knowledge-center row */
.article-back-row { padding: 0 0 60px; }
.back-to-kc { display: inline-flex; align-items: center; gap: 8px; }
.back-to-kc svg { width: 16px; height: 16px; }
html[dir="rtl"] .back-to-kc svg { transform: scaleX(-1); }
