/* parcours-cours.css — « LE COURS DANS LE MENU » de l'index d'un chapitre.
   Moteur : assets/js/parcours/parcours-cours.js. Branché dans un chapitre par
   outils/chantier.py (maillon « cours »). Pilote : 7eme/CalculN7 (11/11/2026).

   Ce fichier habille QUATRE choses, toutes posées par parcours-cours.js :
     1. ⚡ ملخّص سريع       .pc-fiche          (menu « محتويات الدرس »)
     2. 📖 الدرس المفصّل     .pc-ligne.pc-detail
     3. 🧩 أنشطة الاكتشاف   .pc-fiche.pc-actes
     4. « الدروس خطوة بخطوة » : les 4 étapes .pc-etapes et les boutons de la carte
        (body.pc-clair)

   🎨 LE DESIGN SE CHANGE ICI, ET SEULEMENT ICI : les jetons --pc-* ci-dessous.
      Le chef (11/11) : « des couleurs claires seront les bienvenues » → partout
      un FOND CLAIR, une ENCRE FONCÉE de la même teinte, un trait un ton au-dessus.
      Changer une couleur = changer son jeton ; aucune couleur n'est écrite plus bas.

   Fichier À PART : parcours.css et chapitre-khan.css sont servis à 42 index.
   Téléphone d'abord (375 px).
   Mode sombre (data-theme="dark"), mesuré le 11/11 : le thème éclaircit les titres
   alors que la colonne garde un fond clair → gris pâle sur blanc. Chaque bloc fixe
   donc son FOND ET son ENCRE ; « html[data-theme] » sert à battre la spécificité. */

:root {
  /* formes */
  --pc-rayon: 12px;              /* boutons, lignes, fiches */
  --pc-rayon-grand: 14px;        /* panneau, bouton principal */
  --pc-pastille: 28px;           /* le rond numéroté */
  /* neutres */
  --pc-fond: #ffffff;
  --pc-encre: #1f2937;
  --pc-encre-2: #4b5563;
  --pc-trait: #e5e7eb;
  --pc-vide-fond: #f3f4f6;       /* « قريبًا » */
  --pc-vide-encre: #6b7280;
  --pc-vide-trait: #d9dee6;
  --pc-vide-pastille: #d1d5db;
  --pc-fait: #15803d;            /* ✓ */
  --pc-focus: #0f766e;
  /* ⚡ résumé rapide — jaune */
  --pc-memo-fond: #fffaf0;
  --pc-memo-fort: #fde9a8;
  --pc-memo-trait: #f2c94c;
  --pc-memo-encre: #6b4200;
  --pc-memo-texte: #3b2a05;
  /* 📖 leçon détaillée — vert d'eau */
  --pc-detail-fond: #e3f6f2;
  --pc-detail-fort: #d3f0ea;
  --pc-detail-trait: #9fd9cf;
  --pc-detail-encre: #0b5c55;
  /* 🧩 activités — violet */
  --pc-act-fond: #f7f5ff;
  --pc-act-fort: #ddd6fe;
  --pc-act-trait: #c4b5fd;
  --pc-act-encre: #4c1d95;
  --pc-act-texte: #2e1065;
  /* les 4 étapes : fond · trait · pastille · encre */
  --pc-e1-fond: #fff8dc; --pc-e1-trait: #f3d98a; --pc-e1-pastille: #f2c94c; --pc-e1-encre: #6b4a00;
  --pc-e2-fond: #e9f8ef; --pc-e2-trait: #a9e2bd; --pc-e2-pastille: #86dba4; --pc-e2-encre: #14532d;
  --pc-e3-fond: #e8f2ff; --pc-e3-trait: #b6d4f2; --pc-e3-pastille: #9cc8f5; --pc-e3-encre: #1e3a5f;
  --pc-e4-fond: #f4edff; --pc-e4-trait: #d4c2f7; --pc-e4-pastille: #c9b3f5; --pc-e4-encre: #4c1d95;
  /* les boutons de la carte d'un paragraphe */
  --pc-b-atelier-fond: #fff3c9; --pc-b-atelier-fort: #ffe9a3; --pc-b-atelier-trait: #f0cf6b; --pc-b-atelier-encre: #5c3d00;
  --pc-b-liste-fond: #ffffff; --pc-b-liste-trait: #d6dbe4; --pc-b-liste-encre: #374151;
}

/* ══ la scène : visible seulement quand le menu l'a demandée ═══════════════ */
#kc-cours { display: none; }
body[data-kc^="cours-"] #kc-cours { display: block; }

