/* BookEngine Docs — Documentation Pages */

/* Layout */
.docs-layout {
  display: flex;
  gap: 3rem;
  max-width: 1200px;
  margin: 6rem auto 4rem;
  padding: 0 2rem;
  align-items: flex-start;
}

/* Sidebar */
.docs-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 6rem;
  height: fit-content;
}

.docs-sidebar-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  padding: 0 12px;
  margin-bottom: 8px;
}

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
}

.docs-nav a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  padding: 9px 12px;
  border-radius: 9px;
  transition: color 0.15s, background 0.15s;
  line-height: 1.4;
}

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

.docs-nav a.active {
  color: var(--accent);
  background: rgba(94, 106, 210, 0.12);
  border: 1px solid rgba(94, 106, 210, 0.2);
}

.docs-nav .nav-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  padding: 10px 12px 4px;
}

/* Content */
.docs-content {
  flex: 1;
  min-width: 0;
}

.docs-content h1 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 12px;
  color: var(--text);
}

.docs-content .docs-lead {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 28px;
}

.docs-content h2 {
  font-size: 21px;
  font-weight: 700;
  margin: 40px 0 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.docs-content h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 20px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

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

.docs-content p {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.75;
  margin-bottom: 14px;
}

.docs-content ul,
.docs-content ol {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.75;
  padding-left: 1.5rem;
  margin-bottom: 14px;
}

.docs-content li {
  margin-bottom: 6px;
}

/* Step Cards */
.step-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
}

.step-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: border-color 0.2s;
}

.step-card:hover {
  border-color: rgba(94, 106, 210, 0.3);
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(94, 106, 210, 0.15);
  border: 1px solid rgba(94, 106, 210, 0.3);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-body {
  flex: 1;
}

.step-body h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
}

.step-body p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

/* Info Box */
.info-box {
  background: rgba(94, 106, 210, 0.08);
  border: 1px solid rgba(94, 106, 210, 0.25);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 20px 0;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.7;
}

.info-box.warning {
  background: rgba(249, 115, 22, 0.08);
  border-color: rgba(249, 115, 22, 0.25);
}

.info-box.success {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.25);
}

.info-box-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  font-size: 13.5px;
}

/* Pipeline Steps */
.pipeline-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 24px 0;
  position: relative;
}

.pipeline-list::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 36px;
  bottom: 36px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(94,106,210,0.1) 100%);
}

.pipeline-step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 16px 20px;
  border-radius: 14px;
  transition: background 0.15s;
  position: relative;
}

.pipeline-step:hover {
  background: var(--surface);
}

.pipeline-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid rgba(94, 106, 210, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 1;
  position: relative;
}

.pipeline-dot .stage-id {
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.pipeline-body {
  flex: 1;
  padding-top: 6px;
}

.pipeline-body h3 {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipeline-body p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

.stage-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(94, 106, 210, 0.15);
  color: #7C85E0;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.stage-badge.pub {
  background: rgba(34, 197, 94, 0.12);
  color: #22C55E;
}

/* Spec Table */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

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

.spec-table th:first-child { border-radius: 10px 0 0 0; }
.spec-table th:last-child { border-radius: 0 10px 0 0; }

.spec-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}

.spec-table td:first-child {
  color: var(--text);
  font-weight: 500;
}

.spec-table tr:last-child td {
  border-bottom: none;
}

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

/* Code Inline */
.docs-content code {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
  color: #A78BFA;
}

/* Key Card Grid */
.key-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.key-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.key-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.key-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(94, 106, 210, 0.15);
  border: 1px solid rgba(94, 106, 210, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.key-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.key-card p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 10px;
}

.key-card .btn-secondary {
  font-size: 12.5px;
  padding: 8px 16px;
}

/* Style Guide Grid */
.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.style-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  transition: border-color 0.2s;
}

.style-card:hover {
  border-color: rgba(94, 106, 210, 0.3);
}

.style-code {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 6px;
  background: rgba(94, 106, 210, 0.1);
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
}

.style-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.style-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Breadcrumb */
.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-subtle);
}

.docs-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.docs-breadcrumb a:hover {
  color: var(--text);
}

.docs-breadcrumb span {
  color: var(--text-subtle);
}

/* Responsive */
@media (max-width: 768px) {
  .docs-layout {
    flex-direction: column;
    margin-top: 4rem;
    gap: 2rem;
  }

  .docs-sidebar {
    width: 100%;
    position: static;
  }

  .docs-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .docs-nav a {
    flex: 0 0 auto;
  }

  .docs-content h1 {
    font-size: 26px;
  }

  .pipeline-list::before {
    display: none;
  }

  .step-card {
    flex-direction: column;
    gap: 12px;
  }
}
