/**
 * Base CSS - Reset et styles fondamentaux
 * Pas de la Case Refonte 2026
 */

/* ============================================
   RESET MODERNE
   ============================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
  color: var(--color-gray-800);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

html {
  overflow-x: hidden;
}

/* ============================================
   TYPOGRAPHIE
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--color-gray-900);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--text-4xl);
  font-weight: var(--font-extrabold);
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-size: var(--text-xl);
}

h5 {
  font-size: var(--text-lg);
}

h6 {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
}

p {
  margin-bottom: var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

strong, b {
  font-weight: var(--font-semibold);
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--text-sm);
}

/* ============================================
   LISTES
   ============================================ */

ul, ol {
  list-style: none;
}

.list-disc {
  list-style-type: disc;
  padding-left: var(--space-6);
}

.list-decimal {
  list-style-type: decimal;
  padding-left: var(--space-6);
}

.list-disc li,
.list-decimal li {
  margin-bottom: var(--space-2);
}

/* ============================================
   IMAGES & MÉDIAS
   ============================================ */

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  border: 0;
}

figure {
  margin: 0;
}

figcaption {
  font-size: var(--text-sm);
  color: var(--color-gray-600);
  margin-top: var(--space-2);
}

/* ============================================
   FORMULAIRES
   ============================================ */

button, input, optgroup, select, textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: inherit;
  color: inherit;
  margin: 0;
}

button, input {
  overflow: visible;
}

button, select {
  text-transform: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
  appearance: button;
  cursor: pointer;
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

textarea {
  overflow: auto;
  resize: vertical;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

legend {
  display: block;
  width: 100%;
  padding: 0;
  margin-bottom: var(--space-2);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
}

label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: var(--font-medium);
}

/* ============================================
   TABLEAUX
   ============================================ */

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

th, td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
}

th {
  font-weight: var(--font-semibold);
  background-color: var(--color-gray-100);
}

/* ============================================
   UTILITAIRES DE BASE
   ============================================ */

.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;
}

.not-sr-only {
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

::selection {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* Focus visible pour accessibilité */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ============================================
   ANIMATIONS RÉDUITES
   ============================================ */

@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;
  }
}
