/* lota-h.css — lot A, développeur H : harmonisation et confort sur téléphone.
   Surcharges ciblées, aucun contenu modifié. La page porte data-lota="<nom de la page>" sur <html>
   (posé par la ligne insérée dans <head>), ce qui permet de limiter chaque règle à sa famille de pages.
   Sommaire : 1 focus clavier · 2 boutons flottants (téléphone) · 3 cibles tactiles · 4 débordements
              5 en-têtes bleu nuit · 6 pieds de page · 7 habillage des pages « copie » (annales, polycopié) */

/* ───────── 1. Focus clavier : un seul anneau par défaut, à la place de l'anneau du navigateur.
   Spécificité strictement nulle (tout est dans :where) : tout style de focus déjà écrit dans une page reste prioritaire. */
:where(a[href],button,summary,select,input,textarea,[role="button"],[tabindex]:not([tabindex="-1"])):where(:focus-visible){outline:2px solid #9a6400;outline-offset:2px}
:where(header.hd,header.hero,header.bh,header.top,header.bar,.board,.hero2) :where(a[href],button,summary,select,[role="button"]):where(:focus-visible){outline-color:#ffd34d}
:where(:root[data-theme="dark"]) :where(a[href],button,summary,select,input,textarea,[role="button"],[tabindex]:not([tabindex="-1"])):where(:focus-visible){outline-color:#ffd34d}
@media (prefers-color-scheme:dark){:where(:root:not([data-theme="light"])) :where(a[href],button,summary,select,input,textarea,[role="button"],[tabindex]:not([tabindex="-1"])):where(:focus-visible){outline-color:#ffd34d}}

/* ───────── 2. Boutons flottants sur téléphone */
@media (max-width:640px){
  /* languettes de gauche : même gabarit que « retour » (30 × 40), zone tactile de 40 px */
  html .th-btn,html .ax-btn{width:30px;height:40px;border-radius:0 12px 12px 0;opacity:.85}
  html .ax-btn{font-size:13px!important}
  html .th-btn svg{width:17px;height:17px}
  html .ax-p{left:38px;max-width:calc(100vw - 50px)}
  .th-btn::after,.ax-btn::after,.rt-btn::after{content:"";position:absolute;left:0;top:-2px;bottom:-2px;width:40px}
  /* drapeau « signaler » : à gauche d'Ampère, sur la même ligne (ne passe plus sur le pied de page ni sous la bulle) */
  html .bsig-fab{right:78px;bottom:21px;width:40px;height:40px}
  .amp-tipx::after{content:"";position:absolute;top:-9px;right:-8px;bottom:-9px;left:-10px}
  /* rangement pendant la lecture (classe posée par lota-h.js) */
  .amp-fab,.bsig-fab,.th-btn,.ax-btn,.rt-btn{transition:transform .22s ease,opacity .22s ease}
  html.lota-lu .amp-fab{transform:translateY(46px)}
  html.lota-lu .bsig-fab{transform:translateY(66px)}
  html.lota-lu .th-btn,html.lota-lu .ax-btn,html.lota-lu .rt-btn{transform:translateX(-22px)}
  html.lota-lu .amp-tip{opacity:0!important;visibility:hidden!important}
  html.lota-lu .amp-fab:focus-visible,html.lota-lu .bsig-fab:focus-visible,html.lota-lu .th-btn:focus-visible,html.lota-lu .ax-btn:focus-visible,html.lota-lu .rt-btn:focus-visible{transform:none}
}
@media (max-width:640px) and (prefers-reduced-motion:reduce){.amp-fab,.bsig-fab,.th-btn,.ax-btn,.rt-btn{transition:none}}
@media print{html.lota-lu .amp-fab,html.lota-lu .bsig-fab{transform:none}}

/* ───────── 3. Cibles tactiles (écran tactile ou étroit) : 40 px au moins */
@media (pointer:coarse),(max-width:640px){
  /* a) boutons qui grandissent réellement */
  header.top .tlk{display:inline-flex;align-items:center;min-height:40px;box-sizing:border-box}
  main.wrap>.filters>button,.stp .man,main.wrap>nav.nav>a,main.wrap>nav.toc>a,main.wrap>#fl.fl>button,.tabs2>button{min-height:40px;box-sizing:border-box}
  main.wrap>nav.nav>a,main.wrap>nav.toc>a{display:inline-flex;align-items:center}
  .board .gob{min-height:40px;box-sizing:border-box}
  [data-lota="index"] .toprow .theme,[data-lota="index"] .links .coll{min-height:40px;box-sizing:border-box}
  [data-lota="podcasts"] .ctrl .sk{min-height:40px;min-width:60px}
  [data-lota="podcasts"] .rate button{min-height:36px;min-width:40px}
  [data-lota="podcasts"] .ep a.fl{min-height:40px;box-sizing:border-box;display:flex;align-items:center}
  [data-lota="maintenance"] .opt>button,[data-lota="mallette-depanneur"] .opt>button,[data-lota="habilitation-electrique"] .opt>button{min-height:40px}
  [data-lota="annales-bts"] .links a,[data-lota="annales-numeriques"] .links a{min-height:36px;box-sizing:border-box}
  [data-lota="annales-bts"] header.top .tb,[data-lota="annales-numeriques"] header.top .tb{min-height:40px;box-sizing:border-box}
  /* b) zone tactile étendue sans changer la mise en page */
  header.hd a.back,header.hero a.back,header.bh a.back,.crumb a,body>footer a,main footer a,.credit-line a{padding-top:10px;padding-bottom:10px}
  header.bh a.back,header.hd a.back,header.hero a.back{margin-top:-10px;margin-bottom:0}
  [data-lota="annales-bts"] .pills .pill,[data-lota="annales-numeriques"] .pills .pill,[data-lota="annales-bts"] #reset,[data-lota="annales-numeriques"] #reset{position:relative}
  [data-lota="annales-bts"] .pills .pill::after,[data-lota="annales-numeriques"] .pills .pill::after,[data-lota="annales-bts"] #reset::after,[data-lota="annales-numeriques"] #reset::after{content:"";position:absolute;left:0;right:0;top:-8px;bottom:-8px}
}

/* ───────── 4. Débordements horizontaux (320 px, et 390 px avec le zoom « Aa ») */
/* cartes de ressource (chapitres, rubriques, simulations…) : la ligne « TP · 2 h · … » peut se couper */
.it .tx .m{overflow-wrap:anywhere}
[data-lota="index"] .tile>span{min-width:0}
[data-lota="index"] .tile b{overflow-wrap:anywhere}
[data-lota="rubrique-tp"] .tpdoc .tt{min-width:min(240px,100%)}
[data-lota="rubrique-tp"] .tpdoc .bts{min-width:0;max-width:100%}
@media (max-width:420px){[data-lota="rubrique-tp"] .tpdoc a{white-space:normal}}
[data-lota="rubrique-maintenance"] .adm-prep{white-space:normal!important}
[data-lota="metiers-electrotechnique"] .jobs{grid-template-columns:repeat(auto-fill,minmax(min(330px,100%),1fr))}
[data-lota="physique-actu"] .arts{grid-template-columns:repeat(auto-fill,minmax(min(340px,100%),1fr))}
[data-lota="guide-stage"] .ck{grid-template-columns:repeat(auto-fill,minmax(min(280px,100%),1fr))}
[data-lota="habilitation-electrique"] .sym{grid-template-columns:repeat(auto-fill,minmax(min(300px,100%),1fr))}
[data-lota="habilitation-electrique"] .grid2{grid-template-columns:repeat(auto-fill,minmax(min(270px,100%),1fr))}
[data-lota="vrai-ou-faux"] .list{grid-template-columns:repeat(auto-fill,minmax(min(300px,100%),1fr))}
[data-lota="pour-les-collegues"] .res{grid-template-columns:repeat(auto-fit,minmax(min(280px,100%),1fr))}
[data-lota="mallette-depanneur"] .g2,[data-lota="maintenance"] .g2{grid-template-columns:repeat(auto-fit,minmax(min(300px,100%),1fr))}
[data-lota="mallette-depanneur"] .g2>*,[data-lota="maintenance"] .g2>*{min-width:0}
[data-lota="une-science-chiffree"] .it .top>*{min-width:0}
[data-lota="une-science-chiffree"] .it .val{white-space:normal}
[data-lota="une-science-chiffree"] .it .top h3{overflow-wrap:anywhere}
[data-lota="schemas-armoire"] .pc .stage{overflow-x:auto}
/* écrans d'accueil de deux jeux (avant la partie) : titre et grille à la largeur du téléphone */
[data-lota="jeu-sos-disjoncteur"] .start h1{font-size:clamp(38px,15vw,64px);overflow-wrap:anywhere}
[data-lota="jeu-sos-disjoncteur"] .start>*{min-width:0}
[data-lota="jeu-sos-disjoncteur"] .startf input{min-width:min(260px,100%)}
[data-lota="jeu-lexique-electricien"] .rail{grid-template-columns:repeat(3,minmax(0,1fr))}
[data-lota="jeu-lexique-electricien"] .rail .mod{min-width:0}

/* ───────── 5. En-têtes bleu nuit : mêmes titres, même lien de retour, même étiquette, mêmes arrondis */
header.hd h1,:root:not([data-lota="index"]) header.hero h1{font-size:clamp(26px,4.4vw,38px);line-height:1.15}
:root:not([data-lota="index"]) header.hero a.back{color:#ffd34d!important;font-weight:700;font-size:15px;opacity:1}
:root:not([data-lota="index"]) header.hero a.back:hover{color:#ffe68a!important}
:root:not([data-lota="index"]) header.hero .kicker{background:transparent;border:1px solid #ffd34d;color:#ffd34d;font-weight:400;font-size:13px;padding:2px 10px}
:root:not([data-lota="index"]) header.hero>p,:root:not([data-lota="index"]) header.hero>div>p{color:#c3d0da}
:is([data-lota="flash-cartes"],[data-lota="chantier-usine"]) header.hd{border:1px solid #2a4054;border-top:0;border-radius:0 0 22px 22px;box-shadow:0 8px 24px rgba(5,15,25,.25);margin-bottom:18px}

/* ───────── 6. Pieds de page : même corps partout */
body>footer,main>footer,main.wrap>footer{font-size:13px;line-height:1.5}

/* ───────── 7. Pages « copie » (sujets d'annales en ligne, sommaire du polycopié numérique, aide ciblée, générateur) :
   même habillage bleu nuit / crème / or que les QCM et les chapitres du polycopié numérique
   (reprise à l'identique du bloc « ecoeur » déjà présent sur ces pages-là). */
@media (prefers-color-scheme:light){
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]):not([data-theme="dark"]){--paper:#f4eee0;--acc:#9a6400;--acc-bg:#fbf1d6}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]):not([data-theme="dark"]) body{background-image:none!important}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]):not([data-theme="dark"]) .card,:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]):not([data-theme="dark"]) .panel,:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]):not([data-theme="dark"]) .sujet,:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]):not([data-theme="dark"]) .q{border-color:#e6dcc4}
}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"])[data-theme="light"]{--paper:#f4eee0;--acc:#9a6400;--acc-bg:#fbf1d6}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"])[data-theme="light"] body{background-image:none!important}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"])[data-theme="light"] .card,:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"])[data-theme="light"] .panel,:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"])[data-theme="light"] .sujet,:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"])[data-theme="light"] .q{border-color:#e6dcc4}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]) header.top{background:#0f1d29!important;color:#fff;border-bottom:1px solid #2a4054!important;box-shadow:0 8px 24px rgba(5,15,25,.18);position:relative;background-image:radial-gradient(rgba(255,211,77,.10) 1.2px,transparent 1.4px)!important;background-size:26px 26px!important}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]) header.top h1{color:#fff}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]) header.top .kick{display:inline-block;font-variant:normal;font-size:12.5px;letter-spacing:.08em;text-transform:uppercase;background:transparent;border:1px solid #ffd34d;color:#ffd34d;border-radius:99px;padding:2px 10px;margin-bottom:4px}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]) header.top .kick a{color:#ffd34d!important;font-weight:700}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]) header.top .lead{color:#c3d0da}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]) header.top .tb{background:transparent!important;color:#ffd34d!important;border:1px solid #ffd34d!important}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]) header.top .tb:hover{background:rgba(255,211,77,.12)!important}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]) header.top .chip{color:#14212b}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]) header.top .note{color:#18232b}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]) .btn:not(.ghost):not(.good):not(.cor):not(.help .btn){background:#ffd34d;color:#0f1d29}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]) .btn:not(.ghost):not(.good):not(.cor):not(.help .btn):hover{background:#ffe68a}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]) .help .btn{background:var(--amber)}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]) .btn:focus-visible{outline-color:#9a6400}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"])[data-theme="dark"] header.top .chip{color:var(--ink)}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"])[data-theme="dark"] header.top .note{color:var(--ink)}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"])[data-theme="dark"] .btn:focus-visible{outline-color:#ffd34d}
@media (prefers-color-scheme:dark){
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]):not([data-theme="light"]) header.top .chip{color:var(--ink)}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]):not([data-theme="light"]) header.top .note{color:var(--ink)}
:root:is([data-lota^="annale-"],[data-lota="poly-numerique"],[data-lota="aide-ciblee"],[data-lota="generateur-exercices-remediation"]):not([data-theme="light"]) .btn:focus-visible{outline-color:#ffd34d}
}
/* aide ciblée : l'étiquette contient aussi le lien « Accueil du site » (à droite) : pas de pastille, on garde les deux bouts */
:root[data-lota="aide-ciblee"] header.top .kick{display:flex;border:0;padding:0;border-radius:0;margin-bottom:2px}
