/* Docs layout — requires main.css for design tokens */

.docs-body {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 0;
}

.docs-shell {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ── Sidebar ── */

.docs-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border2);
  padding: 32px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.docs-sidebar-logo {
  display: block;
  padding: 0 24px 32px;
  border-bottom: 1px solid var(--border);
}

.docs-sidebar-logo img { width: 140px; }

.docs-nav {
  padding: 16px 0;
  flex: 1;
}

.docs-nav-toggle {
  width: 100%;
  background: none;
  border: none;
  margin-top: 0;
  padding: 8px 24px;
  text-align: left;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 0.15s;
  letter-spacing: normal;
}

.docs-nav-toggle:hover { color: var(--amber); opacity: 1; }

.docs-nav-toggle::after {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-right: 4px;
  opacity: 0.5;
}

.docs-nav-section.open > .docs-nav-toggle::after { transform: rotate(45deg); }

.docs-nav-children {
  display: none;
  padding-bottom: 6px;
}

.docs-nav-section.open > .docs-nav-children { display: block; }

.docs-nav-link {
  display: block;
  font-family: var(--display);
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 24px 6px 32px;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.docs-nav-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.03);
}

.docs-nav-link.active {
  color: var(--amber);
  border-left-color: var(--amber);
  background: rgba(245,166,35,0.06);
}

.docs-sidebar-footer {
  padding: 16px 24px 0;
  border-top: 1px solid var(--border);
}

.docs-sidebar-footer a {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0.5;
  transition: opacity 0.2s, color 0.2s;
  display: block;
  margin-bottom: 8px;
}

.docs-sidebar-footer a:hover { opacity: 1; color: var(--teal); }

/* ── Main content ── */

.docs-main {
  flex: 1;
  min-width: 0;
  max-width: 820px;
  margin: 0;
  padding: 56px 64px;
}

.docs-title {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}

.docs-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 48px;
}

.docs-content h2 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  color: var(--amber);
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.docs-content h3 {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-top: 28px;
  margin-bottom: 10px;
}

.docs-content p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 18px;
}

.docs-content ul,
.docs-content ol {
  margin: 0 0 18px 0;
  padding-left: 22px;
}

.docs-content li {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 6px;
}

.docs-content a { color: var(--amber); text-decoration: none; }
.docs-content a:hover { text-decoration: underline; }

.docs-content code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--teal);
}

.docs-content pre {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 20px 24px;
  margin: 0 0 20px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  position: relative;
  min-height: auto;
}

.docs-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
  opacity: 0;
  margin-top: 0;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}

.docs-content pre:hover .docs-copy-btn { opacity: 1; }
.docs-copy-btn:hover { color: var(--teal); border-color: var(--teal); }
.docs-copy-btn.copied { color: #4ade80; border-color: #4ade80; opacity: 1; }

.docs-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: var(--text);
}

.docs-content strong { color: var(--text); font-weight: 600; }

.docs-step {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}

.docs-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--amber-dim);
  border: 1px solid rgba(245,166,35,0.3);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.docs-step-body { flex: 1; }
.docs-step-body h3 { margin-top: 0; }

.docs-callout {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-left: 3px solid var(--teal);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
}

.docs-callout strong { color: var(--teal); }

.docs-nav-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.docs-nav-footer a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.docs-nav-footer a:hover { color: var(--teal); }

/* ── Tables ── */

.docs-table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.docs-table th {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border2);
  background: none;
}

.docs-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
  line-height: 1.6;
  white-space: normal;
}

.docs-table tr:last-child td { border-bottom: none; }
.docs-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── FAQ ── */

.faq-item {
  border: 1px solid var(--border2);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  background: var(--surface);
  border: none;
  padding: 18px 24px;
  text-align: left;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 0;
  transition: background 0.15s;
  letter-spacing: normal;
}

.faq-question:hover { background: var(--surface2); opacity: 1; }

.faq-question::after {
  content: '+';
  font-family: var(--mono);
  font-size: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq-item.open .faq-question::after { transform: rotate(45deg); }

.faq-answer {
  display: none;
  padding: 0 24px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.faq-item.open .faq-answer { display: block; }

.faq-answer p { margin-top: 16px; margin-bottom: 0; }

.faq-answer code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--teal);
}

/* ── Mobile ── */

@media (max-width: 768px) {
  .docs-shell { flex-direction: column; }

  .docs-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border2);
    padding: 20px 0;
  }

  .docs-sidebar-logo { padding: 0 20px 20px; }
  .docs-nav { padding: 16px 0 8px; }
  .docs-nav-link { padding: 8px 20px; }
  .docs-main { padding: 32px 20px; }
  .docs-title { font-size: 26px; }
}
