/* Remise à zéro, typographie et éléments natifs du site public. */

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-height) + var(--space-4));
    scrollbar-color: var(--color-line-night-strong) var(--color-night);
    accent-color: var(--color-champagne);
    caret-color: var(--color-champagne);
}

::selection {
    background-color: var(--color-champagne);
    color: var(--color-night);
}

body {
    min-height: 100vh;
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--fw-regular);
    line-height: var(--leading-body);
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: var(--fw-display);
    letter-spacing: var(--tracking-display);
    line-height: var(--leading-tight);
    text-wrap: balance;
}

h1 {
    font-size: var(--text-3xl);
}

h2 {
    font-size: var(--text-2xl);
}

h3 {
    font-size: var(--text-lg);
    font-weight: var(--fw-bold);
    line-height: var(--leading-snug);
}

/* Sous 360 px, un mot long en Archivo large (« personnalisation » : 324 px) dépasse la colonne :
   césure à la française plutôt qu'un débordement. */
@media (max-width: 22.49rem) {
    h1,
    h2,
    h3 {
        hyphens: auto;
        hyphenate-limit-chars: 12 4 4;
    }
}

p,
li {
    text-wrap: pretty;
}

ul,
ol {
    list-style: none;
}

a {
    color: var(--text-link);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
    transition: color 0.2s var(--ease-out), text-decoration-thickness 0.2s var(--ease-out);
}

a:hover {
    color: var(--text-link-hover);
    text-decoration-thickness: 2px;
}

strong {
    font-weight: var(--fw-medium);
}

img,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: var(--text-base);
    line-height: inherit;
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

table {
    border-collapse: collapse;
    width: 100%;
}

.tabular {
    font-variant-numeric: tabular-nums;
}

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

.skip-link {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    z-index: 100;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-pill);
    background-color: var(--color-champagne);
    color: var(--color-night);
    transform: translateY(-200%);
}

.skip-link:focus,
.skip-link:hover {
    color: var(--color-night);
    transform: none;
}

#main-content:focus {
    outline: none;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}
