/*
 * WebDelphes - feuille du site public (charte, section 12).
 * Seuls les roles --wd-* de tokens.css portent une couleur. Aucun style en
 * ligne : la page passe une CSP sans 'unsafe-inline'.
 */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--wd-espace-5);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

body {
  margin: 0;
  background: var(--wd-fond);
  color: var(--wd-texte);
  font: var(--wd-graisse-normale) var(--wd-taille-l)/var(--wd-interligne) var(--wd-police-texte);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }

h1, h2, h3 { margin: 0; line-height: var(--wd-interligne-serre); text-wrap: balance; }
h1 { font-size: var(--wd-taille-5xl); font-weight: var(--wd-graisse-titre); letter-spacing: -0.02em; }
h2 { font-size: var(--wd-taille-3xl); font-weight: var(--wd-graisse-titre); letter-spacing: -0.01em; }
h3 { font-size: var(--wd-taille-xl); font-weight: var(--wd-graisse-forte); }
p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--wd-marque-texte); text-underline-offset: 2px; }
code { font-family: var(--wd-police-code); font-size: 0.9em; overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--wd-focus); outline-offset: 2px; border-radius: var(--wd-rayon-s); }

.insecable { white-space: nowrap; }

.evitement {
  position: absolute;
  left: var(--wd-espace-4);
  top: calc(-1 * var(--wd-espace-8));
  padding: var(--wd-espace-2) var(--wd-espace-4);
  background: var(--wd-surface);
  color: var(--wd-texte);
  border-radius: var(--wd-rayon);
  z-index: 10;
}
.evitement:focus { top: var(--wd-espace-2); }

.conteneur {
  width: 100%;
  max-width: calc(var(--wd-largeur-site) + 2 * var(--wd-espace-6));
  margin-inline: auto;
  padding-inline: var(--wd-espace-6);
}

/* ---- Barre de navigation ---- */
.nav {
  background: var(--wd-nav-fond);
  border-bottom: 3px solid var(--wd-nav-filet);
  color: var(--wd-nav-texte);
}
.nav .conteneur {
  display: flex;
  align-items: center;
  gap: var(--wd-espace-6);
  min-height: var(--wd-hauteur-nav-site);
}
.nav a { color: var(--wd-nav-texte); text-decoration: none; }
.nav a:hover { color: var(--wd-nav-actif); text-decoration: underline; }
.nav :focus-visible { outline-color: var(--wd-nav-actif); }
.marque-nav {
  display: inline-flex;
  align-items: center;
  gap: var(--wd-espace-3);
  font-size: var(--wd-taille-xl);
  font-weight: var(--wd-graisse-forte);
}
.marque-nav img { width: 32px; height: 32px; }
.nav-bureau { display: flex; align-items: center; gap: var(--wd-espace-6); margin-left: auto; }
.nav-mobile { display: none; }
.nav-liens, .langues { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; }
.nav-liens { gap: var(--wd-espace-5); }
.nav-liens [aria-current="page"] { color: var(--wd-nav-actif); text-decoration: underline; text-underline-offset: 6px; }
.langues { gap: var(--wd-espace-3); font-size: var(--wd-taille-m); }
.langues [aria-current="true"] { color: var(--wd-nav-actif); font-weight: var(--wd-graisse-forte); }

/* ---- Boutons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--wd-hauteur-controle-site);
  padding: var(--wd-espace-2) var(--wd-espace-5);
  border: 1px solid transparent;
  border-radius: var(--wd-rayon);
  font-size: var(--wd-taille-l);
  font-weight: var(--wd-graisse-forte);
  text-decoration: none;
  transition: background var(--wd-transition);
}
.btn-principal { background: var(--wd-marque); color: var(--wd-marque-sur); }
.btn-principal:hover { background: var(--wd-marque-survol); }
.btn-principal:active { background: var(--wd-marque-presse); }
.btn-secondaire { background: var(--wd-surface); color: var(--wd-texte); border-color: var(--wd-bordure-forte); }
.btn-secondaire:hover { background: var(--wd-surface-3); }

/* ---- Bandes ---- */
.bande { padding-block: var(--wd-espace-8); }
.bande-surface { background: var(--wd-surface); border-bottom: 1px solid var(--wd-bordure); }
.bande-sombre { background: var(--wd-nav-fond); color: var(--wd-nav-texte); }
.bande-sombre h2, .bande-sombre h3 { color: var(--wd-nav-actif); }
.entete { max-width: var(--wd-largeur-lecture); margin-bottom: var(--wd-espace-6); }
.entete p { margin-top: var(--wd-espace-3); color: var(--wd-texte-2); }
.bande-sombre .entete p { color: var(--wd-nav-texte); }

/* ---- Bandeau d'accueil ---- */
.bandeau { padding-block: var(--wd-espace-7) var(--wd-espace-6); }
.bandeau-texte { max-width: 960px; }
.bandeau-texte > p { margin-top: var(--wd-espace-4); font-size: var(--wd-taille-xl); color: var(--wd-texte-2); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--wd-espace-4); margin-top: var(--wd-espace-5); }
.identifiants { margin-top: var(--wd-espace-3); font-size: var(--wd-taille-m); color: var(--wd-texte-2); }
.capture { margin: var(--wd-espace-6) 0 0; }
.capture img { width: 100%; border: 1px solid var(--wd-bordure); border-radius: var(--wd-rayon); }
.capture figcaption { margin-top: var(--wd-espace-2); font-size: var(--wd-taille-s); color: var(--wd-texte-discret); }

