/* ==========================================================
   géoduc — Page Projets et pages projet
   Chargé uniquement par projets.html.twig et projet.html.twig.
   Préfixe des classes : .pj-  · conteneur : .gd-pj
   Mode sombre : fonds, bordures et textes dérivés des variables
   de Quark 2 (--q2-bg, --q2-text, --q2-text-muted) ou de
   currentColor ; seules les couleurs réseaux ont une valeur
   sombre dédiée (bloc « Mode sombre » plus bas).
   ========================================================== */

/* ---------- Variables ---------- */
.gd-pj {
  --pj-bg: var(--q2-bg, #fbfbfc);              /* fond de page */
  --pj-card: var(--q2-bg-elev, #ffffff);       /* cartes, comme .content-item */
  --pj-sunken: var(--q2-bg-muted, #f2f2f4);    /* zones en retrait */
  --pj-ink: var(--q2-text, #242424);
  --pj-muted: #4F555E;                         /* encre douce de la charte (contraste AA) */
  --pj-line: var(--q2-border-strong, rgba(34, 42, 53, .14));
  --pj-line-strong: color-mix(in srgb, currentColor 48%, transparent);
  --pj-grey: color-mix(in srgb, currentColor 22%, var(--pj-card));
  --pj-under: var(--pj-card);                  /* fond « sous » les symboles */
  --pj-accent: #1F6FB2;

  /* Couleurs réseaux : variables --gd-* communes, définies dans custom.css */
  --pj-ok: #0B6E77;      --pj-ok-soft: #DDF2F3;

  /* Bandeau de la page projet : toujours sombre */
  --pj-band: #16181D;
  --pj-band-ink: #F1F1EC;
  --pj-band-muted: #A9AEB6;
  --pj-band-line: #2E333B;
  --pj-band-raised: #1C1F25;

  /* Couleur du projet (gamme), réglée par les classes .tone-* */
  --pj-net: var(--pj-ink);
  --pj-net-ink: var(--pj-ink);
  --pj-net-soft: var(--pj-sunken);

  max-width: var(--gd-page-width, 1040px);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* ---------- Mode sombre ---------- */
:root[data-theme="dark"] .gd-pj {
  --pj-muted: #A9AEB6;
  --pj-accent: #7DB4E8;
  --pj-ok: #4FC9D2;      --pj-ok-soft: #0E2E31;
  --pj-band: #0C0E11;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .gd-pj {
    --pj-muted: #A9AEB6;
    --pj-accent: #7DB4E8;
    --pj-ok: #4FC9D2;      --pj-ok-soft: #0E2E31;
    --pj-band: #0C0E11;
  }
}

/* Couleur d'un projet selon sa gamme */
.gd-pj .tone-elec,    .gd-pj.tone-elec    { --pj-net: var(--gd-elec);    --pj-net-ink: var(--gd-elec-ink);    --pj-net-soft: var(--gd-elec-soft); }
.gd-pj .tone-gaz,     .gd-pj.tone-gaz     { --pj-net: var(--gd-gaz);     --pj-net-ink: var(--gd-gaz-ink);     --pj-net-soft: var(--gd-gaz-soft); }
.gd-pj .tone-eau,     .gd-pj.tone-eau     { --pj-net: var(--gd-eau);     --pj-net-ink: var(--gd-eau-ink);     --pj-net-soft: var(--gd-eau-soft); }
.gd-pj .tone-telecom, .gd-pj.tone-telecom { --pj-net: var(--gd-telecom); --pj-net-ink: var(--gd-telecom-ink); --pj-net-soft: var(--gd-telecom-soft); }
.gd-pj .tone-multi,   .gd-pj.tone-multi   { --pj-net: var(--gd-multi);   --pj-net-ink: var(--gd-multi-ink);   --pj-net-soft: var(--gd-multi-soft); }

/* Couleur réseau sur fond sombre (bandeau du projet, visuel « À la une ») :
   une seule teinte par gamme pour le symbole, le nom du produit et la pastille,
   identique dans les deux modes puisque ces fonds restent toujours sombres. */
.gd-pj .tone-elec,    .gd-pj.tone-elec    { --pj-net-band: #E8424F; }
.gd-pj .tone-gaz,     .gd-pj.tone-gaz     { --pj-net-band: #F2B705; }
.gd-pj .tone-eau,     .gd-pj.tone-eau     { --pj-net-band: #3E8BD0; }
.gd-pj .tone-telecom, .gd-pj.tone-telecom { --pj-net-band: #3BB36E; }
.gd-pj .tone-multi,   .gd-pj.tone-multi   { --pj-net-band: #C4C6BE; }

/* ---------- Typographie commune ---------- */
/* Quark 2 dessine un trait au-dessus de chaque h2 : on le garde pour les
   titres de section, on le retire des surtitres et du nom du projet à la une. */
.gd-pj h2.pj-overline::before,
.gd-pj .pj-une-nom::before { content: none; display: none; }
.gd-pj .pj-overline {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--pj-muted);
}
.gd-pj .pj-h2 {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.02em;
}
.gd-pj .pj-h3 {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 1.375rem;
  line-height: 1.3;
  font-weight: 700;
}
.gd-pj .pj-date {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .75rem;
  color: var(--pj-muted);
}
.gd-pj .pj-vide { margin: 0; font-size: .875rem; color: var(--pj-muted); }
.gd-pj .pj-produit { color: var(--pj-net-ink); }

/* ---------- Symboles ---------- */
.gd-pj .pj-sym { display: block; flex: none; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.gd-pj .pj-sym .n { stroke: var(--pj-net); }
.gd-pj .pj-sym .k { stroke: currentColor; }
.gd-pj .pj-sym .u { fill: var(--pj-under); }
.gd-pj .pj-sym .d { fill: currentColor; stroke: none; }
.gd-pj .pj-sym .g { stroke: var(--pj-grey); }
.gd-pj .pj-sym .m { stroke: var(--pj-muted); }
.gd-pj .pj-sym .w-elec    { stroke: var(--gd-elec); }
.gd-pj .pj-sym .w-gaz     { stroke: var(--gd-gaz); }
.gd-pj .pj-sym .w-eau     { stroke: var(--gd-eau); }
.gd-pj .pj-sym .w-telecom { stroke: var(--gd-telecom); }

/* Logos SVG fournis par un projet (logo_clair / logo_sombre) */
.gd-pj .pj-logo {
  display: block;
  flex: none;
  width: var(--t, 48px);
  height: var(--t, 48px);
  object-fit: contain;
}
.gd-pj .pj-logo-sombre { display: none; }
:root[data-theme="dark"] .gd-pj .pj-logo-clair { display: none; }
:root[data-theme="dark"] .gd-pj .pj-logo-sombre { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .gd-pj .pj-logo-clair { display: none; }
  :root:not([data-theme]) .gd-pj .pj-logo-sombre { display: block; }
}

.gd-pj .pj-sigle {
  width: var(--t, 44px);
  height: var(--t, 44px);
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--pj-sunken);
  color: var(--pj-muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: calc(var(--t, 44px) * .24);
  font-weight: 500;
}

/* ---------- Pastilles ---------- */
.gd-pj .pj-pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.gd-pj .pj-pill {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  height: 1.5rem;
  padding: 0 .625rem;
  box-sizing: border-box;
  border-radius: 9999px;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.gd-pj .pj-dot { width: 7px; height: 7px; border-radius: 9999px; background: currentColor; flex: none; }

.gd-pj .pj-st-en-cours   { background: var(--pj-ink); color: var(--pj-bg); }
.gd-pj .pj-st-en-cours .pj-dot { width: 6px; height: 6px; }
.gd-pj .pj-st-disponible { background: var(--pj-ok-soft); color: var(--pj-ok); }
.gd-pj .pj-st-disponible svg { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.gd-pj .pj-st-idee       { border: 1.5px dashed var(--pj-line-strong); color: var(--pj-muted); }
.gd-pj .pj-st-termine    { background: var(--pj-sunken); color: var(--pj-muted); }

.gd-pj .pj-gamme-elec    { background: var(--gd-elec-soft);    color: var(--gd-elec-ink); }
.gd-pj .pj-gamme-gaz     { background: var(--gd-gaz-soft);     color: var(--gd-gaz-ink); }
.gd-pj .pj-gamme-eau     { background: var(--gd-eau-soft);     color: var(--gd-eau-ink); }
.gd-pj .pj-gamme-telecom { background: var(--gd-telecom-soft); color: var(--gd-telecom-ink); }
.gd-pj .pj-gamme-multi   { background: var(--gd-multi-soft);   color: var(--gd-multi-ink); }
.gd-pj .pj-gamme-elec .pj-dot    { background: var(--gd-elec); }
.gd-pj .pj-gamme-gaz .pj-dot     { background: var(--gd-gaz); box-shadow: 0 0 0 1px #9C7400; }
.gd-pj .pj-gamme-eau .pj-dot     { background: var(--gd-eau); }
.gd-pj .pj-gamme-telecom .pj-dot { background: var(--gd-telecom); }
.gd-pj .pj-gamme-multi .pj-dot   { background: var(--gd-multi); }
.gd-pj .pj-type { background: var(--pj-sunken); color: var(--pj-muted); }

/* ---------- Liens et boutons ---------- */
.gd-pj a { color: var(--pj-accent); }
.gd-pj .pj-lien {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--pj-accent);
}
/* « Voir le projet » : bouton discret, sans soulignement ;
   au survol, couleur texte de la gamme du projet sur un léger fond */
.gd-pj .pj-voir,
.gd-pj .pj-voir:visited {
  min-height: 2.5rem;
  padding: 0 .625rem 0 .75rem;
  border-radius: 8px;
  color: var(--pj-ink);
  text-decoration: none;
  transition: color 120ms cubic-bezier(.16, 1, .3, 1), background-color 120ms cubic-bezier(.16, 1, .3, 1);
}
.gd-pj .pj-voir:hover {
  color: var(--pj-net-ink);
  background: var(--pj-sunken);
  text-decoration: none;
}
.gd-pj .tone-multi .pj-voir:hover { color: var(--pj-accent); }
.gd-pj .pj-voir svg { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform 120ms cubic-bezier(.16, 1, .3, 1); }
.gd-pj .pj-voir:hover svg { transform: translateX(2px); }
@media (prefers-reduced-motion: reduce) {
  .gd-pj .pj-voir, .gd-pj .pj-voir svg { transition: none; }
}

.gd-pj .pj-btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  min-height: 2.5rem;
  padding: 0 .875rem;
  box-sizing: border-box;
  border: 1.5px solid var(--pj-line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--pj-ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: .8125rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 120ms cubic-bezier(.16, 1, .3, 1);
}
.gd-pj .pj-btn:hover { background: var(--pj-sunken); color: var(--pj-ink); }
.gd-pj .pj-btn-plein { background: var(--pj-ink); border-color: var(--pj-ink); color: var(--pj-bg); }
.gd-pj .pj-btn-plein:hover { background: color-mix(in srgb, var(--pj-ink) 85%, var(--pj-bg)); color: var(--pj-bg); }
.gd-pj .pj-btn:focus-visible,
.gd-pj a:focus-visible {
  outline: 2px solid var(--pj-accent);
  outline-offset: 2px;
}
.gd-pj .pj-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .625rem 1.125rem; }

/* ==========================================================
   PAGE PROJETS (liste)
   ========================================================== */
.gd-pj .pj-head { display: flex; flex-direction: column; gap: .625rem; }
.gd-pj .pj-titre {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.07;
  letter-spacing: -.03em;
}
.gd-pj .pj-chapeau,
.gd-pj .pj-intro { margin: 0; max-width: 40rem; font-size: 1.0625rem; line-height: 1.55; color: var(--pj-muted); }
.gd-pj .pj-intro p { margin: 0 0 .75rem; }

/* À la une + actualités */
.gd-pj .pj-une-zone { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.gd-pj .pj-une {
  flex: 999 1 34rem;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  overflow: hidden;
  border: 1px solid var(--pj-line);
  border-radius: 14px;
  background: var(--pj-card);
}
.gd-pj .pj-une-visuel {
  --pj-under: var(--pj-band);
  flex: 1 1 13rem;
  min-height: 15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pj-band);
  color: var(--pj-band-ink);
}
.gd-pj .pj-une-visuel .pj-sym .n { stroke: var(--pj-net-band); }
.gd-pj .pj-une-texte { flex: 1 1 18rem; padding: 1.75rem; display: flex; flex-direction: column; gap: .875rem; }
.gd-pj .pj-une-nom {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -.04em;
}
.gd-pj .pj-une-nom a { color: var(--pj-ink); text-decoration: none; }
.gd-pj .pj-une-nom a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.gd-pj .pj-une-resume { margin: 0; font-size: 1.0625rem; line-height: 1.55; color: var(--pj-muted); }
.gd-pj .pj-faits {
  margin: 0;
  padding-top: .875rem;
  border-top: 1px solid var(--pj-line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .625rem 1rem;
  font-size: .8125rem;
}
.gd-pj .pj-faits div { display: flex; flex-direction: column; }
.gd-pj .pj-faits dt { color: var(--pj-muted); font-weight: 400; margin: 0; }
.gd-pj .pj-faits dd { margin: 0; font-family: "IBM Plex Mono", ui-monospace, monospace; font-weight: 500; }
.gd-pj .pj-une .pj-actions { margin-top: auto; }

.gd-pj .pj-actus {
  flex: 1 1 17rem;
  padding: 1.375rem;
  border-radius: 14px;
  background: var(--pj-sunken);
  display: flex;
  flex-direction: column;
  gap: .875rem;
}
.gd-pj .pj-actus-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.gd-pj .pj-actus-liste li { list-style: none; margin: 0; padding: .75rem 0; border-top: 1px solid var(--pj-line); }
.gd-pj .pj-actus-liste li:first-child { border-top: 0; padding-top: 0; }
.gd-pj .pj-actus-liste li::marker { content: none; }
.gd-pj .pj-actus-liste a { display: flex; flex-direction: column; gap: .375rem; color: var(--pj-ink); text-decoration: none; }
.gd-pj .pj-actus-liste a:hover .pj-actus-titre { text-decoration: underline; }
.gd-pj .pj-actus-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.gd-pj .pj-actus-projet {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  height: 1.375rem;
  padding: 0 .5rem 0 .3rem;
  border-radius: 9999px;
  background: var(--pj-card);
  color: var(--pj-ink);
  font-size: .75rem;
  font-weight: 600;
}
.gd-pj .pj-actus-titre {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 700;
}
.gd-pj .pj-actus-tout { margin-top: auto; align-self: flex-start; margin-left: -.75rem; }
/* « Tout le blog » : même bouton discret que « Voir le projet » ;
   au survol, bleu accent (le cadre n'appartient à aucune gamme), fond de carte sur le cadre gris */
.gd-pj .pj-actus-tout:hover { color: var(--pj-accent); background: var(--pj-card); }

/* Tous les projets */
.gd-pj .pj-tous { display: flex; flex-direction: column; gap: 1rem; }
.gd-pj .pj-tous-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; }
.gd-pj .pj-filtres { display: flex; flex-wrap: wrap; gap: .25rem; padding: .25rem; border-radius: 8px; background: var(--pj-sunken); }
.gd-pj .pj-filtres a {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0 .875rem;
  border-radius: 6px;
  color: var(--pj-muted);
  font-size: .8125rem;
  font-weight: 600;
  text-decoration: none;
}
.gd-pj .pj-filtres a:hover { color: var(--pj-ink); }
.gd-pj .pj-filtres a[aria-current] { background: var(--pj-card); color: var(--pj-ink); }

.gd-pj .pj-liste { border: 1px solid var(--pj-line); border-radius: 14px; background: var(--pj-card); padding: 0 1.25rem; }
.gd-pj .pj-liste > .pj-vide { padding: 1.25rem 0; }
.gd-pj .pj-ligne {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--pj-line);
}
.gd-pj .pj-ligne:first-child { border-top: 0; }
.gd-pj .pj-ligne-sym { flex: none; display: flex; }
.gd-pj .pj-ligne-texte { flex: 1 1 22rem; min-width: 0; display: flex; flex-direction: column; gap: .375rem; }
.gd-pj .pj-ligne-titre { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .625rem; }
.gd-pj .pj-ligne-nom {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.04em;
  color: var(--pj-ink);
  text-decoration: none;
}
.gd-pj .pj-ligne-nom:hover { text-decoration: underline; }
.gd-pj .pj-ligne-resume { margin: 0; font-size: .875rem; line-height: 1.45; color: var(--pj-muted); }
.gd-pj .pj-ligne-actions { flex: 0 1 auto; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .5rem 1rem; margin-left: auto; }
.gd-pj .pj-ligne-termine .pj-ligne-nom,
.gd-pj .pj-ligne-termine .pj-voisin-nom { color: var(--pj-muted); letter-spacing: -.02em; }

/* ==========================================================
   PAGE PROJET
   ========================================================== */
.gd-pj .pj-bandeau {
  --pj-under: var(--pj-band-raised);
  position: relative;
  overflow: visible;   /* laisse dépasser le menu des téléchargements */
  border-radius: 14px;
  border: 1px solid var(--pj-band-line);
  background: var(--pj-band);
  color: var(--pj-band-ink);
  padding: 1.5rem 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.gd-pj .pj-ariane a,
.gd-pj .pj-ariane a:visited {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 2rem;
  padding: 0 .625rem;
  margin-left: -.625rem;
  border-radius: 8px;
  color: var(--pj-band-ink);
  font-size: .8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 120ms cubic-bezier(.16, 1, .3, 1), background-color 120ms cubic-bezier(.16, 1, .3, 1);
}
.gd-pj .pj-ariane a:hover {
  color: var(--pj-net-band);
  background: var(--pj-band-raised);
  text-decoration: none;
}
.gd-pj .pj-bandeau-corps { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 1.75rem; }
.gd-pj .pj-bandeau-sym {
  width: 8rem;
  height: 8rem;
  flex: none;
  border-radius: 28px;
  background: var(--pj-band-raised);
  border: 1px solid var(--pj-band-line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gd-pj .pj-bandeau .pj-sym .n { stroke: var(--pj-net-band); }
.gd-pj .pj-bandeau-texte { flex: 1 1 22rem; min-width: 0; display: flex; flex-direction: column; gap: .75rem; }
.gd-pj .pj-bandeau-nom {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.07;
  letter-spacing: -.04em;
  color: var(--pj-band-ink);
}
.gd-pj .pj-bandeau .pj-produit { color: var(--pj-net-band); }
.gd-pj .pj-bandeau-resume { margin: 0; max-width: 39rem; font-size: 1.0625rem; line-height: 1.55; color: var(--pj-band-muted); }

/* Pastilles et boutons posés sur le bandeau sombre */
.gd-pj .pj-bandeau .pj-st-en-cours { background: var(--pj-band-ink); color: var(--pj-band); }
.gd-pj .pj-bandeau .pj-st-idee { border-color: #6E7580; color: var(--pj-band-muted); }
.gd-pj .pj-bandeau .pj-st-termine,
.gd-pj .pj-bandeau .pj-type,
.gd-pj .pj-bandeau .pj-gamme-multi { background: var(--pj-band-line); color: var(--pj-band-ink); }
.gd-pj .pj-bandeau .pj-st-disponible { background: #0E2E31; color: #4FC9D2; }
/* Pastille réseau sur le bandeau : texte clair, point dans la même teinte que le symbole et le nom */
.gd-pj .pj-bandeau .pj-gamme { background: var(--pj-band-line); color: var(--pj-band-ink); }
.gd-pj .pj-bandeau .pj-gamme .pj-dot { background: var(--pj-net-band); box-shadow: none; }
.gd-pj .pj-bandeau .pj-btn { border-color: #6E7580; color: var(--pj-band-ink); }
.gd-pj .pj-bandeau .pj-btn:hover { background: var(--pj-band-raised); }
.gd-pj .pj-bandeau .pj-btn-plein { background: var(--pj-band-ink); border-color: var(--pj-band-ink); color: var(--pj-band); }
.gd-pj .pj-bandeau .pj-btn-plein:hover { background: #ffffff; color: var(--pj-band); }
.gd-pj .pj-bandeau a:focus-visible { outline-color: #7DB4E8; }

/* Avancement */
.gd-pj .pj-avancement {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  padding: 1.125rem 1.5rem;
  border: 1px solid var(--pj-line);
  border-radius: 14px;
  background: var(--pj-card);
}
.gd-pj .pj-avance { flex: 1 1 26rem; display: flex; flex-direction: column; gap: .5rem; }
.gd-pj .pj-avance-roadmap { flex: none; margin-right: -.625rem; }
.gd-pj .pj-avance-piste { position: relative; height: 18px; --pos: 0%; }
.gd-pj .pj-avance-piste::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 7px;
  height: 4px;
  border-radius: 2px;
  background: var(--pj-sunken);
}
.gd-pj .pj-avance-fil {
  position: absolute;
  left: 0; top: 6px;
  width: var(--pos);
  height: 6px;
  border-radius: 3px;
  background: var(--pj-net);
}
.gd-pj .pj-avance-sommet {
  position: absolute;
  top: 0;
  left: clamp(0px, calc(var(--pos) - 9px), calc(100% - 18px));
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border-radius: 3px;
  background: var(--pj-card);
  border: 3px solid currentColor;
}
.gd-pj .pj-e0 { --pos: 0%; }
.gd-pj .pj-e1 { --pos: 25%; }
.gd-pj .pj-e2 { --pos: 50%; }
.gd-pj .pj-e3 { --pos: 75%; }
.gd-pj .pj-e4 { --pos: 100%; }
.gd-pj .pj-avance-etapes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: space-between;
  font-size: .75rem;
  color: var(--pj-muted);
}
.gd-pj .pj-avance-etapes li { list-style: none; margin: 0; }
.gd-pj .pj-avance-etapes li::marker { content: none; }
.gd-pj .pj-avance-etapes li[aria-current] { color: var(--pj-ink); font-weight: 600; }

/* Corps : présentation + colonne */
.gd-pj .pj-corps { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 2.5rem; }
.gd-pj .pj-presentation { flex: 999 1 30rem; min-width: 0; font-size: 1.0625rem; line-height: 1.65; }
.gd-pj .pj-presentation > :first-child { margin-top: 0; }
.gd-pj .pj-presentation h2 {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 2rem 0 .75rem;
}
.gd-pj .pj-presentation h3 {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 1.375rem;
  line-height: 1.3;
  font-weight: 700;
  margin: 1.75rem 0 .5rem;
}
.gd-pj .pj-presentation img { max-width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--pj-line); }
.gd-pj .pj-presentation pre,
.gd-pj .pj-presentation code { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.gd-pj .pj-presentation pre { background: var(--pj-sunken); border-radius: 8px; padding: .875rem 1rem; font-size: .8125rem; overflow-x: auto; }

.gd-pj .pj-cote { flex: 1 1 18rem; display: flex; flex-direction: column; gap: 1.25rem; }
.gd-pj .pj-fiche,
.gd-pj .pj-bloc { margin: 0; border: 1px solid var(--pj-line); border-radius: 14px; background: var(--pj-card); }
.gd-pj .pj-fiche { padding: .375rem 1.25rem; }
.gd-pj .pj-fiche div { display: flex; justify-content: space-between; gap: .75rem; padding: .625rem 0; border-top: 1px solid var(--pj-line); font-size: .875rem; }
.gd-pj .pj-fiche div:first-child { border-top: 0; }
.gd-pj .pj-fiche dt { margin: 0; color: var(--pj-muted); font-weight: 400; }
.gd-pj .pj-fiche dd { margin: 0; text-align: right; font-family: "IBM Plex Mono", ui-monospace, monospace; font-weight: 500; }
.gd-pj .pj-bloc { padding: 1.125rem 1.25rem; display: flex; flex-direction: column; gap: .75rem; }
.gd-pj .pj-bloc-retrait { border: 0; background: var(--pj-sunken); }
.gd-pj .pj-liens { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; font-size: .875rem; font-weight: 600; }
.gd-pj .pj-liens li { list-style: none; margin: 0; }
.gd-pj .pj-liens li::marker { content: none; }
.gd-pj .pj-bloc .pj-actus-titre { font-size: .9375rem; }
.gd-pj .pj-bloc .pj-actus-liste a { gap: .2rem; }
.gd-pj .pj-versions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.gd-pj .pj-versions li { list-style: none; margin: 0; padding: .5rem 0; border-top: 1px solid var(--pj-line); display: flex; flex-direction: column; gap: .125rem; }
.gd-pj .pj-versions li:first-child { border-top: 0; padding-top: 0; }
.gd-pj .pj-versions li::marker { content: none; }
.gd-pj .pj-version-tete { display: flex; justify-content: space-between; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .8125rem; font-weight: 500; }
.gd-pj .pj-version-note { font-size: .8125rem; line-height: 1.45; color: var(--pj-muted); }

/* Dans la gamme */
.gd-pj .pj-voisins { display: flex; flex-direction: column; gap: .875rem; padding-top: 1.75rem; border-top: 1px solid var(--pj-line); }
.gd-pj .pj-voisins-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 1rem; }
.gd-pj .pj-voisin {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: 1.125rem;
  border: 1px solid var(--pj-line);
  border-radius: 14px;
  background: var(--pj-card);
  color: var(--pj-ink);
  text-decoration: none;
}
.gd-pj .pj-voisin:hover { border-color: var(--pj-line-strong); }
.gd-pj .pj-voisin > span { display: flex; flex-direction: column; gap: .125rem; min-width: 0; }
.gd-pj .pj-voisin-nom { font-family: "Space Grotesk", system-ui, sans-serif; font-size: 1.125rem; font-weight: 700; letter-spacing: -.04em; }
.gd-pj .pj-voisin-resume { font-size: .8125rem; color: var(--pj-muted); }

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .gd-pj { gap: 2rem; }
  .gd-pj .pj-ligne-actions { margin-left: 0; justify-content: flex-start; }
  .gd-pj .pj-bandeau { padding: 1.25rem; }
  .gd-pj .pj-une-texte { padding: 1.25rem; }
  .gd-pj .pj-avance-etapes { font-size: .6875rem; }
}

@media (prefers-reduced-motion: reduce) {
  .gd-pj .pj-btn { transition: none; }
}

/* ==========================================================
   BOUTON TÉLÉCHARGER (page Projets et page d'un projet)
   Bouton principal = premier lien de la liste « telechargements » ;
   la flèche ouvre les autres (élément <details>, fermé par js/projets.js).
   ========================================================== */
.gd-pj .pj-dl { position: relative; display: inline-flex; align-items: stretch; }
/* Picto SVG personnalisé : le fichier sert de masque, la couleur vient du texte (suit le thème) */
.gd-pj .pj-dl-ico {
  display: inline-block;
  flex: none;
  width: 1.125em;
  height: 1.125em;
  background-color: currentColor;
  -webkit-mask: var(--pj-ico) center / contain no-repeat;
          mask: var(--pj-ico) center / contain no-repeat;
}
.gd-pj .pj-dl-menu a .pj-dl-ico { width: 1.125rem; height: 1rem; color: var(--pj-muted); }
.gd-pj .pj-dl-menu a:hover .pj-dl-ico { color: inherit; }
.gd-pj .pj-dl-plat {
  margin-left: .375rem;
  padding-left: .5rem;
  border-left: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  font-weight: 500;
  opacity: .85;
}
.gd-pj .pj-dl-multi .pj-dl-main { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.gd-pj .pj-dl-plus { position: static; display: flex; margin: 0; padding: 0; border: 0; }
.gd-pj .pj-dl-plus > summary.pj-dl-fleche { margin: 0; height: auto; line-height: 1; }
.gd-pj .pj-dl-fleche {
  list-style: none;
  cursor: pointer;
  min-width: 2.25rem;
  padding: 0 .5rem;
  justify-content: center;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 1px solid color-mix(in srgb, var(--pj-bg) 30%, transparent);
  user-select: none;
}
.gd-pj .pj-dl-fleche::-webkit-details-marker { display: none; }
.gd-pj .pj-dl-fleche::marker { content: none; }
.gd-pj .pj-dl-fleche::after,
.gd-pj .pj-dl-fleche::before { content: none !important; display: none !important; }
.gd-pj .pj-dl-fleche svg { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform 120ms cubic-bezier(.16, 1, .3, 1); }
.gd-pj .pj-dl-plus[open] .pj-dl-fleche svg { transform: rotate(180deg); }
.gd-pj .pj-dl-fleche:focus-visible { outline: 2px solid var(--pj-accent); outline-offset: 2px; }

.gd-pj .pj-dl-menu {
  position: absolute;
  top: calc(100% + .375rem);
  right: 0;
  z-index: 30;
  min-width: 100%;
  width: max-content;
  max-width: min(22rem, calc(100vw - 2rem));
  margin: 0;
  padding: .375rem;
  list-style: none;
  border: 1px solid var(--pj-line);
  border-radius: 12px;
  background: var(--pj-card);
  color: var(--pj-ink);
  box-shadow: var(--q2-shadow-dropdown, 0 4px 8px rgba(22, 24, 29, .08), 0 12px 28px -2px rgba(22, 24, 29, .18));
}
.gd-pj .pj-dl-menu li { list-style: none; margin: 0; }
.gd-pj .pj-dl-menu li::marker { content: none; }
.gd-pj .pj-dl-menu a,
.gd-pj .pj-dl-menu a:visited {
  display: flex;
  align-items: center;
  gap: .625rem;
  min-height: 2.5rem;
  padding: .375rem .75rem;
  border-radius: 8px;
  color: var(--pj-ink);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.gd-pj .pj-dl-menu a i { width: 1.125rem; text-align: center; color: var(--pj-muted); }
.gd-pj .pj-dl-menu a:hover,
.gd-pj .pj-dl-menu a:focus-visible { background: var(--pj-sunken); color: var(--pj-net-ink); text-decoration: none; outline: none; }
.gd-pj .tone-multi .pj-dl-menu a:hover,
.gd-pj.tone-multi .pj-dl-menu a:hover { color: var(--pj-accent); }
.gd-pj .pj-dl-menu a:hover i { color: inherit; }
.gd-pj .pj-dl-detail {
  margin-left: auto;
  padding-left: 1rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .75rem;
  font-weight: 400;
  color: var(--pj-muted);
}
/* Sur le bandeau sombre, le bouton garde les couleurs du bandeau ; le menu reste une carte du thème */
.gd-pj .pj-bandeau .pj-dl-fleche { border-left-color: color-mix(in srgb, var(--pj-band) 35%, transparent); }
@media (max-width: 40rem) {
  .gd-pj .pj-dl-menu { right: auto; left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .gd-pj .pj-dl-fleche svg { transition: none; }
}
