/* lobster.js Showcase — Wiki layout */

/* ─── Design tokens ─────────────────────────────────────────── */
:root {
  --font: system-ui, -apple-system, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --color:          #1a1a1a;
  --muted:          #6b7280;
  --link:           #2563eb;
  --border:         #e5e7eb;
  --code-bg:        #f3f4f6;
  --blockquote-border: #d1d5db;

  --sidebar-width:  220px;
  --header-height:  52px;
}

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--color);
  line-height: 1.7;
  background: #fff;
}
a { color: var(--link); }
a:hover { text-decoration: underline; }

/* ─── Site header ───────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 100%;
  padding: 0 1.5rem;
}
.site-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.site-logo:hover { text-decoration: none; color: var(--link); }
.site-tagline {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ─── Body layout ───────────────────────────────────────────── */
.site-body {
  display: flex;
  min-height: calc(100vh - var(--header-height) - 48px);
}

/* ─── Sidebar ───────────────────────────────────────────────── */
.site-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 1.25rem 0 1.25rem 0.75rem;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
}

/* lobster.js renders nav.md as lists — style them as a menu */
.site-sidebar .lbs-ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-sidebar .lbs-ul .lbs-ul {
  padding-left: 0.75rem;
}
.site-sidebar .lbs-list-item {
  margin: 0;
}
.site-sidebar .lbs-list-item > .lbs-paragraph {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.8rem 1.25rem 0.2rem;
}
.site-sidebar a {
  display: block;
  padding: 0.3rem 1.25rem;
  color: var(--color);
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: 0;
  border-left: 2px solid transparent;
  transition: background 0.1s, border-color 0.1s;
}
.site-sidebar a:hover {
  background: var(--code-bg);
  text-decoration: none;
}
.site-sidebar a.nav-active {
  border-left-color: var(--link);
  color: var(--link);
  font-weight: 600;
  background: #eff6ff;
}

/* ─── Main content ──────────────────────────────────────────── */
.site-main {
  flex: 1;
  min-width: 0;
  padding: 2rem 2.5rem;
  max-width: 800px;
}

/* ─── Site footer ───────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}
.site-footer p { margin: 0; }

/* ═══════════════════════════════════════════════════════════════
   lobster.js element styles (lbs-* classes)
   ═══════════════════════════════════════════════════════════════ */

/* Headings */
.lbs-heading-1 { font-size: 1.9em; font-weight: 700; margin: 0 0 0.5em; }
.lbs-heading-2 { font-size: 1.4em; font-weight: 600; margin: 1.6em 0 0.4em; border-bottom: 1px solid var(--border); padding-bottom: 0.25em; }
.lbs-heading-3 { font-size: 1.15em; font-weight: 600; margin: 1.3em 0 0.3em; }
.lbs-heading-4 { font-size: 1em;    font-weight: 600; margin: 1.1em 0 0.25em; }
.lbs-heading-5 { font-size: 0.9em;  font-weight: 600; margin: 1em 0 0.2em; }
.lbs-heading-6 { font-size: 0.85em; font-weight: 600; margin: 1em 0 0.2em; color: var(--muted); }

/* Paragraph */
.lbs-paragraph { margin: 0.75em 0; }

/* Inline */
.lbs-emphasis       { font-style: italic; }
.lbs-strong         { font-weight: 700; }
.lbs-strikethrough  { text-decoration: line-through; color: var(--muted); }
.lbs-code-span      { font-family: var(--mono); font-size: 0.875em; background: var(--code-bg); padding: 0.1em 0.4em; border-radius: 3px; }

/* Horizontal rule */
.lbs-hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

/* Code block */
.lbs-code-block { margin: 1em 0; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.lbs-code-block pre { margin: 0; padding: 1em; background: var(--code-bg); overflow-x: auto; }
.lbs-code-block code { font-family: var(--mono); font-size: 0.875em; }
.lbs-code-filename { font-family: var(--mono); font-size: 0.75em; padding: 0.3em 1em; background: var(--border); color: var(--muted); }

/* Blockquote */
.lbs-blockquote { margin: 1em 0; padding: 0.5em 1em; border-left: 4px solid var(--blockquote-border); color: var(--muted); }
.lbs-blockquote .lbs-paragraph { margin: 0.25em 0; }

/* Lists */
.lbs-ul, .lbs-ol { margin: 0.5em 0; padding-left: 1.8em; }
.lbs-list-item   { margin: 0.2em 0; }
.lbs-ul .lbs-ul, .lbs-ul .lbs-ol,
.lbs-ol .lbs-ul, .lbs-ol .lbs-ol { margin: 0.2em 0; }
.lbs-checkbox { margin-right: 0.4em; }

/* Table */
.lbs-table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.lbs-table th,
.lbs-table td  { border: 1px solid var(--border); padding: 0.5em 0.75em; text-align: left; }
.lbs-table th  { background: var(--code-bg); font-weight: 600; }

/* Silent table — layout grid */
.lbs-table-silent { table-layout: fixed; width: 100%; }
.lbs-table-silent thead { display: none; }
.lbs-table-silent th,
.lbs-table-silent td { border: none; vertical-align: top; padding: 0.5rem 1.5rem 0.5rem 0; }
.lbs-table-silent th:last-child,
.lbs-table-silent td:last-child { padding-right: 0; }

/* Image */
.lbs-image { max-width: 100%; }

/* Details / collapsible */
.lbs-details { margin: 1em 0; border: 1px solid var(--border); border-radius: 6px; padding: 0.5em 1em; }
.lbs-summary { cursor: pointer; font-weight: 600; padding: 0.25em 0; }

/* Footnotes */
.lbs-footnote-ref a { font-size: 0.8em; vertical-align: super; text-decoration: none; color: var(--link); }
.lbs-footnotes { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.9em; }
.lbs-footnotes ol { padding-left: 1.5em; }
.lbs-footnote-item { margin: 0.3em 0; color: var(--muted); }

/* Warp — hidden anchors */
.lbs-warp { display: none; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-body { flex-direction: column; }
  .site-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
  }
  .site-main { padding: 1.25rem 1rem; }
  .site-tagline { display: none; }
}
