/* A nav section that also has an index page (e.g. "IDL / Schema") renders a
   dead, non-clickable bold label above a child link with the same text.
   Material only makes that label a link via `navigation.indexes`, which is
   incompatible with `toc.integrate`. Desktop sidebar fix, in three parts. */
@media screen and (min-width: 76.25em) {
  /* 1. hide the dead label */
  .md-sidebar--primary .md-nav__item--section > label.md-nav__link {
    display: none !important;
  }

  /* 2. the section's nested list sits flush with the outer list, so its index
     page lines up with plain top-level entries like "Overview" */
  .md-sidebar--primary .md-nav__item--section > .md-nav > .md-nav__list {
    margin-left: 0 !important;
  }

  /* 3. the section's own pages step in under its index page (padding on the
     link itself — flex, honours it reliably; the index page is the first
     child and stays put) */
  .md-sidebar--primary
    .md-nav__item--section
    > .md-nav
    > .md-nav__list
    > .md-nav__item:not(:first-child)
    > .md-nav__link {
    padding-left: 1.4rem !important;
  }
}

/* On a tab's own page (Home, Getting started, …) Material hides the page's
   nav link in the sidebar — the tab bar already shows it — leaving the
   integrated TOC with no parent heading. Bring it back as the TOC's parent. */
@media screen and (min-width: 76.25em) {
  .md-nav--lifted > .md-nav__list > .md-nav__item--active > a.md-nav__link {
    display: flex !important;
  }
}

/* ── Header: logo + wordmark ─────────────────────────────────────────────
   The stock header logo renders at 1.2rem — undersized beside the title.
   Enlarge it and trim the button box so the header keeps its 2.4rem. */
.md-header__button.md-logo {
  padding: 0.15rem;
  margin: 0.2rem 0.15rem 0.2rem 0.35rem;
}
.md-header__button.md-logo img {
  height: 1.7rem;
}

/* The wordmark: a step up in size, with the cramped -0.025em default
   tracking eased back. Weight stays bold (set by the theme). */
.md-header__title {
  font-size: 1.05rem;
  letter-spacing: 0.005em;
}

/* The mark is a flat single colour, so it needs a per-scheme swap: tomato
   on the light (white) header, cream on the dark (near-black) one. Material
   renders one <img>, so switch its source with `content:` per scheme. */
[data-md-color-scheme="default"] .md-header__button.md-logo img,
[data-md-color-scheme="default"] .md-nav__button.md-logo img {
  content: url("../assets/comline-mark-light.svg");
}
[data-md-color-scheme="slate"] .md-header__button.md-logo img,
[data-md-color-scheme="slate"] .md-nav__button.md-logo img {
  content: url("../assets/comline-mark-dark.svg");
}
