/*
 * base.css
 * Reset léger + styles par défaut des éléments HTML natifs.
 */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  min-height: 100svh;
  font-family: var(--font-body);
  font-size: var(--fs-400);
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-cream);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

img {
  height: auto;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-navy-dark);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-900);
}

h2 {
  font-size: var(--fs-800);
}

h3 {
  font-size: var(--fs-700);
  color: var(--color-sage-dark);
}

h4 {
  font-size: var(--fs-600);
}

p {
  max-width: 68ch;
}

p + p {
  margin-top: var(--space-sm);
}

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

a:hover,
a:focus-visible {
  color: var(--color-terracotta);
}

ul,
ol {
  padding-left: 1.25em;
}

li + li {
  margin-top: var(--space-2xs);
}

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

button {
  cursor: pointer;
}

label {
  display: inline-block;
  margin-bottom: var(--space-3xs);
  font-weight: 600;
}

fieldset {
  border: none;
  padding: 0;
}

/* Focus visible cohérent pour l'accessibilité clavier */
:focus-visible {
  outline: 3px solid var(--color-terracotta);
  outline-offset: 3px;
}

::selection {
  background-color: var(--color-sage);
  color: var(--color-text-invert);
}

/* Lien d'évitement pour le clavier / lecteurs d'écran */
.skip-link {
  position: absolute;
  left: var(--space-sm);
  top: -50px;
  z-index: 1000;
  background: var(--color-navy-dark);
  color: var(--color-text-invert);
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-sm);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
