/* Style de base */
body {
    font-family: Arial, sans-serif;
    box-sizing: border-box;
    background-color: #DDDDFF; /* Optionnel : définir une couleur de fond pour le corps */
	margin:0;

}

.page{
    max-width: 1000px;
    margin: 0 auto; /* Centre le contenu */
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5); /* Ajoute une ombre légère */
	background-color: white;
	min-height:1evh;
}


/* Entête */
header {
    background-color: #f3f3f3;
    padding: 10px;
    text-align: center;
    display: flex;
    align-items: center;
}

.rappelNotion{
	background-color:#DDEEFF;
	border-radius:20px;
	border:solid 1px #00099;
	padding:5px;
}

h1{
	font-size:18px;
}

#logo {
    height: 80px;
	margin-right: 20px;
}

/* Fil d'Ariane */
#breadcrumb {
    list-style: none;
    padding: 10px;
    background-color: #e1e1e1;
	margin:0;
}

#breadcrumb li {
    display: inline;
    margin-right: 10px;
}

#breadcrumb li a{
	text-decoration:none;
	color:#333;
}

/* Module de filtre */
#filter {
 
    background-color: #d1d1d1;
}

/* ===== Layout de page : GRID (2 colonnes PC, 1 colonne mobile) ===== */
main{
  display: grid;
  grid-template-columns: 3fr 1fr;   /* article | aside */
  gap: 0;
  align-items: stretch;
}


article{
  padding: 10px;
}


/* Style pour chaque bouton */
.bouton-navigation{
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: solid 1px #777;
    background-color: #3A4E8B;
    color: white;
    font-weight: bold;
    text-decoration: none;
    text-align: center;
    padding: 10px 15px;
    display: inline-block;

}


/* Style pour le bouton au survol */
.bouton-navigation:hover {
    transform: scale(1.05); /* Agrandit légèrement l'élément */
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 1); /* Aaugmente l'ombre pour un meilleur effet visuel */
}


.bouton-PageSuivantePrecedente{
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: solid 1px #777;
    background-color: #3A4E8B;
    color: white;
    font-weight: bold;
    text-decoration: none;
    text-align: center;
    padding: 10px 15px;
    display: inline-block;
	width:120px;
	margin:0 20px 0 0;
}


/* Style pour le bouton au survol */
.bouton-navigation:hover {
    transform: scale(1.05); /* Agrandit légèrement l'élément */
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 1); /* Augmente l'ombre pour un meilleur effet visuel */
}


/* La grille ne dépasse jamais */
.pages-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 12px;
  justify-content: start;
  max-width: 100%;
}

/* Les boutons occupent la largeur de leur cellule (plus de width fixe) */
/* Chaque grille de boutons (un groupe de lignes) */
.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 4px;                 /* ← espace entre boutons */
  justify-content: start;
  max-width: 100%;
  margin-bottom: 20px;      /* ← espace entre deux grilles */
}

/* Boutons */
.bouton-page-livre {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border-radius: 10px;
  border: 1px solid #777;
  color: white;
  font-weight: bold;
  text-decoration: none;
  background-color: #1E2A60;
  transition: transform .2s ease, box-shadow .2s ease;
  font-size:24px;
}

.bouton-page-livre-impaire {
  background-color: #3D5AFE; /* bleu plus clair */
}

.bouton-page-livre:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Responsive mobile */
@media (max-width: 360px){
  .pages-grid{
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  }
  .bouton-page-livre{
    height: 40px;
    font-size: 14px;
  }
}



/* Style pour les boutons d’exercices dans l’aside */
aside ul {
    list-style: none;       /* Enlève les puces */
    padding: 0;
    margin: 0;
}

aside li {
    margin: 6px 0;          /* Espace vertical entre les boutons */
}

aside ul a {
    display: block;         /* Pour occuper toute la largeur */
    border-radius: 10px;
    background-color: #3A4E8B; /* Même couleur que tes autres boutons */
    color: white;
    font-weight: bold;
    text-decoration: none;
    text-align: center;
    padding: 10px;
    border: 1px solid #777;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

aside ul a:hover {
    transform: scale(1.05);
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 1);
}

.bouton-navigation.actif,
aside ul a.actif {
    background-color: #ffffff;   /* fond blanc */
    color: #3A4E8B;              /* texte bleu marine */
    border: 1px solid #3A4E8B;   /* contour assorti */
	cursor: default;
    transform: none;
    box-shadow: inset 0px 0px 5px rgba(0,0,0,0.5);
}

/* Désactive l'effet hover pour l'actif */
.bouton-navigation.actif:hover,
aside ul a.actif:hover {
    transform: none;
    box-shadow: inset 0px 0px 5px rgba(0,0,0,0.5);
}


