/**
 * Base — reset léger + styles d'éléments fondamentaux.
 * Dépend de tokens.css (variables) et des presets theme.json.
 * Le layout et les composants vivent dans des feuilles dédiées (à venir).
 */

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

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-sans);
  font-size: var(--wp--preset--font-size--base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

ul,
ol {
  margin: 0;
  padding: 0;
}

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

button {
  cursor: pointer;
}

/* Accessibilité : respecter la préférence de réduction de mouvement */
@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;
  }
}

/* ---------- Typographie ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 var(--space-s);
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  color: var(--c-ink);
  text-wrap: balance;
}

h1 {
  font-size: var(--wp--preset--font-size--display);
}
h2 {
  font-size: var(--wp--preset--font-size--3xl);
}
h3 {
  font-size: var(--wp--preset--font-size--2xl);
}
h4 {
  font-size: var(--wp--preset--font-size--xl);
}

p {
  margin: 0 0 var(--space-s);
  text-wrap: pretty;
}

a {
  color: var(--c-brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color var(--transition);
}
a:hover,
a:focus-visible {
  color: var(--c-brand-deep);
}

/* Focus visible homogène (accessibilité, utile aussi pour la borne) */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--c-brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Sélection */
::selection {
  background: var(--c-brand);
  color: var(--c-on-dark);
}

/* ---------- Utilitaires de structure ---------- */
.screen-reader-text {
  position: absolute !important;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  top: var(--space-xs);
  left: var(--space-xs);
  z-index: 1000;
  padding: var(--space-xs) var(--space-s);
  background: var(--c-brand);
  color: var(--c-on-dark);
  border-radius: var(--radius-sm);
}
