/* Another World Archaeology — static docs viewer */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #222;
  background: #fafafa;
}

body {
  display: flex;
}

/* Sidebar */
nav#sidebar {
  width: 240px;
  flex: 0 0 240px;
  background: #1f2933;
  color: #cbd2d9;
  padding: 1.2em 1em;
  overflow-y: auto;
  height: 100vh;
  position: sticky;
  top: 0;
}

nav#sidebar h1 {
  font-size: 1.1em;
  margin: 0 0 1em 0;
  line-height: 1.2;
}

nav#sidebar h1 a {
  color: #fff;
  text-decoration: none;
}

nav#sidebar h3 {
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9aa5b1;
  margin: 1.5em 0 0.4em 0;
  font-weight: 600;
}

nav#sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

nav#sidebar li {
  margin: 0;
}

nav#sidebar a {
  display: block;
  padding: 0.3em 0.5em;
  color: #cbd2d9;
  text-decoration: none;
  border-radius: 3px;
}

nav#sidebar a:hover {
  background: #323f4b;
  color: #fff;
}

nav#sidebar .generated-at {
  margin-top: 2em;
  font-size: 0.7em;
  color: #7b8794;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* Main */
main {
  flex: 1;
  padding: 2em 3em;
  max-width: 920px;
  overflow-x: auto;
}

main h1 { font-size: 1.8em; margin-top: 0; }
main h2 { font-size: 1.4em; margin-top: 1.5em; border-bottom: 1px solid #d9e2ec; padding-bottom: 0.2em; }
main h3 { font-size: 1.15em; margin-top: 1.3em; }

main p { margin: 0.7em 0; }

main code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: #eef2f6;
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

main pre {
  background: #1f2933;
  color: #f5f7fa;
  padding: 0.8em 1em;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.85em;
  line-height: 1.4;
}

main pre code {
  background: none;
  color: inherit;
  padding: 0;
}

main a { color: #2e74b5; }

main table {
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.92em;
}

main th, main td {
  border: 1px solid #d9e2ec;
  padding: 0.4em 0.8em;
  text-align: left;
  vertical-align: top;
}

main th {
  background: #f0f4f8;
  font-weight: 600;
}

main hr {
  border: 0;
  border-top: 1px solid #d9e2ec;
  margin: 2em 0;
}

main ul, main ol { padding-left: 1.5em; }

/* Inline images from markdown `![alt](path)` syntax — usually
   rendered cut-content galleries under docs/assets/. The native
   sizes vary widely (single sprites are ~300×200, contact-sheet
   grids run to 3000+px wide), so cap to the main column width. */
main img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0.5em 0;
}

/* Blockquotes — used for callouts (e.g. forward_plan.md's
   "Use the tracker, not this page" notice) and for quoted
   research questions. */
main blockquote {
  margin: 1em 0;
  padding: 0.6em 0.9em;
  border-left: 3px solid #d9e2ec;
  background: #f7f9fc;
  color: #334e68;
}

/* Task-list items (`- [ ]` / `- [x]`) — used heavily in
   issues/<NNNN>-*.md "Acceptance criteria" sections. The bullet
   `<li>` would normally show a disc marker before the checkbox;
   remove it via list-style: none and a small negative-margin
   pull-back so the checkbox aligns with sibling non-task items. */
main li > input[type="checkbox"]:first-child {
  margin-right: 0.4em;
}
main ul > li:has(> input[type="checkbox"]:first-child),
main ol > li:has(> input[type="checkbox"]:first-child) {
  list-style: none;
  margin-left: -1.2em;
}

/* Audio figures (rendered from markdown links to .wav/.ogg/.mp3) */
figure.audio-figure {
  margin: 1em 0;
  padding: 0.7em 0.9em;
  background: #f7f9fc;
  border: 1px solid #d9e2ec;
  border-radius: 4px;
}

figure.audio-figure figcaption {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: #486581;
  margin-bottom: 0.4em;
}

figure.audio-figure audio {
  width: 100%;
  display: block;
}