aside{
  background-color: #CECEDE;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  border-left: solid 1px #ABABDD;
}

/* Footer */
footer {
    display: flex;
	background-color: #b1b1b1;
    padding: 10px;
    text-align: center;
	
}

.footer-widget{
	justify-content: flex-start;
	padding:10px;
	background-color:white;
	border-radius:10px;
	text-align:left;
	width:200px;
	margin:10px;
}

.footer-widget-titre{
	margin:0;
	font-weight:bold;
}

.footer-widget ul{
	padding: 0;
}

.footer-widget li{
	list-style-type: none;
}

.footer-widget a{
	text-decoration:none;
}

/* Empiler les modules du footer sur mobile */
@media screen and (max-width: 768px) {
    footer {
        flex-direction: column; /* Passe les blocs en colonne */
        align-items: center;    /* Centre les blocs horizontalement */
    }

    .footer-widget {
        width: 90%;             /* Largeur plus adaptée sur mobile */
        margin: 10px 0;         /* Espacement vertical */
    }
}

.drapeau{
	padding:0 10px 0 0;
}

/* Bouton "Imprimer" et "Télécharger" */
.conteneur-boutons-action {
    display: flex;
    gap: 40px;
    flex-direction: row;
    justify-content: center;
}

.bouton-action {
    padding: 0px 50px;
    font-size: 20px;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	height:60px;
}

.bouton-action:hover {
	transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.bouton-imprimer {
    background-color: #007bff;
    color: white;
}

.bouton-imprimer:hover {
    background-color: #0056b3;
}

.bouton-acheter {
    background-color: #FF9900;
    color: black;
}

.bouton-acheter:hover {
    background-color: #E68A00;
}

.video-container {
	position: relative;
	padding-bottom: 56.25%; /* Ratio 16:9 */
	height: 0;
	overflow: hidden;
	max-width: 100%;
	background: #000;
}

.video-container iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    main {
        flex-direction: column;
    }

    aside {
        order: 1;
    }
	
	
	article {
		flex: 1;
		display: flex;
		flex-direction: column; /* empile les éléments verticalement */
		justify-content: center; /* centre les éléments horizontalement */
		align-items: center; /* centre les éléments verticalement si vous en avez besoin */
	}
	
	.bouton-coloriage-lien {
		display: flex;
		justify-content: space-between;
		text-decoration:none;
		width:200px;
		flex-direction: column; /* Alignement vertical */
		margin-bottom: 20px;
	}
	
    .conteneur-boutons-action {
        flex-direction: column;
        gap: 10px;
    }
}


.btn-solution {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 1rem 1.25rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: #1E8E5A;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.15);
  transition: transform .05s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn-solution:hover { box-shadow: 0 8px 20px rgba(0,0,0,.2); }
.btn-solution:active { transform: translateY(1px); }
.btn-solution[disabled] { opacity: .6; cursor: not-allowed; }

.solution-error {
  margin-top: .75rem;
  padding: .75rem 1rem;
  border-radius: 8px;
  background: #fff2f0;
  color: #b71c1c;
}

#solution-content {
  margin-top: 1rem;
  padding: 10px;
  border: 1px solid #666;
  border-radius: 12px;
  background: #fff;
}
/* --- Effet magique d'apparition de la solution --- */
#solution-content {
  opacity: 0;
  /*transform: translateY(10px);*/
  transition: opacity 3s ease, transform 3s ease;
}

/* Classe active après chargement */
#solution-content.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Conteneur global : 2 colonnes en desktop, 1 colonne en mobile */
.book-card {
  display: grid;
  grid-template-columns: 220px 1fr; /* largeur fixe pour l'image + tableau fluide */
  gap: 16px;
  align-items: stretch;            /* colonnes de même hauteur */
  margin-bottom: 16px;
}

/* Colonne image : occupe toute la hauteur de la ligne (celle du tableau) */
.book-cover {
  border: 1px solid #888;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

/* Image : remplit la colonne en hauteur et en largeur sans déformation */
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* recadre si nécessaire pour garder le ratio */
  display: block;
}

/* Ton tableau existant (légères adaptations) */
.book-table {
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #888;
  border-radius: 6px;
  overflow: hidden;
  font-size: 16px;
  background-color: #fff;
  width: 100%;         /* prend toute la largeur de sa colonne */
  min-width: 300px;
}

.book-table th,
.book-table td {
  border: 1px solid #ccc;
  text-align: left;
  padding: 10px 14px;
  vertical-align: middle;
  white-space: nowrap;
}

