/* ═══════════════════════════════════════════════════════════
   rabbiico Knowledge Center — Shared Stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ─── RESET & VARIABLES ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --white:       #ffffff;
  --surface:     #f8fafc;
  --surface-2:   #f1f5f9;
  --dark-bg:     #020617;
  --dark-2:      #0f172a;
  --dark-3:      #1e293b;
  --text:        #0f172a;
  --text-2:      #334155;
  --muted:       #64748b;
  --border:      rgba(0,0,0,.08);
  --border-dark: rgba(0,0,0,.13);
  --blue:        #2563eb;
  --blue-dark:   #1d4ed8;
  --violet:      #7c3aed;
  --electric:    #3b82f6;
  --grad:        linear-gradient(135deg, #2563eb 0%, #6366f1 50%, #7c3aed 100%);
  --grad-text:   linear-gradient(135deg, #60a5fa 0%, #a78bfa 50%, #60a5fa 100%);
  --shadow-xs:   0 1px 2px rgba(0,0,0,.05);
  --shadow-s:    0 2px 8px rgba(0,0,0,.06);
  --shadow-m:    0 8px 24px rgba(0,0,0,.08);
  --shadow-l:    0 20px 60px rgba(0,0,0,.12);
  --r:           14px;
  --r-sm:        8px;
  --ease:        cubic-bezier(0.22, 1, 0.36, 1);
  --max-w:       1200px;

  /* Category colors */
  --cat-ai:       #2563eb;
  --cat-analysis: #4f46e5;
  --cat-auto:     #7c3aed;
  --cat-web:      #059669;
  --cat-security: #dc2626;
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--white);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ─── NAV ────────────────────────────────────────────────── */
.kn-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 max(24px, calc((100vw - var(--max-w)) / 2));
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.kn-logo {
  font-size: 20px; font-weight: 900; letter-spacing: -.04em;
  display: flex; align-items: center; gap: 1px;
}
.kn-logo .rabbii { color: var(--text); }
.kn-logo .co { color: var(--blue); }
.kn-nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.kn-nav-a {
  display: block; padding: 6px 14px;
  font-size: 14px; font-weight: 500;
  color: var(--text-2); border-radius: 8px;
  transition: color .2s, background .2s;
}
.kn-nav-a:hover { color: var(--text); background: rgba(0,0,0,.05); }
.kn-nav-a.active { color: var(--blue); }
.kn-nav-cta {
  margin-left: 8px; padding: 8px 18px;
  background: var(--blue); color: #fff;
  border-radius: 8px; font-size: 13px; font-weight: 700;
  transition: background .2s, transform .2s;
}
.kn-nav-cta:hover { background: var(--blue-dark); transform: translateY(-1px); }

