/* Custom documentation styles */

/* Hide Verification & Fault Tolerance from Product Guide sidebar */
.sidebar-tree li.toctree-l1:has(> a[href*="verification-and-fault-tolerance"]) {
  display: none !important;
}

/* Hide Fault-Tolerant Quantum Computing from Simulation and Analysis sidebar */
.sidebar-tree li.toctree-l1:has(> a[href*="fault-tolerant-quantum-computing"]) {
  display: none !important;
}

/* Hide QCLang Design Rules and Constraints from Reference sidebar */
.sidebar-tree li.toctree-l1:has(> a[href*="reference/design-rules"]) {
  display: none !important;
}

/* Hide QCLang Output Targets from Reference sidebar */
.sidebar-tree li.toctree-l1:has(> a[href*="reference/targets"]) {
  display: none !important;
}

/* Remove dark mode toggle button */
.theme-toggle-container {
  display: none !important;
}

/* Remove "View this page" / page source eye icon on the right */
.view-this-page,
.content-icon-container .view-this-page,
a[title="View this page"],
.icon-tabler-eye-code {
  display: none !important;
}

/* Widen content width and center-align the page on desktop viewports to remove empty margins */
@media (min-width: 1280px) {
  .page .sidebar-drawer {
    /* original content width: 46em (padded: 52em, half: 26em)
       we increase content width to 65em (padded: 71em, half: 35.5em) */
    width: calc(50% - 35.5em) !important;
  }
  .content {
    width: 65em !important;
  }
}

@media (min-width: 1440px) {
  .page .sidebar-drawer {
    /* further increase content width to 75em (padded: 81em, half: 40.5em) */
    width: calc(50% - 40.5em) !important;
  }
  .content {
    width: 75em !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════
   Continuous Deep Navy-Black Theme System for Documentation (#020817)
   ══════════════════════════════════════════════════════════════════════════════ */
:root,
html,
body,
body[data-theme="light"],
body[data-theme="dark"],
body[data-theme="auto"],
body:not([data-theme]),
.page {
  --color-background-primary: #020817 !important;
  --color-background-secondary: #020817 !important;
  --color-background-hover: #0b1329 !important;
  --color-background-border: #1e293b !important;
  --color-sidebar-background: #020817 !important;
  --color-sidebar-item-background: #020817 !important;
  --color-sidebar-item-background--current: #0b1329 !important;
  --color-sidebar-item-background--hover: #0b1329 !important;
  --color-sidebar-search-background: #0b1329 !important;
  --color-sidebar-search-border: #1e293b !important;
  --color-sidebar-search-text: #ffffff !important;
  --color-sidebar-brand-text: #ffffff !important;
  --color-sidebar-caption-text: #3ca2fa !important;
  --color-sidebar-link-text: #F6F6F7 !important;
  --color-sidebar-link-text--top-level: #3ca2fa !important;
  --color-brand-primary: #3ca2fa !important;
  --color-brand-content: #3ca2fa !important;
  --color-foreground-primary: #F6F6F7 !important;
  --color-foreground-secondary: rgba(255, 255, 255, 0.75) !important;
  --color-foreground-muted: rgba(255, 255, 255, 0.5) !important;
  --color-link: #3ca2fa !important;
  --color-link--hover: #4da6ff !important;
  --color-admonition-background: #0b1329 !important;
  --color-api-background: #0b1329 !important;
  --color-code-background: #0b1329 !important;
  --color-code-foreground: #e2e8f0 !important;

  /* Navbar tokens */
  --sf-nav-bg: #020817 !important;
  --sf-nav-border: #1e293b !important;
  --sf-nav-shadow: 0 8px 30px rgba(0,0,0,0.5) !important;
  --sf-nav-text: rgba(255, 255, 255, 0.8) !important;
  --sf-nav-text-active: #ffffff !important;
  --sf-nav-hover-bg: rgba(255, 255, 255, 0.1) !important;
}

html, body, .page, .sidebar-drawer, .sidebar-sticky, .sidebar-tree, .content, article, main, header, nav, #sf-app-navbar {
  background-color: #020817 !important;
  color: #F6F6F7 !important;
}

/* Sidebar Search Box */
.sidebar-search-container, .sidebar-search {
  background-color: #020817 !important;
}
.sidebar-search-container input, input.sidebar-search {
  background-color: #0b1329 !important;
  border: 1px solid #1e293b !important;
  color: #ffffff !important;
}
.sidebar-search-container input::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}

/* Sidebar Brand & Header Text */
.sidebar-brand, .sidebar-brand-text, .sidebar-title {
  color: #ffffff !important;
  background-color: #020817 !important;
}

/* Sidebar navigation links & captions */
.sidebar-caption, .caption-text {
  color: #3ca2fa !important;
  font-weight: 600 !important;
}
.sidebar-tree a, .sidebar-tree li a, .toctree-checkbox + label {
  color: #F6F6F7 !important;
}
.sidebar-tree a:hover, .sidebar-tree li a:hover {
  color: #4da6ff !important;
  background-color: #0b1329 !important;
  border-radius: 4px;
}
.sidebar-tree .current > a, .sidebar-tree li.current > a {
  color: #3ca2fa !important;
  font-weight: 600 !important;
  background-color: #0b1329 !important;
}

/* Page titles and content headers */
h1, h2, h3, h4, h5, h6, .content h1, .content h2, .content h3 {
  color: #ffffff !important;
}

/* Content links only — NOT navbar */
.content a, article a, .sidebar-tree a {
  color: #3ca2fa !important;
}
.content a:hover, article a:hover {
  color: #4da6ff !important;
}

/* Force navbar pill links to match landing page (white, not blue) */
#sf-app-navbar a,
#sf-app-navbar .sf-pill,
#sf-app-navbar .sf-btn {
  color: rgba(255, 255, 255, 0.8) !important;
}
#sf-app-navbar a:hover,
#sf-app-navbar .sf-pill:hover {
  color: #ffffff !important;
}
#sf-app-navbar .sf-pill-active,
#sf-app-navbar .sf-pill-active:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.6) !important;
}
#sf-app-navbar .sf-btn-ghost {
  color: rgba(255, 255, 255, 0.85) !important;
}
#sf-app-navbar .sf-btn-ghost:hover {
  color: #ffffff !important;
}
#sf-app-navbar .sf-btn-primary {
  color: #ffffff !important;
}

/* ── Position "Back to top" button below fixed navbar ───────────────────────── */
.back-to-top {
  top: 104px !important;
  z-index: 99 !important;
  background: rgba(11, 19, 41, 0.92) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid #1e293b !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
  color: #3ca2fa !important;
  font-weight: 600 !important;
  padding: 0.5rem 1rem !important;
  border-radius: 9999px !important;
  transition: all 0.2s ease !important;
}

.back-to-top:hover {
  background: #132247 !important;
  color: #ffffff !important;
  border-color: #3ca2fa !important;
  box-shadow: 0 6px 24px rgba(60, 162, 250, 0.28) !important;
  text-decoration: none !important;
  transform: translateX(-50%) translateY(-2px) !important;
}

.back-to-top svg {
  fill: currentColor !important;
}

