/* ========================================
   CORRECTIONS CRITIQUES POUR 10/10
   ======================================== */

/* Fix pour les ancres avec navbar fixe + news-bar */
section[id],
div[id] {
    scroll-margin-top: 150px; /* Ajustez selon hauteur navbar + news-bar */
}

/* Amélioration du scroll smooth */
html {
    scroll-behavior: smooth;
}

/* Font display pour éviter le FOIT (Flash Of Invisible Text) */
@font-face {
    font-family: 'Vitesse';
    font-display: swap;
    /* Ajoutez vos src ici */
}

/* ========================================
   OPTIMISATIONS PERFORMANCE
   ======================================== */

/* GPU Acceleration pour les animations */
.card-flip-spin,
.bounce-ganadora,
.ripple,
.shine-effect {
    will-change: transform;
    transform: translateZ(0);
}

/* Optimisation des transitions */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Préchargement des images de fond critiques */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('assets/images/hero-poster.jpg') center/cover no-repeat;
    z-index: -1;
    opacity: 0;
    pointer-events: none;
}

/* ========================================
   ACCESSIBILITÉ
   ======================================== */

/* Focus visible pour navigation clavier */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid #eb5b25;
    outline-offset: 2px;
}

/* Skip to main content */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1em;
    background-color: #eb5b25;
    color: white;
    text-decoration: none;
}

.skip-to-main:focus {
    left: 50%;
    transform: translateX(-50%);
    top: 10px;
}

/* Amélioration contraste texte */
.text-muted {
    color: #999 !important; /* Au lieu de #6c757d pour meilleur contraste */
}

/* ========================================
   RESPONSIVE IMAGES
   ======================================== */

/* Lazy loading placeholder */
img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

img[loading="lazy"].loaded {
    animation: none;
    background: none;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .navbar,
    .news-bar,
    footer,
    .btn,
    #loader,
    video {
        display: none !important;
    }
    
    section {
        page-break-inside: avoid;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* ========================================
   AMÉLIORATIONS SPÉCIFIQUES
   ======================================== */

/* Correction galerie - hauteur cohérente */
.gallery-item img {
    object-fit: cover;
    aspect-ratio: 4/3;
}

/* Amélioration du loader */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.5s ease-out;
}

/* Optimisation des cartes */
.card {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Amélioration news-bar */
.news-bar {
    overflow: hidden;
    position: relative;
}

.news-item {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.news-item.active {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   DARK MODE SUPPORT (optionnel)
   ======================================== */

@media (prefers-color-scheme: dark) {
    /* Votre code dark mode si souhaité */
}

/* ========================================
   REDUCED MOTION SUPPORT
   ======================================== */

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

/* ========================================
   OPTIMISATION MOBILE
   ======================================== */

@media (max-width: 768px) {
    /* Ajustement scroll offset pour mobile */
    section[id],
    div[id] {
        scroll-margin-top: 120px;
    }
    
    /* Optimisation vidéo hero sur mobile */
    .hero-video {
        object-fit: cover;
        object-position: center;
    }
    
    /* Amélioration tactile */
    .btn,
    a,
    button {
        min-height: 44px; /* Touch target minimum */
        min-width: 44px;
    }
}

/* ========================================
   PERFORMANCE CRITIQUES
   ======================================== */

/* Optimisation des animations */
@media (hover: hover) and (pointer: fine) {
    .btn-orange:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(235, 91, 37, 0.3);
    }
}

/* Conteneur pour éviter les reflows */
.container,
.container-fluid {
    contain: layout style paint;
}

/* ========================================
   CORRECTIONS BUGS VISUELS
   ======================================== */

/* Fix polaroid overflow */
.polaroid {
    overflow: hidden;
    position: relative;
}

.polaroid img {
    display: block;
    width: 100%;
    height: auto;
}

/* Fix modal backdrop */
.modal-backdrop {
    z-index: 1040;
}

.modal {
    z-index: 1050;
}

/* Fix offcanvas z-index */
.offcanvas {
    z-index: 1060;
}

/* ========================================
   TYPOGRAPHIE
   ======================================== */

/* Amélioration lisibilité */
body {
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    font-weight: 700;
}

/* ========================================
   SÉCURITÉ
   ======================================== */

/* Prévention du clickjacking */
iframe {
    max-width: 100%;
}

/* Protection contre les injections CSS */
* {
    box-sizing: border-box;
}

/* ========================================
   CRITICAL CSS INLINE (À METTRE DANS <HEAD>)
   ======================================== */

/*
<style>
body{margin:0;font-family:sans-serif;background:#000;color:#fff}
.navbar{background:#000!important}
#loader{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.95);z-index:99999}
</style>
*/
