/* ══════════════════════════════════════════════════════════════════════════
   CHECKLISTS CANDIDATS — index et détail
   ══════════════════════════════════════════════════════════════════════════ */

/* Texte réservé aux lecteurs d'écran. Pas `display:none`, qui le retirerait
   aussi de la vocalisation : on le sort de l'écran, pas de l'accessibilité. */
.wr-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── L'INDEX ───────────────────────────────────────────────────────────── */

.wr-cli { max-width: 1100px; margin: 0 auto; padding: 8px 0 48px; }
.wr-cli__head { margin-bottom: 28px; }
.wr-cli__title { font-size: 34px; font-weight: 800; color: var(--wr-ink, #1E1B2E); margin: 0 0 8px; }
.wr-cli__sub { font-size: 15px; color: var(--wr-muted, #6B7280); margin: 0; max-width: 68ch; }
.wr-cli__empty { color: var(--wr-muted, #6B7280); }

.wr-cli__grid {
  display: grid;
  /* `auto-fill` + `minmax` : le nombre de colonnes suit la largeur
     disponible, sans media query. Utile ici, où la colonne centrale change
     de largeur selon que la sidebar est repliée ou non. */
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 18px;
}

.wr-cli__card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--wr-line, #EEF1F7);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.wr-cli__card:hover {
  transform: translateY(-2px);
  border-color: rgba(138, 99, 193, .32);
  box-shadow: 0 10px 30px rgba(30, 27, 46, .08);
}

.wr-cli__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.wr-cli__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.wr-cli__cardtitle { font-size: 17px; font-weight: 700; margin: 0; color: var(--wr-ink, #1E1B2E); }
.wr-cli__cardtext {
  font-size: 13.5px; color: var(--wr-muted, #6B7280); margin: 0; line-height: 1.5;
  /* Trois lignes au plus : sans cette limite, une intro longue déforme la
     carte et casse l'alignement de la grille. */
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.wr-cli__badge {
  align-self: flex-start; margin-top: auto;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  color: var(--wr-violet, #8A63C1); background: rgba(138, 99, 193, .1);
  padding: 4px 10px; border-radius: 100px;
}

/* ── LE DÉTAIL ─────────────────────────────────────────────────────────── */

.wr-cl { max-width: 860px; margin: 0 auto; padding: 8px 0 56px; }
.wr-cl__fil { font-size: 13px; color: var(--wr-muted, #6B7280); margin-bottom: 12px; display: flex; gap: 7px; }
.wr-cl__fil a { color: var(--wr-violet, #8A63C1); text-decoration: none; }
.wr-cl__fil a:hover { text-decoration: underline; }
.wr-cl__title { font-size: 32px; font-weight: 800; color: var(--wr-ink, #1E1B2E); margin: 0 0 10px; line-height: 1.2; }
.wr-cl__intro { font-size: 15.5px; color: var(--wr-muted, #6B7280); line-height: 1.6; margin: 0 0 22px; max-width: 68ch; }

.wr-cl__prog { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }

.wr-cl__bar {
  flex: 1; height: 8px; border-radius: 100px; overflow: hidden;
  /* `appearance: none` puis les deux pseudo-éléments : Chrome et Firefox
     n'exposent pas la même arborescence interne pour <progress>. Sans les
     trois, la barre reste au style natif du système. */
  appearance: none; -webkit-appearance: none; border: none;
  background: var(--wr-bg-2, #F1F3F7);
}
.wr-cl__bar::-webkit-progress-bar { background: var(--wr-bg-2, #F1F3F7); border-radius: 100px; }
.wr-cl__bar::-webkit-progress-value { background: var(--wr-violet, #8A63C1); border-radius: 100px; transition: width .25s ease; }
.wr-cl__bar::-moz-progress-bar { background: var(--wr-violet, #8A63C1); border-radius: 100px; }

.wr-cl__count { font-size: 13.5px; color: var(--wr-muted, #6B7280); margin: 0; white-space: nowrap; }
.wr-cl__count strong { color: var(--wr-violet, #8A63C1); font-size: 16px; }

.wr-cl.is-complete .wr-cl__count strong { color: #16A34A; }
.wr-cl.is-complete .wr-cl__bar::-webkit-progress-value { background: #16A34A; }
.wr-cl.is-complete .wr-cl__bar::-moz-progress-bar { background: #16A34A; }

.wr-cl__actions { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.wr-cl__btn {
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--wr-line, #EEF1F7);
  background: #fff; color: var(--wr-ink, #1E1B2E);
}
.wr-cl__btn:hover { border-color: rgba(138, 99, 193, .35); color: var(--wr-violet, #8A63C1); }
.wr-cl__btn--ghost { background: transparent; }

.wr-cl__note {
  font-size: 12.5px; color: var(--wr-muted-2, #9AA0AD);
  background: var(--wr-bg-2, #F1F3F7);
  padding: 10px 14px; border-radius: 10px; margin: 0 0 30px; line-height: 1.5;
}

.wr-cl__sec { margin-bottom: 30px; }
.wr-cl__sectitle {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em;
  color: var(--wr-violet, #8A63C1); margin: 0 0 10px;
}

.wr-cl__table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--wr-line, #EEF1F7);
  border-radius: 14px;
  /* `separate` + `hidden` : c'est ce qui permet à un <table> d'avoir des
     coins arrondis. Avec `collapse`, les bordures des cellules débordent
     par-dessus le rayon et les angles redeviennent carrés. */
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.wr-cl__th {
  text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--wr-muted-2, #9AA0AD);
  padding: 10px 14px;
  background: var(--wr-bg-2, #F1F3F7);
  border-bottom: 1px solid var(--wr-line, #EEF1F7);
}
.wr-cl__th--check { width: 52px; }

.wr-cl__row { transition: background .15s ease; }
.wr-cl__row:hover { background: rgba(138, 99, 193, .035); }
.wr-cl__cell { padding: 13px 14px; border-bottom: 1px solid var(--wr-line, #EEF1F7); vertical-align: top; }
.wr-cl__row:last-child .wr-cl__cell { border-bottom: none; }
.wr-cl__cell--check { text-align: center; }

.wr-cl__box {
  width: 19px; height: 19px; cursor: pointer;
  accent-color: var(--wr-violet, #8A63C1);
  margin-top: 1px;
}

/* Le libellé est cliquable sur toute sa largeur grâce au `for` : la cible
   passe de 19 px à toute la ligne, ce qui compte surtout au doigt. */
.wr-cl__label {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  cursor: pointer; font-size: 14.5px; line-height: 1.5;
  color: var(--wr-ink, #1E1B2E);
}

.wr-cl__key {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: #B45309; background: #FEF3C7; padding: 2px 7px; border-radius: 100px;
}

.wr-cl__detail { font-size: 13px; color: var(--wr-muted, #6B7280); margin: 5px 0 0; line-height: 1.5; }

/* Ligne cochée : barrée et estompée. Le barré fait le travail à lui seul —
   on ne compte pas sur la seule couleur, qui exclurait les daltoniens. */
.wr-cl__row.is-done .wr-cl__text { text-decoration: line-through; opacity: .5; }
.wr-cl__row.is-done .wr-cl__detail { opacity: .45; }

.wr-cl__row.is-key .wr-cl__cell:first-child { box-shadow: inset 3px 0 0 #F59E0B; }

.wr-cl__cta {
  margin-top: 36px; padding: 26px 24px; border-radius: 16px; text-align: center;
  background: linear-gradient(180deg, rgba(138, 99, 193, .09), rgba(138, 99, 193, .03));
  border: 1px solid rgba(138, 99, 193, .2);
}
.wr-cl__cta h2 { font-size: 19px; font-weight: 800; margin: 0 0 6px; color: var(--wr-ink, #1E1B2E); }
.wr-cl__cta p { font-size: 14px; color: var(--wr-muted, #6B7280); margin: 0 0 16px; }
.wr-cl__ctabtn {
  display: inline-block; padding: 11px 22px; border-radius: 100px;
  background: var(--wr-violet, #8A63C1); color: #fff;
  font-size: 14px; font-weight: 700; text-decoration: none;
}
.wr-cl__ctabtn:hover { filter: brightness(1.06); }

@media (max-width: 640px) {
  .wr-cl__title { font-size: 25px; }
  .wr-cl__prog { flex-wrap: wrap; }
  .wr-cl__cell { padding: 11px 10px; }
  .wr-cl__th--check, .wr-cl__cell--check { width: 42px; }
}

/* ── IMPRESSION ─────────────────────────────────────────────────────────
   Le bouton « Imprimer » est la seule façon de garder une trace, puisque
   rien n'est enregistré. Autant que la feuille soit utilisable : cases
   vides à remplir au stylo, sans les éléments d'interface. */
@media print {
  .wr-cl__actions,
  .wr-cl__note,
  .wr-cl__prog,
  .wr-cl__fil,
  .wr-cl__cta { display: none !important; }

  .wr-cl { max-width: none; padding: 0; }
  .wr-cl__table { border-color: #999; page-break-inside: auto; }
  .wr-cl__row { page-break-inside: avoid; }
  .wr-cl__row.is-done .wr-cl__text { text-decoration: none; opacity: 1; }
  .wr-cl__box { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ══════════════════════════════════════════════════════════════════════════
   TEXTE LIBRE AUTOUR DE LA LISTE (WYSIWYG)

   Le contenu vient du backoffice : on ne maîtrise pas quelles balises
   arrivent. Il faut donc styler tout ce que `sanitize.editorial` autorise —
   sinon un <h3> saisi par l'admin hérite du style par défaut du navigateur
   et détonne au milieu de la page.
   ══════════════════════════════════════════════════════════════════════════ */

.wr-cl__rte {
  font-size: 15px;
  line-height: 1.7;
  color: var(--wr-ink, #1E1B2E);
  margin: 0 0 30px;
  max-width: 68ch;
}

.wr-cl__rte--after { margin: 30px 0 0; }

.wr-cl__rte > *:first-child { margin-top: 0; }
.wr-cl__rte > *:last-child { margin-bottom: 0; }

.wr-cl__rte p { margin: 0 0 14px; }

.wr-cl__rte h2, .wr-cl__rte h3, .wr-cl__rte h4 {
  font-weight: 800;
  color: var(--wr-ink, #1E1B2E);
  margin: 26px 0 10px;
  line-height: 1.3;
}
.wr-cl__rte h2 { font-size: 21px; }
.wr-cl__rte h3 { font-size: 18px; }
.wr-cl__rte h4 { font-size: 16px; }

.wr-cl__rte ul, .wr-cl__rte ol { margin: 0 0 14px; padding-left: 22px; }
.wr-cl__rte li { margin-bottom: 6px; }

.wr-cl__rte a { color: var(--wr-violet, #8A63C1); text-decoration: underline; }
.wr-cl__rte a:hover { text-decoration: none; }

.wr-cl__rte strong { font-weight: 700; }

.wr-cl__rte blockquote {
  margin: 18px 0;
  padding: 2px 0 2px 16px;
  border-left: 3px solid rgba(138, 99, 193, .4);
  color: var(--wr-muted, #6B7280);
  font-style: italic;
}

/* `sanitize.editorial` autorise <img> : sans `max-width`, une image collée
   à sa taille d'origine déborde de la colonne sur mobile. */
.wr-cl__rte img { max-width: 100%; height: auto; border-radius: 10px; margin: 12px 0; }

/* Il autorise aussi <table>. Un tableau éditorial n'a rien à voir avec le
   tableau de la checklist : il lui faut son propre style, sinon il hérite
   d'un rendu nu, sans bordures. */
.wr-cl__rte table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.wr-cl__rte th, .wr-cl__rte td { border: 1px solid var(--wr-line, #EEF1F7); padding: 8px 10px; text-align: left; }
.wr-cl__rte th { background: var(--wr-bg-2, #F1F3F7); font-weight: 700; }

.wr-cl__rte code {
  background: var(--wr-bg-2, #F1F3F7);
  padding: 2px 6px; border-radius: 5px;
  font-size: 13px;
}

.wr-cl__rte hr { border: none; border-top: 1px solid var(--wr-line, #EEF1F7); margin: 24px 0; }

/* À l'impression, on garde les textes : ils portent le contexte de la liste. */
@media print {
  .wr-cl__rte { font-size: 12pt; max-width: none; }
  .wr-cl__rte a { color: inherit; text-decoration: none; }
}
