/* Shared doc chrome — complements marketing page (DM Sans, EXIFmod palette) */

:root {
  --green: oklch(0.52 0.14 145);
  --green-light: oklch(0.94 0.04 145);
  --bg: oklch(0.985 0.004 80);
  --bg2: oklch(0.965 0.006 80);
  --border: oklch(0.88 0.005 80);
  --text: oklch(0.18 0.008 80);
  --text-mid: oklch(0.42 0.008 80);
  --text-light: oklch(0.60 0.006 80);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.docs-body {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--green);
  text-decoration-thickness: 0.05em;
}

a:hover {
  text-decoration: underline;
}

/* Top bar — same structure and styling as website/index.html */
body.docs-body > nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in oklch, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  height: 60px;
  margin: 0;
  box-sizing: border-box;
}

body.docs-body > nav .nav-logo {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

body.docs-body > nav .nav-logo span {
  color: var(--green);
}

body.docs-body > nav .nav-logo:hover {
  text-decoration: none;
  opacity: 0.9;
}

body.docs-body > nav .nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

body.docs-body > nav .nav-links a {
  font-size: 14px;
  color: var(--text-mid);
  text-decoration: none;
  font-weight: 450;
  transition: color 0.15s;
}

body.docs-body > nav .nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

body.docs-body > nav .nav-links a[aria-current="page"] {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 2px 0 0 var(--green);
  padding-bottom: 2px;
}

body.docs-body > nav .nav-links a[aria-current="page"]:hover {
  color: var(--text);
  text-decoration: none;
  opacity: 0.9;
}

body.docs-body > nav .nav-links a.btn-nav {
  background: var(--green);
  color: #fff;
  padding: 8px 18px;
  border-radius: 7px;
  font-weight: 500;
  font-size: 14px;
  transition: opacity 0.15s;
  text-decoration: none;
}

body.docs-body > nav .nav-links a.btn-nav:hover {
  opacity: 0.88;
  color: #fff;
  text-decoration: none;
}

/* Two-column layout: sidebar + content */
.docs-page {
  display: flex;
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  min-height: 0;
  align-items: flex-start;
  gap: 0;
  padding: 0 20px 48px;
}

.docs-sidebar {
  flex: 0 0 220px;
  position: sticky;
  top: 60px;
  z-index: 5;
  align-self: flex-start;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 32px 20px 40px 8px;
  border-right: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.4;
}

.docs-toc-subtitle {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  margin: 0 0 10px 4px;
  line-height: 1.3;
}

.docs-toc-chapters {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 20px;
}

.docs-toc-chapters a {
  display: block;
  padding: 6px 10px;
  margin-left: -4px;
  border-radius: 6px;
  color: var(--text-mid);
  text-decoration: none;
  font-weight: 500;
}

.docs-toc-chapters a:hover {
  color: var(--text);
  background: color-mix(in oklch, var(--bg2) 80%, var(--text) 0%);
  text-decoration: none;
}

.docs-toc-chapters a.is-active {
  color: var(--text);
  background: var(--green-light);
  font-weight: 600;
}

/* Main */
.docs-wrap {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 720px;
  margin: 0;
  padding: 32px 0 64px 28px;
}

.doc-index-title {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
  line-height: 1.2;
}

.doc-index-lead {
  color: var(--text-mid);
  font-size: 1.05rem;
  margin: 0 0 32px;
  max-width: 52ch;
}

.doc-toc,
ol.doc-toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 3px color-mix(in oklch, var(--text) 6%, transparent);
  overflow: hidden;
}

.doc-toc li {
  border-bottom: 1px solid var(--border);
}

.doc-toc li:last-child {
  border-bottom: 0;
}

.doc-toc a {
  display: block;
  padding: 16px 20px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s;
}

.doc-toc a:hover {
  background: var(--green-light);
  text-decoration: none;
}

.doc-toc .toc-title {
  display: block;
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.doc-toc span.blurb {
  display: block;
  font-size: 0.92rem;
  color: var(--text-mid);
  font-weight: 400;
  line-height: 1.45;
}

/* Markdown content */
.md-content h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
  line-height: 1.2;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.md-content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 32px 0 12px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.md-content h3 {
  font-size: 1.08rem;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--text);
}

.md-content p {
  margin: 0 0 14px;
  max-width: 60ch;
}

.md-content ul,
.md-content ol {
  margin: 0 0 16px;
  padding-left: 1.4em;
}

.md-content li {
  margin: 0 0 6px;
}

.md-content li::marker {
  color: var(--text-mid);
}

.md-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 0 0 20px;
}

.md-content th,
.md-content td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.md-content th {
  background: var(--bg2);
  font-weight: 600;
}

.md-content pre {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0 0 16px;
}

.md-content code {
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.md-content pre code {
  font-size: 0.88rem;
  background: none;
  border: 0;
  padding: 0;
}

/* Footer */
.docs-foot {
  padding: 20px 28px 32px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  background: var(--bg2);
}

.docs-foot a {
  color: var(--text-mid);
  text-decoration: none;
}

.docs-foot a:hover {
  color: var(--text);
  text-decoration: underline;
}

@media (max-width: 900px) {
  .docs-page {
    flex-direction: column;
    padding: 0 16px 32px;
    max-width: 100%;
  }

  .docs-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    flex: 0 0 auto;
    width: 100%;
    padding: 20px 0 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .docs-toc-chapters {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-bottom: 0;
  }

  .docs-toc-chapters a {
    display: inline-block;
    margin-left: 0;
    font-size: 0.86rem;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
  }

  .docs-toc-chapters a.is-active {
    border-color: color-mix(in oklch, var(--green) 50%, var(--border));
  }

  .docs-wrap {
    padding: 20px 0 48px 0;
  }
}

@media (max-width: 768px) {
  body.docs-body > nav {
    padding: 0 20px;
  }

  /* Match marketing page: hide “How it works” on small viewports */
  body.docs-body > nav .nav-links li:first-child {
    display: none;
  }
}

@media (max-width: 540px) {
  body.docs-body > nav {
    height: auto;
    min-height: 56px;
    padding: 10px 18px;
    flex-wrap: wrap;
    row-gap: 8px;
  }
}
