# css de base pour les pages de la boite à physique

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, sans-serif;
  background: #f4f4f4;
}

header {
  width: 100%;
  height: 100px;
  background-color: #ffffff;
}

header h1 {
  color: rgb(31, 212, 31);
  margin-left: 100px;
  line-height: 100px;
}

.contenu {
  display: flex;
  gap: 100px;
  margin: 20px;
  width: min(1200px, 100%);   /* largeur max du groupe */
  margin-inline: auto;         /* centrage horizontal */
}

.principal {
  flex: 3;
  max-width: 800px;
  background-color: #ffffff;
  border: 2px solid rgb(31, 212, 31);
  border-radius: 10px;
  padding: 10px;
}


a {
  color: rgb(20, 130, 20);
  text-decoration: none;
}

p {
  color: rgb(80, 80, 80)
  }

li {
  color: rgb(80, 80, 80)
  }

/* Titres dans les articles */

article h1,
article h2,
article h3,
article h4,
article h5,
article h6 {
  color: firebrick;          /* rouge brique (ou #b22222) */
}

/* h1 h2: soulignés trait plein, centré */
article h1,
article h2 {
  text-align: center;
  text-decoration: underline;
  text-decoration-style: solid;
}

/* h3 à h6 : soulignés en pointillé, alignés à gauche */

article h3,
article h4,
article h5,
article h6 {
  text-align: left;
  text-decoration: underline;
  text-decoration-style: dotted;
}

/* pour des onglets : */
.onglets-titres {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.onglets-titres button {
  font-size: 1em;
  font-family: inherit;
  padding: 8px 15px;
  color: rgb(31, 212, 31);        /* titres verts comme les bordures */
  background-color: #ffffff;
  border: 2px solid rgb(31, 212, 31);
  border-radius: 10px 10px 0 0;   /* arrondi en haut seulement */
  border-bottom: none;
  cursor: pointer;
}

.onglets-titres button:hover {
  background-color: #eaffea;
}

.onglet-contenu {
  display: none;                  /* caché par défaut */
  padding: 10px;
  background-color: #ffffff;
  border: 2px solid rgb(31, 212, 31);
  border-radius: 0 10px 10px 10px;
  border-top-color: rgb(31, 212, 31);
}

.onglet-contenu.onglet-actif {
  display: block;                 /* seul l'onglet actif est visible */
}

/* images */
.conteneur-image {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

figure {
  margin: 0;              /* neutralise les marges par défaut du navigateur */
  text-align: center;
}

figure img {
  max-width: 100%;
  height: auto;
  display: block;         /* supprime l'espace sous l'image */
}

figcaption {
  font-style: italic;             /* italique */
  color: firebrick;               /* rouge brique */
  font-size: 0.85em;              /* plus petit que le texte de paragraphe */
  margin-top: 3px;                /* petit espace entre image et légende */
}

/* caroussel : */
.carrousel {
  display: flex;
  overflow-x: auto;          /* le défilement horizontal */
  scroll-snap-type: x mandatory;  /* chaque image s'aligne parfaitement */
  gap: 20px;
  padding: 10px;
  border: 2px solid rgb(31, 212, 31);
  border-radius: 10px;
}

.diapo {
  flex: 0 0 auto;    /* la diapo prend la largeur de son contenu (120px) */
  scroll-snap-align: center;
  text-decoration: none;
}

.diapo figure {
  width: fit-content;      /* la figure prend la largeur de l'image (120px) */
  margin: 0 auto;          /* ... et est centrée dans la diapo */
  text-align: center;
}

.diapo img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

.diapo figcaption {
  margin-top: 5px;
  font-weight: bold;
  color: rgb(20, 130, 20);
  font-size: 1.5em;        /* même taille que les h2 */
}

/* menu en grille : */
/* ----- Grille de liens : 6 cases (2 lignes de 3) ----- */
.grille-liens {
  display: grid;
  grid-template-columns: repeat(3, 1fr);  /* 3 colonnes égales */
  grid-auto-rows: 1fr;                    /* lignes de hauteur égale */
  gap: 20px;
  margin-top: 20px;
}

.case-lien {
  display: flex;
  align-items: center;       /* centrage vertical de l'image */
  justify-content: center;   /* centrage horizontal de l'image */
  flex-direction: column;
  background: #fff;
  border: 1px solid #b2bec3;
  border-radius: 8px;
  overflow: hidden;          /* arrondi appliqué aussi à l'image */
  text-decoration: none;
  color: #2c3e50;
  transition: transform 0.2s, box-shadow 0.2s;
}

.case-lien:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.case-lien img {
  width: 100%;
  aspect-ratio: 220 / 137;   /* proportion exacte des imagettes */
  object-fit: cover;         /* l'image remplit la case sans déformation */
  max-width: 220px;          /* taille réelle des imagettes, pas d'agrandissement */
  margin: 0 auto;            /* centrage horizontal dans la case */
  display: block;
}

.case-lien span {
  padding: 10px;
  text-align: center;
  font-weight: bold;
}

/* Côté droit de la page : */

.asides {
  display: flex;
  flex-direction: column;
  flex: 1; 
  gap: 20px;
}

nav {
  display: flex;
  flex-direction: column;
  width: 250px;
  background-color: #ffffff;
  border: 2px solid rgb(31, 212, 31);
  border-radius: 10px;
  padding: 10px;
  gap: 10px;
}

.complement {
  display: flex;
  flex-direction: column;
  width: 250px;
  background-color: #ffffff;
  border: 2px solid rgb(31, 212, 31);
  border-radius: 10px;
  padding: 10px;
  gap: 10px;
}

.complement h3 {
  color: rgb(20, 130, 20);
  }

/* ----- Footer : pleine largeur ----- */
footer {
  width: 100%;
  background: #ffffff;
  color: #ff;
  text-align: center;
  padding: 15px;
}

@media (max-width: 800px) {
  .contenu {
    flex-direction: column;   /* empilement vertical */
    gap: 20px;                /* on réduit l'écart */
    margin: 10px;
    width: 100%;
  }

  .principal {
    max-width: none;          /* la section reprend toute la largeur */
  }

  .asides {
    flex: 0 0 auto;           /* l'aside redevient flexible en hauteur */
    width: 100%;
  }
}

/* pour le caroussel,  sur grand écran, on voit deux diapos à la fois */
@media (min-width: 800px) {
  .diapo {
    flex: 0 0 20%;
  }
}
