/* ================================================================
   GhostDocs — Public Design System
   Monochrome premium. Retina-ready. Light/Dark.
   Font: Syne (display) + DM Sans (body) + JetBrains Mono (code)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── TOKENS ─────────────────────────────────────────────────────── */
:root {
  --font-display: 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Light mode */
  --bg:           #ffffff;
  --bg-secondary: #f8f8f8;
  --bg-tertiary:  #f2f2f2;
  --surface:      #ffffff;
  --surface-hover:#f5f5f5;
  --border:       #e5e5e5;
  --border-strong:#cccccc;

  --text:         #0a0a0a;
  --text-secondary:#555555;
  --text-muted:   #999999;
  --text-disabled:#bbbbbb;

  --accent:       #000000;
  --accent-text:  #ffffff;
  --accent-hover: #111111;

  --link:         #0a0a0a;
  --link-hover:   #000000;

  --code-bg:      #f4f4f4;
  --code-text:    #1a1a1a;
  --code-border:  #e0e0e0;

  --sidebar-w:    280px;
  --toc-w:        240px;
  --header-h:     60px;

  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    16px;
  --radius-xl:    24px;

  --shadow-sm:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:    0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:    0 16px 48px rgba(0,0,0,.12);

  --transition:   all 0.18s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="dark"] {
  --bg:           #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary:  #181818;
  --surface:      #141414;
  --surface-hover:#1e1e1e;
  --border:       #222222;
  --border-strong:#333333;

  --text:         #f5f5f5;
  --text-secondary:#aaaaaa;
  --text-muted:   #666666;
  --text-disabled:#444444;

  --accent:       #ffffff;
  --accent-text:  #000000;
  --accent-hover: #e5e5e5;

  --link:         #f5f5f5;
  --link-hover:   #ffffff;

  --code-bg:      #111111;
  --code-text:    #e5e5e5;
  --code-border:  #222222;

  --shadow-sm:    0 1px 3px rgba(0,0,0,.3);
  --shadow-md:    0 4px 16px rgba(0,0,0,.5);
  --shadow-lg:    0 16px 48px rgba(0,0,0,.7);
}

