/*
 * Base commune de Mon Complice : police Nunito auto-hébergée (UX-DR2), page crème, base 20 px,
 * aucun texte sous 18 px, anneau de focus visible, colonne centrée. S'appuie sur jetons.css, chargé avant.
 */

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../vendor/nunito/nunito-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../vendor/nunito/nunito-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../vendor/nunito/nunito-latin-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../vendor/nunito/nunito-latin-800-normal.woff2') format('woff2');
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: var(--type-text-size-a-size);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--color-cream);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-cream);
  color: var(--color-ink);
  font-family: var(--type-body-family);
  font-size: var(--type-body-size);
  font-weight: var(--type-body-weight);
  line-height: var(--type-body-line-height);
}

/* Les contrôles de formulaire n'héritent pas de la police par défaut. */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* Une colonne, marges latérales gutter ; centrée et limitée à column-max au-delà de 430 px. */
main {
  display: block;
  width: 100%;
  padding-inline: var(--space-gutter);
}

@media (min-width: 431px) {
  main {
    max-width: var(--space-column-max);
    margin-inline: auto;
  }
}

/* Titres sur les styles de DESIGN.md : h1 = display (titre d'écran), h2 = title (titres de bloc, de panneau). */
h1 {
  font-family: var(--type-display-family);
  margin: var(--space-6) 0 var(--space-4);
  font-size: var(--type-display-size);
  font-weight: var(--type-display-weight);
  line-height: var(--type-display-line-height);
  color: var(--color-forest);
}

h2 {
  font-family: var(--type-title-family);
  margin: var(--space-section-gap) 0 var(--space-3);
  font-size: var(--type-title-size);
  font-weight: var(--type-title-weight);
  line-height: var(--type-title-line-height);
  color: var(--color-forest);
}

/* Aucun titre de niveau inférieur sous la taille du corps appuyé. */
h3,
h4,
h5,
h6 {
  margin: var(--space-4) 0 var(--space-2);
  font-family: var(--type-body-strong-family);
  font-size: var(--type-body-strong-size);
  font-weight: var(--type-body-strong-weight);
  line-height: var(--type-body-strong-line-height);
}

p,
ul,
ol {
  margin: 0 0 var(--space-4);
}

strong,
b {
  font-weight: var(--type-body-strong-weight);
}

/* Jamais de texte sous 18 px : small et sub/sup ne réduisent pas. */
small,
sub,
sup {
  font-size: var(--type-meta-size);
}

a {
  color: var(--color-leaf);
}

/* Focus visible : anneau de 3 px focus-ring sur la page. */
:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 3px;
}

/*
 * Un titre reçoit le focus à l'ouverture d'un écran ou d'un panneau (pour les lecteurs d'écran) : ce n'est pas un contrôle,
 * il n'a pas besoin d'anneau visible. Les boutons et les liens gardent le leur.
 */
:is(h1, h2)[tabindex='-1']:focus {
  outline: none;
}

/* Zoom 200 % ou texte A++ sur un petit écran : un mot long passe à la ligne plutôt que de dépasser. */
h1,
h2,
h3,
h4,
h5,
h6,
p,
li {
  overflow-wrap: anywhere;
}
