/*
 * reset.css — Calzedonia Maroc
 * Reset minimaliste opinioné : supprime les incohérences navigateur,
 * préserve la sémantique, prépare le terrain CSS Custom Properties.
 * Inspiré du source Foundation (seocontent.css) + modern-normalize.
 */

/* ── Box model universel ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Racine ── */
html {
  font-size: 14px;                  /* base rem = 14px (convention source confirmée) */
  -webkit-text-size-adjust: 100%;   /* iOS — empêche le zoom auto sur rotation */
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  hanging-punctuation: first last;  /* ponctuation optique — titres Spezia */
  overflow-x: clip;                 /* clip (pas hidden) — n'ouvre pas de scroll container RTL */
}

/* ── Corps ── */
body {
  font-family: var(--font-body);
  font-weight: var(--fw-light);
  font-size: var(--text-base);
  line-height: var(--leading-snug);
  color: var(--color-text-primary);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;                 /* clip — évite le décalage d'origine inset en RTL */
}

/* ── Typographie sémantique ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  line-height: var(--leading-display);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
  overflow-wrap: break-word;
}

/* ── Liens ── */
a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ── Médias ── */
img,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* ── Formulaires ── */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ── Listes ── */
ul,
ol {
  list-style: none;
}

/* ── Tableaux ── */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ── Éléments cachés accessibles ── */
[hidden] {
  display: none !important;
}

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

/* ── Focus visible global ── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ── Sélection texte ── */
::selection {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* ── RTL : pas de flip sur les neutres ── */
[dir="rtl"] body {
  text-align: start;
}

/* ── Réduction de mouvement ── */
@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;
  }
}
