/* ==========================================================================
   OLLALINK DOCUMENTATION STYLESHEET
   Arrangement: LOCKED 3-COLUMN (Left Sidebar + Center Docs + Right "On this page")
   Branding: Ollalink Engineering Identity (Electric Blue, Deep Navy, High-contrast Code)
   ========================================================================== */

:root {
  --d-brand: #2563eb;
  --d-brand-dark: #1d4ed8;
  --d-brand-tint: #eff6ff;
  --d-brand-border: #bfdbfe;
  --d-brand-glow: rgba(37, 99, 235, 0.2);
  --d-ink: #0f172a;
  --d-mute: #334155;
  --d-faint: #64748b;
  --d-line: #e2e8f0;
  --d-line-subtle: #f1f5f9;
  --d-panel: #ffffff;
  --d-bg: #f8fafc;
  --d-code-bg: #0b1220;
  --d-code-ink: #f8fafc;
  --d-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --d-ink: #f8fafc;
  --d-mute: #cbd5e1;
  --d-faint: #94a3b8;
  --d-line: #1e293b;
  --d-line-subtle: #0f172a;
  --d-panel: #0b1220;
  --d-bg: #070c16;
  --d-code-bg: #040810;
  --d-brand-tint: rgba(37, 99, 235, 0.15);
  --d-brand-border: rgba(37, 99, 235, 0.35);
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--d-ink);
  background: var(--d-panel);
  -webkit-font-smoothing: antialiased;
}

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

.mono {
  font-family: var(--d-mono);
}

/* --------------------------------------------------------------------------
   SHARED SITE HEADER & ANNOUNCEMENT BAR (Identical to Marketing Homepage)
   -------------------------------------------------------------------------- */
.announcement {
  background: #b3211a;
  color: #fff;
  height: 40px;
  position: relative;
  z-index: 101;
  font-family: 'Lato', sans-serif;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
.announcement-bar-link {
  display: flex;
  height: 100%;
  width: 100%;
  color: #fff !important;
  text-decoration: none !important;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.announcement-bar-link:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #fff !important;
  text-decoration: none !important;
}
.announcement-inner {
  height: 100%;
  width: 100%;
  max-width: 1140px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 14.5px;
  font-weight: 500;
  text-align: center;
}
.announcement-text {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}
.announcement-text strong {
  color: #fff;
}
.announcement .badge {
  background: #fff;
  color: #b3211a;
  font-family: 'Lato', sans-serif;
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.announcement-link {
  color: #fff !important;
  font-weight: 700;
  font-size: 14.5px;
  transition: opacity 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none !important;
  white-space: nowrap;
}
.announcement-bar-link:hover .announcement-link {
  opacity: 0.88;
  text-decoration: underline !important;
}
@media (max-width: 860px) {
  .announcement {
    height: auto;
    min-height: 38px;
    padding: 6px 0;
  }
  .announcement-inner {
    padding: 0 16px;
    justify-content: center;
    font-size: 13px;
    text-align: center;
  }
  .announcement-link {
    display: none;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .site-header {
  background: rgba(11, 18, 32, 0.94);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  width: 100%;
  max-width: 100%;
  padding: 0 36px;
  position: relative;
  box-sizing: border-box;
}
@media (max-width: 768px) {
  .nav-inner {
    padding: 0 16px;
    height: 64px;
  }
}
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none !important;
  z-index: 2;
}
.brand-logo-img {
  height: 56px;
  width: auto;
  display: block;
  object-fit: contain;
}
@media (max-width: 768px) {
  .brand-logo-img {
    height: 48px;
  }
}
.nav-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 26px;
}
.nav-links a {
  font-family: 'Lato', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #000 !important;
  letter-spacing: -0.01em;
  text-decoration: none !important;
  transition: color 0.15s ease, opacity 0.15s ease;
}
[data-theme="dark"] .nav-links a {
  color: #f8fafc !important;
}
.nav-links a:hover,
.nav-links a.active {
  color: #2563eb !important;
  opacity: 0.85;
}
.nav-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2;
}
.nav-cta .btn-primary,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0 20px;
  height: 44px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
  background: #2563eb !important;
  color: #fff !important;
  border: 2px solid #2563eb;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-cta .btn-primary:hover,
.btn-primary:hover {
  background: #1d4ed8 !important;
  border-color: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  color: #fff !important;
}
@media (max-width: 1024px) {
  .nav-links {
    gap: 18px;
  }
  .nav-links a {
    font-size: 14px;
  }
}
@media (max-width: 768px) {
  .nav-links {
    display: none !important;
  }
  .nav-cta {
    display: none !important;
  }
  .mobile-menu-btn {
    display: block !important;
  }
}
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid #e2e8f0;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  color: #0f172a;
}
[data-theme="dark"] .mobile-menu-btn {
  border-color: #334155;
  color: #f8fafc;
}

/* Mobile drawer */
.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 2px solid #1a1a1a;
  padding: 24px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}
[data-theme="dark"] .mobile-nav {
  background: #0b1220;
  border-bottom-color: #334155;
}
.mobile-nav.open { display: block; }
.mobile-nav-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mobile-nav a {
  font-family: 'Lato', sans-serif;
  font-size: 16px;
  font-weight: 600;
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a !important;
  text-decoration: none !important;
}
[data-theme="dark"] .mobile-nav a {
  border-bottom-color: #1e293b;
  color: #f8fafc !important;
}
.mobile-nav a.btn-primary {
  background: #2563eb !important;
  color: #fff !important;
  text-align: center;
  border-radius: 999px;
  padding: 10px 20px;
  border: none;
}

/* --------------------------------------------------------------------------
   LOCKED 3-COLUMN CONTAINER
   Left Sidebar (280px) + Main Pane (flex) + Right "On this page" (240px)
   -------------------------------------------------------------------------- */
