/* box-sizing utile pour padding/max-width cohérents */
*, *::before, *::after { box-sizing: border-box; }

/* Typo globale */
body {
  margin: 0;
  font-family: Helvetica, Arial, sans-serif;
  line-height: 1.6;
    hyphens: auto;
  overflow-wrap: break-word;
  background: #fff;
  color: #222;
}

/* bouton toggle propre */
.toggle-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

/* icônes — seule l'active s'affiche */
.toggle-btn .icon { 
    display: none; width: 20px; height: 20px; 
    margin-top: 0.2rem;
}
.toggle-btn .icon.active { 
    display: inline-block; 
}

/* Menu */
.navbar {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 2rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: #222;
}

.nav-links a:hover {
  text-decoration: underline;
}

.toggle-btn {
  background: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

/* Contenu — boîte alignée à gauche */
main {
display: flex;
flex-direction:column;
  max-width: 45%;               /* largeur du bloc (≈ -30% par rapport à 60%) */
  margin: 0rem 0 3rem 3rem;     /* top/right/bottom/left -> laisse 2rem à gauche */
  padding: 0 0.5rem;            /* marges latérales plus fines */
  text-align: left;             /* texte aligné à gauche */
}

/* Titre */
h1 {
  font-size: 3.8rem;
  margin-bottom: 2rem;
  text-align: left;
  font-weight: normal;
  line-height: 100%;
}

/* Lien de téléchargement (vert, au-dessus du texte) */
.download a {
    display: flex;
  color: green;
  text-decoration: none;
  justify-content: flex-end;
  margin-bottom: 0rem;
  text-decoration: underline;
}

a[href^="#_ftn"] {
  text-decoration: none;
  font-size: 0.75em;     /* plus petit */
  vertical-align: super; /* en exposant */
  color: green;           /* couleur discrète */
  margin-left: 2px;
}

.toc a {
  color: green;
}

img {
  max-width: 100%;
  height: auto;
  max-height: 700px;
  display: block;
  margin: 1rem auto;
  object-fit: contain;
}

.download a:hover {
  text-decoration: underline;
}

/* Texte long */
.texte {
  text-align: justify;
  text-justify: inter-word;
}

/* Footer */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  font-size: 0.9rem;
}

footer a {
  color: #222;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.dark-mode {
  background: #0b0b0b;
  color: #eee;
}

.dark-mode a {
  color: #eee;
}

.bibliographie, 
p {
  overflow-wrap: anywhere;
  word-wrap: break-word;
  word-break: break-all;
  white-space: normal;
}

/* Responsive : sur petits écrans, on recentre et on augmente la largeur pour être lisible */
@media (max-width: 800px) {
  /* tentative plus contraignante pour écraser d'autres règles */
  main {
    width: 95% !important;
    max-width: none !important;
    margin: 1rem auto !important;
    padding: 0 1rem !important;
    box-sizing: border-box;
    flex: 0 0 auto !important;      /* empêche le shrink si parent est flex */
    min-width: 0 !important;
    align-self: stretch !important;
  }

  .nav-links { gap: 1rem; }

  h1 { font-size: 2.5rem; }

  img { max-width: 100%; height: auto;  display: block;
  margin: 0.5rem auto;
  object-fit: contain;}

  footer { 
    flex-direction: column; 
    gap: 0.5rem; 
    text-align: center;
    font-size: small;
  }
}

/* Bannière de consentement */
.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 50%;
  transform: translate(-50%, 50%);
  width: 400px;
  height: 150px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
  padding: 1rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 0.95rem;
  z-index: 200;
  transition: transform 0.4s ease, opacity 0.4s ease;
  border-radius: 5px;
}

.cookie-banner.hidden {
  display: none;
}

.cookie-buttons {
  display: flex;
  gap: 1rem;
  align-self: flex-end;
  margin-top: -70px
}

.cookie-buttons button {
  padding: 0.5rem 1rem;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  font-weight: 550;
  justify-content: flex-end;

}

#acceptCookies {
  background: green;
  color: rgb(255, 255, 255);
}

#refuseCookies {
  background: #ffffff;
  color: #000000;
  border: 1px solid green;
}

.dark-mode .cookie-banner {
  background: rgba(20, 20, 20, 0.97);
  color: #eee;
  box-shadow: 0 -2px 10px rgba(234, 232, 232, 0.8);
}

.no-cookies-icon {
  width: 60px;
  height: 60px;
  margin: 15px 0 0 0px;
}

#refusalMain {
  display: block;
  border: none;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  position: fixed;
  transform: translate(25%, 30%);
}

.button-refus{
  background: green;
  color: rgb(255, 255, 255);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  font-weight: 550;
}

.text-memoire-petit {
    font-size: 0.85rem;
    margin-top: -10px;
}

p {
  hyphens: auto;
  overflow-wrap: break-word;
  word-break: normal;
}