/* /docs/docs.css — shared stylesheet for all XeroOps docs pages */
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;600;700;800&family=DM+Mono:wght@400;500&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --bg: #080c10;
  --surface: #0d1117;
  --surface2: #111820;
  --border: rgba(255,255,255,0.07);
  --border-bright: rgba(255,255,255,0.13);
  --text: #e8edf2;
  --muted: #6b7a8d;
  --muted2: #4a5a6d;
  --accent: #00d4ff;
  --accent2: #00ff9d;
  --accent-dim: rgba(0,212,255,0.08);
  --accent2-dim: rgba(0,255,157,0.08);
  --red: #ff4d6d;
  --yellow: #ffd166;
  --sidebar-w: 260px;
  --header-h: 56px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  line-height: 1.7;
  font-size: 15px;
  overflow-x: hidden;
}

/* ── HEADER ── */
.docs-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(8,12,16,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 100;
  gap: 24px;
}

.docs-logo {
  font-family: 'Barlow', sans-serif;
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}
.docs-logo span { color: var(--accent); }

.docs-header-sep {
  width: 1px; height: 20px;
  background: var(--border-bright);
}

.docs-header-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.docs-header-nav {
  margin-left: auto;
  display: flex;
  gap: 24px;
  align-items: center;
}

.docs-header-nav a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.docs-header-nav a:hover { color: var(--text); }

.docs-header-cta {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--accent) !important;
  border: 1px solid rgba(0,212,255,0.3);
  padding: 6px 14px;
  border-radius: 4px;
  background: var(--accent-dim);
  letter-spacing: 0.05em;
}
.docs-header-cta:hover {
  background: rgba(0,212,255,0.15) !important;
  color: var(--accent) !important;
}

/* ── LAYOUT ── */
.docs-layout {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.docs-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 32px 0 64px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-bright) transparent;
}

.sidebar-section {
  margin-bottom: 28px;
  padding: 0 20px;
}

.sidebar-section-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted2);
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-left: 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.15s;
  line-height: 1.4;
}
.sidebar-link:hover { color: var(--text); background: var(--surface2); }
.sidebar-link.active { color: var(--accent); background: var(--accent-dim); }
.sidebar-link .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  opacity: 0.5;
}
.sidebar-link.active .dot { opacity: 1; }

/* ── CONTENT ── */
.docs-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  max-width: 760px;
  padding: 56px 64px 120px;
}

/* ── TYPOGRAPHY ── */
.docs-content h1 {
  font-family: 'Barlow', sans-serif;
  font-weight: 800;
  font-size: 36px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 16px;
  color: var(--text);
}

.docs-content h2 {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin-top: 52px;
  margin-bottom: 16px;
  color: var(--text);
  padding-top: 52px;
  border-top: 1px solid var(--border);
}
.docs-content h2:first-of-type { margin-top: 36px; }

.docs-content h3 {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 16px;
  margin-top: 28px;
  margin-bottom: 10px;
  color: var(--text);
}

.docs-content p { color: var(--muted); margin-bottom: 16px; }
.docs-content p strong { color: var(--text); font-weight: 600; }
.docs-content a { color: var(--accent); text-decoration: none; }
.docs-content a:hover { text-decoration: underline; }

.docs-content ul, .docs-content ol {
  color: var(--muted);
  padding-left: 20px;
  margin-bottom: 16px;
}
.docs-content li { margin-bottom: 6px; }
.docs-content li strong { color: var(--text); }

/* ── CODE ── */
code {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  background: var(--surface2);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

pre {
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  padding: 24px;
  margin: 20px 0;
  overflow-x: auto;
  max-width: 100%;
  position: relative;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.8;
}

.pre-label {
  position: absolute;
  top: 12px; right: 16px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--muted2);
  letter-spacing: 0.08em;
}

