
/* ============================================================
   KNOWLEDGE BASE STYLES
   ============================================================ */

/* --- KB Index / Home --- */
.kb-hero { padding: 40px 0 5px; text-align: center; }
.kb-hero .section-label { margin-bottom: 20px; }
.kb-hero h1 {
  font-size: clamp(2rem,4vw,3rem);
  font-weight: 800; letter-spacing: -.02em;
  line-height: 1.15; margin-bottom: 14px; margin-top: 10px;
}
.kb-hero h1 em { font-style: normal; color: var(--accent); }
.kb-hero p {
  font-size: 1.05rem; color: var(--text-muted);
  max-width: 560px; margin: 0 auto 32px; line-height: 1.7;
}

/* Search bar */
.kb-search {
  max-width: 480px; margin: 0 auto;
  position: relative;
}
.kb-search input {
  width: 100%; padding: 14px 48px 14px 20px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); color: var(--text);
  font-family: var(--font-body); font-size: .95rem;
  outline: none; transition: border-color .2s;
}
.kb-search input::placeholder { color: var(--text-dim); }
.kb-search input:focus { border-color: var(--accent); }
.kb-search-icon {
  position: absolute; right: 16px; top: 50%;
  transform: translateY(-50%); color: var(--text-dim); font-size: 1rem;
}

/* Category filter */
.kb-filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  justify-content: center; margin: 40px 0 32px;
}
.kb-filter {
  padding: 7px 16px; border-radius: 100px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); font-family: var(--font-body);
  font-size: .8rem; font-weight: 600; cursor: pointer; transition: all .2s;
}
.kb-filter:hover { border-color: var(--border-light); color: var(--text); }
.kb-filter.active { background: var(--accent); border-color: var(--accent); color: #0b1120; }

/* Articles grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px; margin-bottom: 64px;
}

.article-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  transition: all .2s; display: flex; flex-direction: column; gap: 12px;
  text-decoration: none;
}
.article-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}

.article-card-cat {
  font-size: .68rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
}
.article-card-title {
  font-family: var(--font-heading);
  font-size: 1rem; font-weight: 700;
  color: var(--text); line-height: 1.35;
}
.article-card-desc {
  font-size: .83rem; color: var(--text-muted);
  line-height: 1.65; flex: 1;
}
.article-card-meta {
  display: flex; align-items: center; gap: 12px;
  padding-top: 12px; border-top: 1px solid var(--border);
  font-size: .75rem; color: var(--text-dim);
}
.article-card-read { margin-left: auto; color: var(--accent); font-weight: 600; font-size: .78rem; }

/* Featured article */
.article-card--featured {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--bg-card), rgba(0,212,224,.04));
  border-color: rgba(0,212,224,.2);
  flex-direction: row; gap: 24px; align-items: flex-start;
}
.article-card--featured .article-card-title { font-size: 1.2rem; }
.article-card--featured .article-featured-icon {
  font-size: 2.5rem; flex-shrink: 0;
}

/* No results */
.no-results {
  text-align: center; padding: 48px 24px;
  color: var(--text-dim); display: none;
}

/* --- KB Article Page --- */

/* ── Breadcrumb (KB specific) ── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: .8rem; color: var(--text-dim); padding: 20px 0 0;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-dim); transition: color .2s; }
.breadcrumb a:hover { color: var(--text-muted); }
.breadcrumb span { color: var(--text-dim); }

/* ── Layout ── */
.kb-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.kb-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: start;
  padding: 5px 0 5px;
}

/* ── Article ── */
.kb-article {
  min-width: 0;
}

.article-meta {
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap; margin-bottom: 32px;
}
.meta-tag {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; padding: 4px 10px;
  border-radius: 6px; background: var(--accent-dim); color: var(--accent);
}
.meta-date { font-size: .8rem; color: var(--text-dim); }
.meta-read { font-size: .8rem; color: var(--text-dim); }

.article-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800; letter-spacing: -.02em; line-height: 1.15;
  margin-bottom: 16px; color: var(--text);
}
.article-title em { font-style: normal; color: var(--accent); }

.article-intro {
  font-size: 1.1rem; color: var(--text-muted);
  line-height: 1.75; margin-bottom: 40px;
  padding-bottom: 32px; border-bottom: 1px solid var(--border);
}

/* ── Article body typography ── */
.article-body { font-size: .95rem; line-height: 1.8; color: var(--text-muted); }

.article-body h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem; font-weight: 800;
  color: var(--text); margin: 40px 0 16px;
  letter-spacing: -.01em; line-height: 1.2;
}
.article-body h2:first-child { margin-top: 0; }

.article-body h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem; font-weight: 700;
  color: var(--text); margin: 28px 0 12px;
}

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

