/*
 * BADICOM Design System
 * Base styles
 *
 * Normalisation légère, typographie et règles d'accessibilité.
 * Les composants et le layout sont définis dans des fichiers séparés.
 */

/*
 * ----------------------------------------------------------
 * Box model
 * ----------------------------------------------------------
 */

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


/*
 * ----------------------------------------------------------
 * Document
 * ----------------------------------------------------------
 */

html {
    min-height: 100%;
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
}

body {
    min-width: 20rem;
    min-height: 100vh;
    margin: 0;

    background: var(--color-page);
    color: var(--color-text);

    font-family: var(--font-family-sans);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-normal);

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/*
 * ----------------------------------------------------------
 * Typography
 * ----------------------------------------------------------
 */

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin-top: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-text-strong);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
}

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

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

h3 {
    font-size: var(--font-size-xl);
}

h4 {
    font-size: var(--font-size-lg);
}

p {
    margin-bottom: var(--space-4);
}

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

small {
    font-size: var(--font-size-sm);
}

code,
kbd,
samp,
pre {
    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        Menlo,
        monospace;
}


/*
 * ----------------------------------------------------------
 * Links
 * ----------------------------------------------------------
 */

a {
    color: var(--color-primary-700);
    text-decoration: none;
}

a:hover {
    color: var(--color-primary-900);
    text-decoration: underline;
}


/*
 * ----------------------------------------------------------
 * Media
 * ----------------------------------------------------------
 */

img,
svg,
video,
canvas {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}


/*
 * ----------------------------------------------------------
 * Lists
 * ----------------------------------------------------------
 */

ul,
ol {
    margin-top: 0;
}


/*
 * ----------------------------------------------------------
 * Forms
 * ----------------------------------------------------------
 */

button,
input,
select,
textarea {
    margin: 0;
    color: inherit;
    font: inherit;
}

button,
select {
    text-transform: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
    cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
}

textarea {
    resize: vertical;
}


/*
 * ----------------------------------------------------------
 * Tables
 * ----------------------------------------------------------
 */

table {
    border-collapse: collapse;
    border-spacing: 0;
}


/*
 * ----------------------------------------------------------
 * Accessibility
 * ----------------------------------------------------------
 */

:focus {
    outline: none;
}

:focus-visible {
    outline: 3px solid rgb(59 130 246 / 0.35);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

[aria-disabled="true"] {
    cursor: not-allowed;
}


/*
 * ----------------------------------------------------------
 * Selection
 * ----------------------------------------------------------
 */

::selection {
    background: var(--color-primary-200);
    color: var(--color-primary-950);
}


/*
 * ----------------------------------------------------------
 * Reduced motion
 * ----------------------------------------------------------
 */

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