/* Petavue Help Center — shared documentation stylesheet.
   Three-column docs layout (left nav · content · On this page) + article typography.
   Consumes design-system tokens from colorography.css (load it + global.css first).
   Used by every internal docs page (Skills + Dashboards). */

:root {
  --nav-h: 82px;                          /* ≈ navbar height; used only to cap the TOC */

  --bg: #f7f7f7;                          /* app-shell page background */
  --surface: var(--color-white);
  --text: var(--color-neutral-900);       /* #232532 — primary text */
  --muted-text: var(--color-neutral-600); /* #52577A — body muted / secondary */
  --subtle: var(--color-neutral-400);     /* #8E93AF — subtle labels */
  --border: var(--color-neutral-200);     /* #D4D9EA */
  --border-soft: var(--color-neutral-100);/* #EEF0F7 */
  --accent: var(--color-primary-500);     /* #3661ED */
  --accent-soft: var(--color-primary-50); /* #F5F8FF */
  --code-bg: var(--color-neutral-100);
  --table-head: var(--color-neutral-50);

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: 'Instrument Sans', 'Inter', sans-serif;
  --mono: 'Geist Mono', ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
/* Body text is 14px, but the root stays at the browser default (16px) so that
   rem-based widths — 80rem container, button padding — match petavue.com. */
body { font-size: 14px; }
/* App-shell: the page itself doesn't scroll — the nav and card panes do.
   Flex column lets the shell fill whatever height the navbar leaves, so the
   card's margins stay exact regardless of the navbar's height. */
body { overflow: hidden; display: flex; flex-direction: column; }
#navbar-placeholder { flex: 0 0 auto; }
body > .padding-global {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
}
body > .padding-global > .container-large {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ==========================================================================
   App-shell layout
   Full-width navbar · left nav on the grey page · white content card (with the
   "On this page" rail inside it) floating 8px from the top/right/bottom edges.
   ========================================================================== */
.docs-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  flex: 1 1 auto;     /* fill the height the navbar leaves */
  min-height: 0;
}

/* Left sidebar — all-category nav, sits on the grey page background, own scroll */
.docs-sidebar {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 12px 24px 0;   /* flush left so the nav aligns with the navbar logo */
}
/* Search bar (top of the left nav, consistent across pages) */
.docs-nav-search {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 18px;
  padding: 8px 12px;
  background: var(--color-white);
  border: 1px solid var(--color-neutral-100);
  border-radius: 8px;
  transition: border-color 0.15s;
}
.docs-nav-search:hover { border-color: var(--color-primary-300); }
.docs-nav-search:focus-within { border-color: var(--color-primary-500); }
.docs-nav-search-icon { width: 15px; height: 15px; color: var(--subtle); flex-shrink: 0; }
.docs-nav-search input {
  border: none; outline: none; background: none;
  font-family: var(--sans); font-size: 14px; color: var(--text);
  flex: 1; min-width: 0;
}
.docs-nav-search input::placeholder { color: var(--subtle); }
.docs-nav-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
/* Clear button — shown only when the field has text (toggled in components.js) */
.docs-nav-search-clear {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: none; background: none; cursor: pointer;
  color: var(--subtle); flex-shrink: 0;
}
.docs-nav-search-clear:hover { color: var(--text); }
.docs-nav-search-clear svg { width: 16px; height: 16px; }
.docs-nav-search-clear[hidden] { display: none; }
.docs-nav-empty { color: var(--subtle); font-size: 13px; margin: 4px 12px; }
.docs-nav-group { margin-bottom: 22px; }
.docs-nav-title {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-neutral-900);
  margin: 0 0 8px 12px;
}
.docs-nav a {
  display: block;
  padding: 7px 12px;
  margin: 1px 0;
  border-radius: 8px;
  color: var(--muted-text);
  font-size: 14px;
  line-height: 1.4;
}
.docs-nav a:hover { background: var(--color-neutral-100); color: var(--text); text-decoration: none; }
.docs-nav a.active {
  background: var(--color-white);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
}

/* White content card — wraps the article and the On-this-page rail.
   Floats 8px from all sides and is the scroll container, so its scrollbar
   sits at the far-right edge of the card. */
.docs-main-card {
  background: var(--surface);
  border: 1px solid var(--color-neutral-100);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.04);
  margin: 8px;
  height: calc(100% - 16px);
  min-height: 0;
  overflow-y: auto;            /* card scrolls; scrollbar at the far right */
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  align-items: start;
}
.docs-main-card.no-toc { grid-template-columns: minmax(0, 1fr); }

