/* =========================================================
   Projet : Booki – Intégration Responsive
   Auteur : Stéphane ARRAMI
   Structure : Citywizz Communications
   Rôle : Intégration HTML / CSS (sans framework)

   Description :
   Intégration de la maquette Figma Booki en respectant
   les contraintes OpenClassrooms :
   - HTML sémantique
   - CSS pur (Flexbox, sans framework)
   - Responsive Desktop / Tablette / Mobile
   - Approche Desktop First
   - Breakpoints principaux : 1024px et 768px
   - Respect du design system fourni

   Outils utilisés :
   - VS Code
   - Figma
   - Chrome DevTools
   - FontAwesome

   Date : 2024 - Mise à jour en février 2026
   ========================================================= */

/****** General ***********/
*,
::before,
::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

* {
  font-family: "Raleway", sans-serif;
}

:root {
  --main-color: #0065fc;
  --main-bg-color: #f2f2f2;
  --filter-bg-color: #deebff;
  --white: #ffffff;
  --black: #000000;
  --grey: #d9d9d9;
  --font-size-small: 1rem; /* 16px */
  --font-size-medium: 1.125rem; /* 18px */
}

body {
  display: flex;
  justify-content: center;
}

.main-container {
  width: 100%;
  max-width: 1440px;
  padding: 0 50px;
  box-sizing: border-box;
}

a {
  text-decoration: none;
  color: var(--black);
}

img {
  max-width: 100%;
  height: auto;
}

li {
  list-style-type: none;
}

.section-title {
  margin: 0;
  font-size: 22px;
}

.euro {
  font-weight: 700;
}

/****** Icônes ***********/

.fa-solid {
  color: var(--main-color);
}

.fa-star {
  color: var(--main-color);
}

.neutral-star {
  color: var(--main-bg-color);
}

/****** Cards ***********/

.card {
  background-color: var(--white);
  border-radius: 20px;
  padding: 5px;
  filter: drop-shadow(0px 3px 15px rgba(0, 0, 0, 0.1));
}

.card img {
  object-fit: cover;
}

.card-title {
  font-size: 16px;
}

/****** Header ***********/

.site-header {
  display: flex;
  justify-content: space-between;
}

.site-header img {
  width: 60px;
  height: auto;
  margin: 30px 0;
}

.header-links {
  display: flex;
  padding: 0 25px;
  align-items: center;
  gap: 68px;
  cursor: pointer;
}

.links {
  padding-top: 14px;
  border-top: 2px solid transparent;
}

.links:hover {
  border-top-color: var(--main-color);
}

.links:hover a,
.links a:hover {
  color: var(--main-color);
}

/****** Info group ***********/

.info-group {
  padding: 0 20px 35px 0;
  display: flex;
  flex-direction: column;
  gap: 35px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
}

/* Masqué visuellement mais accessible aux lecteurs d'écran */
.visually-hidden {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
}

/****** Barre de recherche ***********/

.search-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  border-radius: 15px;
  height: 50px;
  max-width: 400px;
  background: var(--white);
  overflow: hidden;
}

/* Icône location en noir */
.location .fa-solid {
  color: var(--black);
}

.location {
  background-color: var(--main-bg-color);
  border-radius: 15px 0 0 15px;
  padding: 15px 16px;
  height: 50px;
}

.destination {
  flex-grow: 1;
  height: 50px;
}

.destination input {
  padding: 18px;
  width: 100%;
  height: 100%;
  border: none;
  border-top: 1px solid var(--main-bg-color);
  border-bottom: 1px solid var(--main-bg-color);
  font-size: 18px;
  font-weight: 700;
  color: var(--black);
  outline: none;
}

#search_input::placeholder {
  color: var(--black);
  opacity: 1;
}

/* Masquer la loupe sur desktop */
.search-bar .mobile-only {
  display: none;
}

.button-research {
  display: flex;
  height: 50px;
}

.button-research button {
  flex-shrink: 0;
  padding: 15px 16px;
  height: 100%;
  border: none;
  background-color: var(--main-color);
  color: var(--white);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 0 15px 15px 0;
}

.fa-magnifying-glass {
  color: var(--white);
}

/****** Barre de filtres ***********/

.filter-bar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.filter-bar h2 {
  font-size: 18px;
  font-weight: 700;
}

.filter-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px;
}

.button-filter {
  display: flex;
  flex-direction: row;
  align-items: center;
  background-color: var(--white);
  border-radius: 25px;
  border: 2px solid var(--grey);
  padding: 4px 20px;
  font-weight: 900;
  font-size: 14px;
  gap: 10px;
  height: 50px;
  cursor: pointer;
}

.button-filter:hover {
  background-color: var(--filter-bg-color);
}

/****** Infobar ***********/

.infobar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.circle {
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--grey);
  border-radius: 50%;
  padding: 5px 10px;
}

.infobar-msg {
  font-weight: 400;
  font-size: var(--font-size-small);
}

/****** Hébergements et Populaires ***********/

.hebergements-and-populaires {
  display: flex;
  justify-content: space-between;
  gap: 30px;
}

/****** Hébergements ***********/

.hebergements {
  width: 65%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  background-color: var(--main-bg-color);
  border-radius: 20px;
  padding: 30px;
  box-sizing: border-box;
}

.hebergements-cards {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 100%;
  margin-bottom: 33px;
}

.hebergements-cards > * {
  width: calc(33.33% - 15px);
  height: auto;
  margin-top: 33px;
}

.hebergements-cards .card img {
  width: 100%;
  height: 124px;
  padding: 1px;
  border-radius: 20px 20px 0 0;
}

.hebergements-cards .card-title {
  font-weight: bold;
  font-size: 16px;
  margin: 8px 0;
}

