/* ── Baulit Docs — Design System ── */
/* Matches marketing site: DM Sans body, Barlow Condensed headings, navy/gold brand */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', 'Segoe UI', Arial, sans-serif;
  color: #1e293b;
  background: #f8fafc;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

/* ── Variables ── */
:root {
  --navy: #0f2d5c;
  --navy-light: #163a6e;
  --amber: #e8a020;
  --amber-light: #f0b840;
  --white: #ffffff;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-800: #1e293b;
  --sidebar-width: 280px;
  --toc-width: 220px;
  --header-height: 64px;
}

/* ── Typography ── */
h1, h2, h3, h4 { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-weight: 700; line-height: 1.2; }
h1 { font-size: 2.5rem; color: var(--navy); letter-spacing: 0.5px; text-transform: uppercase; }
h2 { font-size: 1.75rem; color: var(--navy); letter-spacing: 0.25px; text-transform: uppercase; margin-top: 2.5rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--slate-200); }
h3 { font-size: 1.25rem; color: var(--slate-800); margin-top: 2rem; margin-bottom: 0.75rem; text-transform: none; }
h4 { font-size: 1.1rem; color: var(--slate-600); margin-top: 1.5rem; margin-bottom: 0.5rem; text-transform: none; }
p { margin-bottom: 1rem; }
ul, ol { margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.4rem; }
li > ul, li > ol { margin-top: 0.4rem; margin-bottom: 0; }
strong { font-weight: 600; }
code {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.875em;
  background: var(--slate-100);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--navy);
}
pre {
  background: var(--slate-800);
  color: var(--slate-100);
  padding: 16px 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.6;
}
pre code { background: none; padding: 0; color: inherit; }
blockquote {
  border-left: 4px solid var(--amber);
  background: #fefce8;
  padding: 12px 16px;
  margin-bottom: 1rem;
  border-radius: 0 8px 8px 0;
  color: var(--slate-600);
}
blockquote p:last-child { margin-bottom: 0; }
table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: 0.95rem; }
th { background: var(--navy); color: var(--white); font-family: 'Barlow Condensed', sans-serif; font-weight: 700; text-align: left; padding: 10px 14px; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.5px; }
td { padding: 10px 14px; border-bottom: 1px solid var(--slate-200); }
tr:hover td { background: var(--slate-50); }

/* ── Header ── */
.docs-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--navy);
  height: var(--header-height);
  display: flex; align-items: center;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.docs-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 24px;
}
.docs-header-left { display: flex; align-items: center; gap: 20px; }
.docs-header-logo { height: 32px; width: auto; }
.docs-header-divider { width: 1px; height: 24px; background: rgba(255,255,255,0.2); }
.docs-header-title { color: rgba(255,255,255,0.85); font-size: 0.95rem; font-weight: 500; }
.docs-header-title a { color: rgba(255,255,255,0.85); }
.docs-header-title a:hover { color: var(--white); }
.docs-header-right { display: flex; align-items: center; gap: 16px; }
.docs-header-link { color: rgba(255,255,255,0.7); font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.docs-header-link:hover { color: var(--white); }
.docs-search {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 6px 12px;
  color: var(--white);
  font-size: 0.85rem;
  width: 220px;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.docs-search::placeholder { color: rgba(255,255,255,0.4); }
.docs-search:focus { outline: none; border-color: var(--amber); background: rgba(255,255,255,0.15); width: 280px; }
.mobile-sidebar-btn {
  display: none; background: none; border: none; color: var(--white);
  font-size: 1.5rem; cursor: pointer; padding: 4px;
}

/* ── Sidebar ── */
.docs-sidebar {
  position: fixed; top: var(--header-height); left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--white);
  border-right: 1px solid var(--slate-200);
  overflow-y: auto;
  padding: 20px 0;
  z-index: 50;
}
.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 2px; }
.sidebar-section { margin-bottom: 8px; }
.sidebar-section-title {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 20px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--slate-400);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}
.sidebar-section-title:hover { color: var(--navy); }
.sidebar-section-title .arrow {
  font-size: 0.6rem;
  transition: transform 0.2s;
  display: inline-block;
}
.sidebar-section.collapsed .arrow { transform: rotate(-90deg); }
.sidebar-section.collapsed .sidebar-links { display: none; }
.sidebar-links { list-style: none; padding: 0; margin: 0; }
.sidebar-links a {
  display: block;
  padding: 6px 20px 6px 32px;
  font-size: 0.88rem;
  color: var(--slate-600);
  transition: all 0.15s;
  border-left: 3px solid transparent;
}
.sidebar-links a:hover { color: var(--navy); background: var(--slate-50); }
.sidebar-links a.active {
  color: var(--navy);
  font-weight: 600;
  border-left-color: var(--amber);
  background: #fefce8;
}

