/* ============================================================
   ZISIMA — Base : fond, typo, barres de défilement, focus, mouvement
   Dépend de zsm-tokens.css. Sélecteurs préfixés html[data-zsm-theme]
   pour passer devant l'ancien CSS sans !important.
   ============================================================ */

html[data-zsm-theme] body {
  background: var(--zd-bg);
  color: var(--zd-text);
  overflow-x: clip;
}

/* ---- Barres de défilement natives masquées (le défilement reste actif) ---- */
html,
body,
.zsm-side-menu,
.zd-rail,
#zsm-profile-modal,
#zsm-profile-modal *,
#zsm-follow-modal,
#zsm-follow-modal *,
.zd-pedit,
.zd-pedit * {
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* ancien Edge */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
.zsm-side-menu::-webkit-scrollbar,
.zd-rail::-webkit-scrollbar,
#zsm-profile-modal::-webkit-scrollbar,
#zsm-profile-modal *::-webkit-scrollbar,
#zsm-follow-modal::-webkit-scrollbar,
#zsm-follow-modal *::-webkit-scrollbar,
.zd-pedit *::-webkit-scrollbar {
  display: none;              /* Chrome, Safari */
  width: 0;
  height: 0;
}
html {
  scrollbar-gutter: auto;
  overscroll-behavior-y: none;
}

/* Fond verrouillé quand le menu latéral est ouvert */
html.zsm-lock,
html.zsm-lock body {
  overflow: hidden;
}

/* ---- Focus clavier visible partout ---- */
html[data-zsm-theme] :focus-visible {
  outline: 2px solid var(--zd-brand);
  outline-offset: 2px;
}

/* ---- Transition douce lors du changement de thème uniquement ---- */
html.zd-theme-anim *,
html.zd-theme-anim *::before,
html.zd-theme-anim *::after {
  transition:
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease !important; /* neutralise les transitions héritées le temps du basculement */
}

/* ---- Utilitaire ---- */
.zd-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html.zd-theme-anim *,
  html.zd-theme-anim *::before,
  html.zd-theme-anim *::after {
    transition: none !important; /* pas de transition de thème si mouvement réduit */
  }
}