/* ─── BREADCRUMB ─────────────────────────────────────────── */
.breadcrumb {
  padding: 14px max(24px, calc((100vw - var(--max-w)) / 2));
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.breadcrumb a { color: var(--blue); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { opacity: .4; }

/* ─── CATEGORY BADGES ────────────────────────────────────── */
.cat-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase;
}
.cat-badge.ai       { background: rgba(37,99,235,.1);  color: #1d4ed8; }
.cat-badge.analysis { background: rgba(79,70,229,.1);  color: #4338ca; }
.cat-badge.auto     { background: rgba(124,58,237,.1); color: #6d28d9; }
.cat-badge.web      { background: rgba(5,150,105,.1);  color: #047857; }
.cat-badge.security { background: rgba(220,38,38,.1);  color: #b91c1c; }

/* ─── HUB PAGE ───────────────────────────────────────────── */
.hub-hero {
  background: var(--dark-bg);
  padding: 72px max(24px, calc((100vw - var(--max-w)) / 2)) 64px;
  text-align: center;
}
.hub-hero-label {
  font-size: 11px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: #60a5fa; margin-bottom: 16px;
}
.hub-hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 900; letter-spacing: -.04em;
  line-height: 1.1; color: #fff; margin-bottom: 20px;
}
.hub-hero h1 span {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hub-hero p {
  font-size: 18px; color: rgba(255,255,255,.55);
  max-width: 560px; margin: 0 auto 36px; line-height: 1.65;
}
.hub-search {
  max-width: 480px; margin: 0 auto;
  display: flex; gap: 0;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px; overflow: hidden;
}
.hub-search input {
  flex: 1; padding: 14px 18px;
  background: transparent; border: none; outline: none;
  color: #fff; font-size: 15px; font-family: inherit;
}
.hub-search input::placeholder { color: rgba(255,255,255,.3); }
.hub-search button {
  padding: 12px 20px; background: var(--blue);
  border: none; color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background .2s;
}
.hub-search button:hover { background: var(--blue-dark); }

/* Hub content area */
.hub-body {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px 24px 80px;
}
.hub-filters {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 48px;
}
.hub-filter-btn {
  padding: 8px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--border-dark);
  background: var(--white); color: var(--muted);
  cursor: pointer; transition: all .2s; font-family: inherit;
}
.hub-filter-btn:hover { border-color: var(--blue); color: var(--blue); }
.hub-filter-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* Category section */
.hub-category { margin-bottom: 64px; }
.hub-category-title {
  font-size: 13px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.hub-category-title::before {
  content: ''; width: 3px; height: 16px; border-radius: 2px;
  background: var(--cat-color, var(--blue));
}

/* Article card grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.article-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 28px 24px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .25s, box-shadow .25s, transform .25s;
  position: relative;
}
.article-card:hover {
  border-color: rgba(37,99,235,.3);
  box-shadow: 0 8px 28px rgba(37,99,235,.08);
  transform: translateY(-3px);
}
.article-card-meta {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.article-card-time {
  font-size: 11px; color: var(--muted); font-weight: 500;
}
.article-card h3 {
  font-size: 16px; font-weight: 700; letter-spacing: -.02em;
  line-height: 1.4; color: var(--text);
  transition: color .2s;
}
.article-card:hover h3 { color: var(--blue); }
.article-card p {
  font-size: 13px; color: var(--muted); line-height: 1.6;
  flex: 1;
}
.article-card-link {
  font-size: 13px; font-weight: 700; color: var(--blue);
  display: flex; align-items: center; gap: 5px;
  margin-top: auto;
}
.article-card-link::after { content: '→'; }
.article-card:hover .article-card-link::after { transform: translateX(3px); }

/* Comparison cards (wider) */
.article-card.comparison {
  background: linear-gradient(135deg, rgba(37,99,235,.03), rgba(124,58,237,.03));
  border-color: rgba(37,99,235,.12);
}

/* ─── ARTICLE PAGE ───────────────────────────────────────── */
.article-header {
  background: var(--dark-bg);
  padding: 56px max(24px, calc((100vw - var(--max-w)) / 2)) 52px;
}
.article-header-meta {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.article-read-time {
  font-size: 12px; color: rgba(255,255,255,.4); font-weight: 500;
}
.article-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900; letter-spacing: -.04em;
  line-height: 1.15; color: #fff; margin-bottom: 18px;
  max-width: 820px;
}
.article-header h1 span {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.article-intro {
  font-size: 18px; color: rgba(255,255,255,.55);
  max-width: 680px; line-height: 1.7;
}

/* Article body layout */
.article-layout {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 56px;
  align-items: start;
}
.article-content { min-width: 0; }
.article-content h2 {
  font-size: 22px; font-weight: 800; letter-spacing: -.03em;
  color: var(--text); margin: 40px 0 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.article-content h2:first-child { margin-top: 0; }
.article-content h3 {
  font-size: 17px; font-weight: 700; letter-spacing: -.02em;
  color: var(--text); margin: 24px 0 10px;
}
.article-content p {
  font-size: 16px; color: var(--text-2);
  line-height: 1.8; margin-bottom: 16px;
}
.article-content ul, .article-content ol {
  padding-left: 22px; margin-bottom: 18px;
}
.article-content li {
  font-size: 16px; color: var(--text-2); line-height: 1.75;
  margin-bottom: 6px;
}
.article-content strong { color: var(--text); font-weight: 700; }
.article-content a { color: var(--blue); }
.article-content a:hover { text-decoration: underline; }
.article-content .btn-primary,
.article-content .btn-primary:hover { color: #fff; text-decoration: none; }

/* Callout boxes */
.callout {
  border-radius: var(--r-sm);
  padding: 18px 20px; margin: 24px 0;
  display: flex; gap: 14px;
}
.callout.info {
  background: rgba(37,99,235,.06);
  border: 1px solid rgba(37,99,235,.15);
}
.callout.warning {
  background: rgba(245,158,11,.06);
  border: 1px solid rgba(245,158,11,.18);
}
.callout-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.callout-body { font-size: 14px; color: var(--text-2); line-height: 1.65; }
.callout-body strong { color: var(--text); }

/* Definition box */
.definition-box {
  background: var(--surface); border-left: 4px solid var(--blue);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 20px 22px; margin: 24px 0;
}
.definition-box p {
  font-size: 16px; font-style: italic;
  color: var(--text); margin: 0; line-height: 1.65;
}

/* Comparison table */
.compare-table {
  width: 100%; border-collapse: collapse; margin: 24px 0;
  font-size: 14px; border-radius: var(--r-sm); overflow: hidden;
  border: 1px solid var(--border);
}
.compare-table th {
  background: var(--dark-bg); color: #fff;
  padding: 12px 16px; text-align: left; font-weight: 700;
}
.compare-table td {
  padding: 11px 16px; border-bottom: 1px solid var(--border);
  color: var(--text-2); vertical-align: top;
}
.compare-table tr:last-child td { border-bottom: none; }
.compare-table tr:nth-child(even) td { background: var(--surface); }

/* FAQ section */
.faq-section { margin-top: 48px; }
.faq-section h2 {
  font-size: 22px; font-weight: 800; letter-spacing: -.03em;
  margin-bottom: 20px;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-q {
  width: 100%; padding: 16px 20px;
  background: var(--surface);
  border: none; outline: none;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 600; color: var(--text);
  cursor: pointer; font-family: inherit; text-align: left;
  gap: 16px;
}
.faq-q:hover { background: var(--surface-2); }
.faq-icon {
  width: 20px; height: 20px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--blue); transition: transform .3s;
}
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-a {
  padding: 0 20px;
  max-height: 0; overflow: hidden;
  transition: max-height .35s ease, padding .35s ease;
  font-size: 14px; color: var(--muted); line-height: 1.7;
}
.faq-item.open .faq-a {
  max-height: 300px;
  padding: 14px 20px 18px;
}

/* Article bottom CTA */
.article-cta-box {
  margin-top: 48px; padding: 32px 28px;
  background: linear-gradient(135deg, #020617, #0f172a);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--r); text-align: center;
}
.article-cta-box h3 {
  font-size: 20px; font-weight: 800; color: #fff;
  margin-bottom: 10px; letter-spacing: -.03em;
}
.article-cta-box p { font-size: 14px; color: rgba(255,255,255,.5); margin-bottom: 20px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; background: var(--blue); color: #fff;
  border-radius: 10px; font-size: 14px; font-weight: 700;
  transition: background .2s, transform .2s;
}
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  border: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.7);
  border-radius: 10px; font-size: 14px; font-weight: 600;
  transition: border-color .2s, color .2s;
}
.btn-ghost:hover { border-color: rgba(255,255,255,.4); color: #fff; }

/* Related articles at bottom of article */
.related-section {
  margin-top: 56px; padding-top: 40px;
  border-top: 1px solid var(--border);
}
.related-section h2 {
  font-size: 18px; font-weight: 800; margin-bottom: 20px;
  border: none; padding: 0;
}
.related-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.related-card {
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 20px 18px; transition: border-color .2s, transform .2s;
}
.related-card:hover { border-color: rgba(37,99,235,.3); transform: translateY(-2px); }
.related-card h4 {
  font-size: 14px; font-weight: 700; color: var(--text);
  line-height: 1.4; margin-bottom: 6px;
  transition: color .2s;
}
.related-card:hover h4 { color: var(--blue); }
.related-card p { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ─── SIDEBAR ────────────────────────────────────────────── */
.article-sidebar { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 24px; }

.sidebar-toc {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px;
}
.sidebar-toc h4 {
  font-size: 11px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
}
.sidebar-toc ol { padding-left: 16px; }
.sidebar-toc li {
  margin-bottom: 8px;
}
.sidebar-toc a {
  font-size: 13px; color: var(--text-2); line-height: 1.4;
  transition: color .2s;
}
.sidebar-toc a:hover { color: var(--blue); }

.sidebar-cta {
  background: linear-gradient(135deg, #020617, #0f172a);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--r); padding: 24px 20px; text-align: center;
}
.sidebar-cta-icon { font-size: 28px; margin-bottom: 10px; }
.sidebar-cta h4 { font-size: 15px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.sidebar-cta p { font-size: 12px; color: rgba(255,255,255,.45); margin-bottom: 16px; line-height: 1.55; }
.sidebar-cta-btn {
  display: block; padding: 10px 16px;
  background: var(--blue); color: #fff;
  border-radius: 8px; font-size: 13px; font-weight: 700;
  transition: background .2s; text-align: center;
}
.sidebar-cta-btn:hover { background: var(--blue-dark); }

.sidebar-links {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px;
}
.sidebar-links h4 {
  font-size: 11px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
}
.sidebar-link-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text-2); transition: color .2s;
}
.sidebar-link-item:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-link-item:hover { color: var(--blue); }
.sidebar-link-item::before { content: '→'; color: var(--blue); flex-shrink: 0; }

/* ─── FOOTER ─────────────────────────────────────────────── */
.kn-footer {
  background: var(--dark-bg);
  padding: 48px max(24px, calc((100vw - var(--max-w)) / 2));
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 20px;
}
.kn-footer-logo {
  font-size: 18px; font-weight: 900; letter-spacing: -.04em;
}
.kn-footer-logo .rabbii { color: #fff; }
.kn-footer-logo .co { color: #60a5fa; }
.kn-footer p { font-size: 13px; color: rgba(255,255,255,.35); }
.kn-footer-links { display: flex; gap: 20px; }
.kn-footer-links a { font-size: 13px; color: rgba(255,255,255,.4); transition: color .2s; }
.kn-footer-links a:hover { color: #fff; }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .kn-nav-links { display: none; }
}
@media (max-width: 640px) {
  .article-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .hub-filters { gap: 6px; }
  .hub-filter-btn { font-size: 12px; padding: 7px 14px; }
}

/* ─── FAQ JS ─────────────────────────────────────────────── */
/* toggled via JS — no extra styles needed beyond above */

/* ─── PROGRESS BAR ───────────────────────────────────────── */
.reading-progress {
  position: fixed; top: 0; left: 0; z-index: 200;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  transition: width .1s linear;
}
