/* ================================
   Styles généraux communs
================================ */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f6f6f6;
  color: #222;
}

/* ================================
   Header commun (accueil + livres)
================================ */

header {
  background: #2b4eff;
  color: white;
  text-align: center;
  padding: 30px 20px;
}

header h1 {
  margin: 0 0 10px 0;
  font-size: 32px;
}

header p {
  margin: 0;
  font-size: 16px;
}

/* ================================
   Footer commun
================================ */

footer {
  text-align: center;
  padding: 20px;
  font-size: 14px;
  color: #555;
}

/* ================================
   1) PAGE D’ACCUEIL – cartes livres
  
================================ */

.main-container {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
}

h2.section-title {
  margin: 0 0 20px 0;
  font-size: 26px;
  color: #222;
}

/* Grille de cartes livres */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* Carte d’un livre sur l’accueil */
.book-card {
  background: white;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: 0.3s;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}

.book-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 20px;
  color: #1d1d1d;
}

.book-card p {
  margin: 0 0 18px 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Bouton sur carte de livre */
.book-card .btn-primary {
  background: #2b4eff;
  color: white;
  padding: 10px 16px;
  text-align: center;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
  transition: 0.2s;
}

.book-card .btn-primary:hover {
  background: #1c38d2;
}

/* ================================
   2) PAGES LIVRES – layout couverture + niveaux
  
================================ */

/* Mise en page globale pour une page livre */
.layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 40px;
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

/* Image de couverture à gauche */
.cover img {
  max-width: 260px;
  width: 100%;
  height: auto;
  display: block;
}

/* Colonne de blocs de niveaux à droite */
#menu {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Bloc de niveau : cadre blanc avec bordure bleue */
#menu section {
  margin: 0;
  max-width: 600px;
  background: #ffffff;
  border: 2px solid #2b4eff; /* cadre bleu */
  border-radius: 12px;
  padding: 10px;
}

/* Titre de niveau dans bande bleue en haut */
#menu section h2 {
  margin: 0 0 10px;
  padding: 8px 0;
  text-align: center;
  color: #ffffff;
  background: #2b4eff;
  border-radius: 8px 8px 0 0;
  font-size: 20px;
}

/* Liste de cartes (une ligne par type) */
#menu .card-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  background: transparent;
}

/* Ligne type + boutons, carte blanche + ombre douce */
#menu .card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}

/* Nom du type */
#menu .card h3 {
  margin: 0;
  color: #1d1d1d;
  font-weight: bold;
  font-size: 16px;
}

/* Conteneur pour boutons, si besoin */
.btn-group {
  display: flex;
  gap: 8px;
}

/* Boutons Voir / Télécharger sur les pages livres */
#menu .btn {
  margin-top: 0;
  margin-left: 8px;
  padding: 8px 12px;
  background: #2b4eff;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
  display: inline-block;
  transition: 0.2s;
}

#menu .btn:hover {
  background: #1c38d2;
}

/* ================================
   3) Responsif simple
================================ */

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
    align-items: center;
  }

  .cover img {
    max-width: 320px;
  }

  #menu section {
    width: 100%;
  }
}
/* ================================
   Harmonisation affichage solutions
   ================================ */

#menu .card h3 {
  text-transform: none;      /* respecte la casse du manifest */
  font-weight: 600;          /* cohérent avec 9P9 */
  letter-spacing: normal;
  margin: 0;
}

#menu .card {
  text-align: left;
}

#menu section h2 {
  text-transform: none;      /* titres de groupes cohérents */
  font-weight: 700;
}

/* ============================================================
   ACCUEIL : Styles pour les miniatures (Livre + Texte)
   ============================================================ */

.book-card-content {
  display: flex;
  align-items: center; /* Aligne l'image et le texte verticalement */
  gap: 15px;           /* Espace entre l'image et le texte */
  margin-bottom: 15px;
}

.book-thumbnail {
  width: 70px;         /* Taille de la miniature */
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  flex-shrink: 0;      /* Empêche l'image d'être écrasée */
}

.book-details h3 {
  margin: 0 0 5px 0 !important;
  font-size: 18px !important;
}

.book-details p {
  margin: 0 !important;
  color: #666;
  font-size: 14px;
}

/* Optionnel : Ajustement mobile pour les petites cartes */
@media (max-width: 480px) {
  .book-thumbnail {
    width: 60px;
  }
}
}