:root {
  --md-primary-fg-color: #2b5f3c;
  --md-primary-fg-color--light: #3b8252;
  --md-primary-fg-color--dark: #1a4a2b;
  --md-accent-fg-color: #C8820C;
  --md-typeset-a-color: #A06A08;
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #3b8252;
  --md-primary-fg-color--light: #7fc6a1;
  --md-primary-fg-color--dark: #2b5f3c;
  --md-accent-fg-color: #F0D898;
  --md-typeset-a-color: #E8C060;
}

/* ── Header: amber gradient ── */
.md-header {
  background: linear-gradient(100deg, #B8720A 0%, #D49818 25%, #E8B040 50%, #D49818 75%, #3b8252 100%);
}

.md-tabs {
  background: transparent;
}

/* Header logo: full Nodera logo */
.md-header .md-logo img {
  height: 24px;
  width: auto;
}

/* Always show "Ambra" in header, never swap to page title on scroll */
.md-header__title--active .md-header__topic:first-child {
  opacity: 1 !important;
  transform: none !important;
  position: static !important;
}

.md-header__topic:last-child {
  display: none !important;
}

/* ── Mobile sidebar: white background, clean look ── */

/* Hide sidebar logo + Ambra title */
.md-nav--primary > .md-nav__title[for="__drawer"] {
  display: none !important;
}

/* Hide duplicate inner section titles on desktop (navigation.expand shows parent label).
   Keep visible on mobile drawer where they serve as back buttons. */
@media screen and (min-width: 76.25em) {
  .md-nav__item--nested > .md-nav > .md-nav__title {
    display: none !important;
  }
}

/* On mobile drawer, style inner section titles as left-aligned back buttons */
@media screen and (max-width: 76.24em) {
  .md-nav--primary .md-nav__title[for]:not([for="__drawer"]) {
    background-color: #fff !important;
    color: #000 !important;
    font-weight: 600;
    text-align: left !important;
    display: block !important;
    padding: 0.6rem 0.8rem !important;
    font-size: inherit;
  }

  [data-md-color-scheme="slate"] .md-nav--primary .md-nav__title[for]:not([for="__drawer"]) {
    background-color: #2e2e2e !important;
    color: #fff !important;
  }
}


/* Nav items: normal weight, not bold */
.md-nav__link {
  font-weight: 400;
}

/* Section/category labels: black, normal weight */
.md-nav__item--nested > .md-nav__link {
  color: #000;
  font-weight: 400;
}

[data-md-color-scheme="slate"] .md-nav__item--nested > .md-nav__link {
  color: #fff;
}

/* Active page: ambra color, same font size as siblings */
.md-nav__item--active > .md-nav__link,
.md-nav__link--active,
.md-nav .md-nav__link--active {
  color: #C8820C !important;
  font-weight: 600;
  font-size: inherit;
}

[data-md-color-scheme="slate"] .md-nav__item--active > .md-nav__link,
[data-md-color-scheme="slate"] .md-nav__link--active,
[data-md-color-scheme="slate"] .md-nav .md-nav__link--active {
  color: #F0D898 !important;
}

/* Hover: darker ambra */
.md-nav__link:hover {
  color: #8B5A06 !important;
}

[data-md-color-scheme="slate"] .md-nav__link:hover {
  color: #E8C060 !important;
}

/* Consistent arrow icon for all expandable items */
.md-nav__item--nested .md-nav__link .md-nav__icon::after {
  content: "";
}

/* Hide ToC title (it duplicates the active nav link above) */
.md-nav--secondary > .md-nav__title {
  display: none !important;
}

/* ── Content links: darker ambra ── */
.md-typeset a {
  color: #A06A08;
}

.md-typeset a:hover {
  color: #8B5A06;
}

[data-md-color-scheme="slate"] .md-typeset a {
  color: #E8C060;
}

[data-md-color-scheme="slate"] .md-typeset a:hover {
  color: #F0D898;
}

/* ── Footer: white bg, Nodera style ── */
.md-footer {
  background-color: #fff;
  color: #333;
  border-top: 1px solid #e0e0e0;
}

[data-md-color-scheme="slate"] .md-footer {
  background-color: #1e1e1e;
  color: #ccc;
  border-top: 1px solid #444;
}

.md-footer-meta {
  background-color: transparent;
}

.nodera-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
  width: 100%;
}

