/* ============================================================
   TrustyData Docs — docs.css
   Layout : header + sidebar + content. Mobile-first.
   Breakpoints : 768px (tablet), 1024px (desktop).
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--charcoal);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Header ───────────────────────────────────────────────── */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  background: var(--deep-navy);
  border-bottom: 1px solid var(--ocean-deep);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
}
.docs-header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--white);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.docs-header__brand:hover { color: var(--sky-accent); }
.docs-header__logo {
  width: 32px;
  height: auto;
  display: block;
}
.docs-header__brand-name {
  margin-left: var(--space-1);
}
.docs-header__badge {
  margin-left: var(--space-3);
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08);
  color: var(--sky-accent);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.docs-header__spacer { flex: 1; }
.docs-header__link {
  color: var(--ice-blue);
  text-decoration: none;
  font-size: 0.9rem;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-sm);
  transition: background 0.15s;
}
.docs-header__link:hover { background: rgba(255,255,255,0.06); color: var(--white); }

/* ── Layout shell ─────────────────────────────────────────── */
.docs-shell {
  display: grid;
  grid-template-columns: 1fr;
  min-height: calc(100vh - var(--header-h));
}
@media (min-width: 1024px) {
  .docs-shell {
    grid-template-columns: var(--sidebar-w) 1fr;
  }
}

/* ── Sidebar ──────────────────────────────────────────────── */
.docs-sidebar {
  background: var(--cloud);
  border-right: 1px solid var(--mist);
  padding: var(--space-6) var(--space-4);
}
@media (min-width: 1024px) {
  .docs-sidebar {
    position: sticky;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
}
.docs-sidebar__group {
  margin-bottom: var(--space-6);
}
.docs-sidebar__title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-500);
  margin: 0 0 var(--space-2) var(--space-3);
}
.docs-sidebar__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.docs-sidebar__link {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-sm);
  color: var(--slate-700);
  text-decoration: none;
  font-size: 0.92rem;
  transition: background 0.15s, color 0.15s;
}
.docs-sidebar__link:hover {
  background: var(--ice-blue);
  color: var(--trust-blue);
}
.docs-sidebar__link[aria-current="page"] {
  background: var(--ice-blue);
  color: var(--trust-blue);
  font-weight: 600;
}

/* ── Content ──────────────────────────────────────────────── */
.docs-content {
  padding: var(--space-8) var(--space-6);
  max-width: 100%;
}
@media (min-width: 768px) {
  .docs-content {
    padding: var(--space-12) var(--space-8);
  }
}
.docs-content__inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

/* ── Typography ───────────────────────────────────────────── */
.docs-content h1, .docs-content h2, .docs-content h3 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  color: var(--deep-navy);
  line-height: 1.2;
}
.docs-content h1 {
  font-size: 2.25rem;
  font-weight: 800;
  margin: 0 0 var(--space-3);
  letter-spacing: -0.03em;
}
.docs-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: var(--space-12) 0 var(--space-3);
  padding-top: var(--space-3);
}
.docs-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: var(--space-8) 0 var(--space-2);
}
.docs-content p { margin: 0 0 var(--space-4); }
.docs-content a {
  color: var(--trust-blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.docs-content a:hover { border-bottom-color: var(--trust-blue); }
.docs-content strong { font-weight: 600; color: var(--deep-navy); }
.docs-content ul, .docs-content ol {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-6);
}
.docs-content li { margin-bottom: var(--space-2); }

/* Lead paragraph below H1 */
.docs-lead {
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--slate-600);
  margin-bottom: var(--space-8);
}

/* ── Code ─────────────────────────────────────────────────── */
.docs-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--cloud);
  padding: 0.15em 0.4em;
  border-radius: var(--r-sm);
  border: 1px solid var(--mist);
  color: var(--ocean-blue);
}
.docs-content pre {
  background: var(--deep-navy);
  color: var(--ice-blue);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--r-lg);
  overflow-x: auto;
  margin: var(--space-4) 0;
  font-size: 0.88rem;
  line-height: 1.55;
}
.docs-content pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ── Callouts ─────────────────────────────────────────────── */
.callout {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--r-lg);
  border-left: 3px solid var(--trust-blue);
  background: var(--ice-blue);
  margin: var(--space-6) 0;
}
.callout--warn {
  border-left-color: var(--amber-warn);
  background: rgb(254 243 199 / 0.5);
}
.callout--success {
  border-left-color: var(--emerald);
  background: var(--emerald-soft);
}
.callout--danger {
  border-left-color: var(--coral-alert);
  background: rgb(254 226 226 / 0.5);
}
.callout p:last-child { margin-bottom: 0; }
.callout__title {
  font-weight: 700;
  color: var(--deep-navy);
  margin-bottom: var(--space-1);
  font-family: var(--font-display);
}

/* ── Plan badges ──────────────────────────────────────────── */
.plan-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.plan-badge--discovery { background: var(--ice-blue);    color: var(--trust-blue-700); }
.plan-badge--starter   { background: var(--emerald-soft); color: #047857; }
.plan-badge--growth    { background: #FEF3C7;             color: #B45309; }
.plan-badge--business  { background: #EDE9FE;             color: #5B21B6; }

/* ── Table ────────────────────────────────────────────────── */
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-4) 0 var(--space-6);
  font-size: 0.92rem;
}
.docs-content th, .docs-content td {
  text-align: left;
  padding: var(--space-3);
  border-bottom: 1px solid var(--mist);
}
.docs-content th {
  font-weight: 700;
  color: var(--deep-navy);
  background: var(--cloud);
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}
.docs-content td code { font-size: 0.82em; }

/* ── Reference (Scalar) page — full bleed ─────────────────── */
.docs-reference-wrapper {
  /* Scalar paints its own background — we just give it the full space */
  margin: 0;
  padding: 0;
  background: var(--white);
}

/* ── Accessibility ────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--trust-blue);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Skip link ────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--deep-navy);
  color: var(--white);
  padding: var(--space-3);
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }
