/*reset.css*/

/* Utiliser border-box partout */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Supprimer uniquement la marge extérieure de la page */
body {
  min-height: 100vh;
  margin: 0;
  line-height: 1.5;
  font-family: Arial, Helvetica, sans-serif;
}

/* Empêcher les médias de dépasser leur conteneur */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* Utiliser la même police que le reste de la page */
button,
input,
textarea,
select {
  font: inherit;
}

/* Autoriser seulement le redimensionnement vertical */
textarea {
  resize: vertical;
}

/*end reset.css*/

/* Base styles for mobile */
.container {
  width: 100%;
  padding: 10px;
  position: relative;
}

#navbar {
  box-sizing: border-box;
  width: min(100% - 2rem, 61vw);
  height: 100dvh;
  inset: 0 0 0 auto;
  margin: 0;
  border: 0;

  /* État fermé */
  opacity: 0;
  transform: translateX(100%);
  transition:
    transform 0.2s ease-out,
    opacity 0.2s ease-out,
    display 0.2s allow-discrete,
    overlay 0.2s allow-discrete;
}

/* État ouvert */
#navbar:popover-open {
  opacity: 1;
  transform: translateX(0);
}

/* Point de départ de l’animation d’ouverture */
@starting-style {
  #navbar:popover-open {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Assombrissement de la page */
#navbar::backdrop {
  background: rgb(0 0 0 / 0.35);
}

/* close-button */
.close-button {
  appearance: none;

  min-width: 124px;
  min-height: 48px;
  padding: 0 18px;
  margin-bottom: 14px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;

  border: 2px solid #6047ff;
  border-radius: 12px;

  background-color: #fff;
  color: #6047ff;

  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  line-height: 1;

  cursor: pointer;
}

.close-icon {
  position: relative;

  width: 20px;
  height: 20px;

  flex-shrink: 0;
}

.close-icon::before,
.close-icon::after {
  content: "";

  position: absolute;
  top: 50%;
  left: 50%;

  width: 24px;
  height: 2px;

  border-radius: 999px;
  background-color: currentColor;
}

.close-icon::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.close-icon::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.close-button:active {
  background-color: #6047ff;
  color: #ffffff;

  transform: scale(0.97);

  box-shadow: 0 4px 10px rgba(96, 71, 255, 0.2);
}

.close-button:focus-visible {
  outline: 3px solid rgba(96, 71, 255, 0.3);
  outline-offset: 3px;
}

/* mobile navigation  */

.mobile-nav {
  display: flex;
  justify-items: center;
  flex-wrap: wrap;
  position: sticky;
  top: 5px;
}

.mobile-nav .logo {
  width: 50px;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
}

#nav-btn {
  margin-left: auto;

  /* Reset du bouton */
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.8);
  cursor: pointer;

  /* Dimensions */
  width: 150px;
  min-height: 55px;
  padding-inline: 1rem;

  /* Placement du contenu */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;

  /* Apparence */
  border-radius: 35px;
  background: linear-gradient(145deg, #ffffff 0%, #f7f6fd 100%);
  color: #6b52f3;

  /* Texte */
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -1px;

  /* Ombre Soft UI */
  box-shadow:
    0 14px 28px rgba(91, 69, 224, 0.2),
    -8px -8px 20px rgba(255, 255, 255, 0.95);

  transition:
    transform 200ms ease,
    box-shadow 200ms ease,
    background 200ms ease;
}

#navbar h1 {
    padding-left: .5rem;
    font-size: 1.1rem;
}
#navbar ul {
    padding-left: .5rem;
}
#navbar li:has(.nav-link) {
  list-style: none;
  margin-top: 0.5em;
  padding-top: .5em;
  border-top: 2px solid gray;
}


#navbar .nav-link {
  text-decoration: none;
  color: #6b52f3;
}

#navbar .nav-link:hover {
  color: #4a3bc9;
  text-decoration: underline;
}

/* main content */

#main-doc pre:has(code) {
    background-color: #F7F7F7;
    padding: 1rem;
    border-radius: 8px;
}

code {
  font-family: monospace;
}



/* Styles for larger screens */
@media screen and (min-width: 768px) {
  body {
    font-size: 1.2rem;
  }

  .container {
    width: 750px;
    margin: 0 auto;
    padding: 20px;

    display: flex;
    gap: 1.5rem;
    
  }

  .container .mobile-nav, 
  #navbar .close-button {
    display: none;
  }

  .container::before {
    content: "";
    display: block;
    min-width: 280px;
    flex: auto;
  }
  
  #navbar {
    all: unset;
    border-right: 3px solid gray;
    height: 100vh;
    position: fixed;
    top: 0
  }

   #navbar h1 {
    font-size: 1.5rem;
   }
   #navbar ul {
    padding-inline: .5rem;
   }
}

@media screen and (min-width: 1024px) {
  .container {
    width: 960px;
    gap: 2rem
  }
}
