/* KenhoWeb Formation — styles publics. Codes visuels du ministère :
   bleu nuit #0d2b4c et doré #d9ad4d sur fond clair pour la lecture. */
.kwf-wrap { max-width: 1100px; margin: 0 auto; padding: 16px; font-size: 17px; line-height: 1.55; }
.kwf-wrap h2 { margin-top: 0; }
.kwf-notice { background: #eef4fb; border: 1px solid #b8d2ee; border-radius: 8px; padding: 12px 16px; margin: 14px 0; }
.kwf-notice-ok { background: #eaf7ec; border-color: #a9d8ae; }
.kwf-notice-erreur { background: #fdeeee; border-color: #eeb8b8; }
.kwf-petit { font-size: 0.85em; color: #555; }
.kwf-bouton { display: inline-block; background: #0d2b4c; color: #fff !important; padding: 10px 18px; border: none; border-radius: 8px; cursor: pointer; text-decoration: none !important; font-weight: 600; }
.kwf-bouton:hover { background: #12395f; }
.kwf-bouton-secondaire { background: #fff; color: #0d2b4c !important; border: 2px solid #0d2b4c; }
/* v1.0.31 : groupe de boutons d'une carte de livre (« Lire ce livre » + « Aller au cours »)
   ou du retour au cours du lecteur. La règle v1.0.29 (margin-left: 8px sur le bouton
   suivant) ne séparait qu'à l'horizontale : en largeur mobile les boutons s'empilent
   et restaient collés. Le groupe flex avec gap sépare dans les deux sens, et réserve
   aussi l'écart avec le texte au-dessus. */
.kwf-carte-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.kwf-carte-actions .kwf-bouton { margin: 0; }

/* Page d'entrée (v1.0.11) : le bouton « Voir les cours
   disponibles », centré et bien visible, sous la note d'entrée —
   le catalogue vit sur sa propre page ([kwf_catalogue]). */
.kwf-entree-cours { text-align: center; margin: 30px 0 10px; }
.kwf-bouton-catalogue { font-size: 1.15em; padding: 15px 32px; border-radius: 10px; box-shadow: 0 2px 8px rgba(13, 43, 76, 0.25); }
/* v1.0.12 : lien secondaire bibliothèque sur la page d'entrée. */
.kwf-entree-biblio { text-align: center; margin: 14px 0 6px; font-size: 0.95em; }
/* v1.0.12 : encadré solennel du certificat de fin de formation, en haut de « Ma formation ». */
.kwf-certificat-final { background: #0d2b4c; color: #eef3f8; border: 2px solid #d9ad4d; border-radius: 12px; padding: 22px 24px; margin: 0 0 26px; text-align: center; }
.kwf-certificat-final h3 { color: #d9ad4d; margin-top: 0; font-size: 1.35em; }
.kwf-certificat-final .kwf-petit { color: #b9cbdd; }
/* v1.0.12 : bloc liens utiles de « Ma formation ». */
.kwf-liens-utiles { border-top: 1px solid #e3ddc8; margin-top: 26px; padding-top: 14px; }
.kwf-badge { display: inline-block; background: #d9ad4d; color: #0d2b4c; border-radius: 20px; padding: 2px 10px; font-size: 0.8em; font-weight: 700; }
.kwf-badge-rouge { background: #c0392b; color: #fff; }

/* Note d'entrée */
.kwf-note { background: #fdfcf7; border: 1px solid #e3ddc8; border-radius: 12px; padding: 22px; margin-bottom: 28px; }
.kwf-note-texte h2, .kwf-note-texte h3 { color: #0d2b4c; }
.kwf-form-note label { display: block; margin: 14px 0; font-size: 1.05em; }
.kwf-note-ok { font-weight: 700; color: #1d7a2f; }

/* Profil général de l'étudiant (dans « Ma formation ») */
.kwf-profil { background: #fff; border: 1px solid #dde3ea; border-radius: 12px; padding: 18px; margin: 18px 0 26px; box-shadow: 0 1px 4px rgba(13, 43, 76, 0.08); }
.kwf-profil h3 { margin-top: 0; color: #0d2b4c; }
.kwf-form-profil p { margin: 0 0 14px; }
.kwf-form-profil input[type="text"] { width: 100%; max-width: 480px; padding: 9px 12px; border: 1px solid #b9c6d4; border-radius: 8px; font-size: 1em; margin-top: 4px; }

/* Catalogue — organisation par année (sections), grille de
   cartes façon librairie : image, titre centré, « Voir le cours ». */
.kwf-section { margin-bottom: 34px; }
.kwf-section > h2 { text-align: center; color: #0d2b4c; border-bottom: 2px solid #d9ad4d; padding-bottom: 8px; margin-bottom: 18px; }
.kwf-section-desc { text-align: center; color: #555; }
.kwf-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.kwf-carte { background: #fff; border: 1px solid #dde3ea; border-radius: 12px; padding: 18px; box-shadow: 0 1px 4px rgba(13, 43, 76, 0.08); text-align: center; }
.kwf-carte h3, .kwf-carte h4 { margin-top: 0; color: #0d2b4c; }
.kwf-carte-faits { margin: 10px 0 14px; padding-left: 0; list-style: none; }
/* Carte image du catalogue (v1.0.9) : photo thématique, titre
   centré, bouton « Voir le cours » — aucun texte de description. */
.kwf-carte-img { width: 100%; height: 150px; object-fit: cover; border-radius: 8px; display: block; margin-bottom: 12px; }
/* Page de présentation du cours (v1.0.9) */
.kwf-presentation { max-width: 760px; margin: 0 auto; }
.kwf-pres-titre { text-align: center; color: #0d2b4c; margin: 4px 0 10px; }
.kwf-pres-centre { text-align: center; }
.kwf-pres-corps { font-size: 1.02em; }
.kwf-pres-corps h3 { color: #0d2b4c; text-align: center; margin: 20px 0 8px; }
.kwf-pres-intro, .kwf-pres-conclusion { text-align: center; }
.kwf-pres-points { max-width: 600px; margin: 0 auto; text-align: left; line-height: 1.6; }
.kwf-pres-faits { text-align: center; margin-top: 20px; }
.kwf-pres-action { text-align: center; margin: 18px 0; }
.kwf-pres-retour { text-align: center; }
.kwf-progression { background: #e6ebf2; border-radius: 8px; height: 10px; overflow: hidden; margin: 10px 0 4px; }
.kwf-progression span { display: block; height: 100%; background: #d9ad4d; }

/* Lecteur de cours : menu à gauche, contenu à droite (format plateforme) */
.kwf-lecteur { display: flex; gap: 22px; align-items: flex-start; }
.kwf-menu { flex: 0 0 300px; background: #0d2b4c; color: #eaf1f8; border-radius: 12px; padding: 18px; position: sticky; top: 16px; }
.kwf-menu h3 { color: #fff; margin-top: 0; }
.kwf-menu ol { list-style: none; margin: 0; padding: 0; }
.kwf-etape { padding: 9px 8px; border-radius: 8px; margin-bottom: 4px; }
.kwf-etape a { color: #eaf1f8; text-decoration: none; display: block; }
.kwf-etape.actuelle { background: #16406b; }
.kwf-etape.faite .kwf-etape-num { background: #2e9e4f; color: #fff; }
.kwf-etape.verrouillee { opacity: 0.55; }
.kwf-etape-num { display: inline-block; min-width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 50%; background: #d9ad4d; color: #0d2b4c; font-weight: 700; margin-right: 6px; }
.kwf-contenu { flex: 1 1 auto; background: #fff; border: 1px solid #dde3ea; border-radius: 12px; padding: 22px; min-width: 0; }
.kwf-texte { font-size: 1.05em; }
.kwf-non-select { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* Images thématiques du lecteur (v1.0.9) : photo du cours en
   bandeau au-dessus du contenu, photo de fermeture de page. */
.kwf-bandeau { margin: 0 0 16px; }
.kwf-bandeau img { width: 100%; height: 190px; object-fit: cover; border-radius: 12px; display: block; }
.kwf-image-bas { margin: 16px 0 0; }
.kwf-image-bas img { width: 100%; height: 170px; object-fit: cover; border-radius: 12px; display: block; }

/* État de la leçon — fin automatique (v1.0.9) */
.kwf-etat-lecon { background: #eef4fb; border: 1px solid #b8d2ee; border-radius: 12px; padding: 16px 18px; margin-top: 22px; }
.kwf-etat-lecon h3 { margin-top: 0; color: #0d2b4c; }
.kwf-conditions { list-style: none; margin: 10px 0 2px; padding: 0; }
.kwf-conditions li { padding: 7px 10px; border-radius: 8px; margin-bottom: 6px; background: #fff; border: 1px solid #dde3ea; font-weight: 600; }
.kwf-conditions li.faite { color: #1d7a2f; border-color: #a9d8ae; background: #eaf7ec; }
.kwf-conditions li.a-faire { color: #7a5b12; border-color: #e3d3a1; background: #fdf8ec; }

/* Réponses du devoir formatif (v1.0.9) */
.kwf-reponses { background: #fdfcf7; border: 1px solid #e3ddc8; border-radius: 12px; padding: 18px; margin-top: 22px; }
.kwf-reponses h3 { margin-top: 0; color: #0d2b4c; }
.kwf-form-reponses textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #b9c6d4; border-radius: 8px; font-size: 1em; line-height: 1.55; font-family: inherit; margin: 4px 0 12px; background: #fff; }
.kwf-form-reponses textarea:focus { outline: 2px solid #d9ad4d; outline-offset: 1px; border-color: #0d2b4c; }
.kwf-question-reponse { margin: 0 0 18px; }
.kwf-question-texte { margin: 0 0 2px; color: #0d2b4c; line-height: 1.55; }
.kwf-reponse-libelle { display: block; margin-top: 6px; font-size: 0.82em; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: #8a6d1f; }
.kwf-audio audio { width: 100%; }
.kwf-form-etape, .kwf-form-note, .kwf-form-examen { margin-top: 20px; }
.kwf-form-etape label { display: block; margin-bottom: 12px; }
.kwf-form-message { margin-left: 10px; font-weight: 600; }

/* Salutation personnalisée en tête du lecteur */
.kwf-salutation { background: #fdf8ec; border: 1px solid #e3d3a1; border-left: 5px solid #0d2b4c; border-radius: 10px; padding: 16px 20px; margin: 0 0 16px; }
.kwf-salutation h2 { margin: 0 0 6px; color: #0d2b4c; }
.kwf-salutation audio { width: 100%; }

/* Livre et bibliothèque */
.kwf-chapitres-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.kwf-chapitres-nav a { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; min-width: 34px; text-align: center; padding: 6px 8px; border: 1px solid #0d2b4c; border-radius: 8px; color: #0d2b4c; text-decoration: none; }
/* v1.0.23 : encadré des chapitres à lire et badges de la grille. */
.kwf-encadre-obligations { border: 2px solid #d9ad4d; background: #fdf6e0; border-radius: 10px; padding: 12px 16px; margin: 14px 0; }
.kwf-encadre-obligations .kwf-encadre-titre { margin: 0 0 6px; font-size: 1.05em; }
.kwf-encadre-obligations .kwf-petit { margin: 0; }
.kwf-badge-lecture { display: inline-block; background: #d9ad4d; color: #0d2b4c; border-radius: 12px; padding: 1px 8px; font-size: 0.62em; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.kwf-badge-lecture-libre { background: #eef1f4; color: #5a6a7a; border: 1px solid #c3cedb; font-weight: 600; }
.kwf-chapitres-nav a.actif .kwf-badge-lecture { background: #d9ad4d; color: #0d2b4c; }
.kwf-chapitres-nav a.actif { background: #0d2b4c; color: #fff; }
.kwf-chapitres-nav a.lu { border-color: #7a9a01; background: #f2f7e3; }
.kwf-chapitres-nav a.actif.lu { background: #0d2b4c; color: #fff; }
.kwf-chapitres-avancement { margin: 10px 0 0; }
.kwf-lecture-reste { margin-top: 14px; }
.kwf-chapitre { background: #fffdf6; border: 1px solid #e8e2cc; border-radius: 10px; padding: 20px; }
.kwf-chapitres-bas { margin-top: 16px; }
.kwf-biblio-cours { margin-bottom: 26px; }

/* Livres liés (v1.0.20) : mention « approfondissement » sur les
   cartes de la Bibliothèque et encadré « Pour aller plus loin »
   dans le lecteur du cours. Purement informatif. */
.kwf-mention-lie { font-style: italic; color: #5a6b7f; margin: 2px 0 0; }
.kwf-livres-lies { margin-top: 26px; background: #f4f8fc; border: 1px solid #cfdde9; border-radius: 10px; padding: 16px 20px; }
.kwf-livres-lies h3 { margin-top: 0; color: #0d2b4c; }
.kwf-livres-lies ul { margin: 8px 0 0; padding-left: 20px; }
.kwf-livres-lies li { margin: 6px 0; }

/* Lecture à voix haute des chapitres de livre (v1.0.14) : barre
   discrète en haut du chapitre. Le texte est lu par la synthèse
   vocale de l'appareil de l'étudiant — aucun audio hébergé. La
   barre et sa note de repli sont rendues cachées (attribut
   hidden) et révélées par le script selon la capacité de
   l'appareil ; le display:flex de la barre et le display des
   boutons écraseraient l'attribut hidden, d'où la règle
   explicite ci-dessous. */
.kwf-ecoute { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid #e8e2cc; }
.kwf-ecoute[hidden], .kwf-ecoute [hidden], .kwf-ecoute-indispo[hidden] { display: none !important; }
.kwf-ecoute-libelle { font-weight: 600; color: #0d2b4c; }
.kwf-ecoute-etat { font-weight: 600; color: #1d7a2f; }
.kwf-ecoute-indispo { margin: 0 0 12px; font-style: italic; }

/* Progression par l'écoute (v1.0.15) : bouton « Chapitre suivant »
   verrouillé tant que le chapitre en cours n'a pas été écouté en
   entier, grille des chapitres avec numéros verrouillés et marque
   🎧 des chapitres écoutés, note de reprise. Le display des
   boutons (.kwf-bouton, inline-block) écraserait l'attribut
   hidden dont se sert le script pour révéler le vrai bouton en
   place : règle explicite, comme pour la barre d'écoute. */
.kwf-bouton[hidden] { display: none !important; }
.kwf-bouton-bloque { opacity: .55; cursor: not-allowed; }
.kwf-ecoute-requise { margin: 8px 0 0; max-width: 560px; }
.kwf-ecoute-reprise { margin: 0 0 12px; }
.kwf-chapitres-nav span.kwf-nav-bloque { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; min-width: 34px; text-align: center; padding: 6px 8px; border: 1px dashed #9aa7b4; border-radius: 8px; color: #7c8a99; background: #f4f6f8; cursor: not-allowed; }
.kwf-chapitres-nav a.ecoute { border-color: #1d7a2f; }

/* Examen */
.kwf-question { border: 1px solid #dde3ea; border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.kwf-question legend { font-weight: 700; padding: 0 6px; }
.kwf-question label { display: block; padding: 6px 0; cursor: pointer; }
.kwf-resultat { border-radius: 12px; padding: 18px; margin-top: 18px; }
.kwf-resultat.reussi { background: #eaf7ec; border: 1px solid #a9d8ae; }
.kwf-resultat.echoue { background: #fdeeee; border: 1px solid #eeb8b8; }
.kwf-correction-item { border-top: 1px solid #dde3ea; padding: 8px 0; }

/* Anti-copie renforcé (v1.0.21) : filigrane personnel répété sur
   le texte des chapitres (lecteur de cours et Bibliothèque),
   marque des chapitres libres dans la grille, et impression
   bloquée — à l'impression, le texte protégé (chapitres ET
   leçons) est masqué et seule la note d'impression paraît. */
.kwf-lecture-protection { position: relative; }
.kwf-filigrane { position: absolute; inset: 0; pointer-events: none; background-repeat: repeat; z-index: 3; }
.kwf-chapitres-nav a.libre { border-style: dashed; opacity: .8; }
.kwf-impression-note { display: none; }

@media print {
	.kwf-texte { display: none !important; }
	.kwf-filigrane, .kwf-ecoute, .kwf-chapitres-nav, .kwf-chapitres-bas, .kwf-form-etape { display: none !important; }
	.kwf-impression-note { display: block !important; font-style: italic; }
}

@media (max-width: 820px) {
	.kwf-lecteur { flex-direction: column; }
	.kwf-menu { flex: 1 1 auto; width: 100%; position: static; box-sizing: border-box; }
	.kwf-contenu { width: 100%; box-sizing: border-box; }
}

/* v1.0.25 — lecture suivie (audio réel des livres) : le mot suivi
   est peint en bleu, son paragraphe est teinté ; le lecteur audio
   est invisible (pas de contrôles natifs, pas de téléchargement).
   Les paragraphes touchables n'ont le pointeur qu'une fois le
   minutage prêt (classe « kwf-suivi » sur la zone de texte). */
.kwf-audio-livre { display: none; }
.kwf-suivi [data-kwf-para] { cursor: pointer; }
.kwf-mot-actif { background: #2f6fdd; color: #fff; border-radius: 2px; }
.kwf-para-actif { background: #eaf2ff; border-radius: 4px; }

/* v1.0.26 — barre audio INVISIBLE, style Speechify : fine barre
   fixe en bas de l'écran, au-dessus du texte, sous le portail de
   notifications et le tiroir du cadre applicatif (même échelle que
   Lecture Livres v1.9.18). Le chapitre gagne une marge en bas tant
   que la barre est visible, pour que la navigation ne passe jamais
   dessous.
   v1.0.27 (captures du ministère, Genèse 1, 2026-11-28 — même
   correction que Lecture Livres v1.9.20) : la barre ne passe plus
   SOUS le rail gauche de l'application (bord gauche décalé par le
   script, variable « --kwf-ba-gauche », mesurée sur le rail réel)
   et son bas est REMONTÉ de la zone de sécurité basse du téléphone
   (« bottom » = env(safe-area-inset-bottom), l'insert n'est donc
   compté qu'une fois, en décalage, plus en rembourrage). */
.kwf-barre-audio {
	position: fixed; left: var(--kwf-ba-gauche, 0); right: 0; bottom: env(safe-area-inset-bottom, 0px); z-index: 99990;
	background: #0b1c33; color: #faf7f0;
	border-top: 3px solid #c9a227;
	box-shadow: 0 -4px 18px rgba(0, 0, 0, .35);
	padding: .45rem .7rem .55rem;
	box-sizing: border-box;
}
.kwf-barre-audio[hidden] { display: none; }
.kwf-ba-contenu[hidden] { display: none; }
.kwf-ba-progression {
	position: relative; height: 6px; margin-bottom: .45rem;
	background: rgba(250, 247, 240, .25); border-radius: 3px; cursor: pointer;
}
.kwf-ba-remplissage { height: 100%; width: 0; background: #c9a227; border-radius: 3px; }
.kwf-ba-ligne { display: flex; align-items: center; gap: .45rem; }
.kwf-ba-ligne .kwf-bouton { min-height: 44px; padding: .4rem .6rem; }
/* Verrouillage de l'avance (règle de Kenho) : le bouton +10 s est
   estompé quand l'avance est bloquée au point le plus lointain
   entendu — il reste cliquable, et le message explique le blocage. */
.kwf-ba-ligne [data-kwf-ba="plus10"].kwf-ba-avance-bloquee { opacity: .45; }
.kwf-ba-ligne [data-kwf-ba="lecture"] { min-width: 52px; font-size: 1.25rem; }
.kwf-ba-temps { font-variant-numeric: tabular-nums; font-size: .92rem; white-space: nowrap; margin-left: auto; }
.kwf-ba-rouvrir[hidden] { display: none; }
.kwf-ba-rouvrir { display: block; margin: 0 auto; }
.kwf-ecoute-etat { display: block; font-size: .85rem; margin-top: .35rem; color: #dbe4f0; }
/* v1.0.31 : la réserve basse est mesurée sur la barre réelle par le script (variable
   --kwf-barre-hauteur posée sur l'article) ; le repli 116 px couvre la barre la plus
   haute à une ligne (~103 px : bordure 3 + rembourrage 16 + progression 13 + boutons
   44 + état 27) + 12 px de marge, zone sûre basse comprise — la mesure, elle, la
   contient déjà. */
.kwf-chapitre.kwf-barre-audio-visible { padding-bottom: calc(var(--kwf-barre-hauteur, calc(116px + env(safe-area-inset-bottom, 0px))) + 12px); }

/* v1.0.29 — lecture suivie des LEÇONS : mêmes règles que les
   livres. L'élément <audio> de la leçon est caché ; la leçon
   gagne une marge en bas tant que la barre est visible, pour
   que la fin de la leçon ne passe jamais dessous (v1.0.31 : la
   marge est mesurée sur la barre réelle, repli 116 px).
   L'article .kwf-lecon ne porte aucun autre style : la mise en
   page de la leçon est inchangée. */
.kwf-audio-lecon { display: none; }
.kwf-ecoute-lecon[hidden] { display: none; }
.kwf-lecon.kwf-barre-audio-visible { padding-bottom: calc(var(--kwf-barre-hauteur, calc(116px + env(safe-area-inset-bottom, 0px))) + 12px); }
