/* Shared styles for documentation pages */

.docs-shell {
  padding: 3rem 0 4.5rem;
}

.docs-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.docs-nav {
  position: sticky;
  top: calc(var(--header-h, 72px) + 1rem);
  padding: 1rem 0;
  border-right: 1px solid var(--border);
  padding-right: 1.25rem;
}

.docs-nav strong {
  display: block;
  margin-bottom: 0.85rem;
  color: var(--heading);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.docs-nav a {
  display: block;
  padding: 0.4rem 0;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.docs-nav a:hover,
.docs-nav a.is-active {
  color: var(--accent-hover);
}

.docs-content {
  max-width: 48rem;
  min-width: 0;
}

.docs-content h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  letter-spacing: -0.03em;
  color: var(--heading);
}

.docs-content h2 {
  margin: 2.5rem 0 0.85rem;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--heading);
}

.docs-content h3 {
  margin: 1.75rem 0 0.65rem;
  font-size: 1.1rem;
  color: var(--heading);
}

.docs-content p,
.docs-content li {
  color: var(--text-muted);
}

.docs-content ul,
.docs-content ol {
  padding-left: 1.25rem;
}

.docs-lead {
  margin: 0 0 1.5rem;
  font-size: 1.08rem;
}

.docs-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
  width: 100%;
}

.docs-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  color: var(--heading);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.docs-brand:hover,
.docs-brand:focus-visible {
  color: var(--heading);
  text-decoration: none;
}

.docs-brand img {
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  display: block;
  flex-shrink: 0;
}

.docs-top .back,
a.back {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  color: var(--accent-hover);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.35em;
  line-height: 1.4;
  box-sizing: border-box;
}

.docs-table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.docs-table th,
.docs-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.docs-table th {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7f93a8;
  background: rgba(0, 0, 0, 0.2);
}

.docs-table tr:last-child td {
  border-bottom: 0;
}

.docs-table code {
  font-size: 0.82rem;
  word-break: break-word;
}

.docs-note {
  margin: 1.25rem 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.docs-note strong {
  color: var(--heading);
}

.docs-pre {
  margin: 1rem 0 1.5rem;
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0a1018;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.55;
  color: #b8c9d8;
  white-space: pre;
}

.docs-toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.docs-toc-card {
  display: block;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, background 0.2s;
}

.docs-toc-card:hover {
  border-color: rgba(31, 168, 160, 0.4);
  background: var(--accent-soft);
  color: inherit;
}

.docs-toc-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  color: var(--heading);
}

.docs-toc-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

@media (max-width: 860px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .docs-nav {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 1rem;
  }
}

/* Demo guides */

.guide-step {
  margin: 2rem 0 2.5rem;
  padding-top: 0.25rem;
}

.guide-step h2 {
  margin-top: 0;
}

.guide-figure {
  margin: 1rem 0 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0a1018;
}

.guide-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.guide-figure figcaption {
  margin-top: 0.65rem;
  color: #7f93a8;
  font-size: 0.88rem;
}

.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
}
