/* ══════════════════════════════════════════════════════════
   Aurore Énergies · « Les projets près de chez vous »
   (/autoconsommation-collective/projets)
   Chargée par includes/templates/projets.php ($page_css = ['projets']).
   Mobile-first, paliers 768 et 1024 px. Jetons et composants : style.css.
   Spécification : handoff « H · Projets », « Page projets », « Fiche projet ».
   ══════════════════════════════════════════════════════════ */

/* ── Hero court (papier) ────────────────────────────────── */
/* Bas de section plus court que --py : 40 / 56 / 56 → 72 px (handoff --syh). */
.projets-hero {
  display: flex; flex-direction: column; gap: var(--gap);
  padding-top: 8px; padding-bottom: 40px;
}
.projets-hero__grid {
  display: grid; grid-template-columns: minmax(0, 1fr);
  gap: var(--gap); align-items: center;
}
.projets-hero__text { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.projets-hero__title { max-width: 780px; }
.projets-hero__chapo { max-width: 620px; }
.projets-hero__reassurance {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; line-height: 1.4; color: var(--muted);
}

/* ── Grille de fiches (blanc) ───────────────────────────── */
.projets-grille { display: flex; flex-direction: column; gap: 28px; }
.projets-grille__head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px 24px;
}
.projets-grille__compte { font-size: 16px; font-weight: 700; color: var(--muted); }

.projets-liste {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px;
}
.projets-liste__item { display: flex; min-width: 0; }

.projets-repli { max-width: 720px; font-size: 16px; line-height: 1.55; color: var(--text-2); }
.projets-repli__lien {
  font-weight: 700; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--ring);
  text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.projets-repli__lien:hover { color: var(--ink); text-decoration-color: var(--ink); }

/* ── Fiche projet ───────────────────────────────────────── */
/* Hauteur égale dans la grille : l'<article> remplit le <li> (flex), le
   bouton est calé en bas (margin-top: auto). */
.projet {
  flex: 1; width: 100%; min-width: 0;
  display: flex; flex-direction: column; gap: 18px;
  padding: 24px;
  background: var(--white); color: var(--ink);
  border: 1px solid var(--line); border-radius: 24px;
}
.projet__badge {
  align-self: flex-start;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 8px; border-radius: var(--pill);
  background: var(--tint); color: var(--ochre-tint);
  font-size: 13px; font-weight: 700; line-height: 1.2;
  letter-spacing: .1em; text-transform: uppercase;
}
.projet__badge-disc {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--yellow); color: var(--ink);
}
/* Commune longue (« Saint-Thomas-de-Courceriers ») : coupure après les traits
   d'union, puis n'importe où plutôt que de déborder à 360 px. */
.projet__titre {
  font-size: 26px; line-height: 1.12; font-weight: 800; letter-spacing: -.02em;
  overflow-wrap: anywhere; text-wrap: balance;
}
.projet__cp {
  font-size: 18px; font-weight: 600; letter-spacing: 0;
  color: var(--muted); white-space: nowrap;
}
.projet__infos { display: flex; flex-direction: column; }
.projet__info {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.projet__info:last-child { border-bottom: 1px solid var(--line); }
.projet__dt { font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--muted); }
.projet__dd { font-size: 17px; font-weight: 700; line-height: 1.35; }
.projet__adresse { overflow-wrap: anywhere; }
.projet__volume { white-space: nowrap; }
.projet__mwh { font-size: 34px; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; }
.projet__unite { font-size: 17px; font-weight: 700; }

.projet__btn {
  margin-top: auto;
  display: flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 12px 24px; border-radius: var(--pill);
  background: var(--yellow); color: var(--ink);
  font-size: 17px; font-weight: 700; line-height: 1.25; text-align: center;
  transition: background-color .15s ease-out, color .15s ease-out;
}
.projet__btn:hover { background: var(--ink); color: var(--yellow); }
.projet__btn-label { min-width: 0; }

/* ── Carte des projets ──────────────────────────────────── */
/* Même tracé que la carte À propos ; repères et noms en HTML, positionnés
   en % (--x, --y posés par carte_projets()) et dimensionnés en cqi. */
