/* ============================
   GRAPHBUS DOCS — STYLES
   ============================ */

/* Layout */
.docs-body {
  background: var(--bg);
}

/* Reset the global nav { position: fixed } rule for the sidebar nav */
.docs-nav {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  z-index: auto;
  background: none;
  backdrop-filter: none;
  border-bottom: none;
}

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

/* ============================
   SIDEBAR
   ============================ */

.docs-sidebar {
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 32px 16px 32px 24px;
  border-right: 1px solid var(--border);
  width: 260px;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.docs-nav-section {
  margin-bottom: 28px;
}

.docs-nav-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 8px;
  padding-left: 12px;
}

.docs-nav-link {
  display: block;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--muted);
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  border-left: 2px solid transparent;
}

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

.docs-nav-link.active {
  color: var(--accent2);
  border-left-color: var(--accent2);
  background: rgba(6,182,212,0.06);
}

/* ============================
   MAIN CONTENT
   ============================ */

.docs-main {
  padding: 40px 48px 80px;
  max-width: 860px;
}

.docs-hero {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.docs-hero h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin: 16px 0 12px;
}

.docs-hero-sub {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 600px;
}

/* Sections */
.docs-section {
  margin-bottom: 64px;
  scroll-margin-top: 100px;
}

.docs-section h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  color: var(--text);
}

.docs-section h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--text);
}

.docs-section p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 16px;
}

.docs-section code {
  font-family: var(--mono);
  font-size: 13px;
  background: rgba(255,255,255,0.07);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent2);
}

.docs-section a {
  color: var(--accent2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.docs-section a:hover { opacity: 0.8; }

/* Code blocks */
.code-file {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

/* Tables */
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 16px 0;
}

.docs-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.docs-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--muted);
  vertical-align: top;
  line-height: 1.5;
}

.docs-table td:first-child {
  color: var(--text);
  white-space: nowrap;
}

.docs-table td code {
  font-size: 12px;
}

.docs-table tr:hover td { background: rgba(255,255,255,0.02); }

/* Callouts */
.docs-callout {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.6;
  margin: 20px 0;
}

.docs-callout.info {
  background: rgba(6,182,212,0.08);
  border: 1px solid rgba(6,182,212,0.2);
  color: var(--text);
}

.docs-callout.success {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  color: var(--text);
}

.docs-callout.warning {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  color: var(--text);
}

.docs-callout strong { font-weight: 700; }
.docs-callout code { background: rgba(255,255,255,0.1); }

/* Two-mode cards */
.docs-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}

.docs-mode-card {
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.docs-mode-card.build {
  background: rgba(245,158,11,0.05);
  border-color: rgba(245,158,11,0.2);
}

.docs-mode-card.runtime {
  background: rgba(6,182,212,0.05);
  border-color: rgba(6,182,212,0.2);
}

.docs-mode-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.build .docs-mode-tag { color: var(--build); }
.runtime .docs-mode-tag { color: var(--accent2); }

.docs-mode-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px !important;
}

.docs-mode-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.docs-mode-card ul li {
  font-size: 13px;
  color: var(--muted);
  padding: 3px 0;
  padding-left: 18px;
  position: relative;
}

.docs-mode-card ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent3);
  font-size: 11px;
}

.docs-mode-cost {
  font-size: 12px;
  font-weight: 700;
  color: var(--build);
  padding: 6px 10px;
  background: rgba(245,158,11,0.1);
  border-radius: 6px;
  display: inline-block;
}

.docs-mode-cost.runtime-cost {
  color: var(--accent3);
  background: rgba(16,185,129,0.1);
}

/* Pipeline list */
.docs-pipeline {
  padding-left: 0;
  list-style: none;
  counter-reset: pipeline;
  margin: 20px 0;
}

.docs-pipeline li {
  counter-increment: pipeline;
  padding: 10px 14px 10px 48px;
  position: relative;
  border-left: 2px solid var(--border);
  margin-left: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.docs-pipeline li::before {
  content: counter(pipeline);
  position: absolute;
  left: -16px;
  top: 10px;
  width: 28px;
  height: 28px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent2);
}

.docs-pipeline li strong { color: var(--text); }

.pipeline-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 10px;
  color: #a78bfa;
  vertical-align: middle;
}

/* CTA */
.docs-cta {
  margin-top: 80px;
  padding: 40px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.docs-cta h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
}

.docs-cta p {
  color: var(--muted);
  margin-bottom: 24px;
}

.docs-cta .btn {
  margin: 0 8px;
}

/* Nav active state */
nav a.nav-active {
  color: var(--accent2);
}

/* ============================
   RESPONSIVE
   ============================ */

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

  .docs-sidebar {
    display: none;
  }

  .docs-main {
    padding: 24px 20px 60px;
  }

  .docs-two-col {
    grid-template-columns: 1fr;
  }

  .docs-table {
    font-size: 12px;
  }

  .docs-table td:first-child {
    white-space: normal;
  }
}

@media (max-width: 600px) {
  /* Scrollable tables for narrow screens */
  .docs-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    font-size: 12px;
  }

  .docs-table td:first-child {
    white-space: nowrap;
  }

  /* Reduce section heading sizes */
  .docs-section h2 {
    font-size: 20px;
    letter-spacing: -0.4px;
  }

  .docs-section h3 {
    font-size: 17px;
  }

  /* Tighter main padding */
  .docs-main {
    padding: 20px 16px 56px;
  }
}
