/* ============================================================
   en-Stage.com — HUB / CLASSEMENT des métiers face à l'IA
   (charge styles.css avant : variables, header, footer, boutons)
   ============================================================ */

.rank-main { padding-bottom: 60px; }

/* ---------- en-tête éditorial ---------- */
.rank-head {
  padding: 30px 0 6px;
  max-width: 780px;
}
.rank-head h1 {
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 16px 0 18px;
  text-wrap: balance;
}
.rank-head h1 .trinque { color: var(--rouge); }
.rank-chapo {
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.55;
  color: var(--encre-2);
  max-width: 56ch;
}
.rank-chapo a {
  color: var(--encre);
  text-decoration: underline;
  text-decoration-color: var(--orange-2);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  font-weight: 600;
}
.rank-chapo a:hover { color: var(--rouge); text-decoration-color: var(--rouge); }

.mini-stat {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding: 10px 18px;
  background: var(--blanc);
  border: 1px solid var(--gris-line);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  font-size: 14px;
  color: var(--gris);
  flex-wrap: wrap;
}
.mini-stat b {
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--encre);
}
.mini-stat .ms-sep { width: 1px; height: 22px; background: var(--gris-line); }

/* ============================================================
   BLOCS VEDETTES (top / bottom 5)
   ============================================================ */
.feature-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin: 38px 0 8px;
}
.feature-card {
  border-radius: var(--r-lg);
  padding: 24px;
  border: 1px solid var(--gris-line);
  background: var(--blanc);
  box-shadow: var(--shadow-card);
}
.feature-card.resilient { background: linear-gradient(180deg, rgba(15,157,110,.08), rgba(15,157,110,.02)); border-color: rgba(15,157,110,.28); }
.feature-card.exposed { background: linear-gradient(180deg, rgba(220,38,38,.07), rgba(220,38,38,.02)); border-color: rgba(220,38,38,.24); }
.fc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.fc-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid; place-items: center;
  color: #fff;
  flex-shrink: 0;
}
.resilient .fc-icon { background: #0f9d6e; }
.exposed .fc-icon { background: var(--rouge); }
.fc-title {
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  font-size: 19px;
  line-height: 1.1;
}
.fc-sub { font-size: 12.5px; color: var(--gris); margin-top: 2px; }

.fc-row {
  display: grid;
  grid-template-columns: 22px 46px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--gris-line);
  text-decoration: none;
  color: inherit;
  transition: padding-left .15s ease;
}
.fc-row:hover { padding-left: 5px; }
.fc-rank {
  font-family: "Roboto Mono", monospace;
  font-size: 13px;
  color: var(--gris);
  font-weight: 500;
}
.score-badge {
  width: 46px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  font-size: 17px;
  color: #fff;
  flex-shrink: 0;
}
.fc-name { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.fc-name .n { font-family: "Poppins", sans-serif; font-weight: 600; font-size: 15.5px; line-height: 1.15; }
.fc-name .c { font-size: 12px; color: var(--gris); }
.fc-spark {
  width: 64px;
  height: 7px;
  border-radius: 999px;
  background: rgba(21,22,29,.07);
  overflow: hidden;
}
.fc-spark span { display: block; height: 100%; border-radius: 999px; }

/* ============================================================
   BARRE DE CONTRÔLE
   ============================================================ */
.controls {
  position: sticky;
  top: 76px;
  z-index: 40;
  background: rgba(255,247,239,.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--gris-line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin: 36px 0 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.ctrl-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 200px;
  border: 2px solid var(--gris-line);
  border-radius: 12px;
  padding: 9px 13px;
  background: var(--blanc);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ctrl-search:focus-within { border-color: var(--encre); box-shadow: 0 0 0 3px rgba(247,127,0,.16); }
.ctrl-search svg { color: var(--rouge); flex-shrink: 0; }
.ctrl-search input {
  flex: 1; border: none; background: none; outline: none;
  font-family: "Inter", sans-serif; font-size: 15px; font-weight: 500; color: var(--encre);
  min-width: 0;
}
.cat-filters {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.cat-chip {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--blanc);
  border: 1.5px solid var(--gris-line);
  color: var(--encre-2);
  cursor: pointer;
  transition: all .14s ease;
  white-space: nowrap;
}
.cat-chip:hover { border-color: var(--encre); }
.cat-chip.active { background: var(--encre); color: var(--creme); border-color: var(--encre); }
.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  padding: 9px 15px;
  border-radius: 12px;
  background: var(--blanc);
  border: 1.5px solid var(--gris-line);
  color: var(--encre);
  cursor: pointer;
  transition: all .14s ease;
  white-space: nowrap;
}
.sort-btn:hover { border-color: var(--encre); }
.sort-btn svg { transition: transform .2s ease; }
.sort-btn.asc svg { transform: rotate(180deg); }

/* ============================================================
   TABLEAU-CLASSEMENT
   ============================================================ */
.rank-count {
  font-size: 13px;
  color: var(--gris);
  margin: 14px 2px 12px;
}
.rank-count b { color: var(--encre); font-weight: 700; }
.ranking { display: flex; flex-direction: column; }
.rk-row {
  display: grid;
  grid-template-columns: 40px 54px 1fr 160px 200px 22px;
  align-items: center;
  gap: 16px;
  padding: 14px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition: background .14s ease, border-color .14s ease, transform .14s ease;
}
.rk-row:hover { background: var(--blanc); border-color: var(--gris-line); box-shadow: var(--shadow-soft); }
.rk-row + .rk-row { margin-top: 2px; }
.rk-rank {
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--gris);
  text-align: center;
}
.rk-name { font-family: "Poppins", sans-serif; font-weight: 600; font-size: 17px; color: var(--encre); min-width: 0; }
.rk-cat {
  font-family: "Roboto Mono", monospace;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gris);
}
.rk-verdict {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 13.5px;
}
.rk-verdict .vd-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.rk-arrow { color: var(--gris-line); transition: transform .15s ease, color .15s ease; }
.rk-row:hover .rk-arrow { color: var(--rouge); transform: translateX(3px); }
.rk-head-row {
  display: grid;
  grid-template-columns: 40px 54px 1fr 160px 200px 22px;
  gap: 16px;
  padding: 0 12px 10px;
  border-bottom: 2px solid var(--encre);
  font-family: "Roboto Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gris);
}
.rk-empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--gris);
  font-size: 16px;
}

