/* ═══════════════════════ KNOWLEDGE BASE ═══════════════════════ */

/* Hub Page */
.kb-hub { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.kb-hub-hero { text-align: center; margin-bottom: 2.5rem; }
.kb-hub-search {
  max-width: 480px; margin: 1.5rem auto 0; position: relative;
}
.kb-hub-search input {
  width: 100%; padding: 0.85rem 1.25rem 0.85rem 2.75rem;
  border-radius: 50px; border: 1.5px solid var(--border);
  background: var(--surface-alt); color: var(--text-primary);
  font-family: 'Outfit', sans-serif; font-size: 0.95rem;
  transition: border-color 0.3s;
}
.kb-hub-search input:focus {
  outline: none; border-color: var(--indigo-light);
}
.kb-hub-search svg {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--text-secondary); pointer-events: none;
}

.kb-category-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem; color: var(--ink);
  margin: 2.5rem 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Card Grid */
.kb-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.25rem;
}
.kb-card {
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  transition: all 0.3s;
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
}
.kb-card:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 70, 229, 0.3);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.kb-card-emoji { font-size: 1.75rem; margin-bottom: 0.6rem; }
.kb-card h4 {
  font-size: 1rem; color: var(--ink);
  margin-bottom: 0.3rem; font-weight: 600;
}
.kb-card p {
  font-size: 0.85rem; color: var(--text-secondary);
  line-height: 1.6; margin: 0;
}
.kb-card-arrow {
  margin-top: 0.75rem; font-size: 0.8rem;
  color: var(--indigo-light); font-weight: 600;
}

/* Article Layout */
.kb-article {
  max-width: 820px; margin: 0 auto;
  padding: 0 1.5rem;
}

/* Breadcrumbs */
.kb-breadcrumb {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; color: var(--text-secondary);
  margin-bottom: 1.5rem; flex-wrap: wrap;
}
.kb-breadcrumb a {
  color: var(--indigo-light);
  text-decoration: none;
}
.kb-breadcrumb a:hover { text-decoration: underline; }
.kb-breadcrumb-sep { color: var(--text-tertiary); }

/* Article Heading */
.kb-article-title {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem; color: var(--ink);
  margin-bottom: 0.5rem; line-height: 1.2;
}
.kb-article-subtitle {
  font-size: 0.95rem; color: var(--text-secondary);
  line-height: 1.6; margin-bottom: 2rem;
}

/* Section */
.kb-section { margin-bottom: 2.5rem; }
.kb-section h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem; color: var(--ink);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.kb-section h3 {
  font-size: 1.05rem; color: var(--ink);
  margin: 1.25rem 0 0.5rem; font-weight: 600;
}
.kb-section p {
  color: var(--text-secondary);
  line-height: 1.7; margin-bottom: 0.75rem;
  font-size: 0.95rem;
}
.kb-section ul, .kb-section ol {
  color: var(--text-secondary);
  line-height: 1.7; padding-left: 1.5rem;
  margin-bottom: 1rem; font-size: 0.95rem;
}
.kb-section li { margin-bottom: 0.4rem; }

/* Evidence Checklist */
.kb-checklist { list-style: none; padding: 0; margin: 1rem 0; }
.kb-checklist li {
  position: relative;
  padding: 0.55rem 0 0.55rem 2rem;
  color: var(--text-secondary); line-height: 1.6;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.92rem;
}
.kb-checklist li::before {
  content: ''; position: absolute; left: 0; top: 0.7rem;
  width: 16px; height: 16px;
  border: 2px solid var(--indigo-light);
  border-radius: 3px;
}

/* Tip / Warning / Info Boxes */
.kb-tip-box {
  padding: 1.15rem 1.35rem;
  border-radius: 10px;
  margin: 1.25rem 0;
  border-left: 4px solid;
}
.kb-tip-box.tip {
  background: rgba(79, 70, 229, 0.06);
  border-color: var(--indigo-light);
}
.kb-tip-box.warning {
  background: rgba(232, 197, 71, 0.06);
  border-color: var(--gold);
}
.kb-tip-box.info {
  background: rgba(78, 203, 113, 0.06);
  border-color: var(--green);
}
.kb-tip-title {
  font-weight: 700; font-size: 0.88rem;
  margin-bottom: 0.35rem;
  color: var(--ink);
}
.kb-tip-box p { margin: 0; font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; }

