@import url('https://fonts.googleapis.com/css2?family=Cousine&display=swap');

:root {
  --white: #ffffff;
  --gray-light: #f5f5f5;
  --gray-dark: #eeeeee;
  --text-dark: #222222;
  --border: #dddddd;
}



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

body {
  margin: 0;
  font-family: 'Cousine', monospace;
  font-size: 14px;
  color: var(--text-dark);
 /* background: var(--white);*/
  overflow-x: hidden; /* ✅ Important pour tout overflow global */
  background: linear-gradient(to bottom,
  white 0%,
  #ffe6e6 10%,   /* Rouge clair */
  #ffb380 20%,   /* Orange clair */
  #fff5b8 30%,   /* Jaune clair */
  #cce8cc 45%,   /* Vert clair */
  #b3ccff 60%,   /* Bleu clair */
  #d9b3d9 75%,   /* Violet clair */
  #86007D 90%
      );    /* Violet plus foncé */
}

.container {
  display: flex;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 250px;
  background: var(--white);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 100;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

nav img {
  width: 100%;
  max-width: 180px;
  height: auto;
  border-radius: 4px;
}

nav a {
  text-decoration: none;
  color: var(--text-dark);
  margin: 0.3rem 0;
  font-weight: 600;
}

nav hr {
  margin: 1rem 0;
  border: 0;
  border-top: 1px solid var(--gray-dark);
}

.content {
  margin-left: 250px;
  padding: 1rem 1rem;
  max-width: 100vw;       /* ✅ Empêche de dépasser la largeur du viewport */
  box-sizing: border-box; /* ✅ Prend bien en compte le padding dans le width */
  overflow-x: hidden;     /* ✅ Coupe les débordements horizontaux */
}


section {
  margin-bottom: 4rem;
  padding: 1rem 1rem;
  background: var(--gray-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: transform 0.5s, opacity 0.5s;
}

section:nth-child(even) {
  background: var(--gray-dark);
}

.section-content {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  padding-bottom: 10px;
}

.section-content.even-layout {
  grid-template-columns: 1fr 1fr;
}

.section-content.odd-layout {
  grid-template-columns: 1.5fr 1fr;
}

section h2 {
  text-align: center;       /* Centre le titre */
  margin-bottom: 1.5rem;    /* Espace sous le titre (ajuste selon besoin) */
}

section .text-block p {
  margin-top: 0;            /* Réinitialiser si besoin */
  margin-bottom: 1.5rem;    /* Espace sous le paragraphe (ajuste selon besoin) */
}


.text-block,
.image-block {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: white;
  color: #222;
  min-height: 200px;
  height: 100%; /* ⚠️ important : occupe toute la hauteur de la cellule */
  width: 100%;        /* remplissent toute la largeur de la colonne */

}

.text-block {
  line-height: 1.6;
  background: var(--white);
  border-radius: 4px;
  padding: 1rem;
}

section:nth-child(even) .text-block {
  background: var(--gray-light);
}

.image-block img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;  /* ne rogne pas l'image */
  transition: transform 0.3s ease, width 0.3s ease;
  border-radius: inherit;
  cursor: zoom-in;
  align-items: center;
}

.image-block {
  display: flex;
  justify-content: center;   /* centre horizontalement */
  align-items: center;       /* centre verticalement */
  padding: 1rem;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  min-height: 200px;         /* ou une autre valeur minimale raisonnable */
  text-align: center;
  max-width: 100%;
  overflow: hidden; /* empêche les débordements */
}

.image-block .caption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
  line-height: 1.4;
}

.caption {
  font-size: 0.9em;
  color: #555;
  text-align: center;
  margin-top: 0.4em;
  display: block;
  font-style: italic;
  user-select: none; /* empêche la sélection accidentelle */
}


.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #444;
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 0.8;
  visibility: visible;
}

.back-to-top:hover {
  opacity: 1;
}

.show {
  display: block !important;
}

.hamburger {
  display: none;
  font-size: 2rem;
  position: fixed;
  top: 1rem;
  left: 1rem;
  cursor: pointer;
  z-index: 1100;
  user-select: none;
  background: var(--gray-light);
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  transition: background 0.3s;
}

.hamburger:hover {
  background: var(--gray-dark);
}

/* Mobile styles */
@media screen and (max-width: 768px) {
  nav {
    display: none;
  }

  .hamburger {
    display: block;
  }

  .menu-mobile {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 250px;
    /*background: var(--white);*/
    background: rgba(255, 255, 255, 0.75); /* blanc avec 85% d’opacité */
    backdrop-filter: blur(8px); /* flouté derrière pour un effet glass */
    -webkit-backdrop-filter: blur(8px);
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    padding: 1rem;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .menu-mobile.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .menu-mobile img {
    width: 100%;
    max-width: 140px;
    height: auto;
    border-radius: 4px;
    margin-bottom: 1rem;
    /* Ajouté pour aligner à droite */
    align-self: flex-end;
  }

  .menu-mobile a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    padding: 0.3rem 0;
    user-select: none;
  }

  .content {
    margin-left: 0;
    margin-top: 3rem;
    padding-top:4rem;
    width: 100%;
  }

  .section {
    padding: 5px;
  }
 
  .section-content {
    grid-template-columns: 1fr !important;
    gap: 1rem; /* Réduire un peu l’espace sur mobile */
      
    }
  }
  
    .text-block,
    .image-block {
      width: 100% !important;
      max-width: 100% !important;
    }


/* Encore plus petit logo pour petits écrans */
@media screen and (max-width: 480px) {
  nav img,
  .menu-mobile img {
    max-width: 100px;
  }
}
