/* ── DUIK Documentation Styles ─────────────────────────────── */
:root {
  --topbar-h: 56px;
}

body {
  padding-top: var(--topbar-h);
  font-size: 15px;
  color: #343a40;
}

/* ── Topbar brand darker bg ─────────────────────────────────── */
.bg-primary-darker {
  background-color: #0a58ca !important;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.duik-sidebar {
  min-height: calc(100vh - var(--topbar-h));
  background: #f8f9fa;
  border-right: 1px solid #dee2e6;
  padding: 0;
}

.duik-sidebar-sticky {
  position: sticky;
  top: calc(var(--topbar-h) + 8px);
  max-height: calc(100vh - var(--topbar-h) - 16px);
  overflow-y: auto;
  padding-top: 1.25rem;
  padding-bottom: 2rem;
}

.duik-sidebar__heading {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6c757d;
  padding: .75rem 1.25rem .3rem;
  margin: 0;
}

.duik-sidebar__nav {
  list-style: none;
  padding: 0;
  margin: 0 0 .25rem;
}

.duik-sidebar__item { margin: 0; }

.duik-sidebar__link {
  display: block;
  padding: .4rem 1.25rem;
  font-size: .875rem;
  color: #495057;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .12s, color .12s;
}
.duik-sidebar__link:hover {
  color: #0d6efd;
  background: rgba(13,110,253,.06);
  text-decoration: none;
}
.duik-sidebar__link.active {
  color: #0d6efd;
  font-weight: 600;
  border-left-color: #0d6efd;
  background: rgba(13,110,253,.1);
}

/* ── Content ────────────────────────────────────────────────── */
.duik-content {
  padding: 1.75rem 1.5rem 3rem;
}

.duik-content h1 {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.duik-content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: .6rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid #dee2e6;
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}
.duik-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: .5rem;
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}
.duik-content h4 {
  font-size: .95rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: .4rem;
}

.duik-content p { line-height: 1.75; margin-bottom: .85rem; }
.duik-content ul,
.duik-content ol { padding-left: 1.5rem; margin-bottom: .85rem; }
.duik-content li { line-height: 1.65; margin-bottom: .35rem; }
.duik-content hr { border-top: 1px solid #dee2e6; margin: 1.75rem 0; }

/* inline code */
.duik-content :not(pre) > code {
  background: #e7f1ff;
  color: #0d6efd;
  padding: .13em .42em;
  border-radius: .3rem;
  font-size: .875em;
  font-family: "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

/* code blocks */
.duik-content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: .5rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: .84rem;
  line-height: 1.6;
  margin: .75rem 0 1.25rem;
}
.duik-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
  font-family: "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

/* tables */
.duik-content .table th { background: #f8f9fa; }
.duik-content .table td,
.duik-content .table th { font-size: .9rem; }

/* blockquote */
.duik-content .blockquote {
  border-left: 4px solid #0d6efd;
  background: #e7f1ff;
  padding: .75rem 1rem;
  margin: 1rem 0;
  border-radius: 0 .4rem .4rem 0;
  font-size: 1rem;
}

/* ── Right TOC ──────────────────────────────────────────────── */
.duik-content-nav { padding-top: .25rem; }
.duik-content-nav li { list-style: none; }
.duik-content-nav li a {
  display: block;
  padding: .28rem .6rem;
  font-size: .78rem;
  color: #6c757d;
  text-decoration: none;
  border-left: 2px solid #dee2e6;
  transition: color .12s, border-color .12s;
}
.duik-content-nav li a:hover {
  color: #0d6efd;
  border-left-color: #0d6efd;
  text-decoration: none;
}
.js-scroll-nav {
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
  padding: 0;
  margin: 0;
}

/* ── Back to top ────────────────────────────────────────────── */
.duik-go-to {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 2.25rem;
  height: 2.25rem;
  background: #0d6efd;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1;
  opacity: .75;
  transition: opacity .15s;
  z-index: 500;
}
.duik-go-to:hover { opacity: 1; color: #fff; text-decoration: none; }

/* ── Language dropdown — pure CSS, no Bootstrap JS needed ───── */
.navbar .dropdown:hover > .dropdown-menu,
.navbar .dropdown:focus-within > .dropdown-menu {
  display: block;
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .duik-sidebar {
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid #dee2e6;
  }
  .duik-sidebar-sticky {
    position: static;
    max-height: none;
  }
  .duik-content { padding: 1.25rem 1rem 2rem; }
}
