/* ============================================================
   CUILLÈRE D'OR — BASE
   Reset moderne + typographie globale + utilitaires
   ============================================================ */

/* --- Reset moderne --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body-md);
  font-weight: var(--primitive-fw-400);
  line-height: var(--primitive-lh-normal);
  color: var(--color-text-primary);
  background-color: var(--color-surface-page);
  min-height: 100vh;
}

/* --- Liens --- */
a {
  color: inherit;
  text-decoration: none;
  transition: opacity var(--primitive-duration-fast) var(--primitive-ease-default);
}

a:hover {
  opacity: 0.7;
}

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

/* --- Form elements --- */
button, input, select, textarea {
  font: inherit;
  color: inherit;
}

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

ul, ol {
  list-style: none;
}

/* --- Typographie globale --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--primitive-fw-400);
  line-height: var(--primitive-lh-tight);
  color: var(--color-text-primary);
}

h1 { font-size: var(--fs-display-md); letter-spacing: var(--primitive-ls-tight); }
h2 { font-size: var(--fs-heading-1); letter-spacing: var(--primitive-ls-tight); }
h3 { font-size: var(--fs-heading-2); }
h4 { font-size: var(--fs-heading-3); }
h5 { font-size: var(--fs-heading-4); }
h6 { font-size: var(--fs-heading-5); }

p {
  line-height: var(--primitive-lh-normal);
}

strong, b {
  font-weight: var(--primitive-fw-600);
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--fs-body-sm);
}

/* --- Sélection texte --- */
::selection {
  background-color: var(--color-brand-accent);
  color: var(--color-text-on-accent);
}

/* --- Focus visible (accessibilité) --- */
:focus-visible {
  outline: 2px solid var(--color-brand-accent);
  outline-offset: 2px;
}

/* --- Scrollbar discrète --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-surface-page);
}

::-webkit-scrollbar-thumb {
  background: var(--primitive-neutral-300);
  border: var(--primitive-border-0);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primitive-neutral-400);
}

/* --- Utilitaires de texte --- */
.u-serif {
  font-family: var(--font-heading);
}

.u-sans {
  font-family: var(--font-body);
}

.u-uppercase {
  text-transform: uppercase;
  letter-spacing: var(--primitive-ls-wider);
}

.u-tracking-wide  { letter-spacing: var(--primitive-ls-wide); }
.u-tracking-wider { letter-spacing: var(--primitive-ls-wider); }
.u-tracking-widest { letter-spacing: var(--primitive-ls-widest); }

.u-text-muted     { color: var(--color-text-muted); }
.u-text-secondary { color: var(--color-text-secondary); }
.u-text-gold      { color: var(--color-text-gold); }
.u-text-danger    { color: var(--color-status-danger); }

.u-fw-300 { font-weight: 300; }
.u-fw-400 { font-weight: 400; }
.u-fw-500 { font-weight: 500; }
.u-fw-600 { font-weight: 600; }
.u-fw-700 { font-weight: 700; }

.u-text-center { text-align: center; }
.u-text-right  { text-align: right; }

/* --- Utilitaires d'affichage --- */
.u-hidden  { display: none !important; }
.u-block   { display: block; }
.u-flex    { display: flex; }
.u-grid    { display: grid; }
.u-iflex   { display: inline-flex; }

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

/* --- Numbered prefix (style "01" "02" devant les titres CDO) --- */
.numbered-prefix {
  display: inline-block;
  border: var(--primitive-border-1) solid var(--color-text-primary);
  padding: 0 var(--primitive-space-2);
  font-family: var(--font-ui);
  font-size: var(--fs-label-md);
  font-weight: var(--primitive-fw-500);
  vertical-align: middle;
  margin-right: var(--primitive-space-3);
  position: relative;
  top: -2px;
}
