/* site layout — scc styles the components; this file is only the docs shell layout
   (grid, sidebar drawer, nav, doc columns). All colors come from scc tokens, so it
   follows the miasma theme and light/dark automatically. */

/* ── app shell ─────────────────────────────────────────────────────── */
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
}
@media (min-width: 1024px) {
  .shell { grid-template-columns: 15rem 1fr; }
}

.shell-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-width) solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in oklab, var(--bg), transparent 10%);
  backdrop-filter: blur(8px);
}
.shell-title { font-weight: 800; font-size: var(--text-lg); letter-spacing: -0.01em; }
.shell-title small { color: var(--text-muted); font-weight: 500; font-size: var(--text-sm); margin-left: var(--space-1); }
.shell-spacer { flex: 1; }
.icon-link { color: var(--text-muted); display: inline-flex; }
.icon-link:hover { color: var(--text); }
.menu-btn { display: none; background: none; border: 0; color: var(--text-muted); cursor: pointer; padding: var(--space-1); }
.menu-btn:hover { color: var(--text); }

.shell-main { padding: var(--space-6); min-width: 0; }

/* ── sidebar (drawer on mobile, sticky on desktop) ─────────────────── */
.shell-sidebar {
  border-right: var(--border-width) solid var(--border);
  padding: var(--space-3);
  overflow: auto;
}
.shell-backdrop { display: none; }

@media (max-width: 1023px) {
  .menu-btn { display: inline-flex; }
  .shell-sidebar {
    position: fixed;
    top: 3.25rem; bottom: 0; left: 0;
    width: 15rem; z-index: 30;
    background: var(--bg);
    transform: translateX(-100%);
    transition: transform var(--dur) var(--ease);
  }
  .shell-sidebar.open { transform: none; }
  .shell-backdrop.open { display: block; position: fixed; inset: 0; z-index: 20; background: rgb(0 0 0 / 0.4); }
}
@media (min-width: 1024px) {
  .shell-sidebar { position: sticky; top: 3.25rem; align-self: start; height: calc(100vh - 3.25rem); }
  .menu-btn { display: none; }
}

/* ── nav ───────────────────────────────────────────────────────────── */
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: var(--space-4) var(--space-3) var(--space-1); }
.nav-link { display: block; padding: var(--space-1) var(--space-3); border-radius: var(--radius-sm); font-size: var(--text-sm); color: var(--text); text-decoration: none; }
.nav-link:hover { background: var(--surface); }
.nav-link[aria-current="page"] { background: var(--accent); color: var(--accent-fg); }

/* ── doc page ──────────────────────────────────────────────────────── */
.doc-layout.cols { display: grid; gap: var(--space-8); align-items: start; }
@media (min-width: 1024px) { .doc-layout.cols { grid-template-columns: 1fr 1fr; } }
.doc-layout.single { max-width: var(--measure); }
.doc-body { min-width: 0; }
.ex-wrap { min-width: 0; display: flex; flex-direction: column; gap: var(--space-5); }
.ex-wrap.sticky { position: sticky; top: 4.5rem; }
.ex-label { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: var(--space-2); }
.ex-frames { display: flex; flex-direction: column; gap: var(--space-5); }
.ex-cap { font-size: var(--text-sm); color: var(--text-muted); margin-bottom: var(--space-1); }
.ex-frame { width: 100%; border: var(--border-width) solid var(--border); border-radius: var(--radius); background: var(--bg); }
.ex-open { display: inline-block; margin-top: var(--space-2); font-size: var(--text-sm); color: var(--accent); }

/* ── landing hero ──────────────────────────────────────────────────── */
.hero { text-align: center; padding: var(--space-8) 0; }
.hero h1 { font-size: var(--text-4xl); font-weight: 800; letter-spacing: -0.02em; }
.hero p { color: var(--text-muted); font-size: var(--text-lg); margin: var(--space-3) auto 0; max-width: 36rem; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; margin-top: var(--space-5); }
.demo-grid { display: grid; gap: var(--space-5); align-items: start; }
@media (min-width: 1024px) { .demo-grid { grid-template-columns: 1fr 1fr; } }
.code-block { min-width: 0; border-radius: var(--radius); background: #1a1a17; overflow: auto; }

.ex-frame--tall { height: 26rem; }
@media (min-width: 1024px) { .ex-frame--tall { height: calc(100vh - 9rem); } }

/* small layout helpers reused by the templates */
ul.stack { list-style: none; padding: 0; margin: 0; }
form.cluster input { flex: 1; }
.demo-grid > * { min-width: 0; }

/* the landing demo's "done" toggle (demo.js toggles .line-through) */
.line-through { text-decoration: line-through; opacity: 0.55; }

/* Re-tint highlight.js (github-dark) to the miasma palette, so rendered-doc code blocks
   match the warm theme and the examples' own listings (same token colors). `!important`
   guarantees it wins over the github-dark theme regardless of stylesheet load order. */
.doc-body pre, .code-block, .hljs { background: #1a1a17 !important; }
.hljs { color: #d9d4c2 !important; }
.hljs-keyword, .hljs-built_in, .hljs-literal, .hljs-type, .hljs-meta { color: #c98a45 !important; }
.hljs-title, .hljs-title.function_, .hljs-section, .hljs-name { color: #c8a45c !important; }
.hljs-string, .hljs-regexp, .hljs-symbol, .hljs-addition { color: #78824b !important; }
.hljs-number, .hljs-attr, .hljs-attribute, .hljs-property, .hljs-variable { color: #c8a45c !important; }
.hljs-comment, .hljs-quote, .hljs-deletion { color: #6b6b58 !important; }
