/* HEADER  */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  width: 100%;
  padding: 20px;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-subtext {
  font-size: 1.2rem;
  font-weight: 200;
}

.dropdown-container {
  width: 100%;
}

nav {
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

nav a {
  font-size: 1.5rem;
  font-weight: 200;
  transition: all 0.3s ease;
  position: relative;
  text-align: center;
}

.current-page {
  font-weight: 500;
}

.current-page::after {
  content: "";
  position: absolute;
  display: inline-block;
  left: 0px;
  width: 100%;
  height: 4px;
  background-color: var(--tertiary-color);
  transform: scaleX(1);
}

/* EFFETS DE TRANSITION LIENS NAV  */
nav a:hover {
  font-weight: 500;
  transition: all 0.3s ease;
}

nav a::before {
  /* texte plus gras invisible pour éviter le décalage au hover */
  content: attr(data-text);
  font-weight: 500;
  visibility: hidden;
  height: 0;
  overflow: hidden;
  display: block;
}

nav a:hover::after {
  transform: scaleX(1);
}

nav a::after {
  /* Insertion d'une bordure colorée */
  content: "";
  position: absolute;
  display: inline-block;
  left: 0px;
  bottom: -5px;
  width: 100%;
  height: 4px;
  background-color: var(--tertiary-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

/* LAYOUT TELEPHONE ET TABLETTE */
@media (max-width: 1050px) {
  /* MENU  */
  h1 {
    font-size: 1.5rem;
    text-align: center;
    max-width: fit-content;
  }

  .logo-subtext {
    font-size: 1rem;
  }

  nav {
    position: absolute;
    left: 50%;
    transform-origin: top center;
    transform: translateX(-50%) scaleY(0);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s ease, opacity 0.25s ease;
    width: calc(100% - 2rem);
    margin-top: 60px;
    width: 100%;
    padding-bottom: 4rem;
    background: var(--secondary-color);
    height: 100vh;
    z-index: 10;

    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    will-change: transform, opacity;
  }

  nav.visible {
    transform: translateX(-50%) scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }

  header {
    padding: 10px 15px;
    padding-bottom: 0;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
  }

  .menu-toggle {
    display: block;
  }

  .dropdown-container {
    display: flex;
    justify-content: end;
  }

  /* RETIRER LES EFFETS HOVER POUR EVITER LES CONFLITS */
  .nav a::after,
  .nav a::before {
    content: none;
    opacity: 0;
  }
}
