/* daitchain docs - extends ../styles.css with docs-specific layout */

:root {
  --doc-side-w: 280px;
  --doc-content-max: 760px;
  --doc-bg-code: #f6f8fc;
  --doc-bg-pre: #0b1220;
  --doc-fg-pre: #e8eef9;
  --doc-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* Body layout: sidebar + content */
body.docs { background: var(--bg); }

.docs-shell {
  display: grid;
  grid-template-columns: var(--doc-side-w) minmax(0, 1fr);
  max-width: var(--maxw);
  margin: 0 auto;
  gap: 32px;
  padding: 32px 24px 80px;
  align-items: start;
}

/* Sidebar */
.docs-side {
  position: sticky;
  top: 80px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  font-size: 14px;
  border-right: 1px solid var(--border);
  padding-right: 18px;
}
.docs-side h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-soft);
  margin: 24px 0 8px;
  font-weight: 700;
}
.docs-side h4:first-child { margin-top: 0; }
.docs-side ul { list-style: none; padding: 0; margin: 0 0 4px; }
.docs-side li { margin: 0; }
.docs-side a {
  display: block;
  padding: 5px 8px;
  color: var(--ink-soft);
  border-radius: 6px;
  font-weight: 500;
}
.docs-side a:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.docs-side a.current {
  background: rgba(26,115,232,.10);
  color: var(--primary);
  font-weight: 600;
}

/* Content column */
.docs-main {
  min-width: 0;
  max-width: var(--doc-content-max);
}
.docs-main h1 {
  font-size: 36px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -.5px;
  margin-bottom: 8px;
}
.docs-main .lede {
  font-size: 18px;
  color: var(--ink-soft);
  margin-bottom: 28px;
  line-height: 1.55;
}
.docs-main h2 {
  font-size: 24px;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 12px;
  letter-spacing: -.3px;
  border-top: 1px solid var(--border);
  padding-top: 28px;
}
.docs-main h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 24px; }
.docs-main h3 {
  font-size: 18px;
  font-weight: 700;
  margin-top: 24px;
  margin-bottom: 10px;
}
.docs-main h4 {
  font-size: 15px;
  font-weight: 700;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--ink);
}
.docs-main p, .docs-main li { font-size: 15px; line-height: 1.65; }
.docs-main p { margin-bottom: 14px; }
.docs-main ul, .docs-main ol { margin: 0 0 14px 22px; }
.docs-main li { margin-bottom: 4px; }

/* Inline code + pre */
.docs-main code {
  font-family: var(--doc-mono);
  font-size: 13px;
  background: var(--doc-bg-code);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--ink);
}
.docs-main pre {
  background: var(--doc-bg-pre);
  color: var(--doc-fg-pre);
  font-family: var(--doc-mono);
  font-size: 13px;
  line-height: 1.55;
  padding: 16px 18px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 14px 0 22px;
}
.docs-main pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Tables */
.docs-main table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 22px;
  font-size: 14px;
}
.docs-main th, .docs-main td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.docs-main th {
  font-weight: 600;
  background: var(--bg-soft);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--ink-soft);
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .5px;
  vertical-align: middle;
  margin-left: 8px;
}
.badge-phase1 { background: var(--accent-yellow); color: #5b4500; }
.badge-stub   { background: var(--bg-soft); color: var(--ink-soft); border: 1px solid var(--border); }
.badge-live   { background: var(--primary); color: white; }
.badge-real   { background: #d9f0e2; color: #0e6e3a; }

/* Callouts */
.callout {
  border-left: 4px solid var(--primary);
  background: var(--bg-soft);
  padding: 14px 18px;
  border-radius: 8px;
  margin: 18px 0 22px;
  font-size: 14px;
  color: var(--ink);
}
.callout strong { color: var(--ink); }
.callout-warn { border-left-color: var(--accent-yellow); }
.callout-note { border-left-color: var(--ink-soft); }

/* Hero card on docs landing */
.docs-hero {
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 32px 24px;
  margin-bottom: 36px;
}
.docs-hero h1 {
  font-size: 40px;
  margin-bottom: 12px;
  letter-spacing: -1px;
}
.docs-hero p { font-size: 17px; color: var(--ink-soft); margin-bottom: 14px; }

/* Section grid for landing */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.docs-grid .card {
  display: block;
  padding: 20px;
}
.docs-grid .card h3 { margin-bottom: 6px; font-size: 16px; }
.docs-grid .card p { color: var(--ink-soft); font-size: 14px; line-height: 1.5; margin: 0 0 8px; }
.docs-grid .card .pages {
  font-size: 12px;
  color: var(--ink-soft);
  font-family: var(--doc-mono);
}
.docs-grid .card a { color: inherit; }
.docs-grid .card:hover { border-color: var(--primary); }

/* Footer breadcrumb / nav */
.docs-pager {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
}
.docs-pager a {
  display: block;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  flex: 1 1 0;
  color: var(--ink);
}
.docs-pager a:hover { background: var(--bg-soft); text-decoration: none; }
.docs-pager .pager-label {
  display: block;
  font-size: 11px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2px;
}
.docs-pager a.next { text-align: right; }

/* Mobile: stack sidebar above content */
@media (max-width: 880px) {
  .docs-shell { grid-template-columns: 1fr; padding: 24px 18px 60px; }
  .docs-side { position: static; max-height: none; border-right: 0; padding-right: 0; border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 8px; }
  .docs-grid { grid-template-columns: 1fr; }
  .docs-main h1 { font-size: 28px; }
  .docs-main h2 { font-size: 20px; }
}
