
/* Légende WMS : image fournie par GeoServer, tenant compte du style appliqué. */
.carte-legende {
  max-width: 240px;
  max-height: 300px;
  overflow-y: auto;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
  font-size: 12px;
}

.carte-legende img {
  max-width: 100%;
  display: block;
}

.carte-legende__titre {
  margin: 6px 0 2px;
  font-weight: 600;
}

.carte-legende__titre:first-child {
  margin-top: 0;
}

/* Couche que GeoServer n'a pas pu dessiner : sans ce message, la carte reste
   simplement vide et rien n'explique pourquoi. */
.carte-panne {
  max-width: 320px;
  padding: 8px 10px;
  background: #fbeaea;
  border: 1px solid #eec4c4;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
  color: #7a1f1f;
  font-size: 13px;
  line-height: 1.4;
}

/* Légende graduée : une barre continue plutôt qu'une case par classe. Mesuré
   sur un style à 145 classes, l'image de GeoServer fait 2900 px de haut. */
.legende-rampe {
  height: 26px;
  border: 1px solid #b5b5b5;
  border-radius: 2px;
}

.legende-reperes {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  font-size: 11px;
  color: #444;
}

/* Légende catégorisée : une case par valeur, repliée au-delà d'une dizaine. */
.legende-cases {
  margin: 0;
  padding: 0;
  list-style: none;
}

.legende-cases li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 0;
}

.legende-cases i {
  width: 14px;
  height: 14px;
  border: 1px solid #8a8a8a;
  flex: none;
}

.legende-suite summary {
  margin-top: 4px;
  color: #1a5c46;
  cursor: pointer;
}

.carte-legende__couche + .carte-legende__couche {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e0e0e0;
}
