/* Header */
header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 0; 
}


header h1 {
  text-align: center;
  margin-top: 15px;
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 1.8rem;
  font-family: var(--ff-text);
}



/* Boutons de liste */
.list-buttons {
  display: flex;
  gap: 1rem;
}

.list-buttons button,
.list-buttons a {
  padding: 0.5rem 1rem;
  background-color: transparent;
  color: black;
  border: none;
  border-radius: 5px;
  font-family: var(--ff-text);
  font-size: 1.15rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.list-buttons button:hover,
.list-buttons a:hover,
.list-buttons button.active,
.list-buttons a.active {
  text-decoration: underline;
}

hr {
  width: 60%;
  margin: 1rem 0;
  border: 1px solid #000;
}

/* Main */
main {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

main .infos-title {
  margin: 5rem 20rem 2rem 20rem;
  font-family: var(--ff-main);
}

main .infos-title h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  font-weight: bold;
}

main .infos-title i {
  color: #696969;
  font-style: italic;
}

/* Liste des recettes */
.list-top-recipes {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin: 1rem 10rem;
}

.list-top-recipes > div {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
}

.list-top-recipes h2 {
  font-size: 4rem;
  font-family: var(--ff-text);
}

/* Carte recette */
.list-top-recipes div .recipe {
  display: flex;
  width: 80%;
  height: 200px;
  background-color: #f5f2e8;
  border-top-left-radius: 20px;
  border-bottom-left-radius: 20px;
  box-shadow: 0 5px 5px rgba(0, 0, 0, 0.25);
  overflow-y: hidden;
}

.list-top-recipes .recipe a {
  color: black;
}

.list-top-recipes .recipe img {
  width: 500px;
  height: 200px;
  margin-right: 2rem;
  border-top-left-radius: 20px;
  border-bottom-left-radius: 20px;
  object-fit: cover;
}

.list-top-recipes div .recipe .infos-recipe {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 60%;
  padding: 36px 20px;
}

/* Menu recette */
.recipe-name-menu {
  display: flex;
  justify-content: space-between;
  gap: 10rem;
}

.recipe-name-menu h3 {
  font-size: 1.4rem;
  font-family: var(--ff-main);
  font-weight: bold;
}

.recipe-name-menu button {
  background-color: transparent;
  border: none;
}

.recipe-name-menu button i {
  font-size: 2rem;
  cursor: pointer;
}

.list-top-recipes div .submenu-recipe {
  position: absolute;
  right: 0;
  z-index: 999;
  display: none;
  flex-direction: column;
}

/* Infos recette */
.infos-recipe .more-infos-recipe {
  margin-top: 20px;
  font-size: 1rem;
  font-family: var(--ff-text);
}

.more-infos-recipe .like {
  position: absolute;
  right: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  font-size: 1.5rem;
}

/* Lien voir plus */
a.see-more {
  margin: 1.2rem auto 3rem auto;
  color: black;
  font-size: 1.2rem;
  text-decoration: underline;
}

/* Propositions */
.propositions {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 1rem;
  padding: 5rem 10rem;
  background-color: var(--color-yellow);
  font-family: var(--ff-text);
  height: 720px;
}

.propositions h1 {
  margin-left: 0;
  margin-bottom: 3rem;
}

button.other-proposition {
  width: 300px;
  margin: 30px auto;
  padding: 18px 20px;
  background-color: var(--color-black);
  color: white;
  border: none;
  border-radius: 5px;
  font-family: var(--ff-text);
  font-size: 1.06rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

button.other-proposition:hover {
  background-color: white;
  color: black;
  border: 2px solid black;
}

/* ================= RESPONSIVE COMPLET ================= */
@media (max-width: 1450px) {
  .list-top-recipes .recipe h3 {
    font-size: 1.2rem;
  }
}

@media (max-width: 1390px) {
  .recipe-name-menu {
    font-size: 1.2rem;
  }

  .list-top-recipes .recipe p {
    font-size: 1rem;
  }
}

@media (max-width: 1310px) {
  .more-infos-recipe .like {
    bottom: 20px;
  }
}

@media (max-width: 1260px) {
  .list-top-recipes {
    margin: 0;
  }

  .list-top-recipes .recipe h3 {
    font-size: 1.2rem;
    text-overflow: ellipsis;
    min-width: 200px;
    white-space: nowrap;       
    overflow: hidden;          
    text-overflow: ellipsis;  
  }

  .list-top-recipes .recipe p {
    font-size: 1rem;
  }
}

/* ---------------- Tablettes / écrans moyens ---------------- */
@media (max-width: 1024px) {
  /* Header */
  header h1 {
    font-size: 1.5rem;
  }

  .list-buttons {
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
  }

  .list-buttons button,
  .list-buttons a {
    font-size: 1rem;
    padding: 0.4rem 0.8rem;
  }

  hr {
    width: 80%;
  }

  /* Infos title */
  main .infos-title {
    margin: 3rem 5rem 2rem 5rem;
  }

  /* Liste des recettes */
  .list-top-recipes {
    margin: 1rem 3rem;
    gap: 2rem;
  }

  .list-top-recipes h2 {
    text-align: left;
  }

  .list-top-recipes > div {
    text-align: left;
    flex-direction: column;
    gap: 2rem;
  }

  .list-top-recipes div .recipe {
    width: 60%;
    flex-direction: column;
    height: auto;
  }

  .list-top-recipes div .recipe img {
    width: 100%;
    height: auto;
    margin: 0 0 1rem 0;
    border-radius: 20px 20px 0 0;
  }

  .list-top-recipes div .recipe .infos-recipe {
    width: 100%;
    padding: 20px;
  }

  .recipe-name-menu {
    /* flex-direction: column; */
    gap: 1rem;
    /* justify-content: center; */
    align-items: center;
  }

  /* Propositions */
  .propositions {
    padding: 3rem 3rem;
    height: auto;
  }

  button.other-proposition {
    width: 250px;
    font-size: 1rem;
    padding: 14px 18px;
  }
}

/* ---------------- Petits écrans / tablettes compactes ---------------- */
@media (max-width: 768px) {

  a, button {
    min-width: 0;
  }

  header h1 {
    font-size: 1.3rem;
  }

  .list-buttons {
    gap: 0.5rem;
    display: flex;
    justify-content: left;
    flex-direction: column;
    text-align: left;
    margin: 0;
    width: 100%;
    padding-left: 80px;
  }

  main .infos-title {
    margin: 2rem 2rem 1rem 2rem;
    text-align: center;
  }

  .list-top-recipes {
    margin: 1rem 1.5rem;
    gap: 1.5rem;
  }

  .list-top-recipes h2 {
    font-size: 2rem;
  }

  .list-top-recipes div .recipe img {
    height: auto;
  }

  .list-top-recipes div .recipe .infos-recipe {
    padding: 15px;
  }

  .recipe-name-menu h3 {
    font-size: 1.2rem;
  }

  .recipe-name-menu button i {
    font-size: 1.5rem;
  }

  .propositions {
    padding: 2rem 2rem;
  }

  button.other-proposition {
    width: 90%;
    margin: 15px auto;
  }

  .infos-recipe .more-infos-recipe {
    display: none;
  }
}

/* ---------------- Très petits écrans / mobiles ---------------- */
@media (max-width: 480px) {
  a, button {
    min-width: 0;
  }

  /* Header */
  header {
    gap: 0.5rem;
  }

  header h1 {
    font-size: 1.1rem;
  }

  .list-buttons {
    /* flex-direction: column; */
    gap: 0.5rem;
  }

  .list-buttons button,
  .list-buttons a {
    font-size: 0.95rem;
    padding: 0.3rem 0.6rem;
  }

  hr {
    width: 90%;
  }

  /* Infos title */
  main .infos-title {
    margin: 1.5rem 1rem 1rem 1rem;
  }

  main .infos-title h2 {
    font-size: 1.5rem;
  }

  main .infos-title i {
    font-size: 0.9rem;
  }

  /* Liste des recettes */
  .list-top-recipes {
    margin: 1rem 1rem;
    gap: 1rem;
  }

  .list-top-recipes h2 {
    font-size: 1.8rem;
  }

  .list-top-recipes > div {
    gap: 1rem;
  }

  .list-top-recipes div .recipe {
    flex-direction: column;
    width: 100%;
    height: auto;
  }

  .list-top-recipes div .recipe img {
    width: 100%;
    height: auto;
    margin-bottom: 0.5rem;
  }

  .list-top-recipes div .recipe .infos-recipe {
    padding: 12px;
  }

  .recipe-name-menu {
    /* flex-direction: column; */
    gap: 0.5rem;
  }

  .recipe-name-menu h3 {
    font-size: 1rem;
  }

  .recipe-name-menu button i {
    font-size: 1.3rem;
  }

  .more-infos-recipe {
    font-size: 0.9rem;
  }

  /* Propositions */
  .propositions {
    padding: 1.5rem 1rem;
    height: auto;
  }

  .propositions h1 {
    font-size: 1.3rem;
  }

  button.other-proposition {
    width: 95%;
    font-size: 0.95rem;
    padding: 12px 14px;
  }

  /* Submenu recette */
  .submenu-recipe {
    min-width: 120px;
  }

  /* Cards recommended */
  .card-recipe img {
    width: 100%;
    height: auto;
  }

  .card-recipe .content-recipe h1 {
    font-size: 1rem;
  }

  .card-recipe button i {
    font-size: 1.3rem;
  }
}
