/* ═════════════════════════════════════════════════════════════════
   خزانه — Documentation Styles
   Inherits brand from main website, with docs-specific layout
   ═════════════════════════════════════════════════════════════════ */

/* Reuse brand variables and base styles from website */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body.docs-body {
  font-family: 'Vazirmatn', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: #1a1d23;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
}
.nums-fa { font-feature-settings: "ss01"; font-variant-numeric: tabular-nums; }
:root {
  --c-bg: #ffffff;
  --c-bg-alt: #f8f5e9;
  --c-text: #1a1d23;
  --c-text-muted: #5c6470;
  --c-text-faint: #8b919b;
  --c-border: #e3e0d9;
  --c-primary: #1f6f5c;
  --c-primary-light: #2a8d75;
  --c-primary-soft: #e7f0ec;
  --c-accent: #c9a227;
  --c-accent-soft: #faf3df;
  --c-success: #1f7a4d;
  --c-warning: #b88200;
  --c-danger: #c64a2a;
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08);
  --radius: 10px;
  --radius-lg: 14px;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  border-radius: 8px; transition: all 0.2s; cursor: pointer; white-space: nowrap;
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: #1a5f50; }
.btn-ghost { color: var(--c-text); }
.btn-ghost:hover { background: var(--c-bg-alt); }

/* ─── Header ─── */
.docs-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
}
.docs-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; gap: 20px;
}
.docs-header .brand {
  display: flex; align-items: center; gap: 10px;
}
.brand-name { font-size: 16px; font-weight: 800; color: var(--c-primary); }
.brand-docs-tag {
  font-size: 10px; font-weight: 600; padding: 2px 8px;
  background: var(--c-primary-soft); color: var(--c-primary);
  border-radius: 999px;
}
.docs-search {
  position: relative; flex: 1; max-width: 400px;
}
.docs-search input {
  width: 100%; padding: 8px 60px 8px 12px;
  font-size: 13px; font-family: inherit;
  border: 1px solid var(--c-border); border-radius: 8px;
  background: var(--c-bg-alt);
}
.docs-search input:focus {
  outline: none; border-color: var(--c-primary);
  background: #fff; box-shadow: 0 0 0 3px rgba(31, 111, 92, 0.1);
}
.docs-search kbd {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  padding: 2px 6px; font-size: 10px; font-family: 'JetBrains Mono', monospace;
  background: #fff; border: 1px solid var(--c-border); border-radius: 4px;
  color: var(--c-text-muted);
}
.docs-header-cta { display: flex; gap: 6px; }

/* ─── Layout ─── */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  max-width: 1200px;
  margin: 0 auto;
  gap: 0;
}

/* ─── Sidebar ─── */
.docs-sidebar {
  position: sticky; top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 24px 16px 24px 24px;
  border-left: 1px solid var(--c-border);
}
.docs-nav-section { margin-bottom: 24px; }
.docs-nav-title {
  font-size: 11px; font-weight: 700; color: var(--c-text-faint);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 10px; padding-right: 12px;
}
.docs-sidebar a {
  display: block;
  padding: 6px 12px;
  font-size: 13px; font-weight: 500;
  color: var(--c-text-muted);
  border-radius: 6px;
  margin-bottom: 2px;
  transition: all 0.15s;
}
.docs-sidebar a:hover {
  background: var(--c-bg-alt); color: var(--c-text);
}
.docs-sidebar a.active {
  background: var(--c-primary-soft); color: var(--c-primary);
  font-weight: 600;
}

/* ─── Main content ─── */
.docs-main { padding: 40px 48px; min-width: 0; }
.docs-content { max-width: 720px; margin: 0 auto; }

.docs-section { margin-bottom: 56px; scroll-margin-top: 80px; }
.docs-section h1 {
  font-size: 36px; font-weight: 900; letter-spacing: -0.5px;
  margin-bottom: 16px;
}
.docs-section h2 {
  font-size: 24px; font-weight: 800; letter-spacing: -0.3px;
  margin-bottom: 16px; margin-top: 40px;
  padding-bottom: 10px; border-bottom: 1px solid var(--c-border);
}
.docs-section h3 {
  font-size: 17px; font-weight: 700;
  margin-top: 24px; margin-bottom: 10px;
}
.docs-section p {
  margin-bottom: 14px;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--c-text);
}
.docs-lead {
  font-size: 17px !important;
  line-height: 1.7 !important;
  color: var(--c-text-muted) !important;
  margin-bottom: 32px !important;
}

