/* Palette du site : vert foncé, orange, blanc */
:root > * {
  --md-primary-fg-color: #1b5e20;
  --md-primary-fg-color--light: #2e7d32;
  --md-primary-fg-color--dark: #0f3d14;
  --md-primary-bg-color: #ffffff;
  --md-primary-bg-color--light: rgba(255, 255, 255, 0.7);
  --md-accent-fg-color: #ef6c00;
  --md-accent-fg-color--transparent: rgba(239, 108, 0, 0.1);
  --md-accent-bg-color: #ffffff;
}
[data-md-color-scheme="default"] {
  --md-default-bg-color: #ffffff;
  --md-typeset-a-color: #1b5e20;
}
/* Mode sombre : un vert plus clair pour que les liens restent lisibles */
[data-md-color-scheme="slate"] {
  --md-typeset-a-color: #81c784;
}

/* Menu de navigation (arborescence de gauche) : fond orange foncé, texte blanc,
   section courante en vert foncé.
   Les couleurs de fond sont écrites en dur (et non via les variables de Material) :
   Safari ne repeint pas toujours les fonds définis par variable au survol. */
.md-sidebar--primary {
  --md-default-bg-color: #bf4d00;
  --md-default-fg-color: #ffffff;
  --md-default-fg-color--light: rgba(255, 255, 255, 0.85);
  --md-default-fg-color--lighter: rgba(255, 255, 255, 0.5);
  --md-default-fg-color--lightest: rgba(255, 255, 255, 0.2);
  --md-typeset-a-color: #ffffff;
  --md-accent-fg-color: #ffe0b2;
  color: #ffffff;
}
/* Fond orange : la liste principale et tous les panneaux imbriqués */
.md-sidebar--primary .md-nav--primary,
.md-sidebar--primary .md-nav--primary .md-nav,
.md-sidebar--primary .md-nav--primary .md-nav__title {
  background-color: #bf4d00 !important;
}
.md-sidebar--primary .md-nav--primary {
  border-radius: 0.2rem;
  padding: 0.4rem 0;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
/* Éléments, liens et conteneurs : jamais de fond propre, y compris au survol */
.md-sidebar--primary .md-nav__item,
.md-sidebar--primary .md-nav__link,
.md-sidebar--primary .md-nav__container,
.md-sidebar--primary .md-nav__item:hover,
.md-sidebar--primary .md-nav__link:hover,
.md-sidebar--primary .md-nav__link:focus,
.md-sidebar--primary .md-nav__container:hover {
  background-color: transparent !important;
}
.md-sidebar--primary .md-nav,
.md-sidebar--primary .md-nav__title,
.md-sidebar--primary .md-nav__link,
.md-sidebar--primary .md-nav__icon {
  color: #ffffff;
  box-shadow: none;
}
.md-sidebar--primary .md-nav__link:hover,
.md-sidebar--primary .md-nav__link:focus {
  color: #ffe0b2;
}
/* Section courante : fond vert foncé, panneaux imbriqués compris */
.md-sidebar--primary .md-nav--primary > .md-nav__list > .md-nav__item--active {
  background-color: #1b5e20 !important;
  border-radius: 0.2rem;
  margin: 0.1rem 0.3rem;
  padding: 0.1rem 0.4rem;
}
.md-sidebar--primary .md-nav--primary > .md-nav__list > .md-nav__item--active .md-nav,
.md-sidebar--primary .md-nav--primary > .md-nav__list > .md-nav__item--active .md-nav__title {
  background-color: #1b5e20 !important;
}
/* Page courante : en gras et soulignée */
.md-sidebar--primary .md-nav__link--active,
.md-sidebar--primary .md-nav__link--active:hover {
  color: #ffffff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
/* Sur mobile, l'en-tête du tiroir garde le vert du site ; sur grand écran, on le masque
   (le titre est déjà dans la barre du haut) */
.md-sidebar--primary .md-nav--primary > .md-nav__title[for="__drawer"] {
  background-color: #1b5e20 !important;
}
@media screen and (min-width: 76.25em) {
  .md-sidebar--primary .md-nav--primary > .md-nav__title[for="__drawer"] {
    display: none;
  }
}

/* Difficulté moyenne : cinq fois le même caractère ★, pleine, vide (grise) ou à moitié pleine */
.etoiles-moyenne { white-space: nowrap; }
.etoiles-moyenne .vide { color: var(--md-default-fg-color--lighter); }
.etoiles-moyenne .demi {
  background: linear-gradient(90deg, var(--md-typeset-color) 50%, var(--md-default-fg-color--lighter) 50%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
