/* ============================================================================
   base.css — Reset + styles globaux du portail LetsGo
   Référence : tokens.css (variables consommées ici), référentiel §17.5
   (classes utilitaires d'accessibilité).

   Scope :
     1. Reset minimal
     2. Typographie par élément (h1..h4, p, a, strong, em, small)
     3. Éléments de formulaire (héritage de la police)
     4. Accessibilité (focus visible, .skip-link, .visually-hidden)
     5. Utilitaires transverses (.lead, .eyebrow, sélection)

   Volontairement minimal : les styles de composants (cartes, hero, nav,
   footer, etc.) vivent dans components.css, les styles spécifiques aux
   types de pages dans pages.css.
   ============================================================================ */

/* ----------------------------------------------------------------------------
   1. RESET
   ---------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    /* Évite les jumps lors du passage d'une page avec scrollbar à une sans. */
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-primary);
    font-size: var(--font-body);
    font-weight: var(--weight-regular);
    line-height: var(--lh-body);
    color: var(--text-primary);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

ul, ol {
    margin: 0;
    padding: 0;
}

figure, blockquote {
    margin: 0;
}

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    padding: 0;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* ----------------------------------------------------------------------------
   2. TYPOGRAPHIE PAR ÉLÉMENT
   On préfère styler les éléments HTML natifs plutôt que des classes utilitaires
   (cf. 02bis §11.5). Les classes spécialisées viendront par composants dans
   components.css.
   ---------------------------------------------------------------------------- */

h1, h2, h3, h4 {
    margin: 0 0 0.5em;
    color: var(--text-primary);
    font-weight: var(--weight-bold);
    font-family: var(--font-primary);
}

h1 {
    font-size: var(--font-h1);
    line-height: var(--lh-tight);
    letter-spacing: var(--tracking-heading);
}

h2 {
    font-size: var(--font-h2);
    font-weight: var(--weight-semibold);
    line-height: var(--lh-heading);
    letter-spacing: -0.015em;
}

h3 {
    font-size: var(--font-h3);
    font-weight: var(--weight-semibold);
    line-height: var(--lh-subheading);
    letter-spacing: -0.01em;
}

h4 {
    font-size: var(--font-h4);
    font-weight: var(--weight-semibold);
    line-height: 1.4;
}

p {
    margin: 0 0 1em;
}

/* Dernier paragraphe d'un bloc : pas de marge basse superflue. */
p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color 0.15s;
}

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

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

em, i {
    font-style: italic;
}

small {
    font-size: var(--font-body-s);
    color: var(--text-secondary);
}

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

hr {
    border: 0;
    border-top: 1px solid var(--border-default);
    margin: 2em 0;
}

/* ----------------------------------------------------------------------------
   3. SÉLECTION ET FOCUS (RGAA AA — référentiel §17.1 et §17.5)
   ---------------------------------------------------------------------------- */
::selection {
    background: var(--c-blue-am);
    color: var(--c-white);
}

*:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ----------------------------------------------------------------------------
   4. UTILITAIRES D'ACCESSIBILITÉ
   ---------------------------------------------------------------------------- */

/* Skip-link : lien "Aller au contenu", invisible par défaut, visible au focus.
   À positionner en tout premier dans le <body>.

   On cache l'élément avec `transform: translateY(-100%)` (robuste quel que
   soit son contenu), pas avec `top: -40px` qui dépassait de quelques pixels
   selon le padding et la taille de police. L'ancre `top: 8px` reste fixe —
   la transition animée porte seulement sur le transform. */
.skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--c-blue-am);
    color: var(--c-white);
    font-weight: var(--weight-bold);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transform: translateY(-150%);
    transition: transform 0.2s;
}

.skip-link:focus {
    transform: translateY(0);
    color: var(--c-white);
}

/* visually-hidden : cache un élément visuellement, reste lisible pour les
   lecteurs d'écran. Référentiel §17.5. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ----------------------------------------------------------------------------
   5. UTILITAIRES TRANSVERSES
   ---------------------------------------------------------------------------- */

/* Accroche introductive, utilisée sous un H1 (homepage, hub, cas d'usage). */
.lead {
    font-size: var(--font-body-l);
    line-height: 1.55;
    color: var(--text-secondary);
}

/* Eyebrow : petit kicker coloré au-dessus des titres. */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 10px;
    font-size: var(--font-eyebrow);
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--c-blue-am);
    background: var(--c-blue-am-l90);
    border-radius: var(--radius-pill);
}

.eyebrow-dot {
    width: 6px;
    height: 6px;
    background: var(--c-blue-am);
    border-radius: 50%;
}