/* Syntax colors */
.c-cmd { color: var(--accent2); }
.c-out { color: var(--muted); }
.c-ok  { color: var(--accent2); }
.c-info { color: var(--accent); }
.c-str { color: #ffd166; }
.c-kw  { color: #c792ea; }
.c-comment { color: var(--muted2); }
.c-err { color: var(--red); }

/* ── CALLOUTS ── */
.callout {
  border-radius: 8px;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14px;
  border-left: 3px solid;
  display: flex;
  gap: 12px;
}
.callout-icon { flex-shrink: 0; font-size: 15px; margin-top: 1px; }
.callout-body { color: var(--muted); }
.callout-body strong { color: var(--text); display: block; margin-bottom: 4px; }

.callout-info {
  background: rgba(0,212,255,0.05);
  border-color: var(--accent);
}
.callout-warn {
  background: rgba(255,209,102,0.05);
  border-color: var(--yellow);
}
.callout-tip {
  background: rgba(0,255,157,0.05);
  border-color: var(--accent2);
}

/* ── PAGE HEADER ── */
.page-header { margin-bottom: 40px; }
.page-tag {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent2);
  border: 1px solid rgba(0,255,157,0.2);
  padding: 3px 10px;
  border-radius: 3px;
  background: var(--accent2-dim);
  margin-bottom: 14px;
  text-transform: uppercase;
}
.page-lead {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 580px;
  margin-top: 12px;
}

/* ── STEP BLOCKS ── */
.step-block {
  display: flex;
  gap: 20px;
  margin-bottom: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
}
.step-block:last-child { border-bottom: none; }
.step-num-big {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  border: 1px solid rgba(0,212,255,0.25);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 4px;
  background: var(--accent-dim);
}
.step-body h3 { margin-top: 0; }

/* ── COMMAND REFERENCE ── */
.cmd-block {
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  margin: 20px 0 32px;
  overflow: hidden;
}
.cmd-header {
  padding: 14px 20px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.cmd-name {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  color: var(--accent2);
}
.cmd-desc { font-size: 13px; color: var(--muted); }
.cmd-body { padding: 20px; }
.cmd-flag {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.cmd-flag:last-child { border-bottom: none; }
.cmd-flag-name { font-family: 'DM Mono', monospace; color: var(--accent); min-width: 180px; flex-shrink: 0; }
.cmd-flag-desc { color: var(--muted); }

/* ── TABLE ── */
.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 13px;
}
.docs-table th {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted2);
  text-transform: uppercase;
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-bright);
}
.docs-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  vertical-align: top;
}
.docs-table td:first-child { color: var(--text); font-family: 'DM Mono', monospace; font-size: 12px; }
.docs-table tr:last-child td { border-bottom: none; }

/* ── CARDS ── */
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 0;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  display: block;
  transition: border-color 0.2s;
}
.card:hover { border-color: rgba(0,212,255,0.3); }
.card-tag {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--muted2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.card h3 {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 6px;
}
.card p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }

/* ── PREV/NEXT NAV ── */
.docs-nav-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  gap: 16px;
}
.docs-nav-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 180px;
  transition: border-color 0.2s;
}
.docs-nav-btn:hover { border-color: var(--accent); }
.docs-nav-btn.next { text-align: right; }
.docs-nav-label { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--muted2); letter-spacing: 0.08em; }
.docs-nav-title { font-size: 14px; color: var(--text); font-weight: 600; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .docs-sidebar { display: none; }
  .docs-layout { display: block; }
  .docs-content {
    margin-left: 0;
    padding: 24px 16px 80px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
  .card-grid { grid-template-columns: 1fr; }

  /* Typography */
  .docs-content h1 { font-size: clamp(22px, 6vw, 36px); }
  .docs-content h2 { font-size: 18px; padding-top: 36px; margin-top: 36px; }
  .page-lead { font-size: 15px; }

  /* Code blocks — must be contained and scroll internally */
  pre {
    padding: 14px;
    border-radius: 6px;
    max-width: 100%;
    overflow-x: auto;
    white-space: pre;
    word-break: normal;
    word-wrap: normal;
  }
  pre code { font-size: 11px; white-space: pre; }

  /* Tables — scrollable */
  .docs-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }

  /* CLI command flag rows — stack */
  .cmd-block { margin: 12px 0 24px; }
  .cmd-flag { flex-direction: column; gap: 4px; }
  .cmd-flag-name { min-width: unset; }
  .cmd-header { flex-direction: column; align-items: flex-start; gap: 6px; }
  .cmd-body { padding: 14px; }

  /* Step blocks — ensure pre inside doesn't blow out */
  .step-block { gap: 12px; flex-wrap: wrap; }
  .step-body { min-width: 0; width: 100%; overflow: hidden; }
  .step-body pre { max-width: 100%; }

  /* Prev/Next nav — stack */
  .docs-nav-footer { flex-direction: column; }
  .docs-nav-btn { min-width: unset; }
  .docs-nav-btn.next { text-align: left; }

  /* Callout */
  .callout { font-size: 13px; padding: 12px 14px; }
}