.nodera-footer__brand {
  display: flex;
  align-items: center;
}

.md-typeset .nodera-footer__logo {
  width: 240px !important;
  height: auto !important;
  max-width: none;
}

.nodera-footer__legal {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nodera-footer__legal a {
  color: #666 !important;
  font-size: 0.8rem !important;
  text-decoration: none;
}

.nodera-footer__legal a:hover {
  color: #333 !important;
  text-decoration: underline;
}

[data-md-color-scheme="slate"] .nodera-footer__legal a {
  color: #999 !important;
}

[data-md-color-scheme="slate"] .nodera-footer__legal a:hover {
  color: #ddd !important;
}

/* Hide default MkDocs prev/next footer nav */
.md-footer__inner {
  display: none;
}

@media (max-width: 600px) {
  .nodera-footer {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* ── Scrollbar: light grey ── */
.md-sidebar__scrollwrap::-webkit-scrollbar {
  width: 6px;
}

.md-sidebar__scrollwrap::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 3px;
}

.md-sidebar__scrollwrap::-webkit-scrollbar-track {
  background-color: transparent;
}

.md-sidebar__scrollwrap {
  scrollbar-color: #ccc transparent;
}

/* ── Permalink ¶ icons: light grey default, dark amber on hover ── */
.md-typeset a.headerlink {
  color: #ccc !important;
}

.md-typeset a.headerlink:hover {
  color: #8B5A06 !important;
}

[data-md-color-scheme="slate"] .md-typeset a.headerlink {
  color: #555 !important;
}

[data-md-color-scheme="slate"] .md-typeset a.headerlink:hover {
  color: #E8C060 !important;
}

/* ── Nav: left-align category titles in sidebar ── */
.md-nav__item--nested > .md-nav__link {
  text-align: left;
}

/* ── Remove sidebar scroll fade/mask ── */
.md-sidebar__scrollwrap::before,
.md-sidebar__scrollwrap::after {
  display: none !important;
}

.md-sidebar__scrollwrap {
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

/* ── Admonitions: amber instead of blue ── */
:root {
  --md-admonition-fg-color: #333;
  --md-admonition-bg-color: #fff;
}

.md-typeset .admonition,
.md-typeset details {
  border-color: #C8820C;
}

.md-typeset .admonition > .admonition-title,
.md-typeset details > summary {
  background-color: rgba(200, 130, 12, 0.1);
}

.md-typeset .admonition > .admonition-title::before,
.md-typeset details > summary::before {
  color: #C8820C;
  background-color: #C8820C !important;
}

.md-typeset .admonition.info,
.md-typeset details.info {
  border-color: #C8820C;
}

.md-typeset .admonition.info > .admonition-title,
.md-typeset details.info > summary {
  background-color: rgba(200, 130, 12, 0.1);
}

.md-typeset .admonition.info > .admonition-title::before,
.md-typeset details.info > summary::before {
  color: #C8820C;
}

.md-typeset .admonition.note,
.md-typeset details.note {
  border-color: #C8820C;
}

.md-typeset .admonition.note > .admonition-title,
.md-typeset details.note > summary {
  background-color: rgba(200, 130, 12, 0.1);
}

.md-typeset .admonition.note > .admonition-title::before,
.md-typeset details.note > summary::before {
  color: #C8820C;
}

.md-typeset .admonition.warning,
.md-typeset details.warning {
  border-color: #D49818;
}

.md-typeset .admonition.warning > .admonition-title,
.md-typeset details.warning > summary {
  background-color: rgba(212, 152, 24, 0.1);
}

.md-typeset .admonition.warning > .admonition-title::before,
.md-typeset details.warning > summary::before {
  color: #D49818;
}
