/* JOLT documentation site. Light by default, dark when the system asks for it. */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-code: #f2f3f5;
  --fg: #1d1f23;
  --fg-muted: #5b616b;
  --border: #e3e5e9;
  --accent: #b45309;
  --accent-soft: #fef3c7;
  --link: #0f62c9;
  --note-bg: #eef5ff;
  --note-border: #9cc2f5;
  --warn-bg: #fff7e6;
  --warn-border: #f2c26b;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171b;
    --bg-soft: #1c1f24;
    --bg-code: #23272e;
    --fg: #e6e8eb;
    --fg-muted: #9aa1ab;
    --border: #2d3139;
    --accent: #f59e0b;
    --accent-soft: #3a2a0c;
    --link: #6cb0ff;
    --note-bg: #16233a;
    --note-border: #2f5b9a;
    --warn-bg: #2e2412;
    --warn-border: #8a6420;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 "Segoe UI", system-ui, -apple-system, sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- header ---- */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 700; font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand span { color: var(--fg-muted); font-weight: 400; }
.version { color: var(--fg-muted); font-size: 13px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; }
.top-link { margin-left: auto; font-weight: 600; }
.menu-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--fg); border-radius: 6px; font-size: 18px; width: 36px; height: 34px; cursor: pointer; }

/* ---- layout ---- */
.shell { display: flex; max-width: 1240px; margin: 0 auto; }
.sidebar {
  position: sticky;
  top: 56px;
  flex: 0 0 250px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 24px 16px 40px 20px;
  border-right: 1px solid var(--border);
}
.nav-section h2 { margin: 18px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-muted); }
.nav-section:first-child h2 { margin-top: 0; }
.nav-section ul { list-style: none; margin: 0; padding: 0; }
.nav-section a { display: block; padding: 4px 10px; border-radius: 6px; color: var(--fg); font-size: 15px; }
.nav-section a:hover { background: var(--bg-soft); text-decoration: none; }
.nav-section a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.content { flex: 1; min-width: 0; padding: 32px 48px 48px; }
article { max-width: 780px; }

/* ---- type ---- */
h1 { font-size: 2.1rem; line-height: 1.2; margin: 0 0 12px; }
h2 { font-size: 1.45rem; margin: 2.2em 0 0.5em; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
h3 { font-size: 1.15rem; margin: 1.8em 0 0.4em; }
.lead { font-size: 1.15rem; color: var(--fg-muted); margin-top: 0; }
code, kbd, pre { font-family: "Cascadia Code", Consolas, "SF Mono", monospace; font-size: 0.88em; }
code { background: var(--bg-code); padding: 1px 5px; border-radius: 4px; }
kbd { background: var(--bg-soft); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; }
pre { background: var(--bg-code); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; overflow-x: auto; line-height: 1.5; }
pre code { background: none; padding: 0; font-size: 1em; }
table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 0.95em; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; vertical-align: top; }
th { background: var(--bg-soft); }
li { margin: 0.2em 0; }
li > ul, li > ol { margin: 0.2em 0; }
.ui { font-weight: 600; }

/* ---- callouts and cards ---- */
.note, .warn { border-left: 4px solid; border-radius: 6px; padding: 10px 14px; margin: 1.2em 0; }
.note { background: var(--note-bg); border-color: var(--note-border); }
.warn { background: var(--warn-bg); border-color: var(--warn-border); }
.note > :first-child, .warn > :first-child { margin-top: 0; }
.note > :last-child, .warn > :last-child { margin-bottom: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 1.4em 0; }
.card { display: block; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: var(--bg-soft); color: var(--fg); }
.card:hover { border-color: var(--accent); text-decoration: none; }
.card strong { display: block; font-size: 1.1em; color: var(--accent); }
.card span { color: var(--fg-muted); font-size: 0.93em; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 0 8px; border: 1px solid var(--border); background: var(--bg-soft); }
.badge.ok { color: #15803d; border-color: #86efac; }
.badge.todo { color: var(--accent); border-color: var(--warn-border); }

/* ---- pager and footer ---- */
.pager { display: flex; justify-content: space-between; gap: 16px; max-width: 780px; margin-top: 56px; }
.pager a { flex: 1; max-width: 48%; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-weight: 600; }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .next { text-align: right; margin-left: auto; }
.pager small { display: block; color: var(--fg-muted); font-weight: 400; }
footer { max-width: 780px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--fg-muted); font-size: 14px; }

/* ---- narrow screens ---- */
@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .top { padding: 0 16px; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 56px;
    z-index: 9;
    width: 280px;
    background: var(--bg);
    transform: translateX(-100%);
    transition: transform 0.2s;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.15);
  }
  .sidebar.open { transform: none; }
  .content { padding: 24px 16px 40px; }
  h1 { font-size: 1.7rem; }
  .pager a { max-width: none; }
}

a.button {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  background: var(--accent, #0f6cbd);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
a.button:hover {
  filter: brightness(1.1);
}
@media (prefers-color-scheme: dark) {
  a.button {
    color: #1a1204;
  }
}

/* ---- JAM app cards (docs/pages/jam.html, filled in by scripts/jam/site.js) ---- */
.jam-cards { display: grid; gap: 16px; margin: 16px 0 24px; }
.jam-card { padding: 16px 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft); }
.jam-card h3 { margin: 0 0 6px; }
.jam-card p { margin: 6px 0; }
.jam-version { font-size: 0.8em; font-weight: 400; color: var(--fg-muted); }
.jam-card dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 10px 0; }
.jam-card dt { font-weight: 600; }
.jam-card dd { margin: 0; overflow-wrap: anywhere; }
.jam-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 10px; }
.jam-actions button { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--fg); font: inherit; cursor: pointer; }
.jam-actions button:hover { border-color: var(--link); }
.jam-actions button:first-child { border-color: var(--accent); background: var(--accent-soft); }
.jam-seal { display: inline-block; width: 30px; height: 30px; vertical-align: -7px; }
.jam-seal svg { width: 100%; height: 100%; }
.jam-reviewed { padding: 6px 10px; border: 1px solid #e0a526; border-radius: 6px; background: rgba(249, 217, 118, 0.18); }
.jam-seal-inline { display: inline-block; width: 22px; height: 22px; vertical-align: -5px; }
.jam-seal-inline svg { width: 100%; height: 100%; }