.article-body a { color: var(--accent); border-bottom: 1px solid rgba(0,212,224,.3); }
.article-body a:hover { border-bottom-color: var(--accent); }

.article-body ul, .article-body ol {
  margin: 0 0 16px 20px;
}
.article-body li { margin-bottom: 8px; }

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

/* Code blocks */
.article-body pre {
  background: #080e1c;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 20px 0;
  position: relative;
}
.article-body pre code {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: #e2e8f0;
  line-height: 1.7;
  background: none;
  padding: 0;
}
.article-body code {
  font-family: var(--font-mono);
  font-size: .85rem;
  background: rgba(255,255,255,.06);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Info / warning boxes */
.info-box {
  display: flex; gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  margin: 24px 0;
}
.info-box--tip {
  background: rgba(0,212,224,.06);
  border: 1px solid rgba(0,212,224,.2);
}
.info-box--warning {
  background: rgba(245,158,11,.06);
  border: 1px solid rgba(245,158,11,.2);
}
.info-box--danger {
  background: rgba(239,68,68,.06);
  border: 1px solid rgba(239,68,68,.2);
}
.info-box-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.info-box-content { font-size: .875rem; line-height: 1.65; color: var(--text-muted); }
.info-box-content strong { color: var(--text); }

/* Step counter */
.steps { counter-reset: step; list-style: none; margin: 0 0 24px; padding: 0; }
.steps li {
  counter-increment: step;
  display: flex; gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.steps li:last-child { border-bottom: none; }
.steps li::before {
  content: counter(step);
  min-width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid rgba(0,212,224,.3);
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: .85rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
}
.steps li .step-content { flex: 1; }
.steps li .step-title {
  font-family: var(--font-heading);
  font-size: 1rem; font-weight: 700;
  color: var(--text); margin-bottom: 8px;
}

/* Article footer */
.article-footer {
  margin-top: 48px; padding-top: 32px;
  border-top: 1px solid var(--border);
}
.article-tags {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px;
}
.article-tag {
  font-size: .75rem; font-weight: 600;
  padding: 4px 12px; border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--text-muted); transition: all .2s;
  text-decoration: none;
}
.article-tag:hover { border-color: var(--accent); color: var(--accent); }

/* ── Sidebar ── */
.kb-sidebar {
  position: sticky; top: 100px;
  display: flex; flex-direction: column; gap: 20px;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.sidebar-card h4 {
  font-family: var(--font-heading);
  font-size: .8rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 16px;
}

/* TOC */
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list li { margin-bottom: 4px; }
.toc-list a {
  font-size: .83rem; color: var(--text-muted);
  display: block; padding: 5px 8px;
  border-radius: var(--radius);
  border-left: 2px solid transparent;
  transition: all .2s; line-height: 1.4;
  text-decoration: none;
}
.toc-list a:hover,
.toc-list a.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-left-color: var(--accent);
}

/* Related articles */
.related-list { display: flex; flex-direction: column; gap: 4px; }
.related-link {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px; border-radius: var(--radius);
  font-size: .82rem; color: var(--text-muted);
  line-height: 1.4; transition: all .15s;
  text-decoration: none;
}
.related-link:hover { background: var(--accent-dim); color: var(--text); }
.related-link::before { content: '→'; color: var(--accent); flex-shrink: 0; margin-top: 1px; }

/* CTA sidebar */
.sidebar-cta {
  background: linear-gradient(135deg, var(--bg-card), rgba(30,111,255,.08));
  border: 1px solid rgba(0,212,224,.2);
  border-radius: var(--radius-lg);
  padding: 20px; text-align: center;
}
.sidebar-cta p {
  font-size: .82rem; color: var(--text-muted);
  line-height: 1.6; margin-bottom: 14px;
}
.sidebar-cta .btn { width: 100%; justify-content: center; font-size: .85rem; }

/* ── Related articles section ── */
.related-section { padding: 30px 0; border-top: 1px solid var(--border); }
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px; margin-top: 32px;
}
.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all .2s;
  text-decoration: none;
}
.related-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.related-card-tag {
  font-size: .7rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.related-card-title {
  font-family: var(--font-heading);
  font-size: .95rem; font-weight: 700;
  color: var(--text); line-height: 1.35; margin-bottom: 8px;
}
.related-card-desc {
  font-size: .8rem; color: var(--text-dim); line-height: 1.6;
}

@media (max-width: 900px) {
  .articles-grid { grid-template-columns: 1fr 1fr; }
  .article-card--featured { grid-column: span 2; }
  .kb-layout { grid-template-columns: 1fr; }
  .kb-sidebar { position: static; }
  .related-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .articles-grid { grid-template-columns: 1fr; }
  .article-card--featured { grid-column: span 1; flex-direction: column; }
}
