@charset "UTF-8";

:root {
  --theme-switch-base-width: 34px;
  --theme-switch-base-height: 17px;
  --theme-switch-base-indicator-dimension: 6px;
  --theme-switch-base-indicator-pos-offset: 4px;
  --theme-switch-base-indicator-translation: 16px;
  --theme-switch-division-factor: 1;
  --theme-switch-width: calc(var(--theme-switch-base-width)/var(--theme-switch-division-factor));
  --theme-switch-height: calc(var(--theme-switch-base-height)/var(--theme-switch-division-factor));
  --theme-switch-indicator-dimension: calc(var(--theme-switch-base-indicator-dimension)/var(--theme-switch-division-factor));
  --theme-switch-indicator-pos-offset: calc(var(--theme-switch-base-indicator-pos-offset)/var(--theme-switch-division-factor));
  --theme-switch-indicator-translation: calc(var(--theme-switch-base-indicator-translation)/var(--theme-switch-division-factor));
}

@keyframes fade_in_show {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.contact_banner {
  background-color: var(--surface-container-var);
  padding: 1vh 5vw;
  display: flex;
  justify-content: center;
  gap: 2vw;
  flex-wrap: wrap;
}

.contact_banner--info {
  display: flex;
  gap: 1vw;
  justify-content: center;
  font-size: var(--body-large-font-size);
  line-height: var(--body-large-line-height);
  align-items: center;
}

.contact_banner--svg {
  height: 3vh;
  aspect-ratio: 1;
  display: inline;
}

nav {
  background-color: var(--surface-container);
  display: flex;
  align-items: center;
  gap: 2vw;
  padding: 2vh 4vw;
  width: 100%;
  position: relative;
  z-index: 100;
}

#logo-nav-link img {
  height: auto;
  width: calc(2 * 4px + 2 * var(--theme-switch-height) + var(--theme-switch-width));
}

.outlined-button {
  padding: 1vh 2vw;
  border-radius: 100px;
  border: 2.5px solid black;
  width: fit-content;
  font-size: var(--headline-medium-font-size);
  line-height: var(--headline-medium-line-height);
}

.outlined-primary {
  background-color: var(--surface-container);
  border-color: var(--primary);
  color: var(--on-surface);
}


#nav-actions {
  display: flex;
  align-items: center;
  gap: 3vw;
  order: 2;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  background-color: var(--primary);
  color: var(--on-primary);
  font-size: var(--body-large-font-size);
  line-height: var(--body-large-line-height);
  font-weight: var(--bold-weight);
  padding: 0.75em 1.5em;
  border-radius: 999px;
  text-decoration: none;
}

#theme-switch-container {
  display: flex;
  gap: 4px;
  align-items: center;
}

#theme-switch-container svg {
  width: auto;
  height: var(--theme-switch-height);
}

.switch {
  position: relative;
  display: inline-block;
  width: var(--theme-switch-width);
  height: var(--theme-switch-height);
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--surface-container);
  transition: 0.4s;
  border: 2px solid var(--primary);
  border-radius: var(--theme-switch-height);
}

.slider:before {
  position: absolute;
  content: "";
  height: var(--theme-switch-indicator-dimension);
  width: var(--theme-switch-indicator-dimension);
  left: var(--theme-switch-indicator-pos-offset);
  bottom: var(--theme-switch-indicator-pos-offset);
  background-color: var(--primary);
  transition: 0.4s;
  border-radius: var(--theme-switch-indicator-dimension);
}

input:checked+.slider:before {
  transform: translateX(var(--theme-switch-indicator-translation));
}

/* ---------- Burger (mobile uniquement, < 768px) ---------- */

#burger-checkbox {
  display: none;
}

#burger-button {
  order: 3;
  position: absolute;
  right: 4vw;
}

#burger-button label {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 32px;
  height: 22px;
  cursor: pointer;
}

#burger-button label div {
  position: relative;
  width: 100%;
  height: 3px;
  background-color: var(--secondary);
  border-radius: 2px;
  transform-origin: 0;
  transition:
    0.3s ease transform,
    0.3s ease opacity,
    0.3s ease width;
}

#burger-button:has(#burger-checkbox:checked) label div:first-child {
  transform: rotateZ(45deg);
}

#burger-button:has(#burger-checkbox:checked) label div:nth-child(2) {
  transform: rotateZ(45deg);
  opacity: 0;
  width: 0;
}

#burger-button:has(#burger-checkbox:checked) label div:last-child {
  transform: rotateZ(-45deg);
}

/* ---------- Menu deroulant mobile (accordeon, en flux normal) ---------- */

#nav-links-container {
  display: none;
  order: 4;
  flex-basis: 100%;
  background-color: var(--surface-container-var);
  padding: 1vh 4vw 3vh;
  gap: 2vh;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  z-index: 101;
}

nav:has(#burger-checkbox:checked) #nav-links-container {
  display: flex;
  flex-direction: column;
  animation: fade_in_show 0.3s;
}

#nav-background-hovered {
  display: none;
}

.parent-menu-item {
  border-top: 1px solid var(--primary-container);
  padding-top: 1.5vh;
  display: flex;
  flex-direction: column;
  gap: 1vh;
}

.parent-menu-title {
  display: flex;
  gap: 0.5vh;
  justify-content: space-between;
  align-items: center;
}

.parent-menu-title a {
  font-size: var(--display-small-font-size);
  line-height: var(--display-small-line-height);
  font-weight: var(--bold-weight);
  color: var(--on-surface);
}

