@charset "UTF-8";
.fr-header .fr-header__menu-links .dsfr-doc-version {
  margin-left: -.5rem;
  margin-right: -.5rem;

  &__btn {
    padding-left: .5rem;
    padding-right: .5rem;
  }
}

.dsfr-doc-version {
  --rows: 8;
  position: relative;
}

.dsfr-doc-version .dsfr-doc-version__btn {
  font-size: 1rem;
  line-height: 1.5rem;
  padding: 0.5rem 1rem;
  overflow: initial;
  max-width: 100%;
  max-height: none;
  font-weight: 500;
  min-height: 3rem;
  width: 100%;
}

.dsfr-doc-version .dsfr-doc-version__btn::before {
  --icon-size: 1rem;
  margin-left: -0.125rem;
  margin-right: 0.5rem;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: calc((0.75em - var(--icon-size)) * 0.5);
  background-color: currentColor;
  width: var(--icon-size);
  height: var(--icon-size);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-image: url("../static/icons/code-s-slash-line.svg");
  mask-image: url("../static/icons/code-s-slash-line.svg");
  content: "";
}

.dsfr-doc-version .dsfr-doc-version__btn::after {
  transition: transform 0.3s;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: calc((0.75em - var(--icon-size)) * 0.5);
  background-color: currentColor;
  width: var(--icon-size);
  height: var(--icon-size);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-image: url("../dist/icons/arrows/arrow-down-s-line.svg");
  mask-image: url("../dist/icons/arrows/arrow-down-s-line.svg");
  --icon-size: 1rem;
  content: "";
  margin-left: auto;
}

.dsfr-doc-version .dsfr-doc-version__btn[aria-expanded=true]::after {
  transform: rotate(-180deg);
}

.dsfr-doc-version__version {
  white-space: nowrap;
}

// Hide the current version in the mobile menu while there is only one version available
// .dsfr-doc-version__version[aria-current]:not([aria-current=false]) {
//   display: none;
// }

.dsfr-doc-version__menu {
  margin: 0;
}

.dsfr-doc-version .fr-nav__item::before {
  content: none;
}

.dsfr-doc-version .fr-menu__list {
  width: auto;
  padding: 0;
}

.dsfr-doc-version .dsfr-doc-version__btn[aria-expanded=true] {
  color: var(--text-active-blue-france);
  background-color: var(--background-open-blue-france);

  --idle: transparent;
  --hover: var(--background-open-blue-france-hover);
  --active: var(--background-open-blue-france-active);
}

.dsfr-doc-version .dsfr-doc-version__btn[aria-expanded=true]:hover {
  background-color: var(--hover-tint);
}

.dsfr-doc-version .dsfr-doc-version__btn[aria-expanded=true]:active {
  background-color: var(--active-tint);
}

.dsfr-doc-version__menu .dsfr-doc-version__version {
  box-shadow: none;
}

@media (min-width: 62em) {
  .dsfr-doc-version .dsfr-doc-version__btn {
    min-height: auto;
    width: auto;
    font-size: 0.875rem;
    line-height: 1.5rem;
    padding: 0.25rem 0.75rem;
  }

  .dsfr-doc-version .dsfr-doc-version__btn::after {
    margin-left: 0.25rem;
    margin-right: -0.25rem;
  }

  .dsfr-doc-version .dsfr-doc-version__btn::before {
    --icon-size: 1rem;
  }

  .dsfr-doc-version__version[aria-current]:not([aria-current=false]) {
    display: inline-flex;
  }

  .dsfr-doc-version__menu {
    margin: -0.25rem -1rem 0;
  }

  .dsfr-doc-version .fr-menu__list {
    display: grid;
    grid-template-rows: repeat(var(--rows), auto);
    grid-auto-flow: column;
  }

  .fr-btns-group .dsfr-doc-version__menu {
    margin: -1.25rem -0.75rem 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dsfr-doc-version .dsfr-doc-version__btn::after {
    transition: none;
  }

  .dsfr-doc-version__menu {
    transition: none;
  }
}
