/* ================================
   Styles communs — Solutions en ligne
   Version corrigée pour WordPress
================================ */

/*
  IMPORTANT :
  Ce fichier est chargé sur les pages WordPress de solutions via le shortcode [solution_livre].

  Les anciens sélecteurs globaux `body`, `header` et `footer` ont été retirés
  car ils modifiaient aussi le header/footer WordPress Astra.

  Règle à respecter :
  - ne pas cibler `header` ou `footer` directement ;
  - cibler uniquement les éléments contenus dans `.solution-livre-wp`.
*/

* {
  box-sizing: border-box;
}

/* ================================
   1) Styles anciens de cartes livres
   Conservés pour compatibilité éventuelle
================================ */

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: #2ca6a4;
  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: #218c8a;
}

/* ============================================================
   ACCUEIL : Styles pour les miniatures (Livre + Texte)
   ============================================================ */

.book-card-content {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.book-thumbnail {
  width: 70px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.book-details h3 {
  margin: 0 0 5px 0 !important;
  font-size: 18px !important;
}

.book-details p {
  margin: 0 !important;
  color: #666;
  font-size: 14px;
}

/* ================================
   2) Pages livres — layout couverture + niveaux
   Tout est scoped sous .solution-livre-wp
================================ */

.solution-livre-wp {
  color: #222;
}

/* Conteneur principal de la page livre */
.solution-livre-wp .main-container {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
}

/* Mise en page globale pour une page livre */
.solution-livre-wp .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 */
.solution-livre-wp .cover img {
  max-width: 260px;
  width: 100%;
  height: auto;
  display: block;
}

/* Colonne de blocs de niveaux à droite */
.solution-livre-wp #menu {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Bloc de niveau : cadre blanc avec bordure bleue */
.solution-livre-wp #menu section {
  margin: 0;
  max-width: 600px;
  background: #ffffff;
  border: 2px solid #2ca6a4;
  border-radius: 12px;
  padding: 10px;
}

/* Titre de niveau dans bande bleue en haut */
.solution-livre-wp #menu section h2 {
  margin: 0 0 10px;
  padding: 8px 0;
  text-align: center;
  color: #ffffff;
  background: #2ca6a4;
  border-radius: 8px 8px 0 0;
  font-size: 20px;
  text-transform: none;
  font-weight: 700;
}

/* Liste de cartes */
.solution-livre-wp #menu .card-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  background: transparent;
}

/* Ligne type + boutons */
.solution-livre-wp #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);
  text-align: left;
}

/* Nom du type */
.solution-livre-wp #menu .card h3 {
  margin: 0;
  color: #1d1d1d;
  font-weight: 600;
  font-size: 16px;
  text-transform: none;
  letter-spacing: normal;
}

/* Conteneur pour boutons */
.solution-livre-wp .btn-group {
  display: flex;
  gap: 8px;
}

/* Boutons Voir / Télécharger sur les pages livres */
.solution-livre-wp #menu .btn {
  margin-top: 0;
  margin-left: 8px;
  padding: 8px 12px;
  background: #2ca6a4;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
  display: inline-block;
  transition: 0.2s;
}

.solution-livre-wp #menu .btn:hover {
  background: #218c8a;
}

/* Bouton retour */
.solution-livre-wp .btn-primary {
  background: #2ca6a4;
  color: white;
  padding: 10px 16px;
  text-align: center;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
  transition: 0.2s;
}

.solution-livre-wp .btn-primary:hover {
  background: #218c8a;
  color: white;
}

/* ================================
   3) Responsif simple
================================ */

@media (max-width: 900px) {
  .solution-livre-wp .layout {
    flex-direction: column;
    align-items: center;
  }

  .solution-livre-wp .cover img {
    max-width: 320px;
  }

  .solution-livre-wp #menu section {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .book-thumbnail {
    width: 60px;
  }

  .solution-livre-wp #menu .card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .solution-livre-wp #menu .btn {
    margin-left: 0;
  }
}
