/* Warelix — macOS Blue palette (matches src/styles/variables.css) */

[data-md-color-scheme="default"][data-md-color-primary="blue"] {
  --md-primary-fg-color: #007aff;
  --md-primary-fg-color--light: #409cff;
  --md-primary-fg-color--dark: #0066d6;
  --md-primary-bg-color: #ffffff;
  --md-accent-fg-color: #007aff;
  --md-default-bg-color: #f2f2f7;
  --md-default-bg-color--light: #ffffff;
  --md-default-bg-color--lighter: #ffffff;
  --md-default-fg-color: #1d1d1f;
  --md-default-fg-color--light: #6e6e73;
  --md-default-fg-color--lighter: #6e6e73;
  --md-typeset-a-color: #007aff;
  --md-code-bg-color: #e8f0fe;
}

[data-md-color-scheme="slate"][data-md-color-primary="blue"] {
  --md-primary-fg-color: #0a84ff;
  --md-primary-fg-color--light: #409cff;
  --md-primary-fg-color--dark: #0066d6;
  --md-primary-bg-color: #ffffff;
  --md-accent-fg-color: #0a84ff;
  --md-default-bg-color: #000000;
  --md-default-bg-color--light: #1c1c1e;
  --md-default-bg-color--lighter: #2c2c2e;
  --md-default-fg-color: #f5f5f7;
  --md-default-fg-color--light: #8e8e93;
  --md-default-fg-color--lighter: #8e8e93;
  --md-typeset-a-color: #0a84ff;
  --md-code-bg-color: #0a2540;
}

/* ── Header (light surface) ──
   Colours, icon centering and the mobile drawer header live in
   overrides/main.html (its extrahead <style> loads after the theme CSS,
   so it reliably wins the cascade). Here we keep only the bits that the
   theme doesn't fight: border, logo radius and title-text centering. */

.md-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: none;
}

[data-md-color-scheme="slate"] .md-header {
  border-bottom-color: #38383a;
}

.md-header__button.md-logo img {
  border-radius: 6px;
}

/* Title vertically centered to sit on the same line as the header icons */
.md-header__title {
  display: flex;
  align-items: center;
  height: auto;
  margin-top: 0;
  margin-bottom: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.md-header__ellipsis,
.md-header__topic {
  display: flex;
  align-items: center;
}

/* Search field on light header */

.md-search__form {
  background-color: rgba(0, 0, 0, 0.06);
}

.md-search__form:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.md-search__input {
  color: var(--md-default-fg-color);
}

.md-search__input::placeholder,
.md-search__input + .md-search__icon {
  color: var(--md-default-fg-color--light);
}

[data-md-color-scheme="slate"] .md-search__form {
  background-color: rgba(255, 255, 255, 0.1);
}

[data-md-color-scheme="slate"] .md-search__form:hover {
  background-color: rgba(255, 255, 255, 0.16);
}

/* ── Sidebar navigation tree ── */

/* Compact site title above the nav tree (desktop sidebar only) */
@media screen and (min-width: 76.25em) {
  .md-nav--primary > .md-nav__title {
    height: auto;
    min-height: 0;
    padding: 0.6rem 0.8rem 0.4rem;
    line-height: 1.3;
  }
}

.md-nav__item--nested > .md-nav__link {
  font-weight: 600;
  color: var(--md-default-fg-color);
}

.md-nav__link--active {
  font-weight: 600;
}

.md-nav__item .md-nav__link--active {
  color: var(--md-accent-fg-color);
}

/* ── Content ── */

.md-typeset .admonition,
.md-typeset details {
  border-radius: 10px;
}

.md-typeset code {
  border-radius: 6px;
}

.md-search__form {
  border-radius: 10px;
}

/* ── Mobile ── */

@media screen and (max-width: 76.234375em) {
  /* (Header tap targets and the drawer header live in overrides/main.html) */

  /* Inner section headers (back navigation) — slimmer, keep Material's
     left padding so the back-arrow icon and label don't overlap */
  .md-nav--primary .md-nav__title {
    height: auto;
    min-height: 0;
    line-height: 1.4;
    background-color: var(--md-default-bg-color--light);
    color: var(--md-default-fg-color);
    box-shadow: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  [data-md-color-scheme="slate"] .md-nav--primary .md-nav__title {
    border-bottom-color: #38383a;
  }

  /* Roomier nav links for touch */
  .md-nav--primary .md-nav__link {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
  }

  /* Keep wide tables readable: scroll horizontally instead of overflowing */
  .md-typeset__scrollwrap {
    margin: 0 -0.8rem;
  }

  .md-typeset__table {
    padding: 0 0.8rem;
  }

  /* Slightly tighter content gutters on small screens */
  .md-content__inner {
    margin: 0 0.6rem 1.2rem;
  }
}