html .pc-panneau, html[data-theme] .pc-panneau {
  background: var(--pc-fond); color: var(--pc-encre); border: 1px solid var(--pc-trait);
  border-radius: var(--pc-rayon-grand); padding: 14px 12px 16px; margin: 0 0 14px; scroll-margin-top: 70px; }
html .pc-panneau .pc-h, html[data-theme] .pc-panneau .pc-h {
  margin: 0 0 2px; font-size: 16.5px; font-weight: 900; line-height: 1.5; color: var(--pc-encre); }
html .pc-panneau .pc-intro, html[data-theme] .pc-panneau .pc-intro {
  margin: 0 0 12px; font-size: 12.5px; font-weight: 600; color: var(--pc-encre-2); }
.pc-ligne:focus-visible, .pc-fiche summary:focus-visible, .pc-suite:focus-visible, .pc-pied:focus-visible,
.pc-actes li a:focus-visible, .pc-etape:focus-visible { outline: 3px solid var(--pc-focus); outline-offset: 2px; }

/* le rond numéroté, commun aux activités et aux étapes */
.pc-n { display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--pc-pastille); height: var(--pc-pastille); border-radius: 50%; font-size: 13px; font-weight: 900; }

/* ══ une ligne = un paragraphe (📖, et tout paragraphe « قريبًا ») ═════════ */
.pc-ligne { display: grid; grid-template-columns: 34px minmax(0, 1fr) 18px; column-gap: 10px; align-items: center;
  min-height: 60px; padding: 9px 10px; margin-bottom: 8px; border-radius: var(--pc-rayon); border: 1.5px solid;
  text-decoration: none; -webkit-tap-highlight-color: transparent; }
.pc-ligne .pc-ico { grid-row: 1 / span 2; font-size: 23px; line-height: 1; text-align: center; }
.pc-ligne b { grid-column: 2; font-size: 14.5px; font-weight: 800; line-height: 1.45; }
.pc-ligne small { grid-column: 2; font-size: 11.5px; font-weight: 600; line-height: 1.5; opacity: .88; }
.pc-ligne i { grid-column: 3; grid-row: 1 / span 2; font-style: normal; font-size: 13px; }
a.pc-ligne:active, a.pc-etape:active { transform: scale(.98); }
html .pc-detail, html[data-theme] .pc-detail {
  background: var(--pc-detail-fond); color: var(--pc-detail-encre); border-color: var(--pc-detail-trait); }
html .pc-vide, html[data-theme] .pc-vide {
  background: var(--pc-vide-fond); color: var(--pc-vide-encre); border-color: var(--pc-vide-trait); border-style: dashed; }

/* ══ une fiche dépliable = un paragraphe (⚡ jaune ; 🧩 violet avec .pc-actes) ═ */
html .pc-fiche, html[data-theme] .pc-fiche { margin-bottom: 8px; border-radius: var(--pc-rayon); overflow: hidden;
  background: var(--pc-memo-fond); color: var(--pc-memo-texte); border: 1.5px solid var(--pc-memo-trait); }
.pc-fiche summary { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; column-gap: 10px; align-items: center;
  min-height: 52px; padding: 8px 10px; cursor: pointer; list-style: none; }
.pc-fiche summary::-webkit-details-marker { display: none; }
.pc-fiche summary .pc-ico { font-size: 22px; text-align: center; }
html .pc-fiche summary b, html[data-theme] .pc-fiche summary b { font-size: 14.5px; font-weight: 800; color: var(--pc-memo-encre); }
html .pc-fiche summary small, html[data-theme] .pc-fiche summary small { font-size: 11px; font-weight: 700;
  color: var(--pc-memo-encre); background: var(--pc-memo-fort); border-radius: 999px; padding: 2px 9px; }
html .pc-fiche[open] summary, html[data-theme] .pc-fiche[open] summary { background: var(--pc-memo-fort); }
html .pc-fiche[open] summary small, html[data-theme] .pc-fiche[open] summary small { background: var(--pc-memo-fond); }
.pc-fiche ol { list-style: none; margin: 0; padding: 4px 12px 0; }
.pc-fiche li { padding: 8px 0; border-top: 1px dashed var(--pc-memo-trait); font-size: 13.5px; line-height: 1.7; }
.pc-fiche li:first-child { border-top: 0; }
html .pc-fiche .pc-f, html[data-theme] .pc-fiche .pc-f { display: block; direction: ltr; text-align: center; margin-top: 4px;
  padding: 4px 6px; border-radius: 8px; background: var(--pc-fond); color: var(--pc-encre);
  font-size: 14px; overflow-x: auto; overflow-y: hidden; max-width: 100%; }