/* ── RESET ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.6; transition: background 0.2s, color 0.2s; display: flex; flex-direction: column; min-height: 100vh; }
#spa-content { flex: 1; display: flex; flex-direction: column; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
button { font-family: var(--font-body); cursor: pointer; }

/* ── SCROLLBAR ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── HEADER ─────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 700;
  letter-spacing: -0.03em;
  flex-shrink: 0;
  text-decoration: none; color: var(--text);
}
.header-logo-icon {
  width: 32px; height: 32px;
  background: var(--text);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
}
.header-logo-icon svg { width: 18px; height: 18px; color: var(--bg); }

.header-nav { display: flex; align-items: center; gap: 0.25rem; margin-left: 1.5rem; }
.header-nav a {
  font-size: 0.875rem; font-weight: 500; color: var(--text-secondary);
  padding: 0.4rem 0.75rem; border-radius: var(--radius-sm);
  transition: var(--transition); letter-spacing: -0.01em;
}
.header-nav a:hover, .header-nav a.active { color: var(--text); background: var(--bg-secondary); }

.header-search {
  flex: 1; max-width: 340px; margin: 0 auto;
  position: relative;
}
.header-search-btn {
  width: 100%; display: flex; align-items: center; gap: 8px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 0.5rem 1rem;
  color: var(--text-muted); font-size: 0.875rem; cursor: text;
  transition: var(--transition);
}
.header-search-btn:hover { border-color: var(--border-strong); color: var(--text-secondary); }
.header-search-btn kbd {
  margin-left: auto; display: flex; gap: 3px; align-items: center;
}
.header-search-btn kbd span {
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; font-size: 0.7rem;
  font-family: var(--font-mono); color: var(--text-muted);
}

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.theme-toggle {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); display: flex; align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0;
}
.theme-toggle:hover { background: var(--bg-secondary); color: var(--text); border-color: var(--border-strong); }
.theme-toggle svg { width: 16px; height: 16px; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
.icon-sun { display: none; }
.icon-moon { display: block; }

/* ── SEARCH MODAL ───────────────────────────────────────────────── */
.search-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  align-items: flex-start; justify-content: center; padding-top: 80px;
}
.search-overlay.active { display: flex; }
.search-modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 560px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.search-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.search-input-wrap svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.search-input-wrap input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 1rem; color: var(--text); font-family: var(--font-body);
}
.search-results { max-height: 400px; overflow-y: auto; }
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: var(--transition);
  text-decoration: none; color: var(--text);
}
.search-result-item:hover, .search-result-item.focused { background: var(--bg-secondary); }
.search-result-type {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 600; color: var(--text-muted);
  background: var(--bg-tertiary); padding: 2px 6px; border-radius: 4px;
  flex-shrink: 0;
}
.search-result-item[data-type="doc"]       .search-result-type { background:#1e3a5f22; color:#4a9eff; }
.search-result-item[data-type="blog"]      .search-result-type { background:#1a3a2022; color:#4ade80; }
.search-result-item[data-type="faq"]       .search-result-type { background:#3a2a1022; color:#fb923c; }
.search-result-item[data-type="api"]       .search-result-type { background:#2a1a3a22; color:#c084fc; }
.search-result-item[data-type="changelog"] .search-result-type { background:#1a2a3a22; color:#67e8f9; }
.search-result-title { font-size: 0.9rem; font-weight: 500; }
.search-empty { padding: 2.5rem; text-align: center; color: var(--text-muted); font-size: 0.9rem; }
.search-footer {
  display: flex; gap: 1rem; padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.75rem;
}
.search-footer span { display: flex; align-items: center; gap: 4px; }
.search-footer kbd {
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px; font-family: var(--font-mono); font-size: 0.7rem;
}

/* ── LAYOUT ─────────────────────────────────────────────────────── */
.docs-layout {
  display: flex; min-height: calc(100vh - var(--header-h));
}

/* ── SIDEBAR ────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto; overflow-x: hidden;
}
.sidebar-section { margin-bottom: 2rem; }
.sidebar-section-title {
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-muted); padding: 0 1.25rem;
  margin-bottom: 0.5rem; display: block;
}
.sidebar-link {
  display: flex; align-items: center; gap: 8px;
  padding: 0.45rem 1.25rem;
  font-size: 0.875rem; color: var(--text-secondary);
  transition: var(--transition); border-radius: 0;
  position: relative;
}
.sidebar-link:hover { color: var(--text); background: var(--bg-secondary); }
.sidebar-link.active {
  color: var(--text); font-weight: 500;
  background: var(--bg-secondary);
}
.sidebar-link.active::before {
  content: ''; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 2px; background: var(--text); border-radius: 0 2px 2px 0;
}

/* ── MAIN CONTENT ───────────────────────────────────────────────── */
.docs-main {
  flex: 1; min-width: 0;
  padding: 3rem 4rem 5rem;
  max-width: 780px;
}

/* ── TABLE OF CONTENTS ──────────────────────────────────────────── */
.toc-aside {
  width: var(--toc-w); flex-shrink: 0;
  padding: 2rem 1.5rem 2rem 0;
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.toc-title {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 0.75rem;
}
.toc-list { list-style: none; }
.toc-list li a {
  display: block; font-size: 0.8rem; color: var(--text-secondary);
  padding: 0.3rem 0.5rem; border-left: 1px solid var(--border);
  transition: var(--transition); line-height: 1.5;
}
.toc-list li a:hover { color: var(--text); border-left-color: var(--text-muted); }
.toc-list li a.active { color: var(--text); border-left-color: var(--text); font-weight: 500; }
.toc-list li.level-3 a { padding-left: 1.25rem; font-size: 0.75rem; }

/* ── TYPOGRAPHY ─────────────────────────────────────────────────── */
.content h1 { font-family: var(--font-display); font-size: 2.25rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.2; margin-bottom: 1rem; }
.content h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.3; margin-top: 2.5rem; margin-bottom: 0.75rem; padding-top: 2.5rem; border-top: 1px solid var(--border); }
.content h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.content h3 { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.02em; margin-top: 1.75rem; margin-bottom: 0.5rem; }
.content h4 { font-size: 0.95rem; font-weight: 600; margin-top: 1.25rem; margin-bottom: 0.4rem; }
.content p { margin-bottom: 1rem; color: var(--text); line-height: 1.75; }
.content a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
.content a:hover { text-decoration-color: var(--text); }
.content strong { font-weight: 600; }
.content em { font-style: italic; }
.content del { text-decoration: line-through; color: var(--text-muted); }
.content hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* Lists */
.content ul, .content ol { margin: 0 0 1rem 1.5rem; }
.content li { margin-bottom: 0.35rem; line-height: 1.7; }
.content li::marker { color: var(--text-muted); }

/* Blockquote */
.content blockquote {
  border-left: 3px solid var(--border-strong);
  margin: 1.5rem 0; padding: 0.75rem 1.25rem;
  background: var(--bg-secondary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

/* Inline code */
.content code {
  font-family: var(--font-mono); font-size: 0.85em;
  background: var(--code-bg); color: var(--code-text);
  border: 1px solid var(--code-border);
  padding: 0.15em 0.45em; border-radius: 4px;
}

/* Code blocks */
.content pre {
  background: var(--code-bg); border: 1px solid var(--code-border);
  border-radius: var(--radius-md); padding: 1.25rem 1.5rem;
  overflow-x: auto; margin: 1.5rem 0; position: relative;
}
.content pre code {
  background: none; border: none; padding: 0;
  font-size: 0.875rem; line-height: 1.7;
  font-family: var(--font-mono);
  color: var(--code-text);
}

/* Tables */
.content .table-wrap { overflow-x: auto; margin: 1.5rem 0; }
.content table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.content th { text-align: left; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.content td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); color: var(--text-secondary); vertical-align: top; }
.content tr:last-child td { border-bottom: none; }
.content tr:hover td { background: var(--bg-secondary); }

/* Callouts */
.callout {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 1rem 1.25rem; border-radius: var(--radius-md);
  margin: 1.5rem 0; border: 1px solid;
}
.callout-note    { background: rgba(59,130,246,.06); border-color: rgba(59,130,246,.2); }
.callout-warning { background: rgba(234,179,8,.06); border-color: rgba(234,179,8,.2); }
.callout-tip     { background: rgba(34,197,94,.06); border-color: rgba(34,197,94,.2); }
.callout-danger  { background: rgba(239,68,68,.06); border-color: rgba(239,68,68,.2); }
.callout-icon    { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.callout-content { font-size: 0.9rem; line-height: 1.6; }

/* Images */
.content img {
  border-radius: var(--radius-md); margin: 1.5rem 0;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}

/* ── PAGE NAV ───────────────────────────────────────────────────── */
.page-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border);
}
.page-nav-link {
  display: flex; flex-direction: column; gap: 4px;
  padding: 1rem 1.25rem; border: 1px solid var(--border);
  border-radius: var(--radius-md); flex: 1; max-width: 240px;
  transition: var(--transition); text-decoration: none;
}
.page-nav-link:hover { border-color: var(--border-strong); background: var(--bg-secondary); }
.page-nav-link.next { align-items: flex-end; margin-left: auto; }
.page-nav-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; }
.page-nav-title { font-size: 0.9rem; font-weight: 500; color: var(--text); }

/* ── BREADCRUMB ─────────────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--text-muted);
  margin-bottom: 1.5rem; flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb-sep { color: var(--text-disabled); }

/* ── CARDS (Home page) ──────────────────────────────────────────── */
.home-hero {
  padding: 5rem 2rem 4rem;
  text-align: center; max-width: 700px; margin: 0 auto;
}
.home-hero h1 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 800; letter-spacing: -0.04em; line-height: 1.1;
  margin-bottom: 1.25rem;
}
.home-hero p { font-size: 1.1rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 2rem; }
.home-hero-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.doc-card {
  background: var(--bg); padding: 1.75rem;
  transition: var(--transition); text-decoration: none; color: var(--text);
  display: flex; flex-direction: column; gap: 0.75rem;
}
.doc-card:hover { background: var(--bg-secondary); }
.doc-card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.doc-card h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; }
.doc-card p { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; }

/* ── BUTTONS ────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-family: var(--font-body); font-size: 0.875rem; font-weight: 600; border-radius: var(--radius-md); padding: 0.6rem 1.25rem; cursor: pointer; transition: var(--transition); border: 1px solid transparent; letter-spacing: -0.01em; text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-secondary); border-color: var(--border-strong); }
.btn-sm { font-size: 0.8rem; padding: 0.45rem 0.9rem; border-radius: var(--radius-sm); }
.btn-lg { font-size: 1rem; padding: 0.8rem 1.75rem; border-radius: var(--radius-lg); }
.btn svg { width: 16px; height: 16px; }

/* ── API REFERENCE ──────────────────────────────────────────────── */
.method-badge {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700;
  padding: 3px 8px; border-radius: 5px; letter-spacing: 0.05em; flex-shrink: 0;
}
.method-GET    { background: rgba(34,197,94,.15); color: #16a34a; border: 1px solid rgba(34,197,94,.3); }
.method-POST   { background: rgba(59,130,246,.15); color: #2563eb; border: 1px solid rgba(59,130,246,.3); }
.method-PUT    { background: rgba(234,179,8,.15); color: #ca8a04; border: 1px solid rgba(234,179,8,.3); }
.method-PATCH  { background: rgba(168,85,247,.15); color: #9333ea; border: 1px solid rgba(168,85,247,.3); }
.method-DELETE { background: rgba(239,68,68,.15); color: #dc2626; border: 1px solid rgba(239,68,68,.3); }
[data-theme="dark"] .method-GET    { color: #4ade80; }
[data-theme="dark"] .method-POST   { color: #60a5fa; }
[data-theme="dark"] .method-PUT    { color: #fbbf24; }
[data-theme="dark"] .method-PATCH  { color: #c084fc; }
[data-theme="dark"] .method-DELETE { color: #f87171; }

.api-endpoint-path {
  font-family: var(--font-mono); font-size: 0.85rem;
  background: var(--code-bg); border: 1px solid var(--code-border);
  padding: 0.875rem 1.25rem; border-radius: var(--radius-md);
  margin: 1rem 0 1.5rem;
  display: flex; align-items: center; gap: 10px;
}
.api-params-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.api-params-table th { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; }
.api-params-table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.required-badge { font-size: 0.65rem; background: rgba(239,68,68,.1); color: #ef4444; border: 1px solid rgba(239,68,68,.2); padding: 1px 5px; border-radius: 3px; font-weight: 600; }
.optional-badge { font-size: 0.65rem; background: var(--bg-tertiary); color: var(--text-muted); border: 1px solid var(--border); padding: 1px 5px; border-radius: 3px; }
.type-badge { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-secondary); }

/* ── FAQ ────────────────────────────────────────────────────────── */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-question {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 0; cursor: pointer; font-weight: 500; font-size: 0.95rem;
  gap: 1rem;
}
.faq-question:hover { color: var(--text); }
.faq-toggle { width: 20px; height: 20px; color: var(--text-muted); flex-shrink: 0; transition: var(--transition); }
.faq-item.open .faq-toggle { transform: rotate(45deg); }
.faq-answer { display: none; padding: 0 0 1.25rem; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.7; }
.faq-item.open .faq-answer { display: block; }

/* ── BLOG ───────────────────────────────────────────────────────── */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.blog-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; transition: var(--transition); background: var(--surface);
  text-decoration: none; color: var(--text); display: flex; flex-direction: column;
}
.blog-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.blog-card-img { aspect-ratio: 16/9; background: var(--bg-tertiary); overflow: hidden; border-radius: 6px 6px 0 0; }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px 6px 0 0; }
.blog-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.blog-card-tag { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }
.blog-card h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.35; }
.blog-card p { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; }
.blog-card-meta { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.8rem; color: var(--text-muted); }
.blog-card-meta img { width: 22px; height: 22px; border-radius: 50%; }

/* ── AUTHOR ─────────────────────────────────────────────────────── */
.author-hero {
  display: flex; align-items: center; gap: 2rem;
  padding: 3rem 0 2.5rem;
}
.author-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); flex-shrink: 0; }
.author-name { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; letter-spacing: -0.04em; }
.author-bio { color: var(--text-secondary); font-size: 0.9rem; margin-top: 0.4rem; max-width: 500px; }
.author-links { display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }
.author-link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-muted); padding: 0.35rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); transition: var(--transition); text-decoration: none; }
.author-link svg { flex-shrink: 0; opacity: 0.75; }
.author-link:hover { color: var(--text); border-color: var(--border-strong); }
.author-link:hover svg { opacity: 1; }

/* ── CHANGELOG ──────────────────────────────────────────────────── */
.changelog-list { position: relative; padding-left: 1.5rem; }
.changelog-list::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--border); }
.changelog-entry { position: relative; padding: 0 0 3rem 2rem; }
.changelog-dot { position: absolute; left: -5px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--text); border: 2px solid var(--bg); }
.changelog-meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.changelog-version { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; }
.changelog-date { font-size: 0.8rem; color: var(--text-muted); }
.changelog-type {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 7px; border-radius: 4px;
}
.type-feature     { background: rgba(34,197,94,.1); color: #16a34a; }
.type-fix         { background: rgba(239,68,68,.1); color: #dc2626; }
.type-improvement { background: rgba(59,130,246,.1); color: #2563eb; }
.type-breaking    { background: rgba(239,68,68,.15); color: #b91c1c; }
.type-security    { background: rgba(168,85,247,.1); color: #9333ea; }
.changelog-entry h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.5rem; }

/* ── FOOTER ─────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  font-size: 0.8rem; color: var(--text-muted);
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }
.footer-links { display: flex; gap: 1.25rem; }

/* ── PAGE TRANSITIONS ───────────────────────────────────────────── */
#spa-content { transition: opacity 0.12s ease; }
#spa-content.loading { opacity: 0.5; pointer-events: none; }

/* ── LOADING BAR ────────────────────────────────────────────────── */
.loading-bar {
  position: fixed; top: 0; left: 0; height: 2px;
  background: var(--text); z-index: 9999;
  width: 0%; transition: width 0.2s ease;
}

/* ── MOBILE ─────────────────────────────────────────────────────── */
.mobile-menu-btn { display: none; }

@media (max-width: 1200px) {
  .docs-main { padding: 2.5rem 2.5rem 4rem; }
  .toc-aside { display: none; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 260px; }
  .docs-main { padding: 2rem 1.5rem 4rem; }
  .header-nav { display: none; }
}
@media (max-width: 768px) {
  .sidebar { display: none; position: fixed; top: var(--header-h); left: 0; bottom: 0; z-index: 200; background: var(--bg); transform: translateX(-100%); transition: transform 0.25s ease; width: 280px; height: 100vh; }
  .sidebar.open { display: block; transform: translateX(0); }
  .mobile-menu-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--text); }
  .docs-main { padding: 1.5rem 1rem 3rem; }
  .home-hero { padding: 3rem 1rem 2.5rem; }
  .card-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .author-hero { flex-direction: column; gap: 1rem; text-align: center; }
  .page-nav { flex-direction: column; }
  .site-footer { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  .header-search { display: none; }
  .home-hero h1 { font-size: 2.25rem; }
}

/* ── PRINT ──────────────────────────────────────────────────────── */
@media print {
  .site-header, .sidebar, .toc-aside, .site-footer, .search-overlay { display: none !important; }
  .docs-main { max-width: 100%; padding: 0; }
}

/* ── THEME-AWARE LOGO SWITCHING ─────────────────────────────────
   #logoLight = black/dark logo, shown on light backgrounds
   #logoDark  = white/light logo, shown on dark backgrounds
   These CSS rules ensure correct logo before JS executes.      */
[data-theme="light"] #logoLight { display: block; }
[data-theme="light"] #logoDark  { display: none;  }
[data-theme="dark"]  #logoLight { display: none;  }
[data-theme="dark"]  #logoDark  { display: block; }

/* ── HEADER SITE NAME (logo + text together) ────────────────────── */
.header-site-name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  white-space: nowrap;
}

/* ── BLOG HERO IMAGE (full bleed) ───────────────────────────────── */
.blog-hero-image {
  margin: 0 -2rem 2.5rem;
  overflow: hidden;
  max-height: 520px;
  border-radius: 10px;
}
.blog-hero-image img {
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: cover;
  display: block;
  border-radius: 10px;
  border-radius: 0;
}
@media (max-width: 768px) {
  .blog-hero-image { margin: 0 -1rem 2rem; }
  .blog-hero-image img { max-height: 260px; }
}

/* ── SIDEBAR COLLAPSIBLE GROUPS ─────────────────────────────────── */
.sidebar-group { margin-bottom: 2px; }
.sidebar-group-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 0.4rem 1.25rem;
  font-size: 0.78rem; font-weight: 600; color: var(--text-secondary);
  background: none; border: none; cursor: pointer;
  text-align: left; font-family: var(--font-body);
  transition: color 0.15s;
}
.sidebar-group-btn:hover { color: var(--text); }
.sidebar-chevron {
  width: 12px; height: 12px; flex-shrink: 0;
  transition: transform 0.2s; opacity: 0.6;
}
.sidebar-group-items { overflow: hidden; }
.sidebar-link-indented { padding-left: 2.25rem !important; font-size: 0.84rem !important; }

/* ── CODE BLOCK STYLING (Quill .ql-syntax + standard) ─────────── */
.content pre.ql-syntax,
.content pre {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin: 1.25rem 0;
}
.content pre code {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-size: inherit;
}
.content code:not(pre code) {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.84em;
  font-family: var(--font-mono);
}

/* ── FAQ v2 (GitBook/Trojan style) ──────────────────────────────── */
.faq-list { display: flex; flex-direction: column; }
.faq-item-v2 {
  border-bottom: 1px solid var(--border);
}
.faq-item-v2:first-child { border-top: 1px solid var(--border); }
.faq-q-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 1rem 0;
  background: none; border: none; cursor: pointer;
  font-size: 0.95rem; font-weight: 500; color: var(--text);
  text-align: left; font-family: var(--font-body);
  gap: 1rem;
  transition: color 0.15s;
}
.faq-q-btn:hover { color: var(--text); opacity: 0.8; }
.faq-chev { flex-shrink: 0; transition: transform 0.2s; opacity: 0.5; }
.faq-answer-v2 .content {
  font-size: 0.925rem;
  line-height: 1.75;
  color: var(--text-secondary);
  border-left: 2px solid var(--border);
}
.faq-answer-v2 .content p:last-child { margin-bottom: 0; }