.book-table th {
  background-color: #f3f4f6;
  font-weight: 600;
}

.book-table td {
  font-weight: 500;
}

/* Version mobile : image au-dessus, tableau en dessous */
@media (max-width: 560px) {
  .book-card {
    grid-template-columns: 1fr; /* une seule colonne */
  }

  .book-cover {
    max-width: 420px;   /* optionnel : limite visuelle sur mobile */
    margin: 0 auto 10px;
  }

  .book-cover img {
    height: auto;       /* l'image reprend son ratio naturel */
  }

  /* Option : conserver ton rendu “stacked” pour le tableau */
  .book-table,
  .book-table tbody,
  .book-table tr,
  .book-table th,
  .book-table td {
    display: block;
    max-width: 100%;
  }

  .book-table {
    border-width: 1.5px;
    min-width: 0;       /* évite un débordement horizontal */
  }

  .book-table th {
    background: #f9fafb;
    border: none;
    padding-top: 8px;
  }

  .book-table td {
    border: none;
    padding: 0 0 0 15px;
    white-space: normal; /* autorise le retour à la ligne sur mobile */
  }

  .book-table tr {
    border-bottom: 1px solid #ddd;
    padding: 8px 0;
  }
}



.BarreAdmin{
	font-size:80%;
	background-color:#C5C5C5;
	padding:10px;
	max-width: 980px;
    margin: 0 auto;
	font-size:18px;
	font-weight:bold;
}



/* ===== Titre local, plus aucun float/clear ===== */
.niveau-section-title{
  display: block;
  width: 100%;
  margin: 0 0 14px 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111;
  text-align: left;
}

/* Mobile : 1 colonne, l’aside passe sous l’article */
@media (max-width: 768px){
  main{
    grid-template-columns: 1fr;
  }
  aside{
    border-left: none;
    border-top: solid 1px #ABABDD;
  }
  .niveau-section-title{
    font-size: 1.3rem;
    margin-bottom: 12px;
  }
}




/* ===========================
   LISTE DES LIVRES (DESKTOP)
   =========================== */
.niveau-books-list{
  /* Grille 3 colonnes max, responsive */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  justify-items: center;
  align-items: stretch;   /* toutes les cartes ont la même hauteur */
  width: 100%;
}

.niveau-books-list{ justify-items: start; }



/* ===========================
   CARTE LIVRE
   =========================== */
.niveau-book-card{
  display: flex;
  flex-direction: column;    /* image au-dessus, légende en bas */
  justify-content: space-between;
  width: 100%;
  max-width: 220px;          /* largeur compacte mais lisible */
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.niveau-book-card a{
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.niveau-book-card:hover{
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,.10);
  border-color: #d1d5db;
}

/* ===========================
   IMAGE DE COUVERTURE
   =========================== */
.niveau-book-media{
  flex: 1 1 auto;         /* prend la hauteur disponible */
  width: 100%;
  aspect-ratio: 2 / 3;    /* ratio portrait type couverture */
  background: #f7f7f7;    /* couleur de fond si image lente */
}

.niveau-book-media img{
  width: 100%;
  height: 100%;
  object-fit: cover;       /* remplit sans déformer */
  display: block;
}

/* ===========================
   LÉGENDE
   =========================== */
.niveau-book-caption{
  flex: 0 0 auto;
  padding: 8px 10px 6px;   /* espace blanc réduit sous la légende */
  font-size: 14.5px;       /* légèrement plus grand */
  font-weight: 600;
  line-height: 1.35;
  color: #111;
  text-align: center;

  /* clamp sur 2 lignes pour homogénéiser la hauteur des cartes */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;

  /* garantit un pied de carte aligné même si 1 ligne seulement */
  min-height: 3.4em;
}

/* ===========================
   MOBILE (≤ 768px) : 1 colonne
   =========================== */
@media (max-width: 768px){

  .niveau-books-list{
    display: flex;                 /* colonne propre */
    flex-direction: column;
    gap: 16px;
    clear: both;                   /* évite tout chevauchement avec un float */
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;            /* sécurité anti-scroll horizontal */
  }

  .niveau-book-card{
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 0 0 16px 0;           /* empilement vertical */
  }

  .niveau-book-media{
    width: 100%;
    aspect-ratio: auto;           /* certains navigateurs calculent mieux ainsi */
  }
  .niveau-book-media img{
    width: 100%;
    height: auto;                 /* conserve le ratio naturel */
  }

  .niveau-book-caption{
    font-size: 14px;
    -webkit-line-clamp: 3;        /* un peu plus de marge pour le texte long */
    min-height: auto;
  }
}
