/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}
body {
  line-height: 1;
}
ol,
ul {
  list-style: none;
}
blockquote,
q {
  quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
  content: "";
  content: none;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* -------------------/*
 * Reset CSS "Bretzel"
 * Made par Alsacréations
 /* ------------------ */

/*
 * Un peu de documentation :
 * 1- Mais pourquoi :where() partout ? -> https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity#the_where_exception
 * 2- Que sont les couleurs système ? -> https://blog.jim-nielsen.com/2021/css-system-colors/
 * 3- Qu'est ce que la police système (system-ui) ? -> https://drafts.csswg.org/css-fonts-4/#valdef-font-family-system-ui
 * 4- Mais pourquoi min-width: 0 sur tous les éléments ? -> https://raphaelgoetter.wordpress.com/2016/11/09/flexbox-min-width-0-is-the-new-zoom-1/
 * 5- C'est quoi l'unité dvh ? -> https://dev.to/frehner/css-vh-dvh-lvh-svh-and-vw-units-27k4
 * 6- C'est quoi text-decoration-skip-ink ? -> https://developer.mozilla.org/fr/docs/Web/CSS/text-decoration-skip-ink
 * 7- C'est quoi ARIA ? -> https://developer.mozilla.org/fr/docs/Web/Accessibility/ARIA
*/

/* On adopte les couleurs système afin de s'adapter automatiquement en dark et light mode */

:root {
  color-scheme: light dark;
  color: CanvasText;
  background-color: Canvas;
}

/* On passe tout le monde en modèle border-box et on évite min-width: auto sur les flex- et grid-items */

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

/* On évite les débordements de page */

html {
  overflow-wrap: break-word;
}

/* Body prend toute la hauteur + styles divers */

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: system-ui, sans-serif;
  text-rendering: optimizeSpeed;
  line-height: 1.5;
}

/* On supprime les styles des listes ayant une class */

:where(ol, ul):where([class]) {
  list-style: none;
  padding-left: 0;
}

/* On évite les débordements d'éléments */

:where(
    img,
    table,
    td,
    blockquote,
    pre,
    code,
    input,
    textarea,
    select,
    video,
    svg,
    iframe
  ) {
  max-width: 100%;
}

/* Réduction de la hauteur de ligne sur certains éléments */

:where(h1, h2, h3, h4, button, input, label) {
  line-height: 1.1;
}

/* On préserve le ratio d'affichage */

:where(iframe, img, input, select, textarea) {
  height: auto;
}

/* Styles par défaut des liens */

:where(a:not([class])) {
  text-decoration-skip-ink: auto;
}

/* Styles par défaut des tableaux */

:where(table) {
  table-layout: fixed;
  border-collapse: collapse;
  vertical-align: top;
}

/* Pas de bordures sur images et iframes et alignement */

:where(img, iframe) {
  border-style: none;
  vertical-align: top;
}

/* Les SVG héritent de la couleur de texte courante */

:where(svg:not([fill])) {
  fill: currentColor;
}

/* Correction des différences entre navigateurs */

:where(input, button, textarea, select) {
  margin: 0;
  background-color: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  vertical-align: middle;
}

:where(form, fieldset) {
  border: none;
}

:where(fieldset) {
  margin: 0;
  padding: 1em;
}

:where(legend) {
  max-width: 100%;
  border: 0;
  color: inherit;
  white-space: normal;
}

:where(label) {
  display: inline-block;
  cursor: pointer;
}

:where(textarea) {
  overflow: auto;
  vertical-align: top;
  resize: vertical;
  white-space: pre-wrap;
}

/* Styles préformatés */

:where(pre, code, kbd, samp) {
  font-family: monospace, monospace;
  font-size: 1em;
}

:where(pre) {
  tab-size: 2;
  white-space: pre-wrap;
  line-height: normal;
  overflow: auto;
}

/* Correction des styles ARIA */

:where([aria-busy="true"]) {
  cursor: progress;
}

:where([aria-controls]) {
  cursor: pointer;
}

:where([aria-disabled="true"], [disabled]) {
  cursor: not-allowed;
}

:where([aria-hidden="false"][hidden]) {
  display: revert;
}

:where([aria-hidden="false"][hidden]:not(:focus)) {
  clip: rect(0, 0, 0, 0);
  position: absolute;
}

/* Suppression des animations selon préférences utilisateurice */

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

/* On masque le contenu à l'écran tout en demeurant accessible aux assistances techniques.
 * Le choix de nommage est .visually-hidden et non .sr-only car ce dernier n'est censé s'adresser qu'aux "screen readers", ce qui n'est pas forcément le cas.
 * :focus et :active permettent au contenu d'être affiché lorsque les éléments reçoivent le focus (ex. skip-links)
 * Auteur : James Edwards; Source : https://www.tpgi.com/the-anatomy-of-visually-hidden/
 * Auteur : Gaël Poupard; Source : https://gist.github.com/ffoodd/000b59f431e3e64e4ce1a24d5bb36034
*/

.visually-hidden:not(:focus):not(:active) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}
