:root {
  --docs-brand: #EF4056;
  --docs-brand-soft: #fff0f2;
  --docs-text: #2b2b2b;
  --docs-muted: #6b7280;
  --docs-border: #e8e8ec;
  --docs-bg: #f6f7f9;
  --docs-sidebar: #fff;
  --docs-code-bg: #1e1e2e;
  --docs-code-text: #e8e8f0;
  --docs-radius: 12px;
  --docs-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.docs-page {
  margin: 0;
  font-family: 'Vazirmatn', system-ui, sans-serif;
  background: var(--docs-bg);
  color: var(--docs-text);
  line-height: 1.75;
}

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid var(--docs-border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.docs-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  margin-left: auto;
}

.docs-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--docs-brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.docs-topbar-link {
  color: var(--docs-brand);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
}

.docs-topbar-link:hover { text-decoration: underline; }

.docs-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  max-width: 1280px;
  margin: 0 auto;
  min-height: calc(100vh - 58px);
}

.docs-sidebar {
  background: var(--docs-sidebar);
  border-left: 1px solid var(--docs-border);
  padding: 1.25rem 1rem 2rem;
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  overflow-y: auto;
}

.docs-sidebar-title {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--docs-muted);
  font-weight: 600;
}

.docs-nav { display: flex; flex-direction: column; gap: 0.2rem; }

.docs-nav-link {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: var(--docs-text);
  text-decoration: none;
  font-size: 0.92rem;
  transition: background 0.15s;
}

.docs-nav-link:hover { background: var(--docs-bg); }

.docs-nav-link.is-active {
  background: var(--docs-brand-soft);
  color: var(--docs-brand);
  font-weight: 600;
}

.docs-main {
  padding: 1.5rem 1.75rem 2.5rem;
  min-width: 0;
}

.docs-content {
  background: #fff;
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius);
  box-shadow: var(--docs-shadow);
  padding: 2rem 2.25rem;
  max-width: 900px;
}

.docs-content h1 {
  margin: 0 0 1rem;
  font-size: 1.85rem;
  line-height: 1.35;
  color: #111;
}

.docs-content h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.25rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--docs-brand-soft);
}

.docs-content h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.05rem;
}

.docs-content p { margin: 0.65rem 0; }

.docs-content ul,
.docs-content ol {
  margin: 0.5rem 0 1rem;
  padding-right: 1.35rem;
}

.docs-content li { margin: 0.35rem 0; }

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

.docs-content a:hover { text-decoration: underline; }

.docs-content code {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.88em;
  background: #f3f4f6;
  padding: 0.12rem 0.4rem;
  border-radius: 5px;
  direction: ltr;
  /* isolate (not embed) so the neighbouring Persian punctuation keeps its own
     direction: with embed, a code span inside parentheses flips them. */
  unicode-bidi: isolate;
}

.docs-content pre {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  background: var(--docs-code-bg);
  color: var(--docs-code-text);
  border-radius: 10px;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
}

.docs-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 0.85rem;
  line-height: 1.6;
}

.docs-table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.docs-table th,
.docs-table td {
  border: 1px solid var(--docs-border);
  padding: 0.6rem 0.75rem;
  text-align: right;
  vertical-align: top;
}

.docs-table th {
  background: var(--docs-brand-soft);
  font-weight: 600;
}

.docs-table tr:nth-child(even) td { background: #fafafa; }

.docs-content hr {
  border: none;
  border-top: 1px solid var(--docs-border);
  margin: 1.5rem 0;
}

.docs-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  color: var(--docs-muted);
  font-size: 0.88rem;
}

.docs-footer a { color: var(--docs-brand); }

@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; }

  .docs-sidebar {
    position: static;
    height: auto;
    border-left: none;
    border-bottom: 1px solid var(--docs-border);
  }

  .docs-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
  }

  .docs-content { padding: 1.25rem 1rem; }
  .docs-main { padding: 1rem; }
}

@media (max-width: 520px) {
  .docs-nav { grid-template-columns: 1fr; }
  .docs-topbar { flex-wrap: wrap; }
}
