/* Styles de base : boîte, typographie par défaut, focus, utilitaires. Tokens seulement. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  text-size-adjust: 100%;
}

/* L'attribut hidden l'emporte sur l'affichage d'un composant (bouton, onglets masqués par Alpine.js). */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-heading);
  text-wrap: pretty;
}

h1 {
  font-size: var(--text-h1);
  line-height: var(--leading-tight);
}

h2 {
  font-size: var(--text-section);
  line-height: var(--leading-heading);
}

p {
  margin: 0;
}

a {
  color: var(--color-terracotta);
  text-underline-offset: 3px;
}

/* :where() ramène la spécificité à celle d'une classe (issue 138) : un lien stylé par une classe
   garde sa couleur au survol, sauf s'il déclare son propre :hover. */
:where(a):hover {
  color: var(--color-terracotta-dark);
}

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

/* Focus toujours visible : contour terracotta décalé ; les champs utilisent le halo. */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

.conteneur {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-gutter);
}

.visuellement-cache {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.lien-evitement {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: var(--z-modal);
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-target);
  padding: 0 var(--space-6);
  background: var(--color-bg-white);
  border-radius: var(--radius-md);
  transform: translateY(-200%);
}

.lien-evitement:focus {
  transform: none;
}

@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;
  }
}

/* Le lien d'évitement porte le focus sur le contenu (tabindex="-1") : pas de contour sur ce bloc. */
main[tabindex='-1']:focus {
  outline: none;
}
