* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: system-ui, sans-serif;
  background: #f5f5f5;
  min-width: 350px;
}

header {
  width: 100%;
  min-width: 350px;
  display: grid;
  grid-template-columns: 1fr auto 1fr; 
  align-items: center; /* Centre verticalement */
  position: fixed;
  top: 0;
  border-bottom: 1px solid black;
  background-color: white;
  z-index: 10;
}

footer{
  width: 100%;
  height: 33px;
  position: fixed;
  bottom: 0;
  z-index: 10;
  border-top: 1px solid black;
  background-color: white;
  display: flex;
  justify-content: space-between;
  p{
    margin: 5px;
  }
  a{
    text-decoration: none;
  }
}

.gauche {
  display: flex;
  align-items: center;
  gap: 10px; /* Espace entre l'image et le titre */
}

header img{
  width: 48px;
  height: 48px;
}

.menu-app{
  display: flex;
  align-items: center;
}

.menu-app a{
  text-decoration: none;
  font-size: x-large;
  margin: 0 5px 0 5px;
}

/* --- Container principal --- */
#container {
  display: grid;
  align-content: start;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px; /* Remplace le margin des enfants */
  margin-top: 50px;
  height: calc(100vh - 50px - 33px);
  min-height: 300px;
  overflow: scroll;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: width 0.3s ease;
}

.preview{
  border-radius: 6px;
  width: auto;
  padding: 5px;
  height: fit-content;
}

.preview:hover{
  opacity: 0.7;
  cursor: pointer;
}

.preview img{
  max-width: 600px;
}

.preview h2, .preview h3{
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* Limite à 2 lignes */
  overflow: hidden;
}

@media (max-width: 769px) {
  header{
    display: flex;
    justify-content: space-between;
    font-size: x-small;
  }

  .droite{
    display: none;
  }
}

/* --- BOUTONS GÉNÉRIQUES --- */
button, #book-modal nav a{
  background: #0078ff;
  color: white;
  font-size: 16px;
  padding: 6px 8px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover, #book-modal nav a:hover {
  background: #005fcc;
}

.illustration{
  max-height: 200px;
}

  /* Fenêtre modale */
#book-modal {
  position: fixed;
  inset: 0; /* Raccourci pour top: 0; right: 0; bottom: 0; left: 0; */
  margin: auto;
  padding: 10px;
  background: white;
  border-radius: 12px;
  min-width: 350px;
  max-width: 700px;
  width: 90%;
  animation: fadeIn 0.3s ease;
  border: none;
}

#book-modal::backdrop {
  background-color: rgba(0, 0, 0, 0.6); /* Noir avec 60% d'opacité */
  backdrop-filter: blur(2px); /* Optionnel : ajoute un effet de flou */
}

  @keyframes fadeIn {
    from {opacity: 0; transform: translateY(-10px);}
    to {opacity: 1; transform: translateY(0);}
  }

  #book-modal nav{
    display: flex;
    justify-content: space-around;
    margin: 5px;
  }

  #book-modal nav button {
    display: flex;
    justify-content: space-around;
    padding: 12px;
  }

  #book-modal img,  .preview img{
    width: -webkit-fill-available;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    object-fit: cover;
    background: #f0f0f0;
    margin: 5px;
  }

  #book-modal h2 {
    margin: 12px 0 4px;
    font-size: 18px;
  }

  #book-modal h3 {
    margin: 0 0 10px;
    color: #666;
    font-size: 14px;
    font-weight: normal;
  }

  #book-modal p {
    text-align: justify;
    font-size: 14px;
    color: #333;
    border: gray solid 1px;
    border-radius: 6px;
    padding: 2px;
    font-weight: bolder;
  }

  #book-modal h3::before, .preview h3::before {
    content: "@";
    margin-right: 5px; 
  }