/* PaperQuire Docs — layout & content styles */

/* Reset base-site rules that leak into docs pages */
.docs-page section { padding: 0; }
.docs-page .nav { display: none; }

/* ---- Header ---- */
.docs-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 16px;
  height: 56px; padding: 0 20px;
  background: rgba(18, 18, 21, 0.92); backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.docs-header .brand { font-size: 16px; }
.docs-header .brand svg { width: 24px; height: 24px; }
.docs-label {
  font-size: 13px; font-weight: 700; color: var(--blue);
  background: var(--blue-soft); padding: 2px 10px; border-radius: 6px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.docs-header #docsSearch {
  margin-left: auto; width: 220px;
  padding: 7px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg-soft);
  color: var(--ink); font-size: 13px; font-family: var(--font);
  outline: none; transition: border-color 0.15s;
}
.docs-header #docsSearch:focus { border-color: var(--blue); }
.docs-header #docsSearch::placeholder { color: var(--muted); }
.docs-header .btn-sm {
  padding: 6px 14px; font-size: 13px; border-radius: 8px; margin-left: 8px;
}
.docs-menu-toggle {
  display: none; background: none; border: 0;
  font-size: 22px; color: var(--ink); cursor: pointer; margin-left: 8px;
}

/* ---- 3-column layout ---- */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr 200px;
  grid-template-areas: "sidebar content toc";
  min-height: calc(100vh - 56px);
}

.docs-sidebar { grid-area: sidebar; }
.docs-content { grid-area: content; }
.docs-toc     { grid-area: toc; }

