/* Documentation layout. Uses the shared site tokens. */
:root {
  --text-primary: var(--text);
  --text-secondary: var(--text-2);
  --text-muted: var(--text-3);
  --border: var(--line);
  --border-strong: var(--line-2);
  --accent-blue: var(--blue-300);
  --accent-purple: var(--violet);
  --accent-green: var(--green);
  --accent-amber: var(--amber);
  --accent-cyan: #22d3ee;
  --surface: var(--glass);
  --gradient-text: linear-gradient(180deg, #fff 30%, #c4b5fd 130%);
}

.docs-layout {
  padding-top: calc(var(--nav-h) + 28px) !important;
}
.docs-sidebar {
  top: calc(var(--nav-h) + 16px) !important;
  border-radius: var(--r-lg) !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015)) !important;
}
.docs-title {
  font-weight: 600 !important;
  letter-spacing: -0.04em !important;
}
.docs-content h2 { letter-spacing: -0.03em; }
.nav-buttons a[aria-current="page"] { color: var(--violet-200); }

    /* Docs layout */
    .docs-layout {
      display: grid;
      grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
      gap: 56px;
      max-width: 1240px;
      margin: 0 auto;
      padding: 110px 32px 80px;
    }

    .docs-sidebar {
      position: sticky;
      top: 96px;
      align-self: start;
      height: calc(100vh - 120px);
      overflow-y: auto;
      padding: 24px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 16px;
      backdrop-filter: blur(12px);
    }
    .docs-sidebar::-webkit-scrollbar { width: 6px; }
    .docs-sidebar::-webkit-scrollbar-track { background: transparent; }
    .docs-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

    .docs-sidebar .docs-eyebrow {
      font-size: 0.7rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--text-muted);
      font-weight: 600;
      margin-bottom: 14px;
    }
    .docs-sidebar h3 {
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--text-secondary);
      margin: 22px 0 10px;
    }
    .docs-sidebar h3:first-of-type { margin-top: 4px; }
    .docs-sidebar ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }
    .docs-sidebar li a {
      display: block;
      padding: 6px 10px;
      font-size: 0.875rem;
      color: var(--text-secondary);
      text-decoration: none;
      border-radius: 8px;
      border-left: 2px solid transparent;
      transition: all 0.15s ease;
    }
    .docs-sidebar li a:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.04); }
    .docs-sidebar li a.active {
      color: #93c5fd;
      background: rgba(59, 130, 246, 0.1);
      border-left-color: var(--accent-blue);
    }

    .docs-sidebar .sidebar-footer {
      margin-top: 28px;
      padding-top: 18px;
      border-top: 1px solid var(--border);
      font-size: 0.8rem;
      color: var(--text-muted);
    }
    .docs-sidebar .sidebar-footer a { color: var(--text-secondary); text-decoration: none; }
    .docs-sidebar .sidebar-footer a:hover { color: var(--accent-blue); }

    .docs-content {
      max-width: 800px;
      min-width: 0;
    }

    .docs-eyebrow-top {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 5px 14px;
      background: rgba(59, 130, 246, 0.08);
      border: 1px solid rgba(59, 130, 246, 0.2);
      border-radius: 999px;
      font-size: 0.8rem;
      font-weight: 500;
      color: #93c5fd;
      margin-bottom: 22px;
    }

    .docs-title {
      font-size: clamp(2.2rem, 4.2vw, 3.2rem);
      font-weight: 700;
      letter-spacing: -0.035em;
      line-height: 1.18;
      margin-bottom: 20px;
      padding-bottom: 0.06em;
      background: var(--gradient-text);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .docs-lede {
      font-size: 1.18rem;
      color: var(--text-secondary);
      margin-bottom: 56px;
      line-height: 1.55;
      max-width: 700px;
    }

    .docs-content h2 {
      font-size: 1.7rem;
      font-weight: 700;
      letter-spacing: -0.025em;
      margin: 72px 0 18px;
      padding-top: 8px;
      scroll-margin-top: 96px;
      position: relative;
    }
    .docs-content h2:first-of-type { margin-top: 0; }
    .docs-content h2 .anchor-link {
      opacity: 0;
      margin-left: 10px;
      color: var(--accent-blue);
      font-size: 0.65em;
      text-decoration: none;
      transition: opacity 0.2s;
    }
    .docs-content h2:hover .anchor-link { opacity: 1; }

    .docs-content h3 {
      font-size: 1.18rem;
      font-weight: 600;
      margin: 36px 0 12px;
      color: var(--text-primary);
      scroll-margin-top: 96px;
    }

    .docs-content h4 {
      font-size: 1rem;
      font-weight: 600;
      margin: 24px 0 8px;
      color: var(--text-secondary);
      letter-spacing: 0.01em;
    }

    .docs-content p {
      color: var(--text-secondary);
      margin: 0 0 16px;
      line-height: 1.7;
    }

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

    .docs-content a:not(.btn):not(.anchor-link) {
      color: #93c5fd;
      text-decoration: none;
      border-bottom: 1px solid rgba(147, 197, 253, 0.3);
      transition: border-color 0.15s, color 0.15s;
    }
    .docs-content a:not(.btn):not(.anchor-link):hover {
      color: #bfdbfe;
      border-color: rgba(147, 197, 253, 0.6);
    }

    .docs-content ul, .docs-content ol {
      margin: 0 0 18px 22px;
      color: var(--text-secondary);
      line-height: 1.7;
    }
    .docs-content li { margin: 6px 0; }
    .docs-content li strong { color: var(--text-primary); }

    .docs-content code {
      font-size: 0.9em;
      padding: 2px 6px;
      background: rgba(139, 92, 246, 0.1);
      border: 1px solid rgba(139, 92, 246, 0.15);
      border-radius: 5px;
      color: #c4b5fd;
      word-break: break-word;
    }

    .docs-content pre {
      position: relative;
      background: rgba(7, 11, 20, 0.85);
      border: 1px solid var(--border-strong);
      border-radius: 12px;
      padding: 18px 20px;
      margin: 16px 0 24px;
      overflow-x: auto;
      font-size: 0.85rem;
      line-height: 1.55;
      box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    }
    .docs-content pre::before {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: 12px;
      padding: 1px;
      background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(139, 92, 246, 0.18), transparent);
      -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
      -webkit-mask-composite: xor;
      mask-composite: exclude;
      pointer-events: none;
    }
    .docs-content pre code {
      padding: 0;
      background: transparent;
      border: none;
      color: #e2e8f0;
      font-size: 0.85rem;
    }
    .docs-content pre::-webkit-scrollbar { height: 6px; }
    .docs-content pre::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

    /* Inline syntax tint for handlebars-style snippets */
    .tk-tag    { color: #f0abfc; }
    .tk-var    { color: #93c5fd; }
    .tk-str    { color: #86efac; }
    .tk-num    { color: #fde047; }
    .tk-comment{ color: #64748b; font-style: italic; }
    .tk-kw     { color: #fcd34d; }

    .docs-content blockquote {
      border-left: 3px solid var(--accent-blue);
      padding: 14px 20px;
      margin: 18px 0 24px;
      background: rgba(59, 130, 246, 0.06);
      border-radius: 0 12px 12px 0;
      color: var(--text-secondary);
    }
    .docs-content blockquote p:last-child { margin-bottom: 0; }
    .docs-content blockquote strong { color: var(--text-primary); }

    .callout {
      display: flex;
      gap: 14px;
      padding: 18px 22px;
      margin: 18px 0 24px;
      background: rgba(245, 158, 11, 0.06);
      border: 1px solid rgba(245, 158, 11, 0.18);
      border-radius: 12px;
      align-items: flex-start;
    }
    .callout .callout-icon {
      width: 22px;
      height: 22px;
      color: var(--accent-amber);
      flex-shrink: 0;
      margin-top: 2px;
    }
    .callout-tip {
      background: rgba(6, 182, 212, 0.06);
      border-color: rgba(6, 182, 212, 0.18);
    }
    .callout-tip .callout-icon { color: var(--accent-cyan); }
    .callout-success {
      background: rgba(16, 185, 129, 0.06);
      border-color: rgba(16, 185, 129, 0.18);
    }
    .callout-success .callout-icon { color: var(--accent-green); }
    .callout p:last-child { margin-bottom: 0; }

    .docs-content table {
      width: 100%;
      max-width: 100%;
      border-collapse: separate;
      border-spacing: 0;
      margin: 16px 0 24px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 12px;
      overflow: hidden;
      font-size: 0.92rem;
    }
    .docs-content th {
      text-align: left;
      overflow-wrap: anywhere;
      padding: 14px 18px;
      background: rgba(7, 11, 20, 0.6);
      color: var(--text-primary);
      font-weight: 600;
      font-size: 0.85rem;
      letter-spacing: 0.01em;
      border-bottom: 1px solid var(--border);
    }
    .docs-content td {
      overflow-wrap: anywhere;
      padding: 12px 18px;
      color: var(--text-secondary);
      border-bottom: 1px solid var(--border);
      vertical-align: top;
    }
    .docs-content tr:last-child td { border-bottom: none; }

    /* Next/prev */
    .docs-nextprev {
      display: flex;
      justify-content: space-between;
      gap: 16px;
      margin-top: 72px;
      padding-top: 32px;
      border-top: 1px solid var(--border);
    }
    .docs-nextprev a {
      flex: 1;
      padding: 18px 22px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 12px;
      text-decoration: none;
      color: var(--text-primary);
      transition: all 0.2s;
      border-bottom: 1px solid var(--border) !important;
    }
    .docs-nextprev a:hover {
      background: rgba(59, 130, 246, 0.08);
      border-color: rgba(59, 130, 246, 0.3) !important;
      transform: translateY(-1px);
    }
    .docs-nextprev .label {
      font-size: 0.72rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--text-muted);
      font-weight: 600;
      margin-bottom: 6px;
    }
    .docs-nextprev .title { font-size: 1.05rem; font-weight: 600; color: var(--text-primary); }
    .docs-nextprev .next { text-align: right; }

@media (max-width: 1024px) {
  .docs-layout { grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 880px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-left: 20px; padding-right: 20px; }
  .docs-sidebar { position: static; height: auto; max-height: 280px; }
  .docs-content table { table-layout: fixed; }
}
@media (max-width: 768px) {
  .docs-title { font-size: 2rem; }
  .docs-lede { font-size: 1rem; }
  .docs-content h2 { font-size: 1.4rem; }
  .docs-nextprev { flex-direction: column; }
  .docs-nextprev .next { text-align: left; }
}
