/* === BASE (inherits theme.css vars) === */
body { background: var(--bg); }

/* Override nav for docs page — no transparent/blur on dark docs bg */
.docs-layout .nav {
  background: var(--bg);
  backdrop-filter: none;
}

/* === DOCS LAYOUT === */
.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  padding-top: 60px; /* nav height */
}

/* === SIDEBAR === */
.docs-sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  width: 240px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 2rem 1.5rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  background: var(--bg);
}

.docs-sidebar__section {}

.docs-sidebar__label {
  display: block;
  font-size: 0.65rem;
  color: var(--fg-xdim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.docs-sidebar__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.docs-sidebar__link {
  display: block;
  font-size: 0.875rem;
  color: var(--fg-dim);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.docs-sidebar__link:hover {
  color: var(--fg);
  background: var(--card-bg);
}

.docs-sidebar__link--active {
  color: var(--accent);
  background: var(--accent-dim);
}

.docs-sidebar__footer {
  margin-top: auto;
  padding-top: 2rem;
}

.docs-sidebar__back {
  font-size: 0.75rem;
  color: var(--fg-xdim);
  text-decoration: none;
  transition: color 0.2s;
}

.docs-sidebar__back:hover {
  color: var(--fg-dim);
}

/* === MAIN CONTENT === */
.docs-content {
  grid-column: 2;
  padding: 3rem 4rem 6rem;
  max-width: 860px;
}

.docs-hero {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.docs-hero__badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  border: 1px solid rgba(0,229,196,0.25);
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 1.25rem;
}

.docs-hero__title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 1rem;
}

.docs-hero__lede {
  font-size: 1rem;
  color: var(--fg-dim);
  line-height: 1.7;
  max-width: 600px;
  font-weight: 300;
}

/* === SECTIONS === */
.docs-section {
  margin-bottom: 4rem;
  scroll-margin-top: 80px;
}

.docs-section__title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.docs-subsection__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.docs-section > p {
  font-size: 0.9rem;
  color: var(--fg-dim);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

/* === CODE BLOCKS === */
.code-block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #c9d1d9;
  overflow-x: auto;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.code-block code {
  font-family: inherit;
  color: inherit;
}

.code-block--sm {
  padding: 0.875rem 1.25rem;
  font-size: 0.75rem;
}

.code-block--wide {
  max-width: 660px;
}

.code-block__caption {
  font-size: 0.75rem;
  color: var(--fg-xdim);
  padding-left: 0.25rem;
}

/* === CODE STEPS === */
.code-step {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.code-step__num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid rgba(0,229,196,0.3);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.75rem;
}

.code-step__body {
  flex: 1;
}

.code-step__label {
  font-size: 0.8rem;
  color: var(--fg-dim);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* === TWO COL === */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

.two-col p {
  font-size: 0.875rem;
  color: var(--fg-dim);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

/* === CALLOUTS === */
.callout {
  border-radius: 10px;
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.6;
  margin-top: 1.5rem;
}

.callout--tip {
  background: rgba(0,229,196,0.07);
  border: 1px solid rgba(0,229,196,0.2);
  color: var(--fg-dim);
}

.callout--tip strong {
  color: var(--accent);
}

.callout--warning {
  background: rgba(251,191,36,0.07);
  border: 1px solid rgba(251,191,36,0.2);
  color: #fbbf24;
}

.callout--warning strong {
  color: #fbbf24;
}

.callout--info {
  background: rgba(96,165,250,0.07);
  border: 1px solid rgba(96,165,250,0.2);
  color: var(--fg-dim);
}

.callout code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  background: rgba(255,255,255,0.06);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

.docs-link {
  color: var(--accent);
  text-decoration: none;
}

.docs-link:hover {
  text-decoration: underline;
}

/* === SCHEMA TABLE === */
.schema-table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

.schema-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.schema-table th {
  text-align: left;
  font-weight: 600;
  color: var(--fg-dim);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
}

.schema-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--fg-dim);
  vertical-align: top;
}

.schema-table td:first-child code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent);
}

.schema-table td:nth-child(2) {
  color: var(--fg-xdim);
  font-style: italic;
  white-space: nowrap;
}

/* === EVENT CARDS === */
.event-card {
  margin-bottom: 1.25rem;
}

.event-card__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.event-card__type {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.event-card__desc {
  font-size: 0.8rem;
  color: var(--fg-dim);
}

/* === SPEC GRID === */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.spec-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.spec-card__icon {
  margin-bottom: 0.875rem;
}

.spec-card__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

.spec-card__desc {
  font-size: 0.8rem;
  color: var(--fg-dim);
  line-height: 1.6;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    display: none; /* mobile: nav links suffice */
  }

  .docs-content {
    padding: 2rem 5% 4rem;
    max-width: 100%;
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}