/*
 * _app2/shared/assets/css/reset.css
 *
 * Reset CSS sobre + base typography Dativo.
 * Inspiration : modern-css-reset (Andy Bell) + Tailwind preflight, simplifié.
 * Pré-requis : tokens.css doit être chargé avant ce fichier.
 *
 * Phase 0 / Item F5
 */

/* ============ Box-sizing partout ============ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ============ Reset margin / padding ============ */
html,
body,
h1, h2, h3, h4, h5, h6,
p, blockquote, dl, dd,
ul, ol, figure, hr,
fieldset, legend {
    margin: 0;
    padding: 0;
}

/* ============ HTML root ============ */
html {
    -webkit-text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
    line-height: var(--dv-leading-normal);
    scroll-behavior: smooth;
}

/* ============ Body ============ */
body {
    min-height: 100vh;
    font-family: var(--dv-font-body);
    font-size: var(--dv-text-md);
    line-height: var(--dv-leading-normal);
    color: var(--dv-text-primary);
    background: var(--dv-bg-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ============ Headings ============ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--dv-font-title);
    font-weight: var(--dv-weight-semibold);
    line-height: var(--dv-leading-tight);
    color: var(--dv-text-primary);
}

h1 { font-size: var(--dv-text-3xl); }
h2 { font-size: var(--dv-text-2xl); }
h3 { font-size: var(--dv-text-xl); }
h4 { font-size: var(--dv-text-lg); }
h5 { font-size: var(--dv-text-base); }
h6 { font-size: var(--dv-text-md); }

/* ============ Paragraphs / inline ============ */
p {
    line-height: var(--dv-leading-relaxed);
}

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

small {
    font-size: var(--dv-text-sm);
    color: var(--dv-text-muted);
}

code, kbd, samp, pre {
    font-family: var(--dv-font-mono);
    font-size: 0.9em;
}

/* ============ Liens ============ */
a {
    color: var(--dv-text-link);
    text-decoration: none;
    transition: color var(--dv-transition-fast);
}

a:hover {
    color: var(--dv-color-emerald);
    text-decoration: underline;
}

/* ============ Listes ============ */
ul, ol {
    list-style: none;
}

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

/* ============ Formulaires ============ */
button,
input,
optgroup,
select,
textarea {
    font: inherit;
    color: inherit;
    margin: 0;
}

button {
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
}

button:disabled {
    cursor: not-allowed;
}

textarea {
    resize: vertical;
}

/* ============ Accessibilité — focus visible ============ */
:focus-visible {
    outline: 2px solid var(--dv-border-focus);
    outline-offset: 2px;
    border-radius: var(--dv-radius-sm);
}

/* Désactive l'outline par défaut quand non clavier */
:focus:not(:focus-visible) {
    outline: none;
}

/* ============ Tables ============ */
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* ============ Détails / summary ============ */
summary {
    cursor: pointer;
}

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

/* ============ Utilitaire visually-hidden (accessibilité) ============ */
.dv-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