/* ---- Cartes problème ---- */
.grille { display: grid; gap: var(--wd-espace-5); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.probleme {
  display: flex;
  flex-direction: column;
  gap: var(--wd-espace-3);
  padding: var(--wd-espace-5);
  background: var(--wd-surface);
  border: 1px solid var(--wd-bordure);
  border-radius: var(--wd-rayon);
}
.probleme p { color: var(--wd-texte-2); }
.probleme .vues { font-size: var(--wd-taille-s); color: var(--wd-texte-discret); }
.probleme .pied {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--wd-espace-3);
  margin-top: auto;
  padding-top: var(--wd-espace-3);
}
.edition {
  padding: 2px var(--wd-espace-2);
  border: 1px solid var(--wd-bordure);
  border-radius: var(--wd-rayon-s);
  font-size: var(--wd-taille-xs);
  font-weight: var(--wd-graisse-moyenne);
  color: var(--wd-texte-2);
}
.lien-action { font-size: var(--wd-taille-m); font-weight: var(--wd-graisse-moyenne); white-space: nowrap; }

/* ---- Arguments ---- */
.argument h3 { margin-bottom: var(--wd-espace-2); }
.bande-sombre a { color: var(--wd-nav-actif); }
.bande-sombre code { color: var(--wd-nav-actif); }

/* ---- Éditions ---- */
.editions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.edition-carte {
  display: flex;
  flex-direction: column;
  gap: var(--wd-espace-3);
  padding: var(--wd-espace-5);
  background: var(--wd-surface);
  border: 1px solid var(--wd-bordure);
  border-radius: var(--wd-rayon);
}
.edition-carte p { color: var(--wd-texte-2); }
.edition-carte .lien-action { margin-top: auto; padding-top: var(--wd-espace-2); }
.liste-sobre { margin: 0; padding-left: var(--wd-espace-5); color: var(--wd-texte-2); }
.liste-sobre li + li { margin-top: var(--wd-espace-1); }
.note {
  margin-top: var(--wd-espace-5);
  padding: var(--wd-espace-3) var(--wd-espace-4);
  background: var(--wd-info-fond);
  border-left: 3px solid var(--wd-info);
  color: var(--wd-texte);
}

/* ---- Pied de page ---- */
.pied-site { padding-block: var(--wd-espace-6); background: var(--wd-nav-fond); color: var(--wd-nav-texte); font-size: var(--wd-taille-s); }
.pied-site a { color: var(--wd-nav-texte); }
.pied-site a:hover { color: var(--wd-nav-actif); }
.pied-liens { display: flex; flex-wrap: wrap; gap: var(--wd-espace-2) var(--wd-espace-5); list-style: none; margin: 0 0 var(--wd-espace-3); padding: 0; }
.pied-site p { color: var(--wd-nav-texte-discret); max-width: var(--wd-largeur-lecture); }

/* ---- Adaptation : conçu pour 1920 x 1080, puis réduit ---- */
@media (max-width: 1279px) {
  .conteneur { padding-inline: var(--wd-espace-5); }
  .nav .conteneur, .nav-bureau { gap: var(--wd-espace-5); }
  .nav-liens { gap: var(--wd-espace-4); }
}

@media (max-width: 1023px) {
  h1 { font-size: var(--wd-taille-4xl); }
  .grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .arguments { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767px) {
  .nav .conteneur { flex-wrap: wrap; gap: 0; }
  .marque-nav { min-height: var(--wd-hauteur-nav-site); }
  .nav-bureau { display: none; }
  .nav-mobile { display: contents; }
  .nav-mobile > summary {
    display: inline-flex;
    align-items: center;
    min-height: var(--wd-hauteur-tactile);
    margin-left: auto;
    padding-inline: var(--wd-espace-3);
    border: 1px solid var(--wd-nav-texte-discret);
    border-radius: var(--wd-rayon);
    cursor: pointer;
    list-style: none;
  }
  .nav-mobile > summary::-webkit-details-marker { display: none; }
  .nav-mobile nav { flex: 0 0 100%; padding-block: var(--wd-espace-3); }
  .nav-mobile .nav-liens { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-mobile .langues { margin-top: var(--wd-espace-2); gap: var(--wd-espace-4); }
  .nav-liens a, .langues a { display: flex; align-items: center; min-height: var(--wd-hauteur-tactile); }
  .btn { min-height: var(--wd-hauteur-tactile); }
  .bande { padding-block: var(--wd-espace-7); }
  .grille, .editions { grid-template-columns: minmax(0, 1fr); }
  .lien-action { min-height: var(--wd-hauteur-tactile); display: inline-flex; align-items: center; }
  .bandeau-texte > p { font-size: var(--wd-taille-l); }
}

@media (max-width: 479px) {
  .conteneur { padding-inline: var(--wd-espace-4); }
  h1 { font-size: var(--wd-taille-3xl); }
  h2 { font-size: var(--wd-taille-2xl); }
  .actions .btn { width: 100%; }
}
