/* ============================================================
   entreprises.css — styles propres à /entreprises/
   Phase 7 du chantier Focus (brief MOA Brief_CC_Phase7_entreprises_2026-05-20.md).

   Charge APRÈS style.css, focus.css, metiers.css, formations.css.
   Override minimal : on réutilise au maximum .formations-layout,
   .formations-aside, .formations-bloc, .metier-chip, etc.
   ============================================================ */


/* ── Toggle "Recrutement actif" — mis en valeur visuelle (brief §4.3) ──
   En haut des filtres, fond teal pâle + accent visuel pour signaler que
   c'est le filtre clé : alterne entre "toutes les entreprises" et
   "seulement celles qui recrutent". ─────────────────────────────────── */
.entreprises-bloc-recrutement {
  background: var(--cmq-bg, #EEF8F8);
  border: 1.5px solid var(--cmq-teinte, #AAD9DB);
  border-radius: 10px;
  padding: 12px 14px !important;
  margin-bottom: 22px !important;
  transition: all 0.2s ease;
}
.entreprises-bloc-recrutement:has(input:checked) {
  background: var(--cmq-clair, #C5E8EA);
  border-color: var(--cmq-principal, #5BB9B3);
  box-shadow: 0 2px 8px rgba(91, 185, 179, 0.18);
}

.entreprises-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.entreprises-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.entreprises-toggle-slider {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background: #d8e3e2;
  border-radius: 12px;
  flex-shrink: 0;
  transition: background 0.2s ease;
}
.entreprises-toggle-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}
.entreprises-toggle input:checked + .entreprises-toggle-slider {
  background: var(--cmq-principal, #5BB9B3);
}
.entreprises-toggle input:checked + .entreprises-toggle-slider::after {
  transform: translateX(20px);
}
.entreprises-toggle input:focus-visible + .entreprises-toggle-slider {
  outline: 2px solid var(--cmq-principal, #5BB9B3);
  outline-offset: 2px;
}
.entreprises-toggle-label {
  flex: 1;
  line-height: 1.25;
}
.entreprises-toggle-label strong {
  display: block;
  color: var(--cmq-fonce, #3A8A85);
  font-size: 0.95rem;
}
.entreprises-toggle-label small {
  display: block;
  color: var(--gris-texte, #2C3E3E);
  opacity: 0.75;
  font-size: 0.78rem;
  margin-top: 2px;
}


/* ── Chips étape + taille — réutilise .metier-chip mais en grille
   compacte pour ne pas exploser la hauteur. ────────────────────────── */
.entreprises-chips-etape,
.entreprises-chips-taille {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.entreprises-chips-etape .metier-chip {
  font-size: 0.78rem;
  padding: 5px 10px;
}
.entreprises-chips-taille .metier-chip {
  font-size: 0.8rem;
  padding: 5px 12px;
}


/* ── Carte entreprise dans la liste ─────────────────────────────────
   Pas d'item dépliable comme dans formations (1 entreprise = 1 carte
   simple). Tri par score signaux décroissant + hash siret + seed hebdo. */
.entreprises-liste {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.entreprise-card {
  background: white;
  border: 1px solid #e0eeed;
  border-radius: 8px;
  padding: 11px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.entreprise-card:hover {
  border-color: var(--cmq-principal, #5BB9B3);
  background: var(--cmq-bg, #EEF8F8);
}
.entreprise-card.focus {
  border-color: var(--cmq-principal, #5BB9B3);
  box-shadow: 0 2px 8px rgba(91, 185, 179, 0.18);
}
.entreprise-card-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.entreprise-card-nom {
  flex: 1;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--cmq-fonce, #3A8A85);
  line-height: 1.3;
}
.entreprise-card-meta {
  margin-top: 3px;
  font-size: 0.76rem;
  color: var(--gris-texte, #2C3E3E);
  opacity: 0.72;
  line-height: 1.35;
}
.entreprise-card-meta .effectif {
  display: inline-block;
  background: var(--cmq-clair, #C5E8EA);
  color: var(--cmq-fonce, #3A8A85);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 9px;
  margin-right: 6px;
}
.entreprise-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}


/* ── Badges recrutement — palette MOA Q3 (brief §5) ───────────────── */
.badge-recrut {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 9px;
  color: white;
  line-height: 1.3;
}
.badge-recrut-alternance { background: #2d7a8c; }
.badge-recrut-immersion  { background: #5ba56b; }
.badge-recrut-emploi     { background: #c97a3a; }


/* ── Popup Leaflet : badges + activité + score enrichissement ─────── */
.popup-ent-titre {
  display: block;
  font-weight: 700;
  color: var(--cmq-fonce, #3A8A85);
  margin-bottom: 4px;
  font-size: 0.98rem;
  line-height: 1.25;
}
.popup-ent-meta {
  font-size: 0.78rem;
  color: var(--gris-texte, #2C3E3E);
  opacity: 0.75;
  margin-bottom: 4px;
}
.popup-ent-meta .effectif {
  display: inline-block;
  background: var(--cmq-clair, #C5E8EA);
  color: var(--cmq-fonce, #3A8A85);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 9px;
  margin-right: 4px;
}
.popup-ent-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0 4px;
}
.popup-ent-activite {
  font-size: 0.78rem;
  color: var(--gris-texte, #2C3E3E);
  opacity: 0.85;
  margin-top: 6px;
  font-style: italic;
  line-height: 1.35;
}
/* Ligne étapes dans la popup (mono ou multi) — remplace l'ancien tooltip hover
   redondant. Préfixe « Multi-étapes : » en gras quand l'entreprise traverse
   plusieurs étapes de la chaîne. */
.popup-ent-etapes {
  font-size: 0.78rem;
  color: var(--cmq-fonce, #3A8A85);
  background: var(--cmq-bg, #EEF8F8);
  padding: 4px 8px;
  border-radius: 6px;
  margin: 4px 0;
  line-height: 1.35;
}
.popup-ent-etapes strong {
  font-weight: 700;
  color: var(--cmq-fonce, #3A8A85);
}

/* Bouton « Voir la fiche complète » — visible désormais (V1 fiche livrée
   2026-05-21). Toutes les entreprises ont une fiche, qui s'adapte aux champs
   renseignés. Le score d'enrichissement reste exposé en data-attribute pour
   pilotage éditorial futur. */
.popup-ent-fiche {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 10px;
  background: var(--cmq-principal, #5BB9B3);
  color: white;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}
.popup-ent-fiche:hover {
  background: var(--cmq-fonce, #3A8A85);
  color: white;
}


/* ── Pin Leaflet : marqueur "goutte" + ★ multi-étapes + point recrut ─
   Le HTML du marqueur est généré côté JS (FS.makeMarkerIcon style ou
   override Phase 7 pour la décoration). Les styles ici matchent les
   classes injectées par entreprises.js. ────────────────────────────── */

/* Pin multi-étapes : couleur dédiée + étoile superposée + tooltip hover */
.pin-multi-etape {
  position: relative;
}
.pin-multi-etape::after {
  /* Étoile ★ Unicode, positionnée sur la partie haute du pin */
  content: "★";
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  background: #FFD23F;          /* jaune doré, contraste avec teal */
  color: #2C3E3E;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  border-radius: 50%;
  border: 1.5px solid white;
  box-shadow: 0 1px 2px rgba(0,0,0,0.35);
  font-family: Arial, sans-serif;
  font-weight: 700;
  z-index: 2;
}

/* Point coloré "signal recrutement dominant" dans le coin bas-droit du pin.
   Hiérarchie : alternance > emploi > immersion (cohérent avec pondération tri). */
.pin-signal {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid white;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
  z-index: 2;
}
.pin-signal-alternance { background: #2d7a8c; }
.pin-signal-emploi     { background: #c97a3a; }
.pin-signal-immersion  { background: #5ba56b; }

/* Tooltip Leaflet pour le hover multi-étapes — fond clair, texte foncé
   (le pin lui-même est #2D6E68 ; texte sur ce fond serait illisible). */
.leaflet-tooltip.tooltip-multi-etape {
  background: white;
  color: var(--gris-texte, #2C3E3E);
  border: 1px solid var(--cmq-teinte, #AAD9DB);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  font-size: 0.78rem;
  padding: 6px 9px;
  font-weight: 500;
}
.leaflet-tooltip.tooltip-multi-etape::before {
  border-top-color: var(--cmq-teinte, #AAD9DB);
}
.tooltip-multi-etape strong {
  color: var(--cmq-fonce, #3A8A85);
  display: block;
  margin-bottom: 2px;
}


/* ── Cluster MarkerCluster : recoloration palette vitrine ────────────
   Override les couleurs par défaut (#x9... vert pâle de markercluster).
   On force le teal vitrine pour cohérence visuelle avec les pins. ──── */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: rgba(170, 217, 219, 0.6);  /* --cmq-teinte transparent */
}
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: var(--cmq-fonce, #3A8A85);
  color: white;
  font-weight: 700;
}


/* ── Liste vide / loading — légères tweaks ───────────────────────── */
.entreprises-vide {
  text-align: center;
  padding: 30px 16px;
  color: var(--gris-texte, #2C3E3E);
  opacity: 0.7;
  font-style: italic;
  font-size: 0.92rem;
}


/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 980px) {
  /* Toggle recrutement actif reste accessible en mobile, pas replié */
  .entreprises-bloc-recrutement {
    margin-bottom: 14px !important;
  }
}

@media (max-width: 600px) {
  .entreprises-chips-etape .metier-chip,
  .entreprises-chips-taille .metier-chip {
    font-size: 0.74rem;
    padding: 4px 8px;
  }
  .entreprise-card { padding: 10px 12px; }
  .entreprise-card-nom { font-size: 0.88rem; }
}
