/* =========================================================
 * FFVélo Kitcom — Couche CSS globale moderne
 * Complète theme.json avec des règles plus fines que les
 * styles globaux ne peuvent exprimer (focus, scrollbar, etc.)
 *
 * NB : la navbar est gérée dans assets/css/header.css.
 * ========================================================= */

/* ---------- Reset ciblé / qualité de vie ---------- */

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

html {
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
    /* Active l'animation de height auto pour <details>, accordéons, etc. */
    interpolate-size: allow-keywords;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-wrap: pretty;
}

:where(h1, h2, h3, h4, h5, h6) {
    text-wrap: balance;
}

/* ---------- Focus visible accessible ---------- */

:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid var(--wp--preset--color--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- Liens ---------- */

a {
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
    transition: color 0.2s ease;
}

a:hover {
    text-decoration-thickness: 2px;
}

/* ---------- Images responsives par défaut ---------- */

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

/* ---------- Scrollbar personnalisée (WebKit + Firefox) ---------- */

@supports selector(::-webkit-scrollbar) {
    ::-webkit-scrollbar { width: 12px; height: 12px; }
    ::-webkit-scrollbar-track { background: var(--wp--preset--color--surface-alt); }
    ::-webkit-scrollbar-thumb {
        background: var(--wp--preset--color--border);
        border-radius: 8px;
        border: 3px solid var(--wp--preset--color--surface-alt);
    }
    ::-webkit-scrollbar-thumb:hover {
        background: var(--wp--preset--color--primary);
    }
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--wp--preset--color--border) var(--wp--preset--color--surface-alt);
}

/* ---------- Sélection ---------- */

::selection {
    background: var(--wp--preset--color--accent);
    color: var(--wp--preset--color--surface);
}

/* ---------- Skip link ---------- */

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 9999;
    padding: 0.75rem 1.25rem;
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--surface);
    border-radius: 0 0 8px 8px;
    text-decoration: none;
    font-weight: 600;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}
