:root {
  /* Colonne: quasi pleine largeur si étroit ; 5/9 si large (voir @media) */
  --text: #545454;
  --muted: #6a6a6a;
  --border: #e0e0e0;
  --accent: #2a6;
  --bg-sub: #f8f8f8;
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans: "Raleway", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/playfair-display-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Raleway";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/raleway-latin.woff2") format("woff2");
}



* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 100%;
  line-height: 1.5;
  color: var(--text);
  background: #fff;
  word-wrap: break-word;
}

/* ---- Header / nav (sans-serif, discret) ---- */
header {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 100;
}
nav {
  max-width: 60rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  position: relative;
}

/* Burger – hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 1px;
}
.logo-home.brand-mobile {
  display: none; /* masqué desktop ; le logo du menu suffit */
}

.menu {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem 1.1rem;
  align-items: center;
  justify-content: center;
}
.menu-home {
  display: flex;
  align-items: center;
}
.logo-home {
  display: flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}
.logo-home img {
  height: 3rem;
  width: auto;
  display: block;
}
.menu-lang a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}
.menu-lang a:hover {
  color: var(--accent);
}
.menu > li { position: relative; }
.menu a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.3rem 0.15rem;
  display: block;
  font-size: 0.95rem;
}
.menu a:hover { color: var(--accent); }

.menu-parent-row {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.menu-parent-link {
  color: var(--muted);
  text-decoration: none;
  padding: 0.3rem 0.15rem;
  font-size: 0.95rem;
}
.menu-parent-link:hover { color: var(--accent); }
.submenu-toggle {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  font-size: 0.75rem;
  line-height: 1;
}
.submenu-toggle:hover { color: var(--accent); }

.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  list-style: none;
  margin: 0;
  padding: 0.4rem 0;
  z-index: 200;
}
.submenu li a {
  padding: 0.45rem 1rem;
  white-space: nowrap;
  color: var(--text);
  font-size: 0.9rem;
}
.submenu li a:hover {
  background: var(--bg-sub);
  color: var(--accent);
}

/* Desktop: hover opens submenu */
@media (min-width: 701px) {
  .has-children:hover > .submenu,
  .has-children:focus-within > .submenu,
  .has-children.open > .submenu {
    display: block;
  }
}

/* Mobile / touch */
@media (max-width: 700px) {
  nav {
    justify-content: space-between;
  }
  .logo-home.brand-mobile {
    display: flex;
  }
  .logo-home.brand-mobile img {
    height: 2.25rem;
  }
  .nav-toggle {
    display: flex;
  }
  .menu {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 0.35rem;
  }
  header.nav-open .menu {
    display: flex;
  }
  .menu-home {
    display: none; /* logo déjà dans la barre */
  }
  .menu > li {
    border-bottom: 1px solid var(--border);
  }
  .menu > li > a,
  .menu-parent-row {
    padding: 0.65rem 0.25rem;
  }
  .menu-parent-row {
    justify-content: space-between;
    width: 100%;
  }
  .submenu-toggle {
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
  }
  .submenu {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--border);
    padding: 0;
    min-width: 0;
    background: var(--bg-sub);
  }
  .has-children.open > .submenu {
    display: block;
  }
  .submenu li a {
    padding: 0.55rem 1rem;
    white-space: normal;
  }
  .menu-lang {
    border-bottom: none;
    padding: 0.65rem 0.25rem;
  }
}

/* ---- Main content ---- */
main {
  width: calc(min(100% - 10mm, 50% + 30mm));
  margin: 0 auto;
  padding: 3.5rem 0 4rem;
}

/* Corps de page un peu plus grand que le 100% body, comme Chosen */
article {
  font-size: 1.0625em;
  line-height: 1.4118;
}

article > h1:first-child {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 2.75rem;   /* taille fixe – ne suit pas la largeur */
  line-height: 1.2;
  text-align: center;
  margin: 0 0 2.75rem;
  letter-spacing: -0.01em;
  color: #2B2B2B;
}

h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.3;
  color: #2B2B2B;
}

h2 {
  font-size: 1.65rem;
  margin: 2.75rem 0 1.1rem;
}

h3 {
  font-size: 1.3rem;
  margin: 2.2rem 0 0.9rem;
}

p {
  margin: 0 0 1.15rem;
}

ul, ol {
  margin: 0 0 1.25rem;
  padding-left: 1.4rem;
}
li { margin-bottom: 0.35rem; }

a { color: var(--accent); }

/* ---- Footer ---- */
footer {
  width: calc(min(100% - 10mm, 50% + 30mm));
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---- Media ---- */
img, svg { max-width: 100%; height: auto; }

/* ---- Generic tables ---- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
th, td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: top;
}
th { background: #f7f7f7; font-weight: 600; }

/* ---- Home two-cols ---- */
.two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* minmax(0,…) évite le débordement */
  gap: 2rem;
  margin: 2.5rem 0;
  width: 100%;
}
.two-cols > * {
  min-width: 0; /* indispensable pour que la grille respecte la colonne parente */
}
.logo-title {
  text-align: center;
  margin: 0.5rem 0 2.5rem;
}
.logo-title img {
  display: block;
  width: 100%;
  max-width: 500px;
  height: auto;
  margin: 0 auto;
}
.diagrams .diagram {
  text-align: left;
}
.diagrams .diagram img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: min(280px, 100%); /* ne dépasse jamais la cellule */
  width: auto;
  height: auto;
  margin-bottom: 0.75rem;
}
.diagrams h3 {
  margin-top: 0.5rem;
  text-align: left;
}

/* ---- Graphs (Graphviz) ---- */
.graph {
  text-align: center;
  margin: 2rem 0;
}
.graph img {
  max-width: 100%;
  height: auto;
}

/* ---- Comparison table ---- */
table.comparison {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 1.5rem 0;
}
table.comparison th,
table.comparison td {
  border: 1px solid var(--border);
  padding: 0.35rem 0.6rem;
  vertical-align: top;
}
table.comparison th {
  background: #f0f0f0;
  text-align: center;
  font-weight: 600;
  font-family: var(--font-sans);
}
table.comparison tr.question td {
  background: #f7f7f7;
  font-weight: 600;
  padding: 0.45rem 0.6rem;
}
table.comparison tr.answers td {
  padding-left: 1.2rem;
}

@media (max-width: 700px) {
  /* titres: taille inchangée */
  .two-cols { grid-template-columns: 1fr; }
}

@media (max-width: 500px) {
  table.comparison { font-size: 0.85rem; }
  table.comparison th,
  table.comparison td { padding: 0.3rem 0.4rem; }
  table.comparison tr.answers td { padding-left: 0.6rem; }
}
