/* Page « Nos projets » — survols et états (la mise en page est en styles inline). */

/* Cartes : apparition (comme la maquette : 20px, .7s) */
.js .projet-card.reveal {
  transform: translateY(20px);
  transition: opacity .7s cubic-bezier(.16,1,.3,1) var(--reveal-delay, 0s), transform .7s cubic-bezier(.16,1,.3,1) var(--reveal-delay, 0s);
}
.js .projet-card.reveal.is-visible { transform: none; }
.projet-card[hidden] { display: none !important; }

/* Cartes : survol */
.projet-card:hover .projet-card__box { transform: translateY(-6px); }
.projet-card:hover .projet-card__img { transform: scale(1.05); }

/* Filtres */
.projets-filtre:hover { color: #141414 !important; }
.projets-filtre:focus-visible { outline: 2px solid #e30713; outline-offset: -2px; }

/* Liste synchronisée avec la carte */
.projets-carte-item { position: relative; transition: padding-left .3s cubic-bezier(.16,1,.3,1); }
.projets-carte-item__dot { position: relative; }
.projets-carte-item__dot::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 1.5px solid #e30713; opacity: 0; transform: scale(.4);
  transition: opacity .25s, transform .35s cubic-bezier(.16,1,.3,1);
}
.projets-carte-item:hover,
.projets-carte-item.is-on { padding-left: 6px !important; }
.projets-carte-item:hover .projets-carte-item__dot,
.projets-carte-item.is-on .projets-carte-item__dot { background: #e30713 !important; }
.projets-carte-item:hover .projets-carte-item__dot::after,
.projets-carte-item.is-on .projets-carte-item__dot::after { opacity: .45; transform: scale(1); }
.projets-carte-item:hover .projets-carte-item__titre,
.projets-carte-item.is-on .projets-carte-item__titre { color: #e30713 !important; }
.projets-carte-item:focus-visible { outline: 2px solid #e30713; outline-offset: 2px; border-radius: 4px; }

/* ── Carte Leaflet ─────────────────────────────────────────────── */
.projets-map-col { flex: 0 0 540px; max-width: 100%; align-self: stretch; display: flex; flex-direction: column; }
.projets-map-frame {
  position: relative; flex: 1; min-height: 560px;
  border-radius: 12px; overflow: hidden; isolation: isolate;
  background: #eeebe5;
  box-shadow: 0 0 0 1px rgba(20,20,20,.06), 0 24px 60px -24px rgba(20,20,20,.28), 0 8px 20px -12px rgba(20,20,20,.12);
}
/* liseré dégradé rouge → jaune en tête de cadre */
.projets-map-frame::before {
  content: ""; position: absolute; z-index: 1001; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(to right, #e30713, #ffdc03); pointer-events: none;
}
/* léger vignettage pour fondre les bords */
.projets-map-frame::after {
  content: ""; position: absolute; z-index: 401; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 60px rgba(20,20,20,.05);
  border-radius: inherit;
}
.projets-map { position: absolute; inset: 0; z-index: 0; font-family: inherit; background: #eeebe5; }

.projets-map .leaflet-container,
.projets-map.leaflet-container { background: #eeebe5; font-family: inherit; }

/* Badge « N réalisations en Alsace » */
.projets-map-badge {
  position: absolute; z-index: 1000; top: 20px; left: 20px; margin: 0;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 14px; border-radius: 8px;
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px -8px rgba(20,20,20,.3);
  font-size: 13px; font-weight: 600; color: #555; letter-spacing: .01em; line-height: 1.2;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
}
.projets-map-frame.has-popup .projets-map-badge { opacity: 0; transform: translateY(-6px); }
.projets-map-badge strong { font-size: 18px; font-weight: 800; color: #141414; letter-spacing: -.02em; margin-right: -4px; }
.projets-map-badge__dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #e30713; flex-shrink: 0; }

/* Marqueurs : point rouge cerclé de blanc, sans animation */
.projets-map .projets-marker { background: none; border: 0; }
/* Les points ne captent pas la souris : c'est la carte qui choisit le point le plus proche
   du curseur (projets.js), pour départager les points rapprochés. Clavier : inchangé. */
.projets-map .leaflet-marker-icon.projets-marker { pointer-events: none !important; }
.projets-map.is-sur-point,
.projets-map.is-sur-point .leaflet-interactive { cursor: pointer !important; }
.projets-pin { position: relative; display: block; width: 36px; height: 36px; cursor: pointer; }
.projets-pin__dot { position: absolute; left: 50%; top: 50%; border-radius: 50%; }
.projets-pin__dot {
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  background: #e30713; border: 2.5px solid #fff;
  box-shadow: 0 2px 6px rgba(20,20,20,.35), 0 0 0 1px rgba(227,7,19,.25);
  /* Fondu doux vers l'état sélectionné (au clic) */
  transition: background .25s cubic-bezier(.22,.61,.36,1), box-shadow .25s cubic-bezier(.22,.61,.36,1), transform .25s cubic-bezier(.22,.61,.36,1);
  will-change: transform;
}
/* Point sélectionné (popup ouverte ou projet survolé dans la liste) : badge aux couleurs du logo,
   carré rouge arrondi + emblème « S » blanc + barre jaune, avec une pointe sur le lieu exact.
   Aucun effet au survol du point lui-même. */
.projets-pin__badge {
  position: absolute; left: 50%; bottom: calc(50% + 7px);
  width: 40px; height: 40px; margin-left: -20px;
  border-radius: 9px;
  background: #e30713 url("../../img/icon-192.png") center 1px / 31px 31px no-repeat;
  box-shadow: 0 6px 16px rgba(20,20,20,.3), 0 0 0 2px #fff;
  opacity: 0; transform: translateY(6px) scale(.6); transform-origin: 50% 100%;
  transition: opacity .25s cubic-bezier(.22,.61,.36,1), transform .25s cubic-bezier(.22,.61,.36,1);
  pointer-events: none;
}
/* Barre jaune, comme sous « SOCARA » sur le logo */
.projets-pin__badge::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 5px;
  height: 3px; border-radius: 1px; background: #ffdc03;
}
/* Pointe vers le lieu exact */
.projets-pin__badge::before {
  content: ""; position: absolute; left: 50%; top: 100%; margin-left: -6px;
  border: 6px solid transparent; border-top: 7px solid #e30713; border-bottom: 0;
  filter: drop-shadow(0 2px 0 #fff);
}
.projets-pin.is-on .projets-pin__badge { opacity: 1; transform: none; }
.projets-pin.is-on .projets-pin__dot { transform: scale(.55); }
.projets-map .leaflet-marker-icon:focus-visible { outline: none; }
.projets-map .leaflet-marker-icon:focus-visible .projets-pin__dot { box-shadow: 0 0 0 4px #ffdc03, 0 0 0 6px #141414; }

/* Contrôles de zoom */
.projets-map .leaflet-bar { border: 0; border-radius: 8px; overflow: hidden; box-shadow: 0 6px 20px -8px rgba(20,20,20,.35); }
.projets-map .leaflet-bar a {
  width: 38px; height: 38px; line-height: 38px; font-size: 20px; font-weight: 500;
  color: #141414; background: rgba(255,255,255,.96); border-bottom: 1px solid #eee;
  transition: background .2s, color .2s;
}
.projets-map .leaflet-bar a:last-child { border-bottom: 0; }
.projets-map .leaflet-bar a:hover,
.projets-map .leaflet-bar a:focus-visible { background: #e30713; color: #fff; }
.projets-map .leaflet-bar a.leaflet-disabled { background: #f6f6f6; color: #bbb; }
.projets-map .leaflet-top.leaflet-right,
.projets-map .leaflet-bottom.leaflet-right { margin: 0; }
.projets-map .leaflet-right .leaflet-control-zoom { margin: 20px 20px 0 0; }

/* Attribution discrète */
/* Logo SOCARA en signature, au-dessus des crédits de la carte */
.projets-map-logo {
  position: absolute; z-index: 1000; right: 16px; bottom: 30px; pointer-events: none;
  border-radius: 6px; overflow: hidden; box-shadow: 0 6px 18px -6px rgba(20,20,20,.45);
}
.projets-map-logo img { height: 48px !important; width: auto; }
@media (max-width: 600px) {
  .projets-map-logo { right: 12px; bottom: 26px; }
  .projets-map-logo img { height: 38px !important; }
}

.projets-map .leaflet-control-attribution {
  font-size: 10px; color: #777; background: rgba(255,255,255,.75);
  padding: 2px 8px; border-top-left-radius: 6px;
}
.projets-map .leaflet-control-attribution a { color: #555; }

/* Popup */
.projets-map .projets-popup .leaflet-popup-content-wrapper {
  padding: 0; border-radius: 12px; overflow: hidden;
  box-shadow: 0 20px 50px -16px rgba(20,20,20,.45);
}
.projets-map .projets-popup .leaflet-popup-content { margin: 0; width: 240px !important; font-family: inherit; line-height: 1.35; }
.projets-map .projets-popup .leaflet-popup-tip { box-shadow: none; }
/* Fiche du projet : apparition en fondu, avec une légère montée
   (sur le contenu et la pointe : le conteneur est positionné par Leaflet via transform) */
.projets-map .projets-popup .leaflet-popup-content-wrapper,
.projets-map .projets-popup .leaflet-popup-tip-container { animation: projets-fiche .22s cubic-bezier(.22,.61,.36,1) both; }
@keyframes projets-fiche {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
.projets-map .projets-popup a.leaflet-popup-close-button {
  top: 8px; right: 8px; width: 28px; height: 28px; line-height: 26px; font-size: 18px;
  border-radius: 50%; background: rgba(255,255,255,.92); color: #141414; z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.projets-map .projets-popup a.leaflet-popup-close-button:hover { background: #e30713; color: #fff; }
.projets-pop__media { position: relative; display: block; aspect-ratio: 16/10; background: #eee; overflow: hidden; }
.projets-pop__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s ease; }
.projets-pop__media:hover img { transform: scale(1.05); }
.projets-pop__media::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(to right, #e30713, #ffdc03); }
.projets-pop__body { padding: 14px 16px 16px; }
.projets-pop__type { display: block; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #e30713; margin-bottom: 6px; }
.projets-pop__titre { display: block; font-size: 17px; font-weight: 800; color: #141414; letter-spacing: -.02em; line-height: 1.15; }
.projets-pop__lieu { display: block; font-size: 13px; color: #777; margin-top: 4px; }
.projets-map .projets-popup a.projets-pop__lien {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #e30713; text-decoration: none;
}
.projets-pop__lien span { transition: transform .25s; }
.projets-map .projets-popup a.projets-pop__lien:hover span { transform: translateX(4px); }

@media (prefers-reduced-motion: reduce) {
  .projets-carte-item, .projets-pin__dot, .projets-pin__badge { transition: none; }
  .projets-map .projets-popup .leaflet-popup-content-wrapper,
  .projets-map .projets-popup .leaflet-popup-tip-container { animation: none; }
}

@media (max-width: 1100px) {
  .projets-map-col { flex: 1 1 100%; }
  .projets-map-frame { flex: none; min-height: 0; height: 460px; }
}

@media (max-width: 600px) {
  .projets-carte-item { flex-wrap: wrap; row-gap: 2px !important; padding: 12px 0 !important; }
  .projets-carte-item:hover, .projets-carte-item.is-on { padding-left: 0 !important; }
  .projets-carte-item__lieu { flex: 1 1 100%; padding-left: 24px; text-align: left !important; font-size: 13px !important; }
  .projets-map-frame { height: 380px; }
  .projets-map-badge { top: 14px; left: 14px; padding: 8px 12px; font-size: 12px; }
  .projets-map-badge strong { font-size: 16px; }
  .projets-map .leaflet-right .leaflet-control-zoom { margin: 14px 14px 0 0; }
  .projets-filtre { padding: 12px 14px !important; font-size: 12px !important; }
}