.carte-projets {
  width: 100%; max-width: 600px;
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px; border-radius: 28px;
}
.carte-projets--hero { background: var(--white); justify-self: end; display: none; }
.carte-projets--bas  { background: var(--paper); }
.carte-projets__cadre {
  position: relative; width: 100%; aspect-ratio: 600 / 407;
  container-type: inline-size;
}
.carte-projets__svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.carte-projets__repere,
.carte-projets__nom { position: absolute; left: var(--x); top: var(--y); }
.carte-projets__repere {
  width: 3.2cqi; height: 3.2cqi; min-width: 14px; min-height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--yellow);
  box-shadow: inset 0 0 0 max(4px, 1cqi) var(--ink);
}
.carte-projets__nom {
  padding: .3cqi 1.4cqi; border-radius: var(--pill);
  background: var(--white); box-shadow: 0 0 0 1px var(--line);
  font-size: max(11px, 2.9cqi); font-weight: 700; line-height: 1.2; white-space: nowrap;
}
.carte-projets__nom--gauche { transform: translate(calc(-100% - 2.4cqi), -50%); }
.carte-projets__nom--droite { transform: translate(2.4cqi, -50%); }

.carte-projets__ville {
  position: absolute; border-radius: var(--pill); line-height: 1.2; white-space: nowrap;
}
.carte-projets__ville--nantes {
  left: 59.47%; top: 61.47%; transform: translate(calc(-100% - 2cqi), -115%);
  padding: .3cqi 1.2cqi; background: var(--white); color: var(--muted);
  font-size: max(10px, 2.7cqi); font-weight: 600;
}
.carte-projets__ville--clisson {
  left: 63.78%; top: 66.02%; transform: translate(3cqi, -30%);
  padding: .4cqi 1.6cqi; background: var(--ink); color: var(--yellow);
  font-size: max(11px, 2.9cqi); font-weight: 800;
}

.carte-projets__legende {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  padding: 2px 8px 6px;
  font-size: 14px; line-height: 1.4; color: var(--muted);
}
.carte-projets__cle { display: flex; align-items: center; gap: 8px; }
.carte-projets__pastille {
  flex: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--yellow); box-shadow: inset 0 0 0 4px var(--ink);
}
.carte-projets__pastille--aurore { box-shadow: none; border: 3px solid var(--ink); }

/* ── Qui peut participer (teinte sur papier) ────────────── */
.projets-qui__box {
  display: grid; grid-template-columns: minmax(0, 1fr);
  gap: 24px var(--gap); align-items: start;
  padding: 28px 20px; border-radius: 28px;
  background: var(--tint);
}
.projets-qui__head,
.projets-qui__body { display: flex; flex-direction: column; min-width: 0; }
.projets-qui__head { gap: 16px; }
.projets-qui__body { gap: 20px; }
.projets-qui__intro { font-size: var(--body-lg); line-height: 1.6; color: var(--text-2); text-wrap: pretty; }
.projets-checks { display: flex; flex-direction: column; gap: 14px; }
.projets-checks__item {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: var(--body-lg); line-height: 1.5;
}
.projets-checks__icon {
  flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--yellow);
}
/* Lien sur la teinte : soulignement encre (le --ring y ferait moins de 3:1). */
.projets-qui__lien { text-decoration-color: var(--ink); }

/* ── Pour aller plus loin : carte vers le pilier ────────── */
.projets-loin { display: flex; flex-direction: column; gap: 24px; }
.projets-pilier {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  max-width: 880px; padding: 24px 24px 24px 28px;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: 24px;
  transition: border-color .15s ease-out;
}
.projets-pilier:hover { color: var(--ink); border-color: var(--ink); }
.projets-pilier__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.projets-pilier__titre {
  font-size: 22px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em;
  text-wrap: balance;
}
.projets-pilier__texte { font-size: 15px; line-height: 1.45; color: var(--muted); }
.projets-pilier__fleche {
  flex: none; width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--yellow); color: var(--ink);
  transition: background-color .15s ease-out;
}
.projets-pilier:hover .projets-pilier__fleche { background: var(--yellow-hover); }

/* ══════════════════════════════════════════════════════════
   Tablette : ≥ 768 px
   ══════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  /* Texte courant 17 px dès 768 (handoff --body), comme le gabarit A. */
  .is-projets { --body-lg: 17px; }
  .projets-hero { padding-bottom: 56px; }
  .projets-liste { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .projets-qui__box { padding: 40px; }
}

/* ══════════════════════════════════════════════════════════
   Desktop : ≥ 1024 px
   La carte passe dans la colonne droite du hero.
   ══════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
  .projets-hero { padding-bottom: clamp(56px, 3.846vw + 16.62px, 72px); }
  .projets-hero--carte .projets-hero__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .carte-projets--hero { display: flex; }
  .carte-projets--bas  { display: none; }
  .projets-liste { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .projets-qui__box {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: clamp(48px, 3.846vw + 8.62px, 64px);
  }
}

/* ── Impression ─────────────────────────────────────────── */
@media print {
  .carte-projets--hero { display: none; }
  .carte-projets--bas  { display: flex; }
  .projet { break-inside: avoid; }
  .projet__btn { display: none; }
}
