/* ==========================================================================
   CREDITO SOLIDARIO — Reset & base
   ========================================================================== */

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

* { margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size:   var(--fs-md);
    line-height: var(--lh-base);
    color:       var(--color-text);
    background:  var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

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

button { background: none; border: 0; cursor: pointer; }

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease-out);
}

ul, ol { list-style: none; }

/* ---------- Typographie ---------- */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    line-height: var(--lh-tight);
    color: var(--color-primary);
    font-weight: var(--fw-bold);
    letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-5xl); font-weight: var(--fw-black); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-base); }

p { color: var(--color-text); }

.text-muted    { color: var(--color-text-muted); }
.text-accent   { color: var(--color-accent); }
.text-primary  { color: var(--color-primary); }
.text-inverse  { color: var(--color-text-inverse); }
.text-center   { text-align: center; }

/* ---------- Utilitaires ---------- */

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
}

.container--narrow { max-width: var(--container-narrow); }

.section { padding: var(--space-24) 0; }
.section--sm { padding: var(--space-16) 0; }
.section--alt { background: var(--color-bg-alt); }
.section--dark { background: var(--color-primary); color: var(--color-text-inverse); }
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 { color: var(--color-text-inverse); }

.section-head { text-align: center; margin-bottom: var(--space-16); }
.section-head__eyebrow {
    display: inline-block;
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: var(--space-3);
}
.section-head__title { font-size: var(--fs-3xl); }
.section-head__lead {
    max-width: 640px;
    margin: var(--space-4) auto 0;
    color: var(--color-text-muted);
    font-size: var(--fs-md);
}

/* Divider en petit trait doré sous les titres */
.section-head__title::after,
.title-divider::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    background: var(--color-accent);
    border-radius: 2px;
    margin: var(--space-4) auto 0;
}

/* Icônes */
.icon { display: inline-block; vertical-align: middle; fill: currentColor; }

/* Focus visible : accessibilité clavier */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Sélection */
::selection { background: var(--color-primary); color: #fff; }

/* Scrollbar discrète */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--color-bg-alt); }
::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

/* Skip link accessibilité */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--color-primary);
    color: #fff;
    padding: var(--space-3) var(--space-4);
    z-index: 9999;
}
.skip-link:focus { left: 0; }

/* Prefers reduced motion */
@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;
    }
}
