/* Une commande discrète, assortie au sélecteur de thème. */
.site-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--theme-border);
  border-radius: 999px;
  background: var(--theme-control);
  color: var(--theme-text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .2s ease;
}
.site-menu-toggle:hover { background: var(--theme-control-hover); }
.site-menu-toggle:focus-visible,
.site-menu-panel a:focus-visible,
.site-menu-panel button:focus-visible {
  outline: 2px solid var(--theme-focus);
  outline-offset: 3px;
}
.site-menu-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}
.site-menu-toggle path {
  transform-origin: 12px 12px;
  transition: transform .2s ease;
}
.site-menu-open .site-menu-line-first { transform: rotate(45deg) translateY(4px); }
.site-menu-open .site-menu-line-last { transform: rotate(-45deg) translateY(-4px); }

.site-menu-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(360px, 100%);
  max-height: calc(100vh - 120px);
  max-height: var(--site-menu-space, calc(100dvh - 120px));
  padding: 12px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  border: 1px solid var(--theme-border);
  border-radius: 24px;
  background: rgba(14, 14, 17, .97);
  color: var(--theme-text);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .24);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
html[data-theme="light"] .site-menu-panel {
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 16px 44px rgba(25, 28, 36, .12);
}
.site-menu-compact .site-menu-panel :is(.nav-links, .header-links) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
  color: var(--theme-text);
  font-size: .9rem;
  font-weight: 700;
}
.site-menu-panel :is(.nav-links, .header-links) a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 4px;
  border-radius: 0;
  line-height: 1.4;
  transition: color .2s ease;
}
.site-menu-panel :is(.nav-links, .header-links) a + a {
  border-top: 1px solid var(--theme-border);
}
.site-menu-panel :is(.nav-links, .header-links) a:hover {
  color: var(--theme-muted);
}
.site-menu-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 16px;
  padding-bottom: 8px;
  border-top: 1px solid var(--theme-border);
}
.site-menu-panel .site-menu-actions :is(.btn, .header-cta) {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  font-size: .82rem;
  white-space: normal;
  text-align: center;
}
.site-menu-toggle[hidden], .site-menu-panel[hidden], .site-menu-actions[hidden] { display: none; }

/* Les styles ci-dessus sont limités au menu ajouté : la navbar d'ordinateur
   conserve ses liens, ses espacements et ses états de survol. */
@media (max-width: 680px) {
  .site-menu-compact :is(.nav-actions, .header-actions) { gap: 8px; }
  .site-menu-panel { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .site-menu-toggle, .site-menu-toggle path, .site-menu-panel a { transition: none; }
}
