/* ==========================================================================
   BASE CSS - RESET ET STYLES DE BASE
   Fichier : /css/02-base.css
   Usage : À charger après variables.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   RESET MODERNE
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-base);
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--body-bg);
    overflow-x: hidden;
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom);
}

/* --------------------------------------------------------------------------
   TYPOGRAPHIE RESPONSIVE
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

h1 { font-size: clamp(1.5rem, 4vw, 1.75rem); }
h2 { font-size: clamp(1.25rem, 3.5vw, 1.5rem); }
h3 { font-size: clamp(1.1rem, 3vw, 1.25rem); }
h4 { font-size: clamp(1rem, 2.5vw, 1.1rem); }

p {
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
    color: var(--text-secondary);
}

small {
    font-size: 0.875em;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   LIENS
   -------------------------------------------------------------------------- */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* --------------------------------------------------------------------------
   BOUTONS DE BASE
   -------------------------------------------------------------------------- */
button {
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    min-height: 44px;
    min-width: 44px;
}

button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   LISTES
   -------------------------------------------------------------------------- */
ul, ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* --------------------------------------------------------------------------
   IMAGES
   -------------------------------------------------------------------------- */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --------------------------------------------------------------------------
   FORMULAIRES DE BASE
   -------------------------------------------------------------------------- */
input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* --------------------------------------------------------------------------
   UTILITAIRES DE BASE
   -------------------------------------------------------------------------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* --------------------------------------------------------------------------
   OPTIMISATIONS MOBILE
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    body {
        padding-top: env(safe-area-inset-top);
    }
}

@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;
    }
}