.menu-toggle {
  background: none;
  border: none;
  padding: 0.5rem;
  margin: -0.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
}

.menu-toggle svg {
  height: 18px;
  width: auto;
  transition: transform 0.2s ease;
}

.menu-toggle.is-open svg {
  transform: rotateZ(180deg);
}

.parent-description {
  font-size: var(--headline-large-font-size);
  line-height: var(--headline-large-line-height);
  color: var(--primary);
  font-weight: var(--bold-weight);
  padding-bottom: 2vh;
}

.sub-menu-item-container {
  display: none;
  flex-direction: column;
  gap: 2vh;
  padding: 1vh 0;
  animation: fade_in_show 0.4s;
}

.sub-menu-item-container.is-open {
  display: flex;
}

.sub-menu-item {
  display: flex;
  flex-direction: column;
  gap: 2vh;
}

.sub-nav {
  display: flex;
  flex-direction: column;
  gap: 1.5vh;
}

.sub-nav-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5vh;
}

.sub-nav-title a {
  font-size: var(--body-large-font-size);
  line-height: var(--body-large-line-height);
  font-weight: var(--bold-weight);
  color: var(--secondary);
}

.sub-nav ul {
  padding-left: 5vw;
  font-size: var(--body-large-font-size);
  line-height: var(--body-large-line-height);
  color: var(--on-surface-var);
}

.grandchild-menu-list {
  display: none;
  flex-direction: column;
  gap: 1vh;
  padding-left: 5vw;
  list-style: none;
}

.grandchild-menu-list.is-open {
  display: flex;
}

.grandchild-menu-item a {
  font-size: var(--body-large-font-size);
  line-height: var(--body-large-line-height);
  color: var(--on-surface-var);
}

.nav-badge {
  width: 120px;
}

/* ==================================================================== */
/* Tablette et desktop (>= 768px) : barre horizontale. Sous-menus encore */
/* au clic sur le chevron ici (le hover arrive au palier desktop suivant) */
/* ==================================================================== */

@media screen and (min-width: 768px) {
  :root {
    --theme-switch-division-factor: 0.75;
  }

  nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    justify-content: initial;
    padding: 2vh 2vw;
  }

  .contact_banner {
    justify-content: unset;
    padding: 1vh 2vw;
    flex-direction: row;
    gap: 4vw;
  }

  .contact_banner--info {
    gap: .5vw;
  }

  #logo-nav-link img {
    height: 8vh;
    width: auto;
  }

  #nav-actions {
    order: initial;
    justify-self: end;
  }

  .parent-menu-item {
    border: none;
    padding-top: 0;
    position: relative;
  }

  .parent-menu-title a {
    font-size: var(--headline-medium-font-size);
    line-height: var(--headline-medium-line-height);
    font-weight: normal;
  }

  /*
     * Le chevron reste visible et cliquable ici : sur tablette, l'ouverture
     * des sous-menus se fait au clic (comme en mobile), pas au hover.
     * Il est masque uniquement a partir du breakpoint desktop plus bas.
     */

  .sub-menu-item-container {
    display: none;
    padding: 2vh 1vw;
    top: 100%;
    left: 0;
    right: 0;
    border-radius: 4px;
    background-color: var(--surface-container-var);
    z-index: 2;
    animation: fade_in_show 0.7s ease forwards;
  }

  .parent-menu-item:first-child .sub-menu-item-container {
    width: 100%;
  }

  .sub-menu-item {
    display: flex;
  }

  .sub-nav ul {
    padding-left: 2vw;
  }

  .sub-nav-title a {
    white-space: nowrap;
    display: inline;
    width: fit-content;
  }

  .grandchild-menu-list {
    position: static;
    padding-left: 0;
    margin-top: 1vh;
  }

  .nav-badge {
    align-self: center;
    width: 175px;
  }
}

/* ==================================================================== */
/* Desktop (>= 1024px, --bp-lg) : sous-menus au survol / focus clavier   */
/* ==================================================================== */

@media screen and (min-width: 1024px) {
  :root {
    --theme-switch-division-factor: 0.5625;
  }

  #burger-button {
    display: none;
  }

  #nav-links-container {
    display: flex;
    position: relative;
    order: initial;
    flex-basis: auto;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    padding: 0;
    flex-wrap: wrap;
    top: unset;
    left: unset;
    gap: 2vw;
    row-gap: 1vh;
  }

  /* Le hover remplace le clic : le chevron n'a plus de role, on le masque. */
  .menu-toggle {
    display: none;
  }

  .sub-menu-item-container:hover,
  .parent-menu-item:hover>.sub-menu-item-container,
  .parent-menu-item:focus-within>.sub-menu-item-container {
    display: flex;
  }

  /* Sous-sous-menu (ex : BAC+3 > Page parcours) : meme logique de hover. */
  .grandchild-menu-item:hover,
  .sub-nav:hover .grandchild-menu-list,
  .sub-nav:focus-within .grandchild-menu-list {
    display: flex;
  }

  .sub-menu-item-container {
    position: absolute;
  }

  .parent-menu-item:first-child .sub-menu-item-container {
    width: 300%;
  }

  .parent-menu-item:nth-child(2) .sub-menu-item-container {
    width: 200%;
  }

  .outlined-primary:hover {
    background-color: var(--primary-container);
    color: var(--on-primary-container);
  }

  .nav_contact--wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
  }
}