/* le bouton de suite d'une fiche, et le pied du panneau : clairs eux aussi */
html .pc-panneau .pc-suite, html[data-theme] .pc-panneau .pc-suite { display: flex; align-items: center; justify-content: center;
  min-height: 42px; margin: 8px 12px 12px; padding: 6px 10px; border-radius: var(--pc-rayon); text-decoration: none;
  font-size: 13px; font-weight: 800;
  background: var(--pc-detail-fond); color: var(--pc-detail-encre); border: 1.5px solid var(--pc-detail-trait); }
html .pc-panneau .pc-pied, html[data-theme] .pc-panneau .pc-pied { display: flex; align-items: center; justify-content: center;
  min-height: 42px; margin-top: 4px; padding: 6px 10px; border-radius: var(--pc-rayon); text-decoration: none;
  font-size: 13px; font-weight: 800;
  background: var(--pc-fond); color: var(--pc-memo-encre); border: 1.5px solid var(--pc-memo-trait); }

/* 🧩 les activités : la même fiche, en violet, une activité par ligne */
html .pc-actes, html[data-theme] .pc-actes {
  background: var(--pc-act-fond); color: var(--pc-act-texte); border-color: var(--pc-act-trait); }
html .pc-actes summary b, html[data-theme] .pc-actes summary b { color: var(--pc-act-encre); }
html .pc-actes summary small, html[data-theme] .pc-actes summary small { color: var(--pc-act-encre); background: var(--pc-act-fort); }
html .pc-actes[open] summary, html[data-theme] .pc-actes[open] summary { background: var(--pc-act-fort); }
html .pc-actes[open] summary small, html[data-theme] .pc-actes[open] summary small { background: var(--pc-act-fond); }
.pc-actes ol { padding: 6px 8px 0; }
.pc-actes li { padding: 0; border-top: 0; }
html .pc-actes li a, html[data-theme] .pc-actes li a { display: grid; grid-template-columns: 30px minmax(0, 1fr) 16px;
  column-gap: 9px; align-items: center; min-height: 46px; padding: 6px 8px; margin-bottom: 5px; border-radius: 10px;
  background: var(--pc-fond); color: var(--pc-act-texte); border: 1px solid var(--pc-act-fort); text-decoration: none;
  font-size: 13.5px; font-weight: 700; line-height: 1.5; }
