/* Base : remise à zéro, styles des éléments (design system PBAB) et mise en page commune. */

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

html {
    -webkit-font-smoothing: antialiased;
    text-size-adjust: 100%;
    /* Les ancres ne passent pas sous l'en-tête collant */
    scroll-padding-top: var(--header-height);

    --header-height: 72px;
}

@media (min-width: 960px) {
    html {
        --header-height: 106px;
    }
}

body {
    margin: 0;
    font: var(--type-body);
    color: var(--text-primary);
    background: var(--surface-page);
}

a {
    color: var(--text-link);
    text-decoration: underline;
    text-decoration-color: var(--steel-300);
    text-underline-offset: 3px;
    transition: color var(--duration-fast) var(--ease-out);
}

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

h1,
h2,
h3,
h4 {
    margin: 0;
    font-family: var(--font-display);
    color: var(--text-primary);
    letter-spacing: var(--tracking-tight);
    text-wrap: balance;
}

p {
    margin: 0;
    text-wrap: pretty;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

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

svg {
    flex-shrink: 0;
}

::selection {
    background: var(--red-100);
}

:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
    border-radius: var(--radius-xs);
}

/* Lien d'évitement : visible seulement au clavier */
.skip-link {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    z-index: 100;
    padding: var(--space-2) var(--space-4);
    background: var(--surface-page);
    color: var(--text-primary);
    font: var(--type-label);
    transform: translateY(-200%);
}

.skip-link:focus-visible {
    transform: none;
}

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

/* Mise en page */
.container {
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

.section {
    padding-block: var(--section-y-sm);
}

/* Sur téléphone, un peu moins d'air entre les sections : la page reste longue */
@media (max-width: 599px) {
    .section {
        padding-block: var(--space-12);
    }
}

@media (min-width: 960px) {
    .section {
        padding-block: var(--section-y);
    }
}

.section--subtle {
    background: var(--surface-subtle);
}

.section--inverse {
    background: var(--surface-inverse-deep);
    color: var(--steel-300);
}

.section--inverse :is(h2, h3) {
    color: var(--text-inverse);
}

/* Petits libellés en capitales, en rouge */
.overline {
    font: var(--type-overline);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
    color: var(--text-accent);
}

/* Sur fond anthracite, le rouge du design system n'atteint que 3,05:1 de contraste (WCAG AA : 4,5:1).
   Rouge éclairci à 4,88:1, à reporter dans le design system.
   De même, l'ambre des statuts « sur commande » n'atteint que 3,45:1 sur son propre fond :
   texte assombri à 5,28:1 (5,91:1 sur blanc), le fond et les bordures gardent l'ambre d'origine. */
:root {
    --text-accent-inverse: #E8565C;
    --status-order-text: #8A5A12;
}

.section--inverse .overline {
    color: var(--text-accent-inverse);
}

/* Valeurs techniques, références, numéros */
.mono {
    font: var(--type-mono);
    font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
    }
}
