/* Reset CSS minimal */
html {
  scroll-behavior: smooth;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Styles généraux */
body {
  font-family: "Work Sans", sans-serif;
  font-size: 14px;
  background-color: #fffef8;
  max-width: 1140px;
  margin: 43px auto 0 auto;
  padding: 0 20px;
  /* Ajout d'un padding latéral pour les petits écrans */
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 50px 0;
  flex-wrap: wrap;
  /* Permettre le wrapping des éléments sur petits écrans */
}

h1 {
  display: flex;
  flex-direction: column;
  font-family: "Syne", sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #b1663c;
}

h1 > span {
  font-family: "Work Sans", sans-serif;
  font-size: 10px;
  letter-spacing: 0.1em;
}

header a,
nav a {
  text-decoration: none;
  color: inherit;
}

nav ul {
  display: flex;
  align-items: center;
  list-style: none;
  flex-wrap: wrap;
  /* Permettre le wrapping des éléments du menu */
  margin-top: 10px;
  /* Espace entre le logo et le menu sur petits écrans */
}

nav li {
  padding: 0 10px;
  font-size: 1.2em;
}

nav li:hover {
  color: #b1663c;
}

li a img {
  width: 22px;
  border-radius: 3px;
}

/* Styles pour la section d'introduction */
#introduction {
  display: flex;
  align-items: center;
  margin-bottom: 5em;
  flex-wrap: wrap;
  /* Permettre le wrapping des éléments pour mobile */
}

#introduction figure {
  flex: 1 1 50%;
  /* Ajustement du flex pour s'adapter aux petits écrans */
  order: 1;
  /* Ordre par défaut */
}

#introduction img {
  display: block;
  margin: auto;
  width: 80%;
}

#introduction article {
  flex: 1 1 50%;
  /* Ajustement du flex pour s'adapter aux petits écrans */
  padding: 0 2em;
  display: flex;
  flex-direction: column;
  text-align: left;
  order: 2;
  /* Ordre par défaut */
}

h2 {
  margin-bottom: 1em;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 30px;
  color: #1d6154;
}

#introduction p {
  margin-bottom: 1em;
  line-height: 1.6;
  text-align: justify;
}

#introduction .button {
  display: inline-block;
  margin-top: 1em;
  padding: 0.5em 1em;
  color: white;
  background-color: #1d6154;
  border: none;
  border-radius: 60px;
  text-decoration: none;
  font-family: "Syne", sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  align-self: center;
}

#introduction .button:hover {
  background-color: #163d33;
}

/* Styles pour le bouton Gérer les projets */
.button.manage-button {
  display: inline-block;
  padding: 0.5em 1em;
  margin-bottom: 2em;
  color: white;
  background-color: #1d6154;
  border: none;
  border-radius: 60px;
  text-decoration: none;
  font-family: "Syne", sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.manage-button:hover {
  background-color: #163d33;
}

/* Styles pour la section header des projets */
.portfolio-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  /* Permettre le wrapping des éléments sur petits écrans */
}

/* Styles pour la section Projets */
#portfolio {
  margin: 50px 0;
}

#portfolio h2 {
  text-align: center;
  margin-bottom: 30px;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 30px;
  color: #1d6154;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  justify-content: center;
}

.project-item {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.project-item figure {
  margin: 0;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-item img {
  width: 100%;
  max-height: 450px;
  display: block;
  object-fit: cover;
}

.project-item figcaption {
  margin: 5px 0px;
  text-align: left;
  font-size: 13px;
  font-weight: 400;
  transition: color 0.3s ease;
}

.project-item figure:hover {
  transform: translateY(-10px);
}

.project-item figure:hover figcaption {
  color: #1d6154;
}

/* Styles pour la page de détail du projet */
#project-detail {
  margin: 50px 0;
  text-align: center;
}

#project-detail h2 {
  margin-bottom: 30px;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 30px;
  color: #1d6154;
}

.project-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.project-gallery img {
  width: 100%;
  max-width: 300px;
  height: auto;
  object-fit: cover;
}

