/* Rayven Knowledge Base — shared stylesheet
   Brand tokens pulled from the live rayven.io site: Manrope (headings) +
   Inter (body), blue→magenta gradient accent, deep navy dark sections,
   orange primary CTA. See build notes for extraction details. */

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

:root {
  --color-primary: #007bff;
  --color-primary-dark: #0057b3;
  --color-primary-light: #eaf4ff;
  --color-gradient: linear-gradient(90deg, #007bff 0%, #e61bba 100%);
  --color-navy: #1a1a2e;
  --color-navy-soft: #23233d;
  --color-orange: #f25300;
  --color-orange-dark: #cf4600;
  --color-text: #14161f;
  --color-text-muted: #6a6e78;
  --color-body: #45484e;
  --color-border: #e6e7ec;
  --color-bg: #ffffff;
  --color-bg-alt: #f7f8fa;
  --color-warning-bg: #fff3ea;
  --color-warning-border: var(--color-orange);
  --color-code-bg: #1a1a2e;
  --color-code-text: #e8eaf0;
  --font-heading: "Manrope", "Inter", sans-serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --radius: 11px;
  --radius-sm: 8px;
  --sidebar-width: 280px;
  --header-height: 68px;
  --max-content-width: 860px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--color-body);
  background: var(--color-bg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  color: var(--color-text);
  font-weight: 800;
  letter-spacing: -0.01em;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; }

.gradient-text {
  background: var(--color-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
}

.btn-primary {
  background: var(--color-orange);
  color: #fff;
}

.btn-primary:hover { background: var(--color-orange-dark); }

.btn-outline {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn-outline:hover { border-color: var(--color-text); }

/* ---------- Header ---------- */

/* JS injects the real <header>/<nav> one level inside #site-header/#site-sidebar.
   Without this, those wrapper divs shrink-wrap to their sticky child's own height,
   leaving no room for position:sticky to have any effect. display:contents removes
   the wrappers from the box model so the sticky children measure against the full
   page (body) / column (.page-layout) height instead. */
#site-header,
#site-sidebar {
  display: contents;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-text);
  white-space: nowrap;
}

.site-header .brand .logo-mark {
  height: 26px;
  width: auto;
  flex-shrink: 0;
  display: block;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.menu-toggle svg { width: 18px; height: 18px; }

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 480px;
  margin-left: auto;
}

.search-input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%236a6e78" stroke-width="2"><circle cx="11" cy="11" r="7"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>') no-repeat 12px center;
  background-size: 15px;
  font-size: 0.92rem;
  font-family: var(--font-sans);
  color: var(--color-text);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  background-color: var(--color-bg);
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(20, 25, 45, 0.12);
  max-height: 420px;
  overflow-y: auto;
  display: none;
  z-index: 50;
}

.search-results.open { display: block; }

.search-results a {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--color-bg-alt); text-decoration: none; }

.search-results .result-title { font-weight: 700; font-size: 0.92rem; font-family: var(--font-heading); }
.search-results .result-category { font-size: 0.78rem; color: var(--color-text-muted); }
.search-results .no-results { padding: 14px; color: var(--color-text-muted); font-size: 0.9rem; }

/* ---------- Layout ---------- */

.page-layout {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - var(--header-height));
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  border-right: 1px solid var(--color-border);
  padding: 20px 12px 40px;
  background: var(--color-bg-alt);
}

.sidebar .nav-group { margin-bottom: 18px; }

.sidebar .nav-group-title {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--color-text-muted);
  padding: 6px 10px;
}

.sidebar a.nav-link {
  display: block;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--color-text);
}

.sidebar a.nav-link:hover { background: var(--color-primary-light); text-decoration: none; }

.sidebar a.nav-link.active {
  background: var(--color-navy);
  color: #fff;
  font-weight: 600;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 40px 32px 80px;
}

.content-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
}

/* ---------- Screenshots ---------- */

.article figure.screenshot {
  margin: 0 0 22px;
}

.article figure.screenshot img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: 0 10px 28px rgba(20, 25, 45, 0.10);
}

.article figure.screenshot figcaption {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  text-align: center;
}

.article figure.screenshot.dialog {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Article typography ---------- */

.article h1 {
  font-size: 2.1rem;
  font-weight: 800;
  margin: 0 0 6px;
}

.article .eyebrow {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  margin-bottom: 10px;
  display: block;
}

.article .lede {
  font-size: 1.08rem;
  color: var(--color-text-muted);
  margin: 0 0 32px;
}

.article h2 {
  font-size: 1.4rem;
  margin: 40px 0 12px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
}

.article h2:first-of-type { border-top: none; padding-top: 0; }

.article h3 {
  font-size: 1.1rem;
  margin: 26px 0 8px;
}

.article p { margin: 0 0 14px; }

.article ul, .article ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.article li { margin-bottom: 6px; }

.article .steps { counter-reset: step; }

.article strong { color: var(--color-text); }

.article code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  padding: 1px 5px;
  border-radius: 4px;
}

