/* lotd-entete.css — lot D, développeur E : un seul gabarit d'en-tête.
   Référence : le panneau bleu nuit des chapitres et des rubriques (.board.hd) : panneau détaché du haut de page,
   à la largeur de la colonne, rayon 20 px, marges 18 × 22 px, ombre 0 8px 24px, titre clamp(24px, 3,4vw, 32px),
   étiquette en pastille, lien de retour posé AU-DESSUS du panneau comme le fil d'Ariane.
   Uniquement des surcharges : aucun texte, aucun lien, aucun élément ajouté. Chargé par une ligne balisée
   « lotD-E:debut entete » ; si le fichier manque, la page reste comme avant.
   Sommaire : 0 valeurs · A header.top>.in (QCM, annales, polycopié numérique, aide ciblée, générateur)
              B header.hd>.wrap (stage, maintenance, autrement, boîtes de révision, chantier)
              C header.hero (carte du référentiel, autour de moi, collègues, avis, merci, mentions, confidentialité)
              D header.bh (badges) · E lien de retour · F impression */

/* ───────── 0. Valeurs du gabarit de référence (celles de .board / .crumb des chapitres) */
:root{--lde-fond:#0f1d29;--lde-bord:transparent;--lde-lien:#0b3d5c;--lde-anneau:#9a6400}
:root[data-theme="dark"]{--lde-fond:#0b141c;--lde-bord:#2a4054;--lde-lien:#7fb1f5;--lde-anneau:#ffd34d}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--lde-fond:#0b141c;--lde-bord:#2a4054;--lde-lien:#7fb1f5;--lde-anneau:#ffd34d}}

/* ───────── A. header.top > .in : le bandeau pleine largeur devient un panneau dans la colonne.
   Le panneau est peint par .in::before, en retrait de 16 px : il s'aligne sur les cartes de la page
   (.wrap a la même largeur maximale que .in, avec 16 px de marge intérieure). */
:root:root:root body>header.top:not(.tpv-top){background:none!important;border:0!important;box-shadow:none!important;padding:16px 0 0!important;margin:0}
:root:root:root body>header.top:not(.tpv-top)>.in{position:relative;z-index:0;box-sizing:border-box;padding:18px 38px}
:root:root:root body>header.top:not(.tpv-top)>.in::before{content:"";position:absolute;z-index:-1;inset:0 16px;background:var(--lde-fond);border:1px solid var(--lde-bord);border-radius:20px;box-shadow:0 8px 24px rgba(5,15,25,.25)}
:root:root:root body>header.top:not(.tpv-top) h1{font-size:clamp(24px,3.4vw,32px);line-height:1.15;margin:0}
:root:root:root body>header.top:not(.tpv-top) .kick{margin-bottom:8px}
:root:root:root body>header.top:not(.tpv-top) .lead{margin:4px 0 0}

/* ───────── B. header.hd > .wrap : même panneau, peint par .wrap::before ; le lien de retour passe au-dessus */
:root:root:root body header.hd{background:none!important;border:0!important;box-shadow:none!important;border-radius:0!important;padding:0!important;margin:0 0 18px!important;overflow:visible!important}
:root:root:root body header.hd::before,:root:root:root body header.hd::after{content:none!important}
:root:root:root body header.hd>.wrap{position:relative;z-index:0;box-sizing:border-box;padding:65px 38px 18px}
:root:root:root body header.hd>.wrap::before{content:"";position:absolute;z-index:-1;inset:47px 16px 0;background:var(--lde-fond);border:1px solid var(--lde-bord);border-radius:20px;box-shadow:0 8px 24px rgba(5,15,25,.25)}
:root:root:root body header.hd>.wrap>a.back+br{display:none}
:root:root:root body header.hd h1{font-size:clamp(24px,3.4vw,32px);line-height:1.15;margin:0}
:root:root:root body header.hd .kick{display:inline-block;margin:0 0 8px;font-size:12.5px;letter-spacing:.08em;text-transform:uppercase;background:transparent;border:1px solid #ffd34d;color:#ffd34d;border-radius:99px;padding:2px 10px}
:root:root:root body header.hd p{margin:4px 0 0}

/* ───────── C. header.hero : le panneau est peint par ::before (qui portait le semis de points) */
:root:root:root body header.hero{background:none!important;border:0!important;box-shadow:none!important;border-radius:0!important;overflow:visible!important;isolation:isolate;position:relative;box-sizing:border-box;padding:65px 22px 18px!important}
:root:root:root body header.hero::before{content:"";position:absolute;z-index:-1;inset:47px 0 0;background:var(--lde-fond)!important;background-image:none!important;border:1px solid var(--lde-bord);border-radius:20px;box-shadow:0 8px 24px rgba(5,15,25,.25)}
:root:root:root body header.hero.small>div{position:static}
:root:root:root body header.hero>a.back+br{display:none}
:root:root:root body header.hero h1{font-size:clamp(24px,3.4vw,32px);line-height:1.15;margin:0}
:root:root:root body header.hero .kicker{font-size:12.5px;padding:2px 10px;margin:0 0 8px}
:root:root:root body header.hero>p,:root:root:root body header.hero>div>p{margin:4px 0 0}

/* pages où l'en-tête est posé hors de la colonne : on le ramène à la largeur des cartes de la page */
:root[data-lota="carte-referentiel"] body>header.hero{max-width:min(1068px,calc(100% - 32px));margin:0 auto 18px}
:root[data-lota="la-physique-autour-de-moi"] body>header.hero{max-width:min(1228px,calc(100% - 32px));margin:0 auto 18px}
:root:is([data-lota="mentions-legales"],[data-lota="confidentialite"]) body>header.hero{max-width:min(828px,calc(100% - 32px));margin:0 auto 18px}

/* ───────── D. badges : header.bh > .wrap (même principe que B) */
:root:root:root body header.bh{background:none!important;border:0!important;box-shadow:none!important;padding:0!important}
:root:root:root body header.bh>.wrap{position:relative;z-index:0;box-sizing:content-box;padding:65px 38px 18px;max-width:984px}
:root:root:root body header.bh>.wrap::before{content:"";position:absolute;z-index:-1;inset:47px 16px 0;background:var(--lde-fond);border:1px solid var(--lde-bord);border-radius:20px;box-shadow:0 8px 24px rgba(5,15,25,.25)}
:root:root:root body header.bh h1{font-size:clamp(24px,3.4vw,32px);line-height:1.15}

/* ───────── E. Lien de retour : au-dessus du panneau, comme le fil d'Ariane des chapitres (.crumb a) */
:root:root:root body header.hd>.wrap>a.back,:root:root:root body header.hero a.back,:root:root:root body header.bh>.wrap>a.back{position:absolute;top:16px;left:16px;margin:0;display:block;max-width:calc(100% - 32px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--lde-lien)!important;font-size:14.5px;font-weight:700;line-height:1.45;opacity:1;text-decoration:none}
:root:root:root body header.hero a.back{left:0;max-width:100%}
:root:root:root body header.hd>.wrap>a.back:hover,:root:root:root body header.hero a.back:hover,:root:root:root body header.bh>.wrap>a.back:hover{color:var(--lde-lien)!important;text-decoration:underline}
:root:root:root body header.hd>.wrap>a.back:focus-visible,:root:root:root body header.hero a.back:focus-visible,:root:root:root body header.bh>.wrap>a.back:focus-visible{outline:2px solid var(--lde-anneau);outline-offset:2px}

/* écran tactile ou étroit : le lien garde une zone tactile de 41 px (10 px de marge intérieure haut et bas), le texte reste à la même place */
@media (pointer:coarse),(max-width:640px){
  :root:root:root body header.hd>.wrap>a.back,:root:root:root body header.hero a.back,:root:root:root body header.bh>.wrap>a.back{top:6px;padding:10px 0}
}
/* le lien tient sur une ligne (il est posé à hauteur fixe au-dessus du panneau) : sur très petit écran, ou avec le zoom « Aa »
   sur téléphone, le libellé le plus long (« ← Lien avec l'enseignement professionnel ») passe en corps plus petit plutôt que d'être coupé */
@media (max-width:340px){
  :root:root:root body header.hd>.wrap>a.back,:root:root:root body header.hero a.back,:root:root:root body header.bh>.wrap>a.back{font-size:13px}
}
@media (max-width:480px){
  :root:root:root[data-az="2"] body header.hd>.wrap>a.back,:root:root:root[data-az="2"] body header.hero a.back,:root:root:root[data-az="2"] body header.bh>.wrap>a.back{font-size:12px}
}
/* téléphone : marge intérieure du panneau de 16 px, comme .board */
@media (max-width:480px){
  :root:root:root body>header.top:not(.tpv-top)>.in{padding:16px 32px}
  :root:root:root body header.hd>.wrap{padding:63px 32px 16px}
  :root:root:root body header.hero{padding:63px 16px 16px!important}
  :root:root:root body header.bh>.wrap{padding:63px 32px 16px;max-width:none}
  /* badges : le panneau est 32 px moins large que l'ancien bandeau ; « 45 / 192 XP » ne se coupe pas en deux */
  :root:root:root body header.bh .xpl>span:last-child{white-space:nowrap}
}

/* ───────── F. Impression : pas de panneau peint (comme avant, les fonds ne s'impriment pas) */
@media print{:root:root:root body>header.top:not(.tpv-top)>.in::before,:root:root:root body header.hd>.wrap::before,:root:root:root body header.hero::before,:root:root:root body header.bh>.wrap::before{box-shadow:none}}
