/* Custom styles to match Acclarity branding */

:root,
[data-md-color-scheme="default"] {
  /* Primary colors */
  --md-primary-fg-color: #141a3f !important;
  --md-primary-fg-color--light: #1e2654 !important;
  --md-primary-fg-color--dark: #0e1229 !important;
  
  /* Accent color - bright blue from brand */
  --md-accent-fg-color: #4a98f3;
  --md-accent-fg-color--transparent: rgba(74, 152, 243, 0.1);
  
  /* Typeset link color */
  --md-typeset-a-color: #4a98f3;
}

/* Header background */
.md-header {
  background-color: #141a3f;
}

/* Header - use flexbox to reorder elements */
.md-header__inner {
  display: flex;
  align-items: center;
}

/* Set order for all header elements */
.md-header__inner > * {
  order: 10; /* Default order for everything else */
}

/* Menu button comes first (order 1) */
.md-header__inner > label[for="__drawer"] {
  order: 1 !important;
}

/* Logo comes second (order 2) */
.md-header__inner > .md-header__button.md-logo {
  order: 2 !important;
  display: inline-flex !important;
  margin: 0.2rem 0.5rem;
  padding: 0.2rem;
}

.md-header .md-header__button.md-logo img,
.md-header .md-header__button.md-logo svg {
  height: 2rem;
  width: auto;
  display: block !important;
}

/* Title/nav area comes third (order 3) */
.md-header__inner > .md-header__title {
  order: 3 !important;
  flex-grow: 1;
}

/* Search (order 5) */
.md-header__inner > .md-search {
  order: 5 !important;
}

/* Theme toggle and repo link stay at the end */
.md-header__inner > .md-header__option {
  order: 8 !important;
}

.md-header__inner > .md-header__source {
  order: 9 !important;
}

/* Hide site name text - logo already contains "Acclarity" */
.md-header__title .md-header__topic {
  display: none !important;
}

/* ===== MOBILE: Sidebar drawer - dark blue ===== */
@media screen and (max-width: 76.1875em) {
  /* Hide logo from sidebar - it's already in header */
  .md-nav--primary .md-nav__title .md-logo {
    display: none !important;
  }

  /* Sidebar header - dark blue on mobile */
  .md-nav--primary .md-nav__title {
    background-color: #141a3f !important;
    color: #fff !important;
  }

  .md-nav--primary .md-nav__title[for="__drawer"] {
    background-color: #141a3f !important;
    color: #fff !important;
  }

  .md-nav--primary .md-nav__title--site {
    background-color: #141a3f !important;
    color: #fff !important;
  }

  /* Back arrow in sidebar - white on dark */
  .md-nav--primary .md-nav__title .md-nav__icon {
    color: #fff !important;
  }
  
  /* Source/repo link in drawer */
  .md-nav__source {
    background-color: #0e1229 !important;
  }
}

/* ===== DESKTOP: Sidebar - white, no blue bar ===== */
@media screen and (min-width: 76.1875em) {
  /* Hide the primary nav title on desktop (removes blue bar) */
  .md-nav--primary > .md-nav__title {
    display: none !important;
  }
  
  /* Ensure sidebar is white */
  .md-sidebar--primary .md-sidebar__inner {
    background-color: #fff;
  }
}

/* Navigation tabs (if enabled) */
.md-tabs {
  background-color: #141a3f;
}

/* Sidebar navigation - active item */
.md-nav__link--active {
  color: #141a3f;
}

/* Sidebar navigation - hover */
.md-nav__link:hover {
  color: #4a98f3;
}

/* Table of contents - active item */
.md-nav__link--active,
.md-nav__item--active > .md-nav__link {
  color: #141a3f;
  font-weight: 600;
}

/* Links in content */
.md-typeset a {
  color: #4a98f3;
}

.md-typeset a:hover {
  color: #141a3f;
}

/* Search highlight */
.md-search__input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

/* Admonition - info/note */
.md-typeset .admonition.note,
.md-typeset details.note {
  border-color: #4a98f3;
}

.md-typeset .note > .admonition-title,
.md-typeset .note > summary {
  background-color: rgba(74, 152, 243, 0.1);
}

.md-typeset .note > .admonition-title::before,
.md-typeset .note > summary::before {
  background-color: #4a98f3;
}

/* Admonition - tip */
.md-typeset .admonition.tip,
.md-typeset details.tip {
  border-color: #2bba87;
}

.md-typeset .tip > .admonition-title,
.md-typeset .tip > summary {
  background-color: rgba(43, 186, 135, 0.1);
}

/* Buttons */
.md-typeset .md-button--primary {
  background-color: #141a3f;
  border-color: #141a3f;
}

.md-typeset .md-button--primary:hover {
  background-color: #1e2654;
  border-color: #1e2654;
}

/* Footer */
.md-footer {
  background-color: #141a3f;
}

/* Dark mode adjustments */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #141a3f;
  --md-accent-fg-color: #7cb8ff;
  --md-typeset-a-color: #7cb8ff;
  --md-default-bg-color: #1e1e1e;
}

/* Dark mode - sidebar styling */
[data-md-color-scheme="slate"] .md-sidebar {
  background-color: #1e1e1e;
}

[data-md-color-scheme="slate"] .md-sidebar__inner {
  background-color: #1e1e1e;
}

[data-md-color-scheme="slate"] .md-nav {
  background-color: #1e1e1e;
}

[data-md-color-scheme="slate"] .md-nav__item {
  background-color: transparent;
}

[data-md-color-scheme="slate"] .md-nav__link {
  color: #ccc;
}

[data-md-color-scheme="slate"] .md-nav__link:hover {
  color: #7cb8ff;
}

[data-md-color-scheme="slate"] .md-nav__link--active {
  color: #7cb8ff;
}

/* Hide "Made with Material for MkDocs" in footer */
.md-footer-meta__inner .md-copyright {
  display: none;
}

/* Keep social icons on the right */
.md-footer-meta__inner .md-social {
  margin-left: auto;
}
