/**
 * 🎨 MENU PUBLIC - CSS BASE
 * 
 * Reset, variables CSS, typographie de base
 * Convention BEM stricte
 * Mobile-first (375px+)
 * 
 * @version 2.0.0
 * @date 2025-12
 */

/* ============================================
   I. CSS RESET MINIMAL
   ============================================ */

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

/* ============================================
   II. VARIABLES CSS GLOBALES
   ============================================ */

:root {
    /* Couleurs système (injectées par backend, fallbacks ici) */
    --color-primary: #4A4A4A;
    --color-secondary: #2C2C2C;
    --color-accent: #8B0000;
    
    /* RGB pour opacités */
    --color-primary-rgb: 74, 74, 74;
    --color-secondary-rgb: 44, 44, 44;
    --color-accent-rgb: 139, 0, 0;
    
    /* Opacités pré-calculées */
    --color-primary-05: rgba(var(--color-primary-rgb), 0.05);
    --color-primary-10: rgba(var(--color-primary-rgb), 0.1);
    --color-primary-20: rgba(var(--color-primary-rgb), 0.2);
    --color-secondary-40: rgba(var(--color-secondary-rgb), 0.4);
    --color-secondary-50: rgba(var(--color-secondary-rgb), 0.5);
    --color-secondary-60: rgba(var(--color-secondary-rgb), 0.6);
    --color-secondary-70: rgba(var(--color-secondary-rgb), 0.7);
    --color-secondary-05: rgba(var(--color-secondary-rgb), 0.05);
    
    /* Couleurs neutres */
    --color-white: #FFFFFF;
    --color-black: #000000;
    --color-gray-100: #F8F9FA;
    --color-gray-200: #E9ECEF;
    --color-gray-300: #DEE2E6;
    --color-gray-400: #CED4DA;
    --color-gray-500: #ADB5BD;
    --color-gray-600: #6C757D;
    --color-gray-700: #495057;
    --color-gray-800: #343A40;
    --color-gray-900: #212529;
    
    /* Couleurs sémantiques */
    --color-success: #28A745;
    --color-warning: #FFC107;
    --color-danger: #DC3545;
    --color-info: #17A2B8;
    
    /* Typographie */
    --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-heading: var(--font-family-base);
    --font-family-mono: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    
    /* Tailles de police (mobile-first) */
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-base: 1rem;     /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-2xl: 1.5rem;    /* 24px */
    --font-size-3xl: 2rem;      /* 32px */
    
    /* Line heights */
    --line-height-tight: 1.25;
    --line-height-base: 1.5;
    --line-height-relaxed: 1.75;
    
    /* Font weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Espacements */
    --spacing-0: 0;
    --spacing-1: 0.25rem;   /* 4px */
    --spacing-2: 0.5rem;    /* 8px */
    --spacing-3: 0.75rem;   /* 12px */
    --spacing-4: 1rem;      /* 16px */
    --spacing-5: 1.25rem;   /* 20px */
    --spacing-6: 1.5rem;    /* 24px */
    --spacing-8: 2rem;      /* 32px */
    --spacing-10: 2.5rem;   /* 40px */
    --spacing-12: 3rem;     /* 48px */
    --spacing-16: 4rem;     /* 64px */
    
    /* Bordures */
    --border-width: 1px;
    --border-radius-sm: 0.25rem;
    --border-radius: 0.375rem;
    --border-radius-lg: 0.5rem;
    --border-radius-xl: 1rem;
    --border-radius-full: 9999px;
    
    /* Ombres */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    
    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ============================================
   III. TYPOGRAPHIE DE BASE
   ============================================ */

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-base);
    color: var(--color-gray-900);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: var(--spacing-3);
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--color-gray-900);
}

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

/* Paragraphes */
p {
    margin-top: 0;
    margin-bottom: var(--spacing-4);
}

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

a:hover {
    color: var(--color-accent);
}

/* Listes */
ul, ol {
    margin-top: 0;
    margin-bottom: var(--spacing-4);
    padding-left: var(--spacing-6);
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* Tableaux */
table {
    width: 100%;
    border-collapse: collapse;
}

/* ============================================
   IV. UTILITAIRES DE BASE
   ============================================ */

/* Visually hidden (accessibilité) */
.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;
}

/* Focus visible */
:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* ============================================
   V. RESPONSIVE BREAKPOINTS
   ============================================ */

/* 
 * Mobile-first breakpoints:
 * - sm: 576px
 * - md: 768px
 * - lg: 992px
 * - xl: 1200px
 * - xxl: 1400px
 */

@media (min-width: 768px) {
    :root {
        --font-size-2xl: 1.75rem;   /* 28px */
        --font-size-3xl: 2.25rem;   /* 36px */
    }
}

@media (min-width: 992px) {
    :root {
        --font-size-2xl: 2rem;      /* 32px */
        --font-size-3xl: 2.5rem;    /* 40px */
    }
}
