/* Complement de navigation LUNILA. Charger apres style.css. */
.topbar .nav { flex-wrap: wrap; }
.topbar .navlinks { display: flex; flex-wrap: wrap; }
.topbar .menubutton { display: none; }
.topbar .menubutton[hidden] { display: none !important; }
.topbar .navlinks a { min-height: 48px; display: inline-flex; align-items: center; }
.topbar a[aria-current] { text-decoration: underline; text-underline-offset: .25em; font-weight: 700; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .4rem .65rem; list-style: none; padding: 0; margin: 0; }
.breadcrumb li { display: inline-flex; align-items: baseline; gap: .65rem; min-width: 0; }
.breadcrumb .separator { color: var(--muted, #665e72); }
.breadcrumb a { text-decoration: underline; text-underline-offset: .2em; }
:where(a, button, [tabindex]):focus-visible { outline: 3px solid #6940ab; outline-offset: 3px; }
#contenu { scroll-margin-top: 7rem; }
@media (max-width: 1100px) {
  /* Fermé par défaut (avec ou sans JS) */
  .topbar .navlinks { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 30; width: 100%; padding: .75rem 5%; flex-direction: column; align-items: stretch; gap: .25rem; background: var(--paper, #fffdf9); border-bottom: 1px solid var(--border, #eadfee); }
  .topbar .navlinks.open { display: flex; }
  .topbar .navlinks a { padding: .65rem .75rem; }
  .topbar .menubutton { display: inline-flex; align-items: center; min-height: 48px; margin-left: auto; }
  html[data-nav-ready] .topbar .navlinks[hidden] { display: none !important; }
  #contenu { scroll-margin-top: 1rem; }
}

/* V2.4.1 : sous-menu « Outils » (fonctionne sans JS : liens visibles, bouton masqué) */
.topbar .navgroup { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .9rem; }
.topbar .navgroup-label { font-weight: 600; }
html[data-nav-ready] .topbar .navgroup-label { display: none; }
.topbar .navgroup-toggle { min-height: 48px; display: inline-flex; align-items: center; gap: .3rem; background: none; border: 0; padding: 0 .2rem; font: inherit; color: inherit; cursor: pointer; }
.topbar .navgroup-toggle[hidden] { display: none !important; }
.topbar .navgroup-toggle:hover { color: #87551f; }
.topbar .navgroup-toggle.is-current { font-weight: 700; text-decoration: underline; text-underline-offset: .25em; }
.topbar .navgroup-toggle[aria-expanded="true"] span { display: inline-block; transform: rotate(180deg); }
.topbar .submenu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.topbar .submenu[hidden] { display: none !important; }
@media (min-width: 1101px) {
  html[data-nav-ready] .topbar .submenu { position: absolute; top: 100%; left: 0; z-index: 30; flex-direction: column; gap: 0; min-width: 15rem; padding: .4rem; background: var(--paper, #fffdf9); border: 1px solid var(--border, #eadfee); border-radius: 12px; box-shadow: 0 10px 24px rgba(53,37,80,.12); }
  html[data-nav-ready] .topbar .submenu a { width: 100%; padding: .35rem .75rem; border-radius: 8px; }
  html[data-nav-ready] .topbar .submenu a:hover { background: var(--mist, #f6f0fb); text-decoration: none; }
}
@media (max-width: 1100px) {
  .topbar .navgroup { flex-direction: column; align-items: stretch; gap: 0; }
  .topbar .navgroup-label { padding: .65rem .75rem 0; }
  .topbar .navgroup-toggle { width: 100%; justify-content: space-between; padding: .65rem .75rem; text-align: left; }
  .topbar .submenu { flex-direction: column; gap: 0; padding-left: 1rem; }
}

/* V2.5 : lien d'évitement masqué hors focus (jamais superposé à l'en-tête) */
.skip-link { position: absolute !important; left: 1rem; top: .5rem; z-index: 1000; transform: none !important;
  width: 1px; height: 1px; padding: 0 !important; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link:focus, .skip-link:focus-visible { width: auto; height: auto; padding: .75rem 1rem !important; margin: 0; overflow: visible; clip: auto; clip-path: none; white-space: normal; }
/* V2.5 : l'en-tête reste dans le flux (sticky en bureau, statique en mobile), le contenu commence sous lui */
.topbar { position: sticky; top: 0; }
main { position: relative; z-index: 0; }
:target, [id] { scroll-margin-top: 7rem; }
/* V2.5 : bouton du menu mobile « ☰ Menu » / « ✕ Fermer » */
.topbar .menubutton { gap: .5rem; padding: .5rem .9rem; border: 1px solid var(--border, #eadfee); border-radius: 999px; background: var(--paper, #fffdf9); color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.topbar .menubutton .menu-icone { display: inline-block; width: 1.1em; text-align: center; line-height: 1; }
@media (max-width: 1100px) { .topbar { position: relative; } }
