/* ══════════════════════════════════════
   DOCS — layout, sidebar, content
══════════════════════════════════════ */

.docs-layout {
  display: flex;
  min-height: calc(100vh - var(--nav-h));
  max-width: 75%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  gap: 3rem;
}

/* ── Sidebar ── */
.docs-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--nav-h) + 2rem);
  align-self: flex-start;
  max-height: calc(100vh - var(--nav-h) - 4rem);
  overflow-y: auto;
}

.docs-nav-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--gray-500);
  text-transform: uppercase;
  margin: 1.25rem 0 0.4rem;
}

.docs-nav-label:first-child { margin-top: 0; }

.docs-nav ul { list-style: none; }

.docs-nav-link {
  display: block;
  padding: 0.3rem 0.6rem;
  font-size: 0.875rem;
  color: var(--gray-700);
  text-decoration: none;
  border-radius: var(--radius);
  border-left: 2px solid transparent;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}

.docs-nav-link:hover {
  color: var(--black);
  background: var(--gray-50);
}

.docs-nav-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--gray-50);
  font-weight: 500;
}

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

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

.docs-hero h1 {
  font-size: 2rem;
  font-weight: 600;
  margin: 0.4rem 0 0.75rem;
}

.docs-hero p {
  font-size: 1.05rem;
  color: var(--gray-500);
}

.docs-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}

/* ── Sections ── */
.docs-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.docs-section:last-child { border-bottom: none; }

.docs-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.docs-section p { color: var(--gray-700); }
.docs-section p a { color: var(--accent); text-decoration: none; }
.docs-section p a:hover { text-decoration: underline; }

.docs-section--highlight {
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  padding: 1.5rem 2rem;
}

.docs-section-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.docs-stl-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.docs-stl-icon { font-size: 3rem; }

.docs-stl-count {
  font-size: 0.8rem;
  color: var(--gray-500);
  text-align: center;
}

/* ── Shared buttons (in case docs.css loads standalone) ── */
.btn {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.12s, background 0.12s;
}

.btn-primary  { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-dim); }
.btn-ghost    { background: transparent; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-ghost:hover { background: var(--gray-50); }
.btn--sm      { padding: 0.3rem 0.75rem; font-size: 0.8rem; }

/* ══════════════════════════════════════
   STL BROWSER
══════════════════════════════════════ */

.stl-version-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stl-version-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stl-version-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.stl-pill {
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  border-radius: 99px;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
  text-decoration: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.stl-pill:hover { background: var(--gray-50); border-color: var(--gray-500); }

.stl-pill--active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.stl-meta {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: 1.25rem;
}

.stl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.stl-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.stl-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
  border-color: var(--gray-300);
}

/* 3D viewer */
.stl-viewer {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
}

.stl-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.stl-viewer-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--gray-500);
  pointer-events: none;
}

.stl-viewer-dormant {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--gray-50);
  cursor: pointer;
}

.stl-dormant-icon {
  font-size: 2rem;
  color: var(--gray-300);
  font-family: var(--font-mono);
  transition: color 0.15s;
}

.stl-dormant-label {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--gray-500);
  letter-spacing: 0.05em;
}

.stl-card:hover .stl-viewer-dormant .stl-dormant-icon {
  color: var(--accent);
}

.stl-card-body {
  padding: 1rem 1.25rem 0.5rem;
}

.stl-card-body { flex: 1; }

.stl-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--black);
}

.stl-card-filename {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gray-500);
  margin-bottom: 0.2rem;
  word-break: break-all;
}

.stl-card-size {
  font-size: 0.78rem;
  color: var(--gray-500);
}

.stl-card-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem 1.25rem;
}

.stl-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray-500);
  font-size: 1rem;
}

.stl-empty span { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }
.stl-empty p { margin-bottom: 0.4rem; }
.stl-empty a { color: var(--accent); }