/* ── Content ── */
.docs-content {
  margin-left: var(--sidebar-width);
  margin-right: var(--toc-width);
  padding: calc(var(--header-height) + 32px) 48px 80px;
  max-width: 800px;
  min-height: 100vh;
}

/* ── Breadcrumbs ── */
.breadcrumbs {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 24px;
  font-size: 0.85rem;
  color: var(--slate-400);
}
.breadcrumbs a { color: var(--slate-500); transition: color 0.15s; }
.breadcrumbs a:hover { color: var(--navy); }
.breadcrumbs .sep { color: var(--slate-300); }

/* ── Table of Contents (right rail) ── */
.docs-toc {
  position: fixed; top: var(--header-height); right: 0;
  width: var(--toc-width);
  padding: 32px 16px 32px 0;
  overflow-y: auto;
  max-height: calc(100vh - var(--header-height));
}
.docs-toc-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--slate-400);
  margin-bottom: 12px;
}
.docs-toc ul { list-style: none; padding: 0; margin: 0; }
.docs-toc li { margin-bottom: 4px; }
.docs-toc a {
  display: block;
  font-size: 0.8rem;
  color: var(--slate-500);
  padding: 2px 0 2px 12px;
  border-left: 2px solid var(--slate-200);
  transition: all 0.15s;
}
.docs-toc a:hover { color: var(--navy); border-left-color: var(--slate-400); }
.docs-toc a.active { color: var(--navy); font-weight: 600; border-left-color: var(--amber); }
.docs-toc .toc-h3 { padding-left: 24px; }

