/* reset.css — remise à zéro commune à toutes les pages (chargée en premier). */

/* Modèle de boîte et marges : tout part de zéro */
* { box-sizing: border-box; margin: 0; }

/* Le body empile header, contenu et footer sur au moins toute la hauteur d'écran */
body { margin: 0; display: flex; flex-direction: column; min-height: 100svh; }

/* Une modale ou un panneau marqué scroll-lock bloque le défilement de la page tant qu'il est ouvert */
html:has(dialog[scroll-lock][open], details[scroll-lock][open]) { overflow: hidden; }

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

/* Champs : même police que le texte, rayon du thème */
input, textarea, select { font: inherit; border-radius: var(--at-radius-field); }
select { color: currentcolor; background-color: var(--at-bg); }

/* Fenêtres natives : fond et texte de la palette courante */
dialog { border: 0; color: var(--at-text); background: var(--at-bg); }

/* Textes : césure des mots longs, derniers mots équilibrés, paragraphes vides masqués */
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
p { text-wrap: pretty; }
p:empty { display: none; }

/* Pas de marge avant le premier titre ou paragraphe d'un conteneur, ni après le dernier
   (un élément vide en tête ou en fin est ignoré) */
:is(p, h1, h2, h3, h4, h5, h6):first-child,
:empty:first-child + :where(p, h1, h2, h3, h4, h5, h6) { margin-block-start: 0; }
:is(p, h1, h2, h3, h4, h5, h6):last-child,
:where(p, h1, h2, h3, h4, h5, h6) + :has(+ :empty:last-child) { margin-block-end: 0; }