/* ============================================================
   RÉPARTITION PAR BANDE
   ============================================================ */
.distribution {
  margin: 48px 0 0;
  background: var(--blanc);
  border: 1px solid var(--gris-line);
  border-radius: var(--r-md);
  padding: 26px 28px;
}
.distribution h2 {
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  font-size: 20px;
  margin: 0 0 4px;
}
.distribution .dist-sub { font-size: 13.5px; color: var(--gris); margin-bottom: 22px; }
.dist-grid { display: flex; flex-direction: column; gap: 14px; }
.dist-row { display: grid; grid-template-columns: 190px 1fr 44px; align-items: center; gap: 14px; }
.dist-label { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--encre-2); font-weight: 500; }
.dist-label .dl-dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.dist-track { height: 14px; border-radius: 999px; background: #f0e8dc; overflow: hidden; }
.dist-fill { display: block; height: 100%; border-radius: 999px; }
.dist-num { font-family: "Poppins", sans-serif; font-weight: 800; font-size: 16px; text-align: right; }

/* ============================================================
   RESPONSIVE — cartes empilées sur mobile
   ============================================================ */
@media (max-width: 900px) {
  .feature-duo { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .rk-head-row { display: none; }
  .rk-row {
    grid-template-columns: 30px 50px 1fr;
    grid-template-areas:
      "rank badge name"
      "rank badge verdict";
    row-gap: 4px;
    padding: 14px 12px;
    background: var(--blanc);
    border-color: var(--gris-line);
    margin-top: 8px;
  }
  .rk-rank { grid-area: rank; }
  .score-badge { grid-area: badge; }
  .rk-name-wrap { grid-area: name; min-width: 0; }
  .rk-verdict { grid-area: verdict; }
  .rk-cat-cell { display: none; }
  .rk-arrow { display: none; }
  .rk-name-wrap .rk-cat { display: block; margin-top: 2px; }
  .dist-row { grid-template-columns: 130px 1fr 36px; }
  .dist-label { font-size: 12px; }
  .controls { position: static; }
}
@media (min-width: 721px) {
  .rk-name-wrap .rk-cat { display: none; }
}
