/* Base : reset, typographie, focus, utilitaires. */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  font-family: var(--font);
  font-size: var(--fs-14);
  line-height: 1.5;
  font-optical-sizing: auto;
  font-feature-settings: "cv11", "ss01";
  color: var(--foreground);
  background: var(--popover);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video, canvas { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; touch-action: manipulation; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
p, li, dd { text-wrap: pretty; }
h1, h2, h3, h4 { line-height: 1.2; font-weight: 600; text-wrap: balance; }
h1 { font-size: var(--fs-24); letter-spacing: -.02em; }
h2 { font-size: var(--fs-18); letter-spacing: -.01em; }
h3 { font-size: var(--fs-16); }
h4 { font-size: var(--fs-14); }
table { border-collapse: collapse; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--primary) 28%, #fff); color: var(--foreground); }

:focus-visible {
  outline: 2px solid var(--foreground);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ring) 45%, transparent);
}
:focus:not(:focus-visible) { outline: none; }

/* Liens de texte : #0f1419 souligné de bleu */
.link, .prose a {
  color: var(--foreground);
  text-decoration: underline;
  text-decoration-color: var(--primary);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.link:hover, .prose a:hover { text-decoration-color: var(--foreground); }

.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-12); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.right { text-align: right; }
.danger-text { color: var(--danger-text); }

.sr-only {
  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;
  left: var(--sp-3);
  top: var(--sp-3);
  z-index: 1000;
  padding: var(--sp-2) var(--sp-3);
  background: var(--secondary);
  color: #fff;
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--16 { width: 16px; height: 16px; }
.icon--20 { width: 20px; height: 20px; }

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

@media (prefers-contrast: more) {
  :root { --border: var(--border-strong); --sidebar-border: var(--border-strong); }
}