/* Stat Box */
.kb-stat-row {
  display: flex; gap: 1rem; flex-wrap: wrap;
  margin: 1rem 0 1.5rem;
}
.kb-stat-box {
  display: flex; flex-direction: column;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.5rem;
}
.kb-stat-label {
  font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-secondary);
  margin-bottom: 0.25rem;
}
.kb-stat-value {
  font-size: 1.3rem; font-weight: 700;
  color: var(--indigo-light);
}

/* Numbered Steps */
.kb-steps { counter-reset: kb-step; list-style: none; padding: 0; margin: 1rem 0; }
.kb-steps li {
  position: relative; counter-increment: kb-step;
  padding: 0.75rem 0 0.75rem 3rem;
  color: var(--text-secondary); line-height: 1.6;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.92rem;
}
.kb-steps li::before {
  content: counter(kb-step);
  position: absolute; left: 0; top: 0.65rem;
  width: 26px; height: 26px;
  background: var(--indigo-light); color: #fff;
  border-radius: 50%; font-size: 0.78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* FAQ (Collapsible) */
.kb-faq-item {
  border-bottom: 1px solid var(--border);
}
.kb-faq-toggle {
  display: flex; justify-content: space-between;
  align-items: center; width: 100%; padding: 1rem 0;
  background: none; border: none; cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem; font-weight: 600; color: var(--ink);
  text-align: left; gap: 1rem;
}
.kb-faq-toggle::after {
  content: '+'; font-size: 1.2rem; color: var(--indigo-light);
  flex-shrink: 0; transition: transform 0.3s;
}
.kb-faq-item.open .kb-faq-toggle::after {
  content: '\2212';
}
.kb-faq-answer {
  max-height: 0; overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  color: var(--text-secondary); line-height: 1.7; font-size: 0.9rem;
}
.kb-faq-item.open .kb-faq-answer {
  max-height: 600px;
  padding-bottom: 1rem;
}

/* Related Links */
.kb-related {
  margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.kb-related h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.15rem; margin-bottom: 1rem; color: var(--ink);
}
.kb-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.kb-related-link {
  display: block; padding: 0.85rem 1rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--indigo-light);
  text-decoration: none;
  font-size: 0.85rem; font-weight: 600;
  transition: all 0.3s;
}
.kb-related-link:hover {
  border-color: var(--indigo-light);
  background: rgba(79, 70, 229, 0.06);
}

/* Article CTA */
.kb-cta {
  text-align: center; padding: 2rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin: 2.5rem 0 1.5rem;
}
.kb-cta h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem; color: var(--ink);
  margin-bottom: 0.5rem;
}
.kb-cta p {
  color: var(--text-secondary); font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Wizard Help Panel */
.wizard-help-panel {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.wizard-help-toggle {
  display: flex; justify-content: space-between;
  align-items: center; width: 100%;
  padding: 0.85rem 1.15rem; background: none;
  border: none; cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem; font-weight: 600;
  color: var(--indigo-light); text-align: left;
}
.wizard-help-toggle::after {
  content: '+'; font-size: 1.1rem;
  transition: transform 0.3s;
}
.wizard-help-panel.open .wizard-help-toggle::after {
  content: '\2212';
}
.wizard-help-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.35s ease;
  padding: 0 1.15rem;
}
.wizard-help-panel.open .wizard-help-body {
  max-height: 700px;
  padding: 0 1.15rem 1.15rem;
}
.wizard-help-body h4 {
  color: var(--ink); font-size: 0.9rem;
  margin: 0.75rem 0 0.35rem; font-weight: 600;
}
.wizard-help-body ul {
  margin: 0.25rem 0 0.75rem; padding-left: 1.25rem;
  color: var(--text-secondary); font-size: 0.83rem; line-height: 1.65;
}
.wizard-help-body li { margin-bottom: 0.25rem; }

/* Responsive */
@media (max-width: 768px) {
  .kb-card-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .kb-article-title { font-size: 1.6rem; }
  .kb-stat-row { flex-direction: column; }
  .kb-related-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .kb-card-grid { grid-template-columns: 1fr; }
  .kb-article { padding: 0 1rem; }
}
