/***************************** Hebergements And Populaires ******************************/

.hebergements-and-populaires {
  display: flex;
  justify-content: space-between;

  @media (max-width: 1024px) {
    flex-direction: column;
  }

  @media (max-width: 767.98px) {
    flex-direction: column-reverse;
  }

  section {
    background-color: var(--main-bg-color);
    border-radius: 20px;
    padding: 30px;
    box-sizing: border-box;

    @media (max-width: 767.98px) {
      border-radius: 0px;
      padding: 30px 20px;
    }
  }

  /* === Hebergements === */
  .hebergements {
    width: 65%;

    @media (max-width: 1024px) {
      width: 100%;
    }

    @media (max-width: 767.98px) {
      background-color: var(--white);
      margin-top: 10px;
    }

    .hebergements-cards {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: clamp(10px, 2vw, 33px);
      margin-top: 33px;

      @media (max-width: 767.98px) {
        grid-template-columns: 1fr;
        margin-top: 20px;
        gap: 20px;
      }

      .card {
        /* Pour que leur taille ne s'agrandisse pas en responsive */
        height: 190px;
        display: flex;
        flex-direction: column;

        img {
          /* ==== Pour que l'image ne déborde pas en responsive et s'adapte à l'espace réservé ==== */
          max-height: calc(100% - 70px);
          /* Hauteur limitée pour réserver 70px au card-content */
          flex: 1;
          /* Occupe tout l'espace disponible */
          min-height: 0;
          /* Permet le rétrécissement en responsive */
          width: 100%;
          height: 100%;
          border-radius: 15px 15px 0px 0px;
        }

        .card-content {
          height: 70px;
          padding-left: 10px;
          display: flex;
          flex-direction: column;
          justify-content: space-around;

          .card-title {
            line-height: 0.9;
            /* Pour que le titre ne soit pas trop haut en responsive quand il passe à la ligne*/
            margin: 5px 0;
          }
        }
      }
    }

    /* === Afficher plus === */
    .hebergements-display-more {
      margin-top: 33px;
      transition: all 0.1s ease-in-out;

      @media (max-width: 767.98px) {
        margin-top: 20px;
      }

      &:hover {
        color: var(--main-color);
        cursor: pointer;
      }
    }
  }
}

/* === Populaires === */
.populaires {
  width: 32%;

  @media (max-width: 1024px) {
    width: 100%;
    margin-top: 50px;
  }

  @media (max-width: 767.98px) {
    margin-top: 0px;
  }

  .populaires-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .populaires-cards {
    @media (max-width: 1024px) {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
    }

    @media (max-width: 767.98px) {
      flex-direction: column;
    }

    a {
      @media (max-width: 1024px) {
        width: 32%;
      }

      @media (max-width: 767.98px) {
        width: 100%;
      }

      .card {
        display: flex;
        margin-top: 33px;
        height: 136px;

        @media (max-width: 767.98px) {
          margin-top: 20px;
        }

        img {
          /* Largeur uniforme pour toutes les populaires-cards et toutes les tailles d'écran : */
          width: 33%;
          min-width: 120px;
          flex-shrink: 0;
          /* Pour ne pas que la figure rétrécisse en responsive, même si le contenu est plus petit */
          height: 100%;
          /* J'ai mis border-radius à 15px pour que l'image suive mieux les bords (avant 20px) */
          border-top-left-radius: 15px;
          border-bottom-left-radius: 15px;

          @media (max-width: 1024px) {
            min-width: 90px;
          }
        }

        .card-content {
          padding: 0px 10px;
          display: flex;
          flex-direction: column;
          justify-content: space-between;
          flex: 1;
          /* Pour occuper tout l'espace restant */
          box-sizing: border-box;

          .card-title {
            margin-top: 10px;
            margin-bottom: 4px;
            line-height: 1.1;

            @media (max-width: 767.98px) {
              margin: 10px 0px;
            }
          }

          .card-subtitle {
            margin: 0;

            @media (max-width: 1024px) {
              font-size: 13px;
            }
          }

          .card-rating {
            margin-bottom: 5px;
            white-space: nowrap;

            @media (max-width: 1024px) {
              font-size: 15px;
            }
          }
        }
      }
    }
  }
}