/* ---- Sidebar ---- */
.docs-sidebar {
  position: sticky; top: 56px; height: calc(100vh - 56px);
  overflow-y: auto; padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.sidebar-group { margin-bottom: 8px; }
.sidebar-group-label {
  display: block; padding: 6px 10px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  cursor: pointer; user-select: none;
}
.sidebar-group-label::before {
  content: '\25B8'; display: inline-block; width: 14px;
  font-size: 10px; transition: transform 0.15s;
}
.sidebar-group.open .sidebar-group-label::before { transform: rotate(90deg); }
.sidebar-links { display: none; padding-left: 8px; }
.sidebar-group.open .sidebar-links { display: block; }
.sidebar-links a {
  display: block; padding: 5px 10px 5px 18px;
  font-size: 13.5px; color: var(--body); border-radius: 6px;
  text-decoration: none; transition: background 0.1s, color 0.1s;
}
.sidebar-links a:hover { color: var(--ink); background: var(--bg-elevated); }
.sidebar-links a.active {
  color: var(--blue); background: var(--blue-soft); font-weight: 600;
}

/* ---- Main content ---- */
.docs-content {
  min-width: 0;
  max-width: 820px;
  padding: 32px 48px 80px;
  overflow-wrap: break-word;
}

/* Breadcrumb */
.docs-breadcrumb {
  font-size: 13px; color: var(--muted); margin-bottom: 8px;
}
.docs-breadcrumb a { color: var(--muted); }
.docs-breadcrumb a:hover { color: var(--blue); }

/* Typography */
.docs-content h1 {
  font-size: 32px; margin-bottom: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.docs-content h2 {
  font-size: 22px; margin-top: 48px; margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.docs-content h3 { font-size: 17px; margin-top: 32px; margin-bottom: 8px; }
.docs-content p { margin: 12px 0; font-size: 15px; line-height: 1.7; }
.docs-content ul, .docs-content ol { margin: 12px 0; padding-left: 24px; font-size: 15px; line-height: 1.7; }
.docs-content li { margin: 6px 0; }

/* Links */
.docs-content a { color: var(--blue); }
.docs-content a:hover { text-decoration: underline; }

/* Code */
.docs-content code {
  font-family: var(--mono); font-size: 0.85em;
  background: var(--bg-elevated); color: var(--blue);
  padding: 2px 6px; border-radius: 4px;
}
.docs-content pre {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px 20px; overflow-x: auto;
  margin: 16px 0; font-size: 13.5px; line-height: 1.6;
}
.docs-content pre code {
  background: none; padding: 0; color: var(--body);
}

/* Tables */
.docs-content table {
  width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px;
}
.docs-content th, .docs-content td {
  padding: 10px 14px; border: 1px solid var(--line); text-align: left;
}
.docs-content th {
  background: var(--bg-card); color: var(--ink); font-weight: 600; font-size: 13px;
}
.docs-content td { color: var(--body); }

/* Figures / screenshots */
.docs-content figure {
  margin: 24px 0; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line);
}
.docs-content figure img {
  display: block; width: 100%; height: auto;
}
.docs-content figcaption {
  padding: 8px 14px; font-size: 13px; color: var(--muted);
  background: var(--bg-card); border-top: 1px solid var(--line);
}

/* Callout / tip boxes */
.docs-tip {
  background: var(--blue-soft); border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0; padding: 12px 16px; margin: 16px 0;
  font-size: 14px;
}
.docs-tip strong { color: var(--blue); }

.docs-warn {
  background: rgba(251, 191, 36, 0.08); border-left: 3px solid #fbbf24;
  border-radius: 0 8px 8px 0; padding: 12px 16px; margin: 16px 0;
  font-size: 14px;
}
.docs-warn strong { color: #fbbf24; }

/* Pro / Enterprise badges */
.docs-badge-pro, .docs-badge-enterprise {
  display: inline-block; font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 10px; border-radius: 6px; vertical-align: middle;
  margin-left: 6px;
}
.docs-badge-pro {
  background: rgba(168, 85, 247, 0.12); color: #a855f7;
}
.docs-badge-enterprise {
  background: rgba(245, 158, 11, 0.12); color: #f59e0b;
}
.docs-tier-note {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 16px; margin: 12px 0;
  font-size: 13.5px; color: var(--body);
}
.docs-tier-note strong { color: var(--ink); }

/* Kbd */
.docs-content kbd {
  display: inline-block; padding: 2px 7px;
  background: var(--bg-elevated); border: 1px solid var(--line);
  border-radius: 4px; font-family: var(--mono); font-size: 0.82em;
  color: var(--ink); line-height: 1.5;
}

/* Prev / Next navigation */
.docs-prevnext {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line);
}
.docs-prevnext a {
  padding: 12px 20px; border-radius: 10px;
  border: 1px solid var(--line); font-size: 14px; font-weight: 600;
  color: var(--body); text-decoration: none; transition: border-color 0.15s, color 0.15s;
}
.docs-prevnext a:hover { border-color: var(--blue); color: var(--blue); }

/* ---- On-page TOC ---- */
.docs-toc {
  position: sticky; top: 56px; height: calc(100vh - 56px);
  overflow-y: auto; padding: 24px 12px 24px 0;
  border-left: 1px solid var(--line);
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.docs-toc-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted); margin-bottom: 10px;
  padding-left: 10px;
}
.docs-toc a {
  display: block; padding: 3px 10px; font-size: 12.5px;
  color: var(--muted); text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.1s, border-color 0.1s;
}
.docs-toc a:hover { color: var(--body); }
.docs-toc a.active { color: var(--blue); border-left-color: var(--blue); }
.docs-toc a.toc-h3 { padding-left: 20px; font-size: 12px; }

/* ---- Search results dropdown ---- */
.docs-search-dropdown {
  display: none; position: absolute; top: 100%; right: 0;
  width: 380px; max-height: 400px; overflow-y: auto;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 200; margin-top: 6px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.docs-search-result {
  display: block; padding: 10px 14px;
  text-decoration: none; border-bottom: 1px solid var(--line);
  transition: background 0.1s;
}
.docs-search-result:last-child { border-bottom: none; }
.docs-search-result:hover,
.docs-search-result.selected { background: var(--bg-elevated); text-decoration: none; }
.docs-search-result-page {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); margin-bottom: 2px;
}
.docs-search-result-section {
  display: block; font-size: 14px; font-weight: 600;
  color: var(--ink); margin-bottom: 2px;
}
.docs-search-result-snippet {
  display: block; font-size: 12.5px; color: var(--body);
  line-height: 1.5; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* ---- Landing page cards ---- */
.docs-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; margin: 24px 0;
}
.docs-card {
  display: block; padding: 20px; background: var(--bg-card);
  border: 1px solid var(--line); border-radius: 10px;
  text-decoration: none; transition: border-color 0.15s, background 0.15s;
}
.docs-card:hover { border-color: var(--blue); background: var(--bg-elevated); text-decoration: none; }
.docs-card h3 { font-size: 15px; margin-bottom: 4px; }
.docs-card p { font-size: 13px; color: var(--muted); margin: 0; }

/* ---- Responsive ---- */
@media (max-width: 1200px) {
  .docs-layout {
    grid-template-columns: 260px 1fr;
    grid-template-areas: "sidebar content";
  }
  .docs-toc { display: none; }
}

@media (max-width: 860px) {
  .docs-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "content";
  }
  .docs-sidebar {
    position: fixed; top: 56px; left: 0; bottom: 0;
    width: 280px; z-index: 90;
    transform: translateX(-100%); transition: transform 0.2s ease;
  }
  .docs-sidebar.open { transform: translateX(0); }
  .docs-overlay {
    display: none; position: fixed; inset: 0; top: 56px;
    background: rgba(0,0,0,0.5); z-index: 89;
  }
  .docs-overlay.open { display: block; }
  .docs-menu-toggle { display: block; }
  .docs-content { padding: 24px 20px 60px; }
  .docs-header #docsSearch { width: 140px; }
  .docs-header .btn-sm { display: none; }
  .docs-search-dropdown { width: calc(100vw - 40px); right: -8px; }
}
