/* ==========================================================================
   COMMINGES HERITAGE RACING — Custom CSS overrides
   ========================================================================== */

/* Smooth scroll global */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 4rem; /* compense la nav fixe */
}

/* Réglages corps */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Sélection de texte */
::selection {
    background-color: #C8102E;
    color: #ffffff;
}

/* Scrollbar custom (Webkit + Firefox) */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #0A0A0A;
}
::-webkit-scrollbar-thumb {
    background: #C8102E;
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a30d24;
}
html {
    scrollbar-color: #C8102E #0A0A0A;
}

/* Animation fade-in révélée au scroll (via IntersectionObserver dans main.js) */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Effet hover sur les cards équipage : photo en NB qui repasse en couleur */
.equipage-card img {
    filter: grayscale(20%);
    transition: filter 0.5s ease;
}
.equipage-card:hover img {
    filter: grayscale(0%);
}

/* Bouton checkered flag effect */
.btn-flag::before {
    content: '🏁';
    margin-right: 0.5rem;
}

/* Custom focus-visible pour accessibilité */
*:focus-visible {
    outline: 2px solid #C8102E;
    outline-offset: 2px;
    border-radius: 4px;
}

/* FAQ : retirer le triangle natif du <summary> */
summary::-webkit-details-marker {
    display: none;
}
summary {
    list-style: none;
}

/* Animation pulse plus marquée pour les badges */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(200, 16, 46, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(200, 16, 46, 0.8), 0 0 30px rgba(200, 16, 46, 0.4);
    }
}
.glow {
    animation: glow 2s ease-in-out infinite;
}

/* Grain texture overlay (subtil, ambiance "argentique") */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' /%3E%3C/svg%3E");
}

/* Print styles (au cas où on imprime la page) */
@media print {
    nav, footer, #contact form, .btn-flag {
        display: none !important;
    }
    body {
        background: white !important;
        color: black !important;
    }
}

/* 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;
    }
}

/* Responsive : ajustement des polices Anton sur mobile */
@media (max-width: 640px) {
    .font-display {
        letter-spacing: -0.02em;
    }
}
