/* La carte des observations (bloc « Carte des observations ») : l'allure de l'Explorer de
   GeoMys — la barre des groupes en haut, flottante ; le compteur en bas ; des disques de
   la couleur du groupe ; la liste d'un point en feuille, par-dessus la carte. */
.ana-obs-bloc { margin: 1.25rem 0 2rem; }
.ana-obs {
  /* Les couleurs des groupes de GeoMys (ui/occtax/GroupesTaxons.kt, Taxon.couleur). */
  --oiseaux: #ff6d00;
  --mammiferes: #795548;
  --reptiles: #43a047;
  --batraciens: #0288d1;
  --poissons: #0097a7;
  --insectes: #f9a825;
  --fonge: #6d4c41;
  --mollusques: #7b1fa2;
  --invertebres: #7b1fa2;
  --plantes: #009688;
  --sans-groupe: #757575;
  --encre: #1a2b38;
  --encre-2: #5a6e68;
  --sombre: rgba(26, 43, 56, .82);
  position: relative;
  height: var(--ana-obs-hauteur, 600px);
  max-height: 80vh;
  min-height: 420px;
  border: 1px solid #e1e0d9;
  border-radius: 10px;
  overflow: hidden;
  background: #f4f8f4;
  color: var(--encre);
}
.ana-obs [hidden] { display: none !important; }
.ana-obs-fond { position: absolute; inset: 0; z-index: 0; }
.ana-obs-fond:focus-visible { outline: 3px solid #2f7a36; outline-offset: -3px; }
.ana-obs .leaflet-container { font: inherit; background: #f4f8f4; }
.ana-obs-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ana-obs--oiseaux { --c: var(--oiseaux); }
.ana-obs--mammiferes { --c: var(--mammiferes); }
.ana-obs--reptiles { --c: var(--reptiles); }
.ana-obs--batraciens { --c: var(--batraciens); }
.ana-obs--mollusques { --c: var(--mollusques); }
.ana-obs--poissons { --c: var(--poissons); }
.ana-obs--insectes { --c: var(--insectes); }
.ana-obs--invertebres { --c: var(--invertebres); }
.ana-obs--plantes { --c: var(--plantes); }
.ana-obs--fonge { --c: var(--fonge); }
.ana-obs--sans-groupe { --c: var(--sans-groupe); }

/* La barre des groupes : dix boutons sans texte, l'icône en blanc ; le groupe choisi, sur sa couleur. */
.ana-obs-groupes {
  position: absolute; z-index: 800; top: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 2px; max-width: calc(100% - 16px); overflow-x: auto; padding: 4px 6px;
  border-radius: 20px; background: var(--sombre); scrollbar-width: none;
}
.ana-obs-groupes::-webkit-scrollbar { display: none; }
.ana-obs .ana-obs-groupe {
  flex: none; display: grid; place-items: center; width: 44px; height: 38px; margin: 0; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: #fff; cursor: pointer; box-shadow: none; min-height: 0;
}
.ana-obs .ana-obs-groupe:hover { background: rgba(255, 255, 255, .14); }
.ana-obs .ana-obs-groupe[aria-pressed="true"] { background: var(--c); }
.ana-obs .ana-obs-groupe:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.ana-obs-groupe svg { width: 24px; height: 24px; fill: currentColor; }

/* Le compteur, ou ce qui l'attend : chargement, zone trop large, erreur. */
.ana-obs .ana-obs-pastille {
  position: absolute; z-index: 800; bottom: 26px; left: 50%; transform: translateX(-50%);
  max-width: calc(100% - 140px); margin: 0; padding: 6px 12px; border-radius: 20px;
  background: var(--sombre); color: #fff; font-size: .8rem; line-height: 1.35; text-align: center;
  pointer-events: none;
}
.ana-obs-pastille--chargement::before {
  content: ""; display: inline-block; width: .8em; height: .8em; margin-right: .5em; vertical-align: -.1em;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%;
  animation: ana-obs-tourne .8s linear infinite;
}
@keyframes ana-obs-tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ana-obs-pastille--chargement::before { animation: none; } }

/* Un point : un disque de la couleur du groupe, l'effectif en blanc gras, sinon l'icône. */
.ana-obs .ana-obs-marqueur {
  display: grid; place-items: center; box-sizing: border-box;
  border: 2px solid #fff; border-radius: 50%; background: var(--c);
  box-shadow: 0 1px 4px rgba(26, 43, 56, .35); color: #fff; cursor: pointer;
}
.ana-obs .ana-obs-marqueur:focus-visible { outline: 3px solid var(--encre); outline-offset: 1px; }
.ana-obs-marqueur svg { width: 19px; height: 19px; fill: currentColor; }
.ana-obs-nombre { font-weight: 700; line-height: 1; text-shadow: 0 0 2px rgba(0, 0, 0, .45); }
.ana-obs-nombre--1 { font-size: 16px; }
.ana-obs-nombre--2 { font-size: 13px; }
.ana-obs-nombre--3 { font-size: 10.5px; }

/* Centrer sur ma position, sous le choix du fond. */
.ana-obs .ana-obs-position {
  display: grid; place-items: center; width: 34px; height: 34px; margin: 0; padding: 0;
  border: 2px solid rgba(0, 0, 0, .2); border-radius: 4px; background: #fff; color: var(--encre);
  background-clip: padding-box; cursor: pointer; box-shadow: none; min-height: 0;
}
.ana-obs .ana-obs-position:hover { background-color: #f4f4f4; }
.ana-obs .ana-obs-position:focus-visible { outline: 2px solid #2f7a36; outline-offset: 2px; }
.ana-obs-position svg { width: 20px; height: 20px; fill: currentColor; }

/* La liste d'un point : une feuille par-dessus la carte, qu'un voile sépare du reste. */
.ana-obs-voile { position: absolute; inset: 0; z-index: 900; background: rgba(0, 0, 0, .32); }
.ana-obs .ana-obs-feuille {
  position: absolute; z-index: 1000; left: 0; right: 0; bottom: 0; max-height: 60%; overflow-y: auto;
  border-radius: 18px 18px 0 0; background: #fff; box-shadow: 0 -2px 12px rgba(0, 0, 0, .18);
  padding: 0 1.25rem 1.25rem;
}
.ana-obs-feuille-tete {
  position: sticky; top: 0; display: flex; align-items: center; gap: .5rem;
  padding: 1rem 0 .6rem; background: #fff;
}
.ana-obs .ana-obs-feuille-titre { flex: 1 1 auto; margin: 0; font-size: 1rem; font-weight: 700; }
.ana-obs .ana-obs-fermer {
  flex: none; width: 2rem; height: 2rem; margin: 0; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--encre-2); font: inherit; font-size: 1rem; line-height: 2rem; cursor: pointer;
  box-shadow: none; min-height: 0;
}
.ana-obs .ana-obs-fermer:hover { background: #f4f8f4; color: var(--encre); }
.ana-obs .ana-obs-fermer:focus-visible { outline: 2px solid #2f7a36; outline-offset: 2px; }
.ana-obs ul.ana-obs-feuille-liste { margin: 0; padding: 0; list-style: none; }
.ana-obs ul.ana-obs-feuille-liste li { margin: 0; padding: .55rem 0; border-top: 1px solid #eceae4; line-height: 1.35; }
.ana-obs-feuille-liste a, .ana-obs-feuille-liste strong { display: block; font-size: .95rem; font-weight: 700; }
.ana-obs-feuille-liste a {
  color: #2f7a36; text-decoration: underline; text-decoration-color: rgba(47, 122, 54, .35); text-underline-offset: 2px;
}
.ana-obs-feuille-liste a:hover, .ana-obs-feuille-liste a:focus-visible { text-decoration-color: currentColor; }
.ana-obs-feuille-liste span { display: block; margin-top: 2px; font-size: .82rem; color: var(--encre-2); }

.ana-obs-sans-js { position: absolute; inset: auto 1rem 1rem; z-index: 800; margin: 0; padding: .6rem .9rem; border-radius: 8px; background: #fff; }
.ana-obs-legende { margin: .5rem 0 0; font-size: .8rem; line-height: 1.45; color: #5a6e68; }
.ana-obs-legende a { color: inherit; }

/* Étroit (téléphone) : moins de marge au compteur, qui passe entre les boutons. */
@media (max-width: 560px) {
  .ana-obs { height: 75vh; max-height: none; }
  .ana-obs .ana-obs-pastille { bottom: 64px; max-width: calc(100% - 24px); }
}
