/* =====================================================================
   XOORA — Docs page
   ===================================================================== */

/* ---------------- Header ---------------- */
.docs-header {
  padding: 22px 0 2px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.docs-header-top { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }

.docs-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  height: 44px;
  padding: 0 14px;
  box-shadow: var(--shadow-sm);
}
.docs-search svg { width: 16px; height: 16px; color: var(--text-tertiary); flex-shrink: 0; }
.docs-search input { border: none; outline: none; background: transparent; font: inherit; font-size: 0.875rem; flex: 1; min-width: 0; color: var(--text-primary); }
.docs-search input::placeholder { color: var(--text-tertiary); }

.docs-sections-btn { flex-shrink: 0; }
@media (min-width: 1024px) { .docs-sections-btn { display: none; } }

.docs-hero {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
}
.docs-hero-copy { max-width: 640px; }
.docs-hero-copy h1 { font-size: 1.5rem; font-weight: 800; margin: 0.625rem 0 0.5rem; letter-spacing: -0.01em; }
.docs-hero-copy p { color: var(--text-secondary); font-size: 0.9062rem; }
.docs-hero-art {
  flex-shrink: 0;
  width: 62px; height: 62px;
  object-fit: contain;
  margin-top: 2px;
  filter: drop-shadow(0 10px 20px rgba(47, 111, 237, 0.16));
}
@media (min-width: 560px) {
  .docs-hero-copy h1 { font-size: 1.75rem; }
  .docs-hero-art { width: 108px; height: 108px; }
}
@media (min-width: 960px) {
  .docs-hero { display: block; }
  .docs-hero-copy h1 { font-size: 2rem; }
  .docs-hero-art {
    position: absolute;
    top: -28px;
    right: 4px;
    width: 176px;
    height: 176px;
  }
}

.docs-quicktabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 18px;
  scrollbar-width: none;
}
.docs-quicktabs::-webkit-scrollbar { display: none; }
.docs-quicktabs a {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.docs-quicktabs a.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (min-width: 1024px) { .docs-quicktabs { display: none; } }

/* ---------------- Layout ---------------- */
.docs-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 26px 20px 70px;
}
@media (min-width: 1024px) {
  .docs-layout { grid-template-columns: 232px 1fr; gap: 44px; padding: 34px 32px 90px; }
}
@media (min-width: 1280px) {
  .docs-layout { grid-template-columns: 232px 1fr 200px; padding-left: 40px; padding-right: 40px; }
}

.docs-sidebar-title, .docs-toc-title {
  font-size: 0.7188rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding: 0 10px 8px;
}

.docs-sidebar { display: none; }
@media (min-width: 1024px) {
  .docs-sidebar {
    display: block;
    position: sticky;
    top: calc(var(--nav-height) + 24px);
    max-height: calc(100vh - var(--nav-height) - 48px);
    overflow-y: auto;
  }
}
.docs-nav { display: flex; flex-direction: column; gap: 2px; }
.docs-nav a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.8438rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.docs-nav a:hover { background: var(--bg-soft); color: var(--text-primary); }
.docs-nav a.is-active { background: var(--accent-soft); color: var(--accent); }

.docs-toc { display: none; }
@media (min-width: 1280px) {
  .docs-toc {
    display: block;
    position: sticky;
    top: calc(var(--nav-height) + 24px);
    max-height: calc(100vh - var(--nav-height) - 48px);
    overflow-y: auto;
    border-left: 1px solid var(--border);
    padding-left: 18px;
  }
}
.docs-toc nav { display: flex; flex-direction: column; gap: 1px; }
.docs-toc nav a {
  display: block;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 0.7812rem;
  font-weight: 500;
  color: var(--text-tertiary);
}
.docs-toc nav a.sub { padding-left: 1.25rem; font-size: 0.75rem; }
.docs-toc nav a:hover { color: var(--text-primary); }
.docs-toc nav a.is-active { color: var(--accent); font-weight: 700; }

/* ---------------- Content ---------------- */
.docs-content { min-width: 0; }
.docs-content section {
  padding: 30px 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: calc(var(--nav-height) + 20px);
}
.docs-content section:first-child { padding-top: 4px; }
.docs-content section:last-child { border-bottom: none; }
.docs-content h2 { font-size: 1.3125rem; font-weight: 800; margin-bottom: 0.75rem; letter-spacing: -0.01em; }
.docs-content h3 { font-size: 0.9688rem; font-weight: 700; }
.docs-content > section > p { color: var(--text-secondary); font-size: 0.9062rem; max-width: 72ch; margin-bottom: 0.875rem; }
.docs-content code { font-family: var(--font-mono); }

/* ---------------- Quick start steps ---------------- */
.quick-steps { position: relative; display: flex; flex-direction: column; gap: 22px; list-style: none; margin: 0; padding: 0; }
.quick-step { position: relative; display: flex; gap: 14px; padding-left: 36px; }
.quick-step-num {
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 0.7812rem;
  box-shadow: 0 0 0 1px var(--border);
  z-index: 1;
}
.quick-step:not(:last-child)::before {
  content: ''; position: absolute; left: 12.5px; top: 26px; bottom: -22px;
  width: 1.5px; background: var(--border);
}
.quick-step strong { font-family: var(--font-display); font-size: 0.9062rem; display: block; margin-bottom: 0.1875rem; }
.quick-step p { color: var(--text-secondary); font-size: 0.8438rem; margin: 0; }

/* ---------------- Example / endpoint code grids ---------------- */
.doc-example, .endpoint-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
@media (min-width: 720px) {
  .doc-example, .endpoint-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}
.doc-example .code-body, .endpoint-grid .code-body { max-height: 260px; overflow: auto; }

.code-try-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--code-border);
  background: var(--code-bg-2);
}

/* ---------------- Endpoint reference cards ---------------- */
.endpoint-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
  margin-bottom: 16px;
  background: var(--surface);
}
.endpoint-card:last-child { margin-bottom: 0; }
.endpoint-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.endpoint-card-path {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-soft);
  padding: 2px 8px;
  border-radius: 6px;
}
.endpoint-card-desc { color: var(--text-secondary); font-size: 0.8438rem; margin-bottom: 0.875rem; }
.endpoint-card-desc code { font-size: 0.75rem; background: var(--bg-soft); padding: 0.0625rem 0.3125rem; border-radius: 0.3125rem; }
.endpoint-try-link { margin-top: 12px; }