html .pc-actes li a .pc-n, html[data-theme] .pc-actes li a .pc-n { background: var(--pc-act-fort); color: var(--pc-act-encre); }
html .pc-actes li a.pc-vu .pc-n, html[data-theme] .pc-actes li a.pc-vu .pc-n { background: var(--pc-fait); color: #ffffff; }
.pc-actes li a i { font-style: normal; font-size: 12px; opacity: .7; }
html .pc-panneau .pc-actes .pc-suite, html[data-theme] .pc-panneau .pc-actes .pc-suite { margin: 6px 8px 10px;
  background: var(--pc-act-fort); color: var(--pc-act-encre); border-color: var(--pc-act-trait); }

/* ══ « الدروس خطوة بخطوة » : les 4 étapes d'un paragraphe ══════════════════
   body.chap-khan pose la carte en GRILLE (chapitre-khan.css) : la rangée prend
   toute la largeur. 4 colonnes égales (75 px à 375 px). Les sélecteurs sont
   longs exprès : ils doivent battre ceux de chapitre-khan.css. */
body.chap-khan #pk-app > section[id^="lecon-"] .pc-etapes, .pc-etapes {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 10px 0 12px; }
.pc-etape { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 84px; padding: 8px 3px 7px;
  border-radius: var(--pc-rayon); border: 1.5px solid; text-align: center; text-decoration: none;
  -webkit-tap-highlight-color: transparent; }
.pc-etape b { font-size: 13px; font-weight: 900; line-height: 1.4; }
.pc-etape small { font-size: 10px; font-weight: 700; line-height: 1.35; opacity: .9; }
html body .pc-etape:nth-child(1) { background: var(--pc-e1-fond); color: var(--pc-e1-encre); border-color: var(--pc-e1-trait); }
html body .pc-etape:nth-child(1) .pc-n { background: var(--pc-e1-pastille); color: var(--pc-e1-encre); }
html body .pc-etape:nth-child(2) { background: var(--pc-e2-fond); color: var(--pc-e2-encre); border-color: var(--pc-e2-trait); }
html body .pc-etape:nth-child(2) .pc-n { background: var(--pc-e2-pastille); color: var(--pc-e2-encre); }
html body .pc-etape:nth-child(3) { background: var(--pc-e3-fond); color: var(--pc-e3-encre); border-color: var(--pc-e3-trait); }
html body .pc-etape:nth-child(3) .pc-n { background: var(--pc-e3-pastille); color: var(--pc-e3-encre); }
html body .pc-etape:nth-child(4) { background: var(--pc-e4-fond); color: var(--pc-e4-encre); border-color: var(--pc-e4-trait); }
html body .pc-etape:nth-child(4) .pc-n { background: var(--pc-e4-pastille); color: var(--pc-e4-encre); }
html body .pc-etape.pc-faite .pc-n { background: var(--pc-fait); color: #ffffff; }
html body .pc-etape.pc-etape-vide { background: var(--pc-vide-fond); color: var(--pc-vide-encre);
  border-color: var(--pc-vide-trait); border-style: dashed; }
html body .pc-etape.pc-etape-vide .pc-n { background: var(--pc-vide-pastille); color: var(--pc-encre-2); }

/* ══ les boutons de la carte, en clair (body.pc-clair, posé par le moteur) ══
   Le chef, capture du téléphone, 11/11 : « revoir les couleurs et la forme des
   boutons… je parle des boutons ورشة الدرس ». C'étaient des pilules vert sombre.
   « ورشة الدرس » = bouton principal (jaune pâle) ; « تدرّب » = vert d'eau ;
   « المهارات » = blanc. ⛔ Ne jamais masquer « ورشة الدرس » : une première passe
   l'avait fait, à tort. */
html body.chap-khan.pc-clair #pk-app > section[id^="lecon-"] .pk-lesson-actions { grid-template-columns: 1fr 1fr; gap: 8px; }
html body.chap-khan.pc-clair #pk-app > section[id^="lecon-"] .pk-lesson-actions .pk-btn {
  min-height: 44px; border-radius: var(--pc-rayon); box-shadow: none; font-size: 13.5px; font-weight: 800;
  background: var(--pc-detail-fond); color: var(--pc-detail-encre); border: 1.5px solid var(--pc-detail-trait); }
html body.chap-khan.pc-clair #pk-app > section[id^="lecon-"] .pk-lesson-actions .pk-btn:hover { filter: none; background: var(--pc-detail-fort); }
html body.chap-khan.pc-clair #pk-app > section[id^="lecon-"] .pk-lesson-actions a.pk-btn[href*="atelier"] {
  min-height: 50px; border-radius: var(--pc-rayon-grand); font-size: 15px; font-weight: 900;
  background: var(--pc-b-atelier-fond); color: var(--pc-b-atelier-encre); border: 1.5px solid var(--pc-b-atelier-trait); }
html body.chap-khan.pc-clair #pk-app > section[id^="lecon-"] .pk-lesson-actions a.pk-btn[href*="atelier"]:hover { background: var(--pc-b-atelier-fort); }
html body.chap-khan.pc-clair #pk-app > section[id^="lecon-"] .pk-lesson-actions .pk-btn[data-toggle] {
  grid-column: auto; min-height: 44px; padding: 8px 10px; font-size: 13px; border-radius: var(--pc-rayon);
  background: var(--pc-b-liste-fond); color: var(--pc-b-liste-encre); border: 1.5px solid var(--pc-b-liste-trait); }
html body.chap-khan.pc-clair #pk-app > section[id^="lecon-"] .pk-lesson-actions .pk-btn[data-toggle]:hover { background: var(--pc-vide-fond); }

/* ══ chapitre à COURS ANIMÉ (cours: { anime }) : la règle d'une notion, et les
      titres de partie du cours ═══════════════════════════════════════════ */
html .pc-partie, html[data-theme] .pc-partie { margin: 12px 2px 6px; font-size: 12.5px; font-weight: 900; color: var(--pc-encre-2); }
.pc-fiche .pc-regle { padding: 8px 12px 0; font-size: 13.5px; line-height: 1.75; }
.pc-fiche .pc-regle p { margin: 0 0 6px; }
.pc-fiche .pc-regle .ca-f { display: block; direction: ltr; text-align: center; margin: 4px 0; overflow-x: auto; overflow-y: hidden; max-width: 100%; }
html .pc-fiche summary .pc-n, html[data-theme] .pc-fiche summary .pc-n { background: var(--pc-memo-trait); color: var(--pc-memo-texte); }
html .pc-ligne .pc-n, html[data-theme] .pc-ligne .pc-n { grid-row: 1 / span 2; background: var(--pc-fond); color: var(--pc-detail-encre); }
