/* ============================================================
   RESET – css/base/reset.css
   Modern CSS Reset adapté Drupal 11 / Francenews
   Basé sur Andy Bell's reset + ajouts spécifiques Drupal
   ============================================================ */

/* 1. Box-sizing global */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 2. Supprime les marges par défaut */
* {
  margin: 0;
}

/* 3. Document root */
html {
  font-size: 100%;               /* 1rem = 16px */
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  hanging-punctuation: first last;
}

/* 4. Body base */
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  color: var(--clr-text-default);
  background-color: var(--clr-bg-body);
  -webkit-font-smoothing: antialiased;
  moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 5. Media fluides */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* 6. Inputs héritent la police */
input, button, textarea, select {
  font: inherit;
}

/* 7. Titres – pas de wrapping orphelin */
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  text-wrap: balance;
}

/* 8. Paragraphes et listes */
p, li, figcaption {
  text-wrap: pretty;
  /*max-width: 75ch;*/              /* Limite confort de lecture */
}

/* 9. Listes sans style quand elles ont role="list" */
ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

/* 10. Liens */
a {
  color: var(--clr-text-link);
  text-decoration-skip-ink: auto;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--clr-text-link-hover);
}

/* 11. Boutons base */
button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  color: inherit;
}

/* 12. Accessibilité – focus visible */
:focus-visible {
  outline: var(--border-width-2) solid var(--clr-primary-light);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Supprime l'outline pour les clics souris (garde pour clavier) */
:focus:not(:focus-visible) {
  outline: none;
}

/* 13. Éléments interactifs désactivés */
[disabled],
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
}

/* 14. Images avec alt vide = décoratives */
img[alt=""] {
  /* Pas de border en cas de broken image */
}

/* 15. Tableau */
table {
  border-collapse: collapse;
  width: 100%;
}

/* 16. Séparateur */
hr {
  border: none;
  border-top: var(--border-width-1) solid var(--clr-border-default);
  margin: var(--space-8) 0;
}

/* 17. Code */
code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  white-space: pre-wrap;
}

/* ──────────────────────────────────────────────────────────
   DRUPAL SPECIFICS – Neutralise les classes Drupal parasites
   qui ajoutent du style non désiré
────────────────────────────────────────────────────────── */

/* Supprime les styles inline Drupal sur les wrappers champ */
.field {
  /* Réinitialisé via les composants qui en ont besoin */
}

/* Clear-fix Drupal legacy */
.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* Visually hidden – utilitaire accessibilité */
.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Skip link accessibilité */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-toast);
  padding: var(--space-2) var(--space-4);
  background: var(--clr-primary);
  color: var(--clr-text-inverse);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: top var(--duration-fast);
}

.skip-link:focus {
  top: var(--space-4);
}