.article pre {
  background: var(--color-code-bg);
  color: var(--color-code-text);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 0 0 18px;
}

.article pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: 0.85rem;
}

.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 0.92rem;
}

.article th, .article td {
  border: 1px solid var(--color-border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.article th { background: var(--color-bg-alt); font-family: var(--font-heading); }

/* Numbered feature list (Rayven "01 / 02 / 03" pattern) */

.numbered-list { list-style: none; margin: 0 0 20px; padding: 0; }
.numbered-list li { display: flex; gap: 14px; margin-bottom: 18px; }
.numbered-list .num {
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--color-primary);
  font-size: 1.05rem;
  flex-shrink: 0;
  width: 28px;
}

/* Callouts */

.callout {
  background: var(--color-primary-light);
  border-left: 4px solid var(--color-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  margin: 0 0 18px;
  font-size: 0.92rem;
}

.callout strong { color: var(--color-primary-dark); }

.callout.warning {
  background: var(--color-warning-bg);
  border-left-color: var(--color-warning-border);
}

.callout.warning strong { color: var(--color-orange-dark); }

/* Node reference cards (accordion via <details>) */

.node-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }

.node-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  overflow: hidden;
}

.node-card summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 18px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-bg-alt);
}

.node-card summary::-webkit-details-marker { display: none; }

.node-card summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

.node-card[open] summary::after { content: "\2212"; }

.node-card .node-tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  margin-left: 10px;
}

.node-card .node-body { padding: 4px 18px 18px; }
.node-card .node-body p:first-child { margin-top: 10px; }

/* FAQ accordion */

.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 4px;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--color-primary); flex-shrink: 0; font-family: var(--font-sans); }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item .faq-body { padding: 0 4px 18px; color: var(--color-text-muted); }
.faq-item .faq-body p:first-child { margin-top: 0; }

/* ---------- Home page ---------- */

.hero {
  padding: 64px 32px 48px;
  text-align: center;
  background: var(--color-navy);
  color: #fff;
}

.hero .eyebrow {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6cb2ff;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 14px;
}

.hero p { color: rgba(255,255,255,0.72); font-size: 1.12rem; margin: 0 0 28px; }
.hero .search-wrap { max-width: 560px; margin: 0 auto; }
.hero .search-input {
  padding: 13px 16px 13px 42px;
  font-size: 1rem;
  border: 2px solid rgba(255,255,255,0.16);
  background-color: rgba(255,255,255,0.06);
  color: #fff;
}
.hero .search-input::placeholder { color: rgba(255,255,255,0.5); }
.hero .search-results { text-align: left; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 44px 32px 64px;
}

.category-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--color-bg);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.category-card:hover {
  box-shadow: 0 14px 30px rgba(20, 25, 45, 0.08);
  transform: translateY(-2px);
}

.category-card .icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--color-navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  margin-bottom: 16px;
}

.category-card h3 { font-family: var(--font-heading); margin: 0 0 6px; font-size: 1.08rem; }
.category-card p { margin: 0 0 14px; color: var(--color-text-muted); font-size: 0.9rem; }
.category-card ul { list-style: none; margin: 0; padding: 0; }
.category-card li { margin-bottom: 4px; font-size: 0.88rem; }
.category-card a { color: var(--color-body); }
.category-card a:hover { color: var(--color-primary); }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 24px 32px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* ---------- Page nav (prev/next) ---------- */

.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.page-nav a {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--color-text);
  font-size: 0.88rem;
}

.page-nav a:hover { border-color: var(--color-primary); text-decoration: none; }
.page-nav a.next { text-align: right; }
.page-nav .direction { display: block; color: var(--color-text-muted); font-size: 0.75rem; margin-bottom: 2px; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .menu-toggle { display: flex; }

  .sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    width: 84vw;
    max-width: 320px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 30;
    box-shadow: 8px 0 24px rgba(0,0,0,0.12);
  }

  .sidebar.open { transform: translateX(0); }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: var(--header-height) 0 0 0;
    background: rgba(15, 18, 30, 0.35);
    z-index: 20;
  }

  .sidebar-backdrop.open { display: block; }

  .content { padding: 28px 18px 60px; }

  .hero { padding: 44px 20px 34px; }
  .hero h1 { font-size: 1.7rem; }
}
