[data-md-color-primary="custom"] {
  --md-primary-fg-color:        #1a6ff5;
  --md-primary-fg-color--light: #4d94ff;
  --md-primary-fg-color--dark:  #0d4fcc;
}

[data-md-color-accent="custom"] {
  --md-accent-fg-color: #1a6ff5;
}

/* Hide native scrollbar track on right TOC */
.md-sidebar--secondary .md-sidebar__scrollwrap {
  scrollbar-color: #1a6ff5 transparent;
  scrollbar-width: thin;
}

.md-sidebar--secondary .md-sidebar__scrollwrap::-webkit-scrollbar {
  width: 4px;
}

.md-sidebar--secondary .md-sidebar__scrollwrap::-webkit-scrollbar-track {
  background: transparent;
}

.md-sidebar--secondary .md-sidebar__scrollwrap::-webkit-scrollbar-thumb {
  background-color: #1a6ff5;
  border-radius: 4px;
}

/* Dark navy background to match logo */
[data-md-color-scheme="slate"] {
  --md-default-bg-color:        rgba(7, 12, 24, 0.82);
  --md-default-bg-color--light: rgba(12, 18, 32, 0.80);
  --md-default-bg-color--dark:  rgba(4, 8, 16, 0.88);
  --md-code-bg-color:           #060d1a;
}

/* Code blocks and inline code — match table background */
.md-content pre,
.md-content pre > code,
.highlight,
.highlight pre {
  background-color: #060d1a !important;
}

.md-content code {
  background-color: #060d1a !important;
}

/* Background image on the root */
body {
  background-image: url("images/threader-background.png");
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-color: #070c18;
}

/* Page headings — more distinct */
.md-content h1 {
  color: #ffffff;
  font-size: 2rem;
  border-bottom: 2px solid #1a6ff5;
  padding-bottom: 0.4rem;
}

.md-content h2 {
  color: #c8d8f0;
  font-size: 1.35rem;
  border-bottom: 1px solid rgba(26, 111, 245, 0.3);
  padding-bottom: 0.25rem;
  margin-top: 2rem;
}

.md-content h3 {
  color: #5a90e8;
  font-size: 1.05rem;
}

.md-content h4 {
  color: #3d6db8;
  font-size: 0.95rem;
}

/* TOC: bullet points for top-level section links (h2) — white */
.md-nav--secondary > .md-nav__list > .md-nav__item > .md-nav__link::before {
  content: "• ";
  color: #1a6ff5;
}

.md-nav--secondary > .md-nav__list > .md-nav__item > .md-nav__link {
  color: #ffffff;
}

/* TOC: h3 — dash prefix, indented, light grey */
.md-nav--secondary .md-nav__item .md-nav__item > .md-nav__link::before {
  content: "– ";
  color: #5a90e8;
}

.md-nav--secondary .md-nav__item .md-nav__item > .md-nav__link {
  padding-left: 0.5rem;
  font-size: 0.73rem;
  color: #7a90aa;
}

/* TOC: h4 — deeper indent, dimmer grey */
.md-nav--secondary .md-nav__item .md-nav__item .md-nav__item > .md-nav__link::before {
  content: "– ";
  color: #3d6db8;
}

.md-nav--secondary .md-nav__item .md-nav__item .md-nav__item > .md-nav__link {
  padding-left: 1rem;
  font-size: 0.68rem;
  color: #6b7f99;
}

/* TOC: white hover on all nav links */
.md-nav--secondary .md-nav__link:hover,
.md-nav--secondary .md-nav__link:focus {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.05);
}

/* TOC: active item — white left bar + white text at all levels */
.md-nav--secondary .md-nav__link--active {
  color: #ffffff !important;
  font-weight: 600;
  border-left: 3px solid #ffffff;
  padding-left: calc(0.75rem - 3px);
  background: rgba(255, 255, 255, 0.06);
}

/* Left sidebar: same hover style as TOC */
.md-nav--primary .md-nav__link:hover,
.md-nav--primary .md-nav__link:focus {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.05);
}

/* Left sidebar: active PAGE link only — bold white, no other changes */
.md-nav--primary .md-nav__item .md-nav__link--active {
  color: #ffffff !important;
  font-weight: 700;
}

/* Section headers and active top-level title — white text, keep the box, fix padding */
.md-nav--primary .md-nav__title {
  color: #ffffff !important;
  padding-top: 0.6rem !important;
  padding-bottom: 0.6rem !important;
  line-height: 1 !important;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

/* Deeper, richer header background with subtle bottom glow */
.md-header {
  background: #06090f;
  border-bottom: 1px solid rgba(26, 111, 245, 0.35);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(26, 111, 245, 0.2);
}

/* Site title — bolder and slightly larger */
.md-header__title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: #ffffff;
}

/* Nav tabs bar — slightly darker than header for separation */
.md-tabs {
  background: #06090f;
  border-bottom: 1px solid rgba(26, 111, 245, 0.18);
}

/* Nav tab items — softer inactive, crisp active */
.md-tabs__link {
  color: rgba(255, 255, 255, 0.65) !important;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.15s ease;
}

.md-tabs__link:hover {
  color: #ffffff !important;
}

.md-tabs__link--active {
  color: #ffffff !important;
  border-bottom: 2px solid #1a6ff5;
}