/* ── Prev/Next Navigation ── */
.docs-nav-footer {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--slate-200);
}
.docs-nav-link {
  display: flex; flex-direction: column;
  padding: 12px 16px;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  transition: all 0.2s;
  max-width: 48%;
}
.docs-nav-link:hover { border-color: var(--amber); background: #fefce8; }
.docs-nav-link .label { font-size: 0.75rem; color: var(--slate-400); text-transform: uppercase; letter-spacing: 0.5px; }
.docs-nav-link .title { font-size: 0.95rem; color: var(--navy); font-weight: 600; margin-top: 2px; }
.docs-nav-link.next { text-align: right; margin-left: auto; }

/* ── Callouts ── */
.callout {
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}
.callout-title { font-weight: 700; margin-bottom: 4px; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.5px; }
.callout-tip { background: #ecfdf5; border-left: 4px solid #10b981; }
.callout-tip .callout-title { color: #065f46; }
.callout-warning { background: #fffbeb; border-left: 4px solid var(--amber); }
.callout-warning .callout-title { color: #92400e; }
.callout-info { background: #eff6ff; border-left: 4px solid #3b82f6; }
.callout-info .callout-title { color: #1e40af; }
.callout-danger { background: #fef2f2; border-left: 4px solid #ef4444; }
.callout-danger .callout-title { color: #991b1b; }

/* ── Cards (landing pages) ── */
.docs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 2rem;
}
.docs-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
}
.docs-card:hover { border-color: var(--amber); box-shadow: 0 4px 12px rgba(232,160,32,0.15); transform: translateY(-2px); }
.docs-card-icon { font-size: 1.8rem; margin-bottom: 8px; }
.docs-card-title { font-family: 'Barlow Condensed', sans-serif; font-size: 1.1rem; font-weight: 700; color: var(--navy); margin-bottom: 4px; text-transform: uppercase; }
.docs-card-desc { font-size: 0.88rem; color: var(--slate-500); line-height: 1.5; }
.docs-card-count { font-size: 0.75rem; color: var(--slate-400); margin-top: 8px; }

/* ── Level badges ── */
.level-badge {
  display: inline-block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.level-launch { background: #dbeafe; color: #1e40af; }
.level-foundation { background: #fef3c7; color: #92400e; }
.level-mastery { background: #dcfce7; color: #166534; }
.level-reference { background: var(--slate-100); color: var(--slate-600); }
.level-ai { background: #f3e8ff; color: #6b21a8; }
.level-role { background: #fce7f3; color: #9d174d; }
.level-tutorial { background: var(--amber); color: var(--white); }

/* ── Tier badge ── */
.tier-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  vertical-align: middle;
}
.tier-free { background: #dcfce7; color: #166534; }
.tier-pro { background: #dbeafe; color: #1e40af; }
.tier-enterprise { background: #f3e8ff; color: #6b21a8; }

/* ── Step indicators ── */
.steps { counter-reset: step; margin-bottom: 1.5rem; }
.step {
  position: relative;
  padding-left: 48px;
  margin-bottom: 1.5rem;
  counter-increment: step;
}
.step::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 32px; height: 32px;
  background: var(--navy);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
}
.step-title { font-weight: 600; color: var(--navy); margin-bottom: 4px; }

/* ── Search Results ── */
.search-results {
  position: absolute; top: 100%; right: 0;
  width: 400px; max-height: 400px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  overflow-y: auto;
  display: none;
  z-index: 200;
}
.search-results.open { display: block; }
.search-result {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--slate-100);
  transition: background 0.15s;
}
.search-result:hover { background: var(--slate-50); }
.search-result:last-child { border-bottom: none; }
.search-result-title { font-weight: 600; color: var(--navy); font-size: 0.9rem; }
.search-result-section { font-size: 0.75rem; color: var(--slate-400); margin-top: 2px; }
.search-no-results { padding: 16px; text-align: center; color: var(--slate-400); font-size: 0.9rem; }

/* ── Mobile ── */
@media (max-width: 1100px) {
  .docs-toc { display: none; }
  .docs-content { margin-right: 0; }
}
@media (max-width: 768px) {
  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 280px;
    z-index: 90;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
  }
  .docs-sidebar.open { transform: translateX(0); }
  .docs-content { margin-left: 0; padding: calc(var(--header-height) + 24px) 20px 60px; }
  .mobile-sidebar-btn { display: block; }
  .docs-search { width: 140px; }
  .docs-search:focus { width: 180px; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
  .docs-card-grid { grid-template-columns: 1fr; }
  .docs-nav-footer { flex-direction: column; }
  .docs-nav-link { max-width: 100%; }
  .docs-nav-link.next { text-align: left; }
  .search-results { width: calc(100vw - 32px); right: -60px; }
  .docs-header-link.desktop-only { display: none; }
}
@media (max-width: 480px) {
  .docs-search { display: none; }
}

/* ── Sidebar overlay for mobile ── */
.sidebar-overlay {
  display: none;
  position: fixed; top: var(--header-height); left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3);
  z-index: 80;
}
.sidebar-overlay.open { display: block; }

/* ── Print ── */
@media print {
  .docs-header, .docs-sidebar, .docs-toc, .docs-nav-footer, .breadcrumbs { display: none; }
  .docs-content { margin: 0; padding: 0; max-width: 100%; }
}
