/* main.css */

/* 1. Imports */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

/* 2. Variables & Reset */
:root {
  --max-content-width: 100ch;       /* largeur de lecture optimale */
  --nav-width: 500px;              /* largeur du menu desktop */
  --nav-mobile-max-width: 500px;     /* drawer mobile */
  --gap: 1rem;
  --font: 'Roboto', sans-serif;
  --bg: #fff;
  --fg: #333;
  --nav-bg: #f5f5f5;
  --nav-active-bg: #444;
  --nav-active-fg: #fff;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: var(--font);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  align-items: center;    /* centre les wrappers horizontaux */
  min-height: 100vh;
}
img {
	max-width:100%;
}
h1 {
	color:rgb(27, 54, 93);
}
h2 {
	margin:60px 0px 20px 0px;
	line-height:1.5em;
	color:rgb(27, 54, 93);
}
h3 {
	margin:40px 0px 10px 20px;
	color:rgb(27, 54, 93);
	font-weight:500;
}
p {
	margin:0px 0px 20px 20px;
}
ol, ul {
	margin:0px 0px 20px 20px;
}
dl {
	margin:0px 0px 20px 20px;
}
li {
	margin:0px 0px 10px 0px;
}
dt {
  display: list-item;
  list-style-type: disc;
  list-style-position: inside;
}
dd {
	margin:0px 0px 10px 40px;
	display: list-item;
	list-style-type: "⟶ ";
}
/* 3. Header wrapper (pour bouton+titre+nav) */
.site-header {
  display: flex;
  align-items: center;
  padding: var(--gap);
  background: var(--bg);
  width: 100%;
  max-width: var(--max-content-width);
  margin: 0 auto;         /* aligne avec l'article */
  z-index: 1001;
}

/* 3a. Bouton hamburger */
#menu-toggle {
  font-size: 2rem;
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  border-radius: 100%;
	width:2.7rem;
	line-height:2.1rem;
	padding-bottom:.6rem;
}
/* Quand le menu est ouvert */
#menu-toggle.open {
  background: var(--nav-active-bg);
  color: var(--nav-active-fg);
  transition: background 0.3s, color 0.3s;
}
/* 3b. Titre de page */
.page-title {
  flex: 1;
  font-size: 1.5rem;
  margin: 0;
	margin-left: var(--gap);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 4. Drawer mobile */
.side-nav {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 90%;
  max-width: var(--nav-mobile-max-width);
  background: var(--nav-bg);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
}
.side-nav.open {
  transform: translateX(0);
}
.side-nav ul {
  list-style: none;
  padding: calc(var(--gap)*2) var(--gap);
}
.side-nav a {
  display: block;
  padding: 0.5em var(--gap);
  color: var(--fg);
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.2s;
}
.side-nav a:hover {
  background: rgba(0,0,0,0.05);
}
.side-nav a.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-fg);
}

header {
  width: 100%;
  max-width: var(--max-content-width);
  padding: var(--gap);
  margin: 0 auto;         /* aligne avec le header */
}
/* 5. Corps de page */
article {
  width: 100%;
  max-width: var(--max-content-width);
  padding: var(--gap);
  margin: 0 auto;         /* aligne avec le header */
}
footer {
  width: 100%;
  max-width: var(--max-content-width);
  padding: var(--gap);
  margin: 0 auto;
  text-align: center;
  font-size: 0.9rem;
}


/* 7. Expand/Collapse via details/summary */
.side-nav li.has-children > details {
  margin-bottom: var(--gap);
}
.side-nav li.has-children summary {
  display: flex;
  align-items: center;
  padding: 0.5em var(--gap);
  cursor: pointer;
  user-select: none;
}
.side-nav li.has-children summary::-webkit-details-marker {
  display: none;
}
.side-nav li.has-children summary::before {
  content: '▶';
  margin-right: 0.5em;
  transition: transform 0.2s;
}

/* quand le parent est actif, c’est summary qui porte le fond */
.side-nav li.has-children summary.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-fg);
}

/* on conserve le flex sur le contenu interne (pour que le lien garde flex:1) */
.side-nav li.has-children summary a {
  flex: 1;
  text-decoration: none;
  color: inherit;
  font-weight: 500;
}

/* Style du lien actif en pied de page (bottom nav) */
.site-navigation .current-parent > span.parent-title,
.site-navigation .current-page > span {
  font-weight: bold;
  color: rgb(65,7,137);
}
.side-nav li.has-children details[open] > summary::before {
  transform: rotate(90deg);
}
.side-nav li.has-children details[open] > summary {
  background: transparent;
  color: var(--fg);
}
.side-nav li.has-children summary a {
  flex: 1;
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}
.side-nav li.has-children details > ul {
  padding-left: calc(var(--gap) * 1.5);
}
.menu_ico {
	transform:translate(0px,5px);
}

