/* ==========================================================================
   Tizipedia — Base : reset léger, typographie, accessibilité
   ========================================================================== */

*,
*::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: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

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

img {
  height: auto;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); font-weight: 800; line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); letter-spacing: -0.01em; }

p {
  margin: 0;
  text-wrap: pretty;
}

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

ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
  padding: 0;
}

a {
  color: var(--color-blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--duration-fast) ease;
}

a:hover {
  color: var(--color-blue-strong);
}

strong {
  color: var(--color-navy);
  font-weight: 650;
}

/* --- Focus visible ------------------------------------------------------ */
:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.on-dark :focus-visible {
  outline-color: var(--color-focus-on-dark);
}

/* --- Accessibilité ------------------------------------------------------ */
/* L'attribut hidden l'emporte toujours sur les règles d'affichage des composants. */
[hidden] {
  display: none !important;
}

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

.skip-link {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 100;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-btn);
  background: var(--color-navy);
  color: var(--color-on-dark);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--duration-fast) ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
  color: var(--color-on-dark);
  outline-color: var(--color-green);
}

::selection {
  background: rgb(1 91 153 / 0.16);
  color: var(--color-navy);
}

/* --- Mouvement réduit --------------------------------------------------- */
@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;
  }
}
