/* ══════════════════════════════════════════════════════════════
   CAPTAIN FUTURE — L'Encyclopédie Hyperréaliste
   FICHIER : css/reset.css
   RÔLE   : Normalize moderne + reset sémantique.
            Base saine pour tous les navigateurs.
   ══════════════════════════════════════════════════════════════ */

/* 1. Box-sizing universel */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 2. Base document */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem);
  color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-family: var(--font-body);
}

/* 3. Médias fluides */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* 4. Formulaires — héritent de la typo */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

button {
  cursor: pointer;
}

/* 5. Listes */
ul,
ol {
  list-style: none;
}

/* 6. Liens */
a {
  color: inherit;
  text-decoration: none;
}

/* 7. Titres — graisse et taille maîtrisées par typography.css */
h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.15;
}

/* 8. Accessibilité — focus visible */
:focus-visible {
  outline: 2px solid var(--color-accent-gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* 9. Respect du mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 10. Sélection de texte thématique */
::selection {
  background: rgba(255, 184, 48, 0.85);
  color: #03050F;
}

/* 11. Scrollbar stylée */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #2A3A5C, #16203A);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-bg-secondary);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--color-accent-gold), #8a5a12);
}

/* 12. Masque de défilement horizontal */
[data-no-scrollbar] {
  scrollbar-width: none;
}
[data-no-scrollbar]::-webkit-scrollbar {
  display: none;
}

/* 13. Attribut hidden — TOUJOURS prioritaire.
   Sans cette règle, un `display: grid/flex` défini ailleurs
   (lightbox, toast, panneau planète…) écrase le `display: none`
   du navigateur et laisse des overlays invisibles plein écran
   intercepter les clics. */
[hidden] {
  display: none !important;
}