/* === 8. Unified bottom-of-page navigation === */
.site-navigation {
  width: 100%;
  max-width: var(--max-content-width); /* same max‐width as article/footer */
  padding: var(--gap);                 /* same inner padding as article/footer */
  margin: 0 auto 2rem;                 /* centered + 2 rem bottom spacing */
  list-style: none;                    /* reset bullet */
}

.site-navigation-block {
	background-color:rgb(236,239,244);
	padding: 2rem;
	border-radius:1rem;
}

/* kill the default UL indent completely */
.site-navigation ul {
  padding-left: 0;
  margin-left: 0;
}


/* Level-1 items: all parent pages */
.site-navigation > li {
  margin-bottom: 0.5rem;
}

/* Parent link or title */
.site-navigation > li.current-parent > a,
.site-navigation > li.current-parent > .parent-title {
  font-weight: bold;
  color: rgb(65,7,137);
}

/* All links in this nav share no underline and inherit color */
.site-navigation a {
  text-decoration: none;
  color: inherit;
}

.site-navigation a:over {
  text-decoration: underline;
  color: inherit;
}

/* Level-2 list: only the children of the current parent */
.site-navigation .child-list {
  list-style: none;
  margin: 0.25rem 0 0.5rem 1.25rem;
  padding-left: 0;
}

/* Each child item */
.site-navigation .child-list li {
  margin-bottom: 0.25rem;
}

/* Current page in the child list */
.site-navigation .child-list li.current-page > span {
  font-weight: bold;
  color: rgb(65,7,137);
}

/* === Global Material-style link underlines === */
:root {
  --link-color: rgb(65,7,137);
  --link-hover-color: rgb(27,54,93);
}

/* Base style for all links */
a {
  position: relative;              /* for the pseudo-element */
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

/* Underline pseudo-element, hidden by default */
a::after {
  content: "";
  position: absolute;
  left: 0px;
  bottom: -2px;                   /* slightly below text */
  width: 0;
  height: 1px;
  background-color: var(--link-color);
}

/* On hover: grow the line and tint the text */
a:hover {
  color: var(--link-hover-color);
}
a:hover::after {
  width: 100%;
}
.page-content {
  /* largeur de lecture optimale et centrage */
  max-width: var(--max-content-width);
  margin: 0 auto;              /* centre horizontalement */
  padding: 0 var(--gap);        /* même padding que vos articles, pour aligner la marge gauche */
  box-sizing: border-box;
}

/* 9. Layout “nav à gauche / contenu à droite” sur grand écran */
@media (min-width: 1500px) {
  .page-wrapper {
    display: flex;
    flex-direction: row;
    max-width: 1900px;
    margin: 0 auto;            /* centre l’ensemble */
    align-items: flex-start;
  }

  /* On masque le bouton burger */
  #menu-toggle {
    display: none;
  }
  /* Nav devient une colonne fixe à gauche */
  .page-wrapper > nav {
    position: static !important; /* désactive le drawer/mobile */
    transform: none   !important;
    width: var(--nav-width);
    max-width: none;
    margin: 0 var(--gap) 0 0;
    height: auto;
    overflow-y: auto;
  }

  /* Le reste (header+article+footer) prend tout le reste */
  .page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  /* On retire le max-width appliqué aux wrappers internes pour qu’ils remplissent .page-content */
  .site-header,
  article,
  footer {
    width: 100%;
    max-width: none;
    margin: 0;
  }
}
/* === Correction pour que le lien actif dans <summary> reste blanc === */
.side-nav li.has-children summary a.active {
  color: var(--nav-active-fg);   /* texte blanc */
  /* (le background gris est déjà pris en charge par .side-nav a.active) */
}

/* 1) Espacement entre chaque <li> */
.side-nav ul > li {
  margin-bottom: 0.25rem;  /* au lieu de 10px */
}

/* 2) Espacement entre un parent <details> et son suivant */
.side-nav li.has-children > details {
  margin-bottom: 0.25rem;  /* au lieu de var(--gap) */
}

/* 3) Hauteur des “lignes” (padding top/bottom) */
.side-nav a,
.side-nav li.has-children summary {
  padding-top: 0.25em;     /* au lieu de 0.5em */
  padding-bottom: 0.25em;  /* idem */
}

/* ==============================================
   1) Supprimer les marges “au-dessus” et “en-dessous”
      de la liste des enfants (nested <ul>)
   ============================================== */
.side-nav li.has-children > details > ul {
  margin-block-start: 0;   /* supprime l’espace au-dessus */
  margin-block-end:   0;   /* supprime l’espace en-dessous */
  padding-left:       1rem; /* ou la valeur d’indent souhaitée */
}

/* ==============================================
   2) Si vous voulez compacter encore un peu :
      réduire le gap entre le <summary> et la liste
   ============================================== */
.side-nav li.has-children > details {
  margin-bottom: 0.25rem;  /* déjà proposé, ajuste selon besoin */
  margin-top:    0.25rem;  /* réduit aussi l’espace au-dessus */
}

/* 3) (Optionnel) Resserrez le padding des <li> enfants */
.side-nav li.has-children > details > ul > li {
  margin-bottom: 0.25rem;
}