.docs-layout-container {
  display: flex;
  width: 100%;
  min-height: calc(100vh - 72px);
  max-width: 1540px;
  margin: 0 auto;
}

/* 1. LEFT SIDEBAR (Navigation Tree) */
.docs-left-sidebar {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--d-line);
  background: var(--d-panel);
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
  padding: 24px 16px;
  box-sizing: border-box;
}

.docs-search-bar {
  position: relative;
  margin-bottom: 20px;
}
.docs-search-input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid var(--d-line);
  border-radius: 6px;
  background: var(--d-bg);
  color: var(--d-ink);
  box-sizing: border-box;
}
.docs-search-input:focus {
  outline: none;
  border-color: var(--d-brand);
  box-shadow: 0 0 0 2px var(--d-brand-glow);
}
.docs-search-icon {
  position: absolute;
  left: 9px;
  top: 9px;
  width: 14px;
  height: 14px;
  color: var(--d-faint);
}

.sidebar-group {
  margin-bottom: 16px;
}
.sidebar-group-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--d-faint);
  padding: 6px 8px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  border-radius: 6px;
}
.sidebar-group-summary::-webkit-details-marker {
  display: none;
}
.sidebar-group-summary:hover {
  color: var(--d-ink);
}
.sidebar-caret {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}
details[open] > .sidebar-group-summary .sidebar-caret {
  transform: rotate(90deg);
}

.sidebar-items {
  list-style: none;
  padding: 4px 0 4px 8px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-item a {
  display: flex;
  align-items: center;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--d-mute);
  padding: 6px 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.sidebar-item a:hover {
  color: var(--d-brand);
  background: var(--d-brand-tint);
  text-decoration: none;
}
.sidebar-item a.active {
  color: var(--d-brand);
  background: var(--d-brand-tint);
  font-weight: 800;
  border-left: 3px solid var(--d-brand);
  border-radius: 0 6px 6px 0;
}

/* 2. CENTER MAIN CONTENT */
.docs-main-pane {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 80px;
  box-sizing: border-box;
}

.docs-article {
  max-width: 820px;
  margin: 0 auto;
}

.docs-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--d-faint);
  margin-bottom: 20px;
}
.docs-crumbs a {
  color: var(--d-mute);
  text-decoration: none;
}
.docs-crumbs a:hover {
  color: var(--d-brand);
}

.docs-h1 {
  font-size: 38px;
  line-height: 1.15;
  font-weight: 900;
  color: var(--d-ink);
  letter-spacing: -0.025em;
  margin: 0 0 20px;
}

.docs-lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--d-mute);
  margin: 0 0 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--d-line);
}

.docs-article h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--d-ink);
  margin: 40px 0 16px;
  letter-spacing: -0.015em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--d-line);
}
.docs-article h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--d-ink);
  margin: 28px 0 12px;
}

.docs-article p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--d-ink);
  margin: 0 0 18px;
}

.docs-article ul, .docs-article ol {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--d-ink);
  margin: 0 0 20px;
  padding-left: 24px;
}
.docs-article li {
  margin-bottom: 6px;
}

/* Tables */
.docs-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 24px 0 32px;
  border: 1px solid var(--d-line);
  border-radius: 8px;
}
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}
.docs-table th {
  background: var(--d-bg);
  color: var(--d-ink);
  font-weight: 800;
  padding: 12px 16px;
  border-bottom: 1px solid var(--d-line);
}
.docs-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--d-line-subtle);
  color: var(--d-mute);
}
.docs-table tr:last-child td {
  border-bottom: none;
}
.docs-table code {
  font-family: var(--d-mono);
  font-size: 12.5px;
  background: var(--d-bg);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--d-line);
  color: var(--d-ink);
}

/* Code Blocks */
.code-figure {
  margin: 20px 0 28px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--d-code-bg);
  border: 1px solid #1e293b;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #070d18;
  border-bottom: 1px solid #1e293b;
  font-family: var(--d-mono);
  font-size: 12px;
  color: #94a3b8;
}
.code-pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--d-mono);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--d-code-ink);
}

.copy-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Callouts / Warnings */
.docs-callout {
  background: var(--d-bg);
  border-left: 4px solid var(--d-brand);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 15px;
  line-height: 1.6;
}
.docs-callout strong {
  color: var(--d-brand);
}

/* Pagination Links */
.docs-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--d-line);
  margin-top: 60px;
  padding-top: 32px;
}
.pagination-card {
  display: flex;
  flex-direction: column;
  padding: 12px 18px;
  border: 1px solid var(--d-line);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s ease;
  min-width: 160px;
}
.pagination-card:hover {
  border-color: var(--d-brand);
  background: var(--d-brand-tint);
  text-decoration: none;
}
.pagination-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--d-faint);
  margin-bottom: 4px;
}
.pagination-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--d-ink);
}
.pagination-card:hover .pagination-title {
  color: var(--d-brand);
}

/* 3. RIGHT "ON THIS PAGE" TOC */
.docs-right-sidebar {
  width: 240px;
  flex-shrink: 0;
  border-left: 1px solid var(--d-line);
  background: var(--d-panel);
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
  padding: 28px 18px;
  box-sizing: border-box;
}

.toc-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--d-faint);
  margin-bottom: 14px;
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toc-link {
  font-size: 13px;
  color: var(--d-mute);
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.15s ease;
}
.toc-link:hover {
  color: var(--d-brand);
  text-decoration: none;
}
.toc-link.active {
  color: var(--d-brand);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Responsive Media Queries
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .docs-right-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .docs-left-sidebar {
    display: none;
  }
  .docs-main-pane {
    padding: 24px 18px 60px;
  }
  .docs-h1 {
    font-size: 30px;
  }
}
