/* resource/docs.css
   OwlTerm Docs — dark sidebar + white content/page
*/

/* -------- Theme tokens -------- */
:root {
  /* Sidebar (dark) */
  --panel:         #111826;
  --panel-border:  #1c2333;
  --sidebar-link:        #cfd8e3;
  --sidebar-link-active: #ffffff;
  --sidebar-active-bg:   #1a2440;

  /* Page & content (light) */
  --content-bg:      #ffffff;   /* page + content background */
  --content-text:    #0b1220;
  --content-muted:   #4b5563;
  --content-border:  #e5e7eb;
  --content-shadow:  0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.08);

  /* Links inside content */
  --link:        #1d4ed8;
  --link-hover:  #2563eb;

  /* Code blocks */
  --code-bg:     #0f172a;  /* dark slate for strong contrast */
  --code-text:   #e6e9ef;

  /* Misc */
  --sidebar-w:   260px;
  --content-max: 980px;
}

/* -------- Base / Reset -------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  background: var(--content-bg);     /* make entire page white */
  color: var(--content-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; }

/* -------- Layout -------- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  background: var(--content-bg);     /* ensure grid area is white too */
}

.sidebar {
  background: var(--panel);          /* dark sidebar */
  padding: 18px;
  border-right: 1px solid var(--panel-border);
  position: sticky; top: 0;
  height: 100vh;
  overflow: auto;
  color: #e6e9ef;
}
.logo {
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: .3px;
}

.content {
  background: var(--content-bg);
  color: var(--content-text);
  padding: 28px 36px;
  max-width: var(--content-max);
  box-shadow: var(--content-shadow);
}

/* -------- Typography (content area) -------- */
.doc {
  line-height: 1.65;
  font-size: 16px;
  color: var(--content-text);
}
.doc h1 {
  font-size: 2.1rem;
  line-height: 1.2;
  margin: 0 0 16px;
  color: var(--content-text);
}
.doc h2 {
  font-size: 1.5rem;
  margin: 28px 0 10px;
  padding-top: 8px;
  border-top: 1px solid var(--content-border);
  color: var(--content-text);
}
.doc h3 {
  font-size: 1.15rem;
  margin: 22px 0 8px;
  color: var(--content-text);
}
.doc p { margin: 12px 0; color: var(--content-text); }
.doc strong { font-weight: 600; }
.doc .muted, .doc small { color: var(--content-muted); }

/* Headings anchor offset for in-page TOC */
.doc h1, .doc h2, .doc h3 { scroll-margin-top: 80px; }

/* Horizontal rule */
.doc hr {
  border: 0;
  border-top: 1px solid var(--content-border);
  margin: 24px 0;
}

/* -------- Links (content area) -------- */
.doc a { color: var(--link); }
.doc a:hover, .doc a:focus { color: var(--link-hover); }

/* -------- Sidebar: site TOC -------- */
.site-toc ul { list-style: none; padding: 0; margin: 0 0 16px 0; }
.site-toc li { margin: 2px 0; }
.site-toc a {
  display: block;
  padding: 8px 10px;
  color: var(--sidebar-link);
  text-decoration: none;
  border-radius: 8px;
  font-size: .96rem;
  line-height: 1.25rem;
}
.site-toc a.active,
.site-toc a:hover {
  color: var(--sidebar-link-active);
  background: var(--sidebar-active-bg);
  text-decoration: none;
}

/* “On this page” mini-TOC (sidebar) */
.on-this-page h4 {
  margin: 10px 0 6px;
  font-size: .95rem;
  color: #b6bfcc;
  font-weight: 600;
}
.on-this-page ul { list-style: none; padding-left: 0; margin: 0; }
.on-this-page li { margin: 4px 0; }
.on-this-page li.lvl-3 { margin-left: 12px; }
.on-this-page a {
  color: var(--sidebar-link);
  text-decoration: none;
}
.on-this-page a:hover { color: var(--sidebar-link-active); text-decoration: underline; }

/* Keyboard focus visibility in sidebar */
.sidebar a:focus-visible {
  outline: 2px solid #a5b4fc;
  outline-offset: 2px;
  border-radius: 6px;
}

/* -------- Code & Inline UI -------- */
.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  background: rgba(15, 23, 42, 0.06); /* subtle light background for inline code */
  color: #0b1220;
  padding: 0.15em 0.35em;
  border-radius: 6px;
  border: 1px solid #e7eaf0;
}
.doc pre {
  overflow: auto;
  padding: 12px;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 10px;
}
.doc pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: 0;
}

/* Keyboard keys */
kbd {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-bottom-width: 2px;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .85em;
  color: #111827;
}

/* -------- Lists & Tables (content area) -------- */
.doc ul, .doc ol { padding-left: 22px; }
.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background: #ffffff;
  border: 1px solid var(--content-border);
  border-radius: 10px;
  overflow: hidden;
}
.doc th, .doc td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--content-border);
  color: var(--content-text);
}
.doc th {
  text-align: left;
  background: #f8fafc;
  color: #111827;
  font-weight: 600;
}

/* -------- Pager & Footer (content area) -------- */
.pager {
  display: flex;
  justify-content: space-between;
  margin: 28px 0;
  gap: 10px;
}
.pager a {
  color: var(--link);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}
.pager a:hover {
  color: var(--link-hover);
  background: #eef2ff;
  border-color: #c7d2fe;
}

.footer {
  color: var(--content-muted);
  margin-bottom: 24px;
}

/* -------- Responsive -------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .content { padding: 22px 18px; box-shadow: none; }
}

/* -------- Utility -------- */
hr.sep {
  border: 0;
  border-top: 1px dashed var(--content-border);
  margin: 20px 0;
}