/* Center column (article) */
.docs-main { min-width: 0; padding: 32px; }
.doc-article { max-width: 720px; }

/* Right column — On this page; sticky inside the scrolling card */
.docs-toc {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: calc(100vh - var(--nav-h) - 16px);
  overflow-y: auto;
  padding: 32px 24px 32px 0;
}
.docs-toc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 14px;
}
.docs-toc-title svg { width: 16px; height: 16px; color: var(--muted-text); }
.docs-toc-list { display: flex; flex-direction: column; font-family: 'Inter', sans-serif; }
.docs-toc-list a {
  display: block;
  padding: 6px 0 6px 14px;
  border-left: 2px solid var(--border-soft);
  color: var(--muted-text);
  font-size: 14px;
  line-height: 1.45;
}
.docs-toc-list a:hover { color: var(--text); text-decoration: none; }
.docs-toc-list a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 500; }
.docs-toc-list a.toc-d1 { padding-left: 28px; }
.docs-toc-list a.toc-d2 { padding-left: 42px; }

/* ==========================================================================
   Article typography
   ========================================================================== */
/* Anchor targets get a little breathing room at the top of the scrolling card. */
.doc-article :is(h2, h3, h4) { scroll-margin-top: 24px; }

.doc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 28px;
}
.doc-breadcrumb a { color: var(--subtle); }
.doc-breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.doc-breadcrumb-sep { color: var(--border); }

h1.doc-title {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 12px;
}

.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 14px;
}

.lead {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted-text);
  margin: 0 0 32px;
}

.section {
  border-top: 1px solid var(--border);
  padding-top: 48px;
  margin-top: 48px;
}
.section:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

h2.section-title {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 24px;
}

h3 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 36px 0 12px;
  color: var(--text);
}

h4 {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
  margin: 24px 0 8px;
  color: var(--text);
}

p { margin: 0 0 16px; color: var(--text); }

ul, ol { margin: 0 0 18px; padding-left: 22px; }
li { margin-bottom: 6px; }
li > strong:first-child { color: var(--text); }

/* Tables */
.doc-table-wrap {
  margin: 18px 0 28px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;                 /* wide tables scroll horizontally on small screens */
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
}
table.doc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.doc-table thead th {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted-text);
  padding: 12px 16px;
  background: var(--table-head);
  border-bottom: 1px solid var(--border);
}
table.doc-table tbody td {
  padding: 14px 16px;
  border-top: 1px solid var(--border-soft);
  vertical-align: top;
  color: var(--text);
}
table.doc-table tbody tr:first-child td { border-top: none; }
table.doc-table tbody td:first-child { font-weight: 600; width: 30%; }

/* Screenshots / figures */
figure.screenshot {
  position: relative;
  margin: 24px 0 32px;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}
figure.screenshot img { display: block; width: 100%; height: auto; }
figure.screenshot figcaption {
  font-size: 12.5px;
  color: var(--subtle);
  padding: 10px 16px;
  border-top: 1px solid var(--border-soft);
  background: var(--table-head);
}

/* Expand button on screenshots */
.zoom-btn {
  display: none;          /* hide the expand icon; images are still click-to-zoom */
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.zoom-btn:hover { background: #fff; transform: scale(1.06); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); }
.zoom-btn svg { display: block; width: 18px; height: 18px; }
.zoom-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Lightbox overlay */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 18, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  z-index: 1000;
  cursor: zoom-out;
  overflow: auto;
}
.lightbox.open { display: block; }
.lightbox-inner {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 64px 24px 40px;
  cursor: default;
  box-sizing: border-box;
}
.lightbox-img {
  display: block;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  background: #fff;
}
.lightbox-caption {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  margin: 0 0 16px;
  text-align: center;
  max-width: 720px;
}
.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.26); }
body.lb-open { overflow: hidden; }

/* Callouts */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--surface);
  padding: 16px 20px;
  margin: 20px 0 28px;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
}
.callout .callout-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 6px;
}

