/* carte-suisse.css : la carte de Suisse en points de l'accueil d'onima.ch (compagnon de js/carte-suisse.js, qui
   construit chaque élément ci-dessous). Tout est rangé sous .cs, rien ne fuit vers la page.
   Posée sur le panneau marine de la marque (#000a16 vers #0a1628, halo vert) : le composant ne peint aucun fond.
   Fiche : carte blanche épurée sur la marine (opérateur, 31.10.2026 : pas de noir sur noir). */

.cs {
  --cs-vert: #4fae37;
  --cs-vert-doux: #8cce88;
  --cs-vert-fonce: #259204;
  --cs-fondu: 280ms;
  position: relative;
  width: 100%;
  isolation: isolate;
  /* si la page réserve une boîte plus haute que la carte et sa fiche, l'ensemble s'y centre verticalement */
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

.cs-scene {
  position: relative;
  flex: none;
  width: 100%;
  /* hauteur posée par le script d'après la largeur ; une réserve avant le chargement évite un saut de page */
  min-height: 1px;
  aspect-ratio: 1.2 / 1;
}
@media (max-width: 600px) { .cs-scene { aspect-ratio: 1.5 / 1; } }
.cs--pret .cs-scene { aspect-ratio: auto; }

.cs-canvas {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

/* ------------------------------------------------------------------ la fiche */

.cs-fiche {
  position: absolute;
  left: auto;
  right: 0;
  bottom: 0;
  z-index: 2;
  box-sizing: border-box;
  width: 300px;
  max-width: 60%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 13px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 4, 12, .20), 0 18px 40px rgba(0, 4, 12, .45);
  color: #344054;
  opacity: 0;
  transform: translateY(10px) scale(.985);
  transition: opacity var(--cs-fondu) ease, transform var(--cs-fondu) ease, box-shadow .25s ease;
  will-change: opacity, transform;
}
.cs-fiche[hidden] { display: none; }
.cs-fiche--visible { opacity: 1; transform: translateY(0) scale(1); }
.cs-fiche:hover, .cs-fiche:focus-within { box-shadow: 0 1px 2px rgba(0, 4, 12, .20), 0 22px 48px rgba(0, 4, 12, .55); }

/* Placée par le script (left, top) : le coin bas droit ne sert plus que de repli. */
.cs-fiche--placee { right: auto; bottom: auto; }

.cs-fiche-haut {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.cs-statut {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px 2px 8px;
  border-radius: 999px;
  background: #e8f5e4;
  color: #1f6e0c;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.cs-statut::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cs-vert);
  flex-shrink: 0;
}

.cs-metier {
  font-size: 12px;
  font-weight: 600;
  color: #667085;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.cs-metier[hidden] { display: none; }

.cs-lieu {
  margin: 2px 0 0;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.25;
  color: #0a1628;
  letter-spacing: -.005em;
}
.cs-canton {
  margin-left: 6px;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  vertical-align: 1px;
}
.cs-canton[hidden] { display: none; }

.cs-objet {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #475467;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.cs-objet[hidden] { display: none; }

.cs-fiche-pied {
  display: flex;
  align-items: center;
  gap: 4px 12px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 12px;
  color: #667085;
}
.cs-montant {
  font-weight: 700;
  color: #101828;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cs-montant[hidden] { display: none; }

.cs-source {
  margin-left: auto;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  color: var(--cs-vert-fonce);
  text-decoration: none;
  border-radius: 4px;
}
.cs-source::after { content: '\00a0\2197'; }
.cs-source:hover { text-decoration: underline; text-underline-offset: 3px; }
.cs-source:focus-visible { outline: 2px solid var(--cs-vert); outline-offset: 2px; }

/* ---------------------------------------------------------- mode compact
   Conteneur étroit (téléphone) : la fiche passe sous la carte, dans le flux, pleine largeur, sans trait. Sa
   hauteur est réservée pour que la page ne saute pas quand le texte change. */
.cs--compact .cs-fiche {
  position: relative;
  flex: none;
  left: auto;
  top: auto;
  right: auto;
  bottom: auto;
  width: 100%;
  max-width: none;
  min-height: 150px;           /* réserve avant la mesure ; le script pose ensuite la hauteur de la plus haute */
  margin-top: 6px;
}

/* ------------------------------------------------------ mouvement réduit */
.cs--reduit .cs-fiche { transition: none; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .cs-fiche { transition: none; transform: none; }
}
