/*
 * Reset + styles typographiques de base, calqués sur le @layer base
 * de code_proto_figma/src/styles/theme.css. Nécessite tokens.css.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid var(--color-border);
}

html {
  font-size: var(--font-size);
  -webkit-text-size-adjust: 100%;
  line-height: 1.5;
}

body {
  min-height: 100vh;
  background-color: var(--color-background);
  color: var(--color-foreground);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-weight: var(--font-weight-normal);
  -webkit-font-smoothing: antialiased;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

/* Hiérarchie typographique - reprend les règles de theme.css :
   les classes utilitaires (ex. text-sm) définies par composant priment sur ces valeurs par défaut. */
h1 {
  font-size: var(--text-2xl);
  line-height: var(--text-2xl--line-height);
  font-weight: var(--font-weight-medium);
}

h2 {
  font-size: var(--text-xl);
  line-height: var(--text-xl--line-height);
  font-weight: var(--font-weight-medium);
}

h3 {
  font-size: var(--text-lg);
  line-height: var(--text-lg--line-height);
  font-weight: var(--font-weight-medium);
}

h4 {
  font-size: var(--text-base);
  line-height: var(--text-base--line-height);
  font-weight: var(--font-weight-medium);
}

label {
  font-size: var(--text-base);
  line-height: var(--text-base--line-height);
  font-weight: var(--font-weight-medium);
  display: inline-block;
}

button {
  font-size: var(--text-base);
  line-height: var(--text-base--line-height);
  font-weight: var(--font-weight-medium);
}

input,
textarea,
select {
  font-size: var(--text-base);
  line-height: var(--text-base--line-height);
  font-weight: var(--font-weight-normal);
}

p {
  font-size: var(--text-base);
  line-height: var(--text-base--line-height);
}

/* Accessibilité : garde le focus clavier visible partout (aucun outline: none global) */
:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 2px;
}

/* Utilitaire d'accessibilité pour masquer visuellement sans retirer du DOM/lecteur d'écran */
.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;
}
