/* ════════════════════════════════════════════════════════
   RESET.CSS — Normalisation moderne
   MateXP · Base saine et prévisible pour tous les navigateurs
   Seul fichier autorisé à utiliser !important
   ════════════════════════════════════════════════════════ */

/* ─── Box model unifié ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── Racine : lissage et comportement de défilement ─── */
html {
  -webkit-text-size-adjust: 100%;   /* Pas de zoom auto du texte iOS */
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent; /* Pas de flash tactile bleu */
  scroll-behavior: smooth;
  tab-size: 4;
}

/* Défilement instantané si l'utilisateur préfère moins de mouvement */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }
}

/* ─── Corps : hauteur pleine, héritage typo ─── */
body {
  min-height: 100vh;
  min-height: 100dvh;          /* Tient compte des barres mobiles */
  line-height: 1.5;
  font-family: var(--font-body, system-ui, sans-serif);
  font-weight: 400;            /* Base uniforme toutes pages (= défaut) ; les graisses fines restent scopées (p, .lead…) */
  background: var(--bg-1, #0d0b14);
  color: var(--text-3, #c4b8e8);
  overflow-x: hidden;          /* Évite le scroll horizontal accidentel */
}

/* ─── Médias : blocs fluides par défaut ─── */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ─── Formulaires : héritage de la typographie ─── */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

/* Champs : pas de débordement, redimensionnement vertical seul */
textarea {
  resize: vertical;
}

/* Boutons : remise à zéro de l'apparence native */
button {
  background: none;
  border: none;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

/* Suppression du style natif des champs numériques */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* Champ de recherche : retrait de la croix native WebKit */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* Remplissage auto : on garde nos couleurs (anti-fond blanc Chrome) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-1, #ffffff);
  transition: background-color 9999s ease-in-out 0s;
}

/* ─── Typographie : équilibre des titres et des coupures ─── */
h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;          /* Coupures de titres harmonieuses */
  overflow-wrap: break-word;
}

p,
li,
figcaption {
  text-wrap: pretty;           /* Évite les orphelines en fin de paragraphe */
  overflow-wrap: break-word;
}

/* ─── Listes : retrait des puces quand un rôle ARIA est posé ─── */
ul[role="list"],
ol[role="list"] {
  list-style: none;
}

/* ─── Liens : héritage de couleur, soulignement maîtrisé ─── */
a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.15em;
}

/* ─── Tableaux : fusion des bordures ─── */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ─── Accessibilité : focus visible homogène au clavier ─── */
:focus-visible {
  outline: 2px solid var(--accent, #7C5CFC);
  outline-offset: 3px;
}

/* On masque l'outline au clic souris, jamais au clavier */
:focus:not(:focus-visible) {
  outline: none;
}

/* ─── Élément cible d'une ancre : léger décalage de scroll ─── */
:target {
  scroll-margin-top: var(--sp-20, 80px);
}

/* ─── Réduction de mouvement : neutralisation globale ─── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Caché : respect strict de l'attribut hidden ─── */
[hidden] {
  display: none !important;
}