#project-detail .button {
  display: inline-block;
  margin-top: 30px;
  padding: 0.5em 1em;
  color: white;
  background-color: #1d6154;
  border: none;
  border-radius: 60px;
  text-decoration: none;
  font-family: "Syne", sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

#project-detail .button:hover {
  background-color: #163d33;
}

/* Styles pour la section Contact */
#contact {
  width: 100%;
  max-width: 600px;
  margin: auto;
  text-align: center;
  margin-bottom: 50px;
  padding: 0 20px;
}

#contact h2 {
  margin-bottom: 20px;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 30px;
  color: #1d6154;
}

#contact p {
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 1.6;
}

#contact form {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#contact label {
  align-self: flex-start;
  margin: 1em 0 0.5em 0;
  font-weight: bold;
}

#contact input[type="text"],
#contact textarea {
  width: 100%;
  max-width: 100%;
  font-size: 1em;
  border: none;
  box-shadow: 0px 4px 14px rgba(0, 0, 0, 0.09);
  padding: 10px;
  margin-bottom: 10px;
}

#contact textarea {
  height: 150px;
  resize: none;
}

#contact .note {
  font-size: 0.9em;
  font-style: italic;
  margin-bottom: 20px;
}

#contact input[type="button"] {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  color: white;
  background-color: #1d6154;
  padding: 10px 40px;
  border-radius: 60px;
  border: none;
  cursor: pointer;
}

#contact input[type="button"]:hover {
  background-color: #163d33;
}

/* Styles du footer */
footer {
  background-color: white;
  margin-top: auto;
  padding: 2em;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  /* Permettre le wrapping sur petits écrans */
}

footer address {
  font-style: normal;
  line-height: 1.5;
  font-size: 1.2em;
}

footer address a {
  color: inherit;
  text-decoration: none;
}

footer nav ul {
  list-style: none;
}

footer nav ul li a {
  text-decoration: none;
  color: inherit;
}

footer nav ul li a:hover {
  color: #b1663c;
}

/* Responsivité */

/* Pour les écrans de taille moyenne (tablettes) */
@media (max-width: 1024px) {
  body {
    margin: 20px auto;
    padding: 0 20px;
  }

  header {
    margin: 30px 0;
  }

  #introduction {
    margin-bottom: 3em;
  }

  #introduction img {
    margin-bottom: 3em;
  }

  h2 {
    font-size: 26px;
  }

  #portfolio h2,
  #contact h2 {
    font-size: 28px;
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .project-item figcaption {
    font-size: 12px;
  }
}

/* Pour les petits écrans (mobiles) */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  nav ul {
    justify-content: center;
    width: 100%;
  }

  nav li {
    padding: 0 5px;
  }

  #introduction {
    flex-direction: column;
    text-align: center;
  }

  #introduction figure,
  #introduction article {
    flex: 1 1 100%;
    order: unset;
  }

  #introduction article {
    padding: 0;
  }

  #introduction img {
    width: 60%;
  }

  #introduction p {
    text-align: center;
  }

  .portfolio-header {
    flex-direction: column;
  }

  #portfolio h2 {
    font-size: 26px;
  }

  .gallery {
    grid-template-columns: 1fr 1fr;
  }

  #contact {
    width: 100%;
    padding: 0 10px;
  }

  #contact h2 {
    font-size: 26px;
  }

  footer {
    padding: 1em;
  }

  .footer-content {
    flex-direction: column;
    align-items: center;
  }

  footer nav ul {
    justify-content: center;
  }

  footer address {
    text-align: center;
  }
}

/* Pour les très petits écrans (petits mobiles) */
@media (max-width: 480px) {
  body {
    margin: 10px auto;
    padding: 0 10px;
  }

  h1 {
    font-size: 18px;
  }

  h1 > span {
    font-size: 8px;
  }

  nav li {
    font-size: 1em;
  }

  h2 {
    font-size: 24px;
  }

  #introduction img {
    width: 80%;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .project-item figcaption {
    font-size: 12px;
  }

  #contact h2 {
    font-size: 24px;
  }

  #contact p {
    font-size: 14px;
  }
}
