/* Eposyne Director developer documentation. Builds on /site.css (tokens,
   topbar, tables, buttons, footer). Dark is the default; light follows the
   reader's system setting unless a data-theme attribute says otherwise. */

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg-base: #f4efe4;
    --bg-panel: #ebe4d7;
    --bg-elevated: #dfd6c7;
    --bg-hover: #d4c8b6;
    --surface-1: rgba(55, 43, 28, 0.045);
    --surface-2: rgba(55, 43, 28, 0.075);
    --surface-hover: rgba(55, 43, 28, 0.11);
    --border: rgba(50, 40, 28, 0.14);
    --border-strong: rgba(50, 40, 28, 0.22);
    --text-primary: #29251f;
    --text-secondary: #655e54;
    --text-muted: #81786b;
    --accent: #7a5418;
    --accent-hover: #6b4915;
    --accent-dark: #80581c;
    --accent-foreground: #fffaf0;
    --accent-tint: rgba(122, 84, 24, 0.12);
    --status-success: #557b5b;
    --status-neutral: #746d63;
    --status-destructive: #a25454;
    --warning: #8a5a12;
  }
}

.docs-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px var(--gutter) 80px;
}

.docs-side { position: sticky; top: 24px; align-self: start; font-size: 0.92rem; }
.docs-side .lbl { margin-bottom: 10px; }
.docs-side ul { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 2px; }
.docs-side a { display: block; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--text-secondary); text-decoration: none; font-weight: 500; }
.docs-side a:hover { background: var(--surface-hover); color: var(--text-primary); text-decoration: none; }
.docs-side a[aria-current="page"] { background: var(--surface-2); color: var(--text-primary); box-shadow: inset 2px 0 0 var(--accent); }

.docs-body { min-width: 0; max-width: none; margin: 0; padding: 0; }
.docs-body > h1 { margin-bottom: 0.35em; }
.docs-body h2 { margin: 2.2em 0 0.6em; padding-top: 0.2em; font-size: 1.35rem; }
.docs-body h3 { margin: 1.6em 0 0.5em; font-size: 1.02rem; }
.docs-body p, .docs-body li { max-width: 72ch; }
.docs-body p, .docs-body li, .docs-body td, .docs-body th, .docs-body h1, .docs-body h2, .docs-body h3 { overflow-wrap: anywhere; }
.docs-body ul, .docs-body ol { padding-left: 1.3em; margin: 0 0 1em; }
.docs-body li { margin-bottom: 0.35em; }
.docs-body .lede { margin-bottom: 1.4em; }
.docs-body table { margin: 0 0 1.4em; display: block; overflow-x: auto; }
.docs-body table th, .docs-body table td { white-space: normal; }
.docs-body td code, .docs-body th code { white-space: nowrap; }

.codeblock { margin: 0 0 1.4em; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-panel); overflow: hidden; }
.codeblock .cap { display: block; padding: 7px 14px; font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); font-weight: 600; background: var(--bg-elevated); border-bottom: 1px solid var(--border); }
.codeblock pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.55; color: var(--text-primary); background: var(--bg-panel); white-space: pre; tab-size: 2; }
.codeblock pre code { background: none; border: 0; padding: 0; font-size: inherit; }

.callout { margin: 0 0 1.4em; padding: 12px 16px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--surface-1); max-width: 72ch; }
.callout p { margin: 0 0 0.5em; }
.callout p:last-child { margin-bottom: 0; }
.callout.warn { border-left-color: var(--warning); }
.callout .lbl { margin-bottom: 4px; }

.pagenav { display: flex; justify-content: space-between; gap: 16px; margin-top: 3em; padding-top: 1.2em; border-top: 1px solid var(--border); font-size: 0.95rem; }
.pagenav a { text-decoration: none; }
.pagenav span { color: var(--text-secondary); display: block; font-size: 0.8rem; }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 1.6em; padding: 0; list-style: none; }
.cards li { margin: 0; max-width: none; }
.cards a { display: block; height: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-1); color: var(--text-primary); text-decoration: none; }
.cards a:hover { background: var(--surface-hover); text-decoration: none; }
.cards strong { display: block; margin-bottom: 2px; }
.cards span { color: var(--text-secondary); font-size: 0.92rem; }

.status-pill { display: inline-block; min-width: 3.2em; text-align: center; font-family: var(--font-mono); font-size: 0.84rem; padding: 1px 8px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--bg-elevated); }

@media (max-width: 900px) {
  .topbar nav { display: flex; overflow-x: auto; }
  .topbar { gap: 12px; }
  .topbar nav a { white-space: nowrap; padding: 6px 8px; }
  .docs-body td code, .docs-body th code { white-space: normal; }
  .docs-shell { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-top: 24px; }
  .docs-side { position: static; }
  .docs-side ul { display: flex; flex-wrap: wrap; gap: 4px; }
  .docs-side a[aria-current="page"] { box-shadow: none; }
  .cards { grid-template-columns: 1fr; }
}