/* CSS classique, pour le validator W3, car il ne comprends pas le nesting === checked */

/* .hebergements-and-populaires {
    display: flex;
    justify-content: space-between;
  }
  
  @media (max-width: 1024px) {
    .hebergements-and-populaires {
      flex-direction: column;
    }
  }
  
  @media (max-width: 767.98px) {
    .hebergements-and-populaires {
      flex-direction: column-reverse;
    }
  }
  
  .hebergements-and-populaires section {
    background-color: var(--main-bg-color);
    border-radius: 20px;
    padding: 30px;
    box-sizing: border-box;
  }
  
  @media (max-width: 767.98px) {
    .hebergements-and-populaires section {
      border-radius: 0px;
      padding: 30px 20px;
    }
  }
  
  .hebergements {
    width: 65%;
  }
  
  @media (max-width: 1024px) {
    .hebergements {
      width: 100%;
    }
  }
  
  @media (max-width: 767.98px) {
    .hebergements {
      background-color: var(--white);
      margin-top: 10px;
    }
  }
  
  .hebergements-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(10px, 2vw, 33px);
    margin-top: 33px;
  }
  
  @media (max-width: 767.98px) {
    .hebergements-cards {
      grid-template-columns: 1fr;
      margin-top: 20px;
      gap: 20px;
    }
  }
  
  .hebergements-cards .card {
    height: 190px;
    display: flex;
    flex-direction: column;
  }
  
  .hebergements-cards .card img {
    max-height: calc(100% - 70px);
    flex: 1;
    min-height: 0;
    width: 100%;
    height: 100%;
    border-radius: 15px 15px 0px 0px;
  }
  
  .hebergements-cards .card-content {
    height: 70px;
    padding-left: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
  }
  
  .hebergements-cards .card-content .card-title {
    line-height: 0.9;
    margin: 5px 0;
  }
  
  .hebergements-display-more {
    margin-top: 33px;
    transition: all 0.1s ease-in-out;
  }
  
  @media (max-width: 767.98px) {
    .hebergements-display-more {
      margin-top: 20px;
    }
  }
  
  .hebergements-display-more:hover {
    color: var(--main-color);
    cursor: pointer;
  }
  
  .populaires {
    width: 32%;
  }
  
  @media (max-width: 1024px) {
    .populaires {
      width: 100%;
      margin-top: 50px;
    }
  }
  
  @media (max-width: 767.98px) {
    .populaires {
      margin-top: 0px;
    }
  }
  
  .populaires-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  @media (max-width: 1024px) {
    .populaires-cards {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
    }
  }
  
  @media (max-width: 767.98px) {
    .populaires-cards {
      flex-direction: column;
    }
  }
  
  @media (max-width: 1024px) {
    .populaires-cards a {
      width: 32%;
    }
  }
  
  @media (max-width: 767.98px) {
    .populaires-cards a {
      width: 100%;
    }
  }
  
  .populaires-cards .card {
    display: flex;
    margin-top: 33px;
    height: 136px;
  }
  
  @media (max-width: 767.98px) {
    .populaires-cards .card {
      margin-top: 20px;
    }
  }
  
  .populaires-cards .card img {
    width: 33%;
    min-width: 120px;
    flex-shrink: 0;
    height: 100%;
    border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
  }
  
  @media (max-width: 1024px) {
    .populaires-cards .card img {
      min-width: 90px;
    }
  }
  
  .populaires-cards .card-content {
    flex: 1;
    padding: 0px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
  }
  
  .populaires-cards .card-content .card-title {
    margin-top: 10px;
    margin-bottom: 4px;
    line-height: 1.1;
  }

  @media (max-width: 767.98px) {
    .populaires-cards .card-content .card-title {
      margin: 10px 0px;
    }
  }
  
  .populaires-cards .card-content .card-subtitle {
    margin: 0;
  }
  
  @media (max-width: 1024px) {
    .populaires-cards .card-content .card-subtitle {
      font-size: 13px;
    }
  }
  
  .populaires-cards .card-content .card-rating {
    margin-bottom: 5px;
    white-space: nowrap;
  }
  
  @media (max-width: 1024px) {
    .populaires-cards .card-content .card-rating {
      font-size: 15px;
    }
  } */