/* Tip & Important callouts — full border, 8px radius, icon + label */
.callout-tip, .callout-important { border-radius: 8px; }
.callout-tip {
  background: var(--color-tag-mint);        /* #EBFFF3 */
  border: 1px solid var(--color-success);   /* #08BD50 */
}
.callout-important {
  background: var(--color-primary-50);          /* #F5F8FF */
  border: 1px solid rgba(54, 97, 237, 0.5);     /* #3661ED @ 50% */
}
.callout-tip .callout-label,
.callout-important .callout-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}
.callout-icon { width: 20px; height: 20px; flex-shrink: 0; }
.callout-tip .callout-icon { color: var(--color-success); }
.callout-important .callout-icon { color: var(--color-primary-500); }

.quote {
  font-style: italic;
  color: var(--muted-text);
  border-left: 2px solid var(--border);
  padding-left: 14px;
  margin: 4px 0 10px;
}

code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--code-bg);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text);
}

/* Cross-link list */
.see-also { list-style: none; padding: 0; margin: 16px 0 0; }
.see-also li {
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
  font-size: 14px;
  color: var(--muted-text);
}
.see-also li:first-child { border-top: 1px solid var(--border); }
.see-also .arrow { color: var(--subtle); margin: 0 8px; }

/* Prev/Next pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 56px 0 0; }
.pager a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pager a:hover { text-decoration: none; border-color: var(--accent); box-shadow: 0 2px 12px rgba(45, 79, 207, 0.08); }
.pager .pager-dir {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--color-neutral-600);
  font-weight: 500;
  margin-bottom: 4px;
}
.pager .next .pager-dir { justify-content: flex-end; }
.pager-caret { width: 14px; height: 14px; flex-shrink: 0; }
.pager .pager-title { font-family: var(--display); font-size: 14px; font-weight: 600; color: var(--text); }
.pager .next { text-align: right; }
.pager .placeholder { visibility: hidden; }

/* Library hub */
.hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0 36px; }
.hub-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.hub-card:hover { text-decoration: none; border-color: var(--accent); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05); }
.hub-card .hub-eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 8px;
}
.hub-card h3 { font-family: var(--display); margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.hub-card p { margin: 0; color: var(--muted-text); font-size: 13.5px; }

/* Two-up comparison cards (e.g. Verify / Publish) */
.card-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0 28px; }
.card-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}
.card-item h4 { margin: 12px 0 6px; }
.card-item p { margin: 0; color: var(--muted-text); font-size: 14px; }
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 60px;
}
.badge-green { background: var(--color-success-light); color: #0a7a38; }
.badge-purple { background: var(--color-accent-50); color: var(--color-accent-700); }

/* Roadmap / "coming next" cards — card style, no accent left border */
.future-card {
  background: var(--color-neutral-50);
  border: 1px solid var(--color-neutral-100);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 0 0 12px;
}
.future-card p { margin: 0; font-size: 14px; color: var(--text); }

/* Per-article footer line */
.section-footer {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
  color: var(--subtle);
  text-align: center;
}
.section-footer a { color: var(--accent); }

/* The docs nav also lives inside the navbar's mobile menu; hidden on desktop. */
.navbar_docs-nav { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
/* Drop the right "On this page" column first. */
/* Drop the right "On this page" rail first (card becomes single column). */
@media (max-width: 1200px) {
  .docs-main-card { grid-template-columns: minmax(0, 1fr); }
  .docs-toc { display: none; }
}
/* Then drop the left nav; the card spans full width with 8px on all sides.
   On small screens revert to normal page scrolling (no fixed app-shell). */
@media (max-width: 980px) {
  body { overflow: visible; display: block; }
  body > .padding-global,
  body > .padding-global > .container-large { display: block; }
  .docs-shell { grid-template-columns: minmax(0, 1fr); flex: none; height: auto; }
  .docs-sidebar { display: none; }   /* desktop sidebar hidden; nav lives in the navbar menu */
  .docs-main-card { height: auto; overflow: visible; margin: 0; }
  .docs-main { padding: 20px 16px; }
  .doc-article { max-width: 760px; margin: 0 auto; }

  .navbar_brand-divider, .navbar_brand-label { display: none; }

  /* The shared docs nav shows inside the navbar's mobile menu (above the buttons) */
  .navbar_docs-nav { display: block; width: 100%; margin-bottom: 4px; }
}
@media (max-width: 600px) {
  .card-row { grid-template-columns: 1fr; }
  .hub-grid { grid-template-columns: 1fr; }
  .doc-table { min-width: 30rem; }   /* keep columns readable; wrap scrolls */
}
@media (max-width: 480px) {
  .docs-main { padding: 20px 16px; }
  h1.doc-title { font-size: 28px; }
}