.hebergements-cards .card-subtitle {
  font-weight: 400;
  font-size: 14px;
  margin: 8px 0;
}

.hebergements-cards .card-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 15px 8px 15px;
}

.show-more {
  font-size: 18px;
  font-weight: 700;
  color: var(--black);
}

.show-more:hover {
  color: var(--main-color);
}

/****** Populaires ***********/

.populaires {
  width: 32%;
  background-color: var(--main-bg-color);
  border-radius: 20px;
  padding: 30px;
  box-sizing: border-box;
}

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

.populaires-cards .card {
  display: flex;
  margin-top: 33px;
}

.populaires-cards img {
  width: 123px;
  min-width: 123px;
  height: 146px;
  border-top-left-radius: 20px;
  border-bottom-left-radius: 20px;
}

.populaires-cards .card-content {
  flex: 1;
  padding-left: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.populaires-cards .card-title {
  margin-top: 10px;
  margin-bottom: 4px;
}

.populaires-cards .card-subtitle {
  margin: 0;
}

.populaires-cards .card-rating {
  margin-bottom: 5px;
}

/****** Activités ***********/

.activites {
  display: flex;
  flex-direction: column;
  padding: 30px;
  gap: 30px;
  width: 100%;
}

.activites-cards {
  display: flex;
  justify-content: space-between;
  gap: 30px;
}

.activites-cards > * {
  width: calc(25% - 15px);
  height: auto;
}

.activites-cards .card {
  box-shadow: 0px 3px 15px 0px rgba(0, 0, 0, 0.1);
}

.activites-cards .card img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: 20px 20px 0 0;
}

.activites-cards .card h3 {
  padding: 15px;
  font-weight: bold;
  font-size: 16px;
  color: var(--black);
}

/****** Footer ***********/

.site-footer {
  background-color: var(--main-bg-color);
  display: flex;
  align-items: flex-start;
  margin: 30px 0 0 0;
  padding: 20px 0;
}

.site-footer > * {
  flex: 1;
  padding: 0 20px;
}

.site-footer h2 {
  font-size: var(--font-size-medium);
  margin-bottom: 15px;
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.footer-list li a:hover {
  text-decoration: underline;
}

/****** Media queries ***********/

/* Tablette (max 1024px) */
@media (max-width: 1024px) {
  /* Masquer le texte "Rechercher", afficher la loupe */
  .search-bar .desktop-only {
    display: none;
  }

  .search-bar .mobile-only {
    display: block;
  }

  .search-bar button {
    width: 50px;
  }

  .search-bar button > i {
    font-size: 18px;
    margin: 0 auto;
  }

  /* Filtres en colonne */
  .filter-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-list {
    flex-wrap: wrap;
    gap: 10px;
  }

  .filter-list li {
    flex-basis: calc(50% - 5px);
  }

  .filter-list li button {
    width: 100%;
  }

  /* Hébergements et populaires en colonne */
  .hebergements-and-populaires {
    flex-direction: column;
    gap: 0;
  }

  .hebergements {
    width: 100%;
  }

  /* Populaires en ligne sur tablette */
  .populaires {
    width: 100%;
    margin-top: 50px;
  }

  .populaires-cards {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
  }

  .populaires-cards a {
    width: 30%;
  }

  .populaires-cards .card-title {
    font-size: 14px;
  }

  .populaires-cards .card-subtitle {
    font-size: 13px;
  }

  /* Activités */
  .activites-cards .card img {
    height: 200px;
  }
}

/* Mobile (max 768px) */
@media (max-width: 767.98px) {
  /* Suppression du padding latéral */
  .main-container {
    padding: 0;
  }

  /* Header en colonne */
  .site-header {
    flex-direction: column;
    align-items: center;
  }

  .nav-header {
    width: 100%;
  }

  /* Liens de navigation pleine largeur */
  .header-links {
    flex-direction: row;
    justify-content: space-between;
    padding: 0;
    gap: 0;
  }

  /* Bordure en bas sur mobile (en haut sur desktop) */
  .links {
    flex-basis: 50%;
    display: flex;
    justify-content: center;
    padding-top: 0;
    padding-bottom: 14px;
    border-top: none;
    border-bottom: 2px solid var(--main-bg-color);
  }

  .links:hover {
    border-top: none;
    border-bottom-color: var(--main-color);
  }

  /* Info group */
  .info-group {
    padding: 30px 15px 20px 15px;
  }

  /* Barre de recherche */
  .search-bar {
    position: relative;
    overflow: visible;
  }

  .search-bar button {
    box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
    position: relative;
    margin-bottom: -4px;
    z-index: 1;
  }

  /* Suppression border-radius sur mobile */
  .hebergements-and-populaires section {
    border-radius: 0;
  }

  /* Populaires en premier sur mobile */
  .populaires {
    width: 100%;
    order: 1;
    background-color: var(--main-bg-color);
    margin-top: 20px;
  }

  .populaires-cards {
    flex-direction: column;
  }

  .populaires-cards a {
    width: 100%;
  }

  .populaires-cards .card {
    width: 100%;
  }

  /* Hébergements en second sur mobile */
  .hebergements {
    width: 100%;
    order: 2;
    background-color: var(--white);
  }

  .hebergements-cards > * {
    flex-basis: 100%;
    width: 100%;
    margin-top: 20px;
  }

  .hebergements-cards .card {
    width: 100%;
  }

  /* Activités en colonne */
  .activites-cards {
    flex-direction: column;
  }

  .activites-cards > * {
    width: 100%;
  }

  .activites-cards .card img {
    height: 140px;
  }

  /* Footer en colonne */
  .site-footer {
    flex-direction: column;
    margin: 0;
    padding: 30px;
    gap: 50px;
  }
}
