/* La fiche Enseigner (enseigner.html) : lecture à l'écran, mode projeté et impression A4.
   Les couleurs ne portent jamais seules un sens ; le focus reste visible ; 390 px sans
   défilement horizontal. */

.evitement { position: absolute; left: 8px; top: -60px; z-index: 50; padding: 10px 16px; background: var(--or); color: #1b160d; font-weight: 700; border-radius: 8px; text-decoration: none; }
.evitement:focus { top: 8px; }

.ens-conteneur { width: min(980px, 100% - 2 * var(--gouttiere)); margin-inline: auto; padding: clamp(24px, 4vw, 48px) 0 56px; }
.ens-appli { min-width: 0; }
.ens-tete { margin-bottom: 18px; }
.ens-kicker { margin: 0 0 6px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--or); }
.ens-tete .titre-bd { margin: 4px 0 14px; overflow-wrap: anywhere; }
.ens-tete .chapeau { margin: 0 0 14px; max-width: 64ch; }
.ens-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0; }
.ens-aide { margin: 0; color: var(--texte-doux); }

.ens-section, .ens-deroule { margin: 22px 0; }
.ens-section h2, .ens-deroule h2 { font-size: clamp(20px, 2.4vw, 26px); margin: 0 0 8px; color: var(--or-clair); }
.ens-section ul, .ens-section ol, .ens-bloc ul { margin: 6px 0 10px; padding-left: 22px; }
.ens-section li, .ens-bloc li { margin: 4px 0; line-height: 1.5; }
.ens-section p, .ens-bloc p { line-height: 1.55; max-width: 72ch; }
.ens-note { color: var(--texte-doux); }
.ens-frise { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; }
.ens-frise li { padding: 4px 10px; border: 1px solid var(--bord); border-radius: 999px; }