/* ─── Cards (intro) ─── */
.docs-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.docs-card {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  transition: all 0.2s;
}
.docs-card:hover {
  border-color: var(--c-primary);
  background: var(--c-primary-soft);
  transform: translateY(-1px);
}
.docs-card-icon {
  width: 36px; height: 36px;
  background: var(--c-primary);
  color: #fff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  flex-shrink: 0;
}
.docs-card h3 { margin-top: 0; margin-bottom: 4px; font-size: 15px; }
.docs-card p { margin: 0; font-size: 13px; color: var(--c-text-muted); line-height: 1.6; }

/* ─── Lists & steps ─── */
.docs-list {
  list-style: none;
  margin-bottom: 16px;
  padding-right: 8px;
}
.docs-list li {
  position: relative;
  padding-right: 24px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.7;
}
.docs-list li::before {
  content: "•";
  position: absolute;
  right: 6px;
  color: var(--c-primary);
  font-weight: 700;
}
.docs-steps {
  list-style: decimal;
  padding-right: 24px;
  margin-bottom: 16px;
}
.docs-steps li {
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.8;
  padding-right: 8px;
}
.docs-steps li strong { color: var(--c-primary); }

/* ─── Code ─── */
code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  background: var(--c-bg-alt);
  padding: 1px 6px;
  border-radius: 4px;
  color: #6b3b1a;
  direction: ltr;
  display: inline-block;
}
.docs-code {
  display: block;
  background: #0e1116;
  color: #e8e6e3;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.65;
  padding: 16px;
  border-radius: var(--radius);
  direction: ltr;
  text-align: left;
  overflow-x: auto;
  margin: 12px 0 16px 0;
}
.docs-code code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* ─── Tables ─── */
.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
}
.docs-table th, .docs-table td {
  border: 1px solid var(--c-border);
  padding: 10px 14px;
  text-align: right;
}
.docs-table th {
  background: var(--c-bg-alt);
  font-weight: 700;
  font-size: 12px;
  color: var(--c-text);
}
.docs-table tr:nth-child(even) td {
  background: #fafafa;
}

/* ─── Notes ─── */
.docs-note {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin: 16px 0;
  font-size: 13.5px;
  line-height: 1.7;
  border-right: 4px solid;
}
.docs-note-info {
  background: var(--c-primary-soft);
  border-color: var(--c-primary);
  color: #0e3a2a;
}
.docs-note-warning {
  background: #fbf0d3;
  border-color: var(--c-warning);
  color: #4a3a20;
}
.docs-note strong { font-weight: 700; }
.docs-note code { background: rgba(0,0,0,0.05); }

/* ─── Grid layouts ─── */
.docs-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 16px 0;
}
.docs-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.docs-method {
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px;
}
.docs-method h3 {
  margin-top: 0;
  display: flex; align-items: center; gap: 8px;
  font-size: 15px;
}
.docs-method p { font-size: 13px; margin-bottom: 8px; color: var(--c-text-muted); }
.badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--c-primary-soft);
  color: var(--c-primary);
}
.badge-gold {
  background: var(--c-accent-soft);
  color: var(--c-accent);
}

/* ─── FAQ ─── */
.docs-faq {
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.docs-faq summary {
  padding: 14px 18px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.docs-faq summary::-webkit-details-marker { display: none; }
.docs-faq summary::after {
  content: "+";
  float: left;
  font-size: 18px;
  color: var(--c-primary);
  transition: transform 0.2s;
}
.docs-faq[open] summary::after { transform: rotate(45deg); }
.docs-faq[open] summary { border-bottom: 1px solid var(--c-border); }
.docs-faq p {
  padding: 14px 18px;
  font-size: 13.5px;
  color: var(--c-text-muted);
}

/* ─── Kbd ─── */
kbd {
  font-family: 'JetBrains Mono', monospace;
  display: inline-block;
  padding: 2px 7px;
  font-size: 11px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--c-border);
  direction: ltr;
}

/* ─── Responsive ─── */
@media (max-width: 968px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar {
    position: relative; top: 0; height: auto;
    border-left: none; border-bottom: 1px solid var(--c-border);
    padding: 16px 24px;
  }
  .docs-main { padding: 24px; }
  .docs-cards, .docs-grid-2, .docs-grid-3 { grid-template-columns: 1fr; }
  .docs-search { display: none; }
}