.ens-temps { margin: 20px 0; padding: 18px clamp(14px, 3vw, 24px); background: var(--panneau); border: 1px solid var(--bord); border-left: 4px solid var(--or); border-radius: var(--rayon); }
.ens-titre-temps { margin: 0 0 4px; font-size: clamp(20px, 2.6vw, 28px); color: var(--or-clair); }
.ens-intention { margin: 0 0 4px; font-size: 1.08em; }
.ens-horloge { margin: 0 0 10px; color: var(--texte-doux); }
.ens-bloc { margin: 14px 0; }
.ens-bloc h4, .ens-activites h4 { margin: 0 0 4px; font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--or); }
.ens-activites ul { list-style: none; padding: 0; margin: 6px 0; }
.ens-act { margin: 8px 0; padding: 10px 12px; border: 1px solid var(--bord); border-radius: 10px; }
.ens-act-tete { margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.ens-badge { font-size: 12px; padding: 2px 8px; border: 1px solid var(--equerre); border-radius: 999px; color: var(--texte-doux); }
.ens-cadre { color: var(--texte-doux); margin: 2px 0; }
.ens-liens { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 6px 0 0; }
.ens-lien { color: var(--or-clair); text-underline-offset: 3px; overflow-wrap: anywhere; }
.ens-lien--bouton { display: inline-block; padding: 8px 14px; border: 1px solid var(--equerre); border-radius: 10px; text-decoration: none; }
.ens-corriges-contenu[hidden] { display: none; }
.ens-corrige { margin: 8px 0; }
.ens-corrige h5 { margin: 0 0 4px; font-size: 15px; }
.ens-corrige dl { margin: 0; }
.ens-corrige dt { margin-top: 6px; font-weight: 600; }
.ens-corrige dd { margin: 2px 0 0 12px; line-height: 1.45; }

.ens-table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.ens-table th, .ens-table td { text-align: left; vertical-align: top; padding: 8px 10px; border: 1px solid var(--bord); line-height: 1.4; }
.ens-table thead th { background: var(--or-voile); }
.ens-chapitres li { margin: 6px 0; }
.ens-missions-liees { list-style: none; margin: 2px 0 0; padding: 0 0 0 16px; font-size: .92em; }
.ens-missions-liees li { display: inline; margin: 0; }
.ens-missions-liees li:not(:last-child)::after { content: ' ; '; }

.ens-bouton, .bouton[data-act] { font: inherit; cursor: pointer; }
.ens-bouton { padding: 9px 16px; color: var(--texte); background: transparent; border: 1px solid var(--equerre); border-radius: 10px; min-height: 44px; }
.ens-bouton:hover { background: var(--or-voile); }
.ens-pilotage { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 14px; }
.ens-position { margin: 0 6px; font-weight: 600; }

:where(a, button, [tabindex]):focus-visible { outline: 3px solid var(--or-clair); outline-offset: 3px; border-radius: 4px; }
.ens-titre-temps:focus-visible, #ens-titre:focus-visible { outline: 3px solid var(--or-clair); outline-offset: 4px; }

/* mode projeté : grande taille, un temps à la fois */
.ens-projection .ens-page--projection { font-size: clamp(20px, 2.6vw, 30px); }
.ens-projection .ens-conteneur { width: min(1240px, 100% - 2 * var(--gouttiere)); }
.ens-projection .ens-bloc li, .ens-projection .ens-act p, .ens-projection .ens-corrige dd { line-height: 1.5; }
.ens-projection .ens-titre-temps { font-size: clamp(30px, 4.4vw, 54px); }
.ens-projection .ens-bouton { font-size: 18px; }
.ens-projection .ens-bloc h4, .ens-projection .ens-activites h4 { font-size: 18px; }

@media (max-width: 560px) {
  .ens-table, .ens-table tbody, .ens-table tr, .ens-table th, .ens-table td { display: block; width: auto; }
  .ens-table thead { position: absolute; left: -9999px; }
  .ens-table tr { margin: 0 0 12px; border: 1px solid var(--bord); border-radius: 8px; }
  .ens-table th, .ens-table td { border: 0; border-bottom: 1px solid var(--bord); }
  .ens-table td:nth-child(2)::before { content: 'Activité : '; color: var(--texte-doux); }
  .ens-table td:nth-child(3)::before { content: 'Preuve : '; color: var(--texte-doux); }
}

@media (prefers-reduced-motion: reduce) {
  .ens-conteneur *, .ens-conteneur *::before, .ens-conteneur *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* impression : A4, noir sur blanc, un temps par page, liens écrits en clair, aucune couleur porteuse de sens */
@page { size: A4; margin: 14mm; }
@media print {
  html, body { background: #fff !important; color: #000 !important; }
  .barre, .pied, .evitement, .ens-actions, .ens-pilotage, .ens-aide, noscript, #haut ~ canvas { display: none !important; }
  .ens-conteneur { width: auto; padding: 0; margin: 0; }
  .ens-appli, .ens-page { font: 10pt/1.35 Georgia, "Times New Roman", serif; color: #000; }
  .titre-bd { color: #000 !important; text-shadow: none !important; -webkit-text-stroke: 0 !important; }
  .ens-tete .titre-bd { color: #000 !important; text-shadow: none !important; -webkit-text-stroke: 0 !important; font-size: 22pt; }
  .ens-kicker, .ens-section h2, .ens-deroule h2, .ens-titre-temps, .ens-bloc h4, .ens-activites h4 { color: #000 !important; }
  .ens-section h2, .ens-deroule h2 { font-size: 14pt; border-bottom: 1px solid #000; }
  .ens-temps { background: #fff !important; border: 1px solid #000; border-left-width: 3px; border-radius: 0; padding: 8pt 10pt; margin: 0 0 8pt; break-before: page; break-inside: avoid-page; }
  .ens-deroule > div > .ens-temps:first-child { break-before: auto; }
  .ens-act, .ens-badge, .ens-frise li, .ens-lien--bouton { border-color: #000 !important; color: #000 !important; }
  .ens-cadre, .ens-note, .ens-horloge, .ens-position { color: #000 !important; }
  .ens-bloc { margin: 6pt 0; break-inside: avoid; }
  /* impression lancée depuis le mode projeté : introduction, tous les temps, corrigés, compétences et parcours libre */
  .ens-corriges-contenu[hidden], .ens-temps[hidden], .ens-intro[hidden], .ens-competences[hidden], .ens-libre[hidden] { display: block !important; }
  .ens-corrige, .ens-corrige dd, .ens-corrige dt { font-size: 9pt; line-height: 1.3; }
  .ens-corrige dt { margin-top: 2pt; }
  .ens-corrige dd { margin: 0 0 0 8pt; }
  .ens-act { margin: 4pt 0; padding: 4pt 6pt; }
  .ens-bloc { margin: 4pt 0; }
  a, .ens-lien { color: #000 !important; text-decoration: underline; }
  a[href]::after { content: ' (' attr(href) ')'; font-size: 9pt; }
  .ens-table th, .ens-table td { border: 1px solid #000; padding: 3pt 5pt; }
  .ens-table thead th { background: #fff; font-weight: 700; }
  .ens-competences { break-before: auto; break-inside: auto; }
  .ens-table tr { break-inside: avoid; }
  .ens-table { font-size: 9pt; }
  .ens-libre { break-inside: auto; }
  .ens-corrige dt { break-after: avoid; }
}
.ens-sous-titre { margin: 0 0 10px; font-size: 1.15em; font-weight: 700; }

.ens-projection .ens-resume, .ens-projection .ens-sous-titre, .ens-projection .ens-tete .chapeau, .ens-projection .ens-kicker { display: none; }

/* en projection, l'aide des touches ne mange pas l'écran : le temps courant reste au plus près du haut de la fenêtre */
.ens-projection .ens-aide { font-size: 16px; margin: 0 0 10px; }

/* ───────── le Kit enseignant (K1) : sans inscription, avant la séance, ressources, impression, prolongements, fiche élève, établissement ───────── */
.ens-kit { margin: 20px 0; padding: 18px clamp(14px, 3vw, 24px); background: var(--panneau); border: 1px solid var(--bord); border-left: 4px solid var(--or); border-radius: var(--rayon); }
.ens-kit h2 { margin-top: 0; }
.ens-kit--sans { border-left-width: 8px; }
.ens-kit--sans h2 { font-size: clamp(24px, 3vw, 32px); }
.ens-kit h3 { font-size: 1.1em; margin: 14px 0 4px; color: var(--or-clair); }
.ens-conseil { margin: 8px 0 12px; font-size: 1.12em; }
.ens-enonces, .ens-controle, .ens-ressources, .ens-prolongements { margin: 8px 0 12px; padding-left: 22px; }
.ens-enonces li, .ens-controle li, .ens-prolongements li { margin: 8px 0; line-height: 1.5; }
.ens-controle, .ens-ressources { list-style: none; padding-left: 0; }
.ens-controle li { padding-left: 1.6em; position: relative; }
.ens-controle li::before { content: '\2610'; position: absolute; left: 0; top: 0; }
.ens-source { display: block; margin-top: 2px; font-size: .9em; color: var(--texte-doux); }
.ens-ressource { margin: 0 0 12px; padding: 10px 0; border-bottom: 1px solid var(--bord); }
.ens-ressource p { margin: 2px 0; }
.ens-ressource .ens-act-tete { font-size: 1.05em; }
.ens-eleve { margin: 28px 0; padding: 18px clamp(14px, 3vw, 24px); border: 2px dashed var(--bord); border-radius: var(--rayon); }
.ens-eleve h2 { margin-top: 0; }
.ens-eleve-temps { margin: 16px 0; padding-top: 8px; border-top: 1px solid var(--bord); }
.ens-eleve-temps h3 { margin: 0 0 6px; font-size: 1.1em; color: var(--or-clair); }
.ens-question { margin: 10px 0; }
.ens-question p { margin: 0 0 2px; font-weight: 600; }
.ens-ligne { height: 1.9em; border-bottom: 1px solid var(--bord); }
.ens-projection .ens-hors { display: none; }

@media print {
  .ens-hors[hidden] { display: block !important; }
  .ens-kit, .ens-eleve { background: #fff !important; border: 1px solid #000 !important; border-radius: 0; padding: 6pt 8pt; margin: 0 0 8pt; break-inside: avoid; }
  .ens-kit--sans { border-left-width: 3px !important; }
  .ens-kit h3, .ens-eleve-temps h3 { color: #000 !important; }
  .ens-source, .ens-source a { color: #000 !important; font-size: 8.5pt; }
  .ens-ressource { border-bottom: 1px solid #000; break-inside: avoid; }
  .ens-controle li::before { color: #000; }
  .ens-eleve { break-before: page; break-inside: auto; border-style: solid; }
  .ens-eleve-temps { break-inside: avoid; border-top: 1px solid #000; margin: 8pt 0; }
  .ens-ligne { border-bottom: 1px solid #000; height: 17pt; }
  .ens-question p { color: #000; }
  /* la fiche élève seule : tout le reste disparaît (classe posée par le bouton, retirée après l'impression) */
  .ens-imprime-eleve .ens-page > :not(.ens-eleve), .ens-imprime-eleve .ens-kicker, .ens-imprime-eleve #ens-titre, .ens-imprime-eleve .ens-resume { display: none !important; }
  .ens-imprime-eleve .ens-eleve { break-before: auto; border: 0 !important; padding: 0; }
}
