/* * DESIGN PRINCIPAL - Neurone Digital 
 * Version Expert 2.1 - Optimisée & Cohérente
 * Mise à jour : Correction Responsive Mobile (Mars 2026)
 */

:root {
    --primary-red: #C41E3A; /* Harmonisé avec le Header */
    --dark-bg: #111111;
    --light-grey: #F4F4F4;
    --text-main: #333333;
    --text-light: #666666;
    --font-main: 'Inter', sans-serif;
    --transition: 0.3s ease;
    
    /* Couleurs Système pour Alertes */
    --success-bg: #d4edda;
    --success-text: #155724;
    --success-border: #c3e6cb;
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --error-border: #f5c6cb;
}

/* RESET & BASE */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--text-main);
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

.container { width: 92%; max-width: 1200px; margin: auto; }

/* -----------------------------------------------------------
   HEADER & NAVIGATION (Desktop & Global)
----------------------------------------------------------- */
.main-header {
    background: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo { font-weight: 800; font-size: 1.6rem; text-transform: uppercase; letter-spacing: -1px; }
.logo-red { color: var(--primary-red); }

.nav-links { display: flex; gap: 25px; align-items: center; }
.nav-links a { font-weight: 600; font-size: 0.95rem; color: var(--text-main); }
.nav-links a:hover { color: var(--primary-red); }
.btn-services { 
    background: var(--primary-red); 
    color: #fff !important; 
    padding: 8px 20px; 
    border-radius: 5px; 
}

/* -----------------------------------------------------------
   SYSTÈME D'ALERTES
----------------------------------------------------------- */
.system-messages {
    margin-top: 20px;
    margin-bottom: 20px;
}
.alert {
    padding: 15px;
    border-radius: 5px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* -----------------------------------------------------------
   LAYOUT PRINCIPAL
----------------------------------------------------------- */
.main-layout {
    display: flex;
    gap: 40px;
    margin-top: 40px;
    margin-bottom: 60px;
}
.content-area { flex: 1; }
.sidebar { width: 320px; }

/* TITRES DE SECTION */
.section-title, .category-title {
    font-size: 1.8rem;
    margin-bottom: 25px;
    border-left: 5px solid var(--primary-red);
    padding-left: 15px;
}

/* GRILLE D'ARTICLES */
.grid-2-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* CARDS */
.card-hero { margin-bottom: 40px; }
.card-img { border-radius: 8px; overflow: hidden; margin-bottom: 15px; height: 250px; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.card-hero:hover img { transform: scale(1.05); }
.card-body h3 { font-size: 1.4rem; margin-bottom: 10px; }
.card-meta { font-size: 0.85rem; color: var(--text-light); margin-top: 10px; }
.card-meta strong { color: var(--dark-bg); margin-right: 10px; }

/* CARD HORIZONTAL */
.card-horizontal { display: flex; gap: 15px; margin-bottom: 20px; align-items: flex-start; }
.card-img-small { flex-shrink: 0; width: 100px; height: 80px; border-radius: 5px; overflow: hidden; }
.card-img-small img { width: 100%; height: 100%; object-fit: cover; }

/* SIDEBAR WIDGETS */
.sidebar-widget { background: var(--light-grey); padding: 25px; border-radius: 8px; margin-bottom: 30px; }
.widget-title { font-size: 1.2rem; margin-bottom: 20px; border-bottom: 2px solid #ddd; padding-bottom: 10px; }

.search-widget form { display: flex; }
.search-widget input { flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 4px 0 0 4px; }
.search-widget button { background: var(--dark-bg); color: #fff; border: none; padding: 10px 15px; border-radius: 0 4px 4px 0; cursor: pointer; }

.popular-list li { margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #ddd; }
.popular-list li:last-child { border: 0; }
.article-meta { font-size: 0.75rem; color: var(--primary-red); text-transform: uppercase; font-weight: 700; }

/* NEWSLETTER CARD */
.newsletter-card { background: var(--dark-bg); color: #fff; }
.newsletter-card h3 { margin-bottom: 10px; }
.newsletter-card p { font-size: 0.9rem; color: #ccc; margin-bottom: 20px; }
.newsletter-form input { width: 100%; padding: 12px; margin-bottom: 10px; border-radius: 4px; border: none; }
.btn-primary { width: 100%; background: var(--primary-red); color: #fff; border: none; padding: 12px; border-radius: 4px; font-weight: 700; cursor: pointer; transition: var(--transition); }
.btn-primary:hover { background: #c3191f; }

/* -----------------------------------------------------------
   PAGE CONTACT
----------------------------------------------------------- */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

.contact-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--dark-bg); }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 4px; font-family: var(--font-main); font-size: 0.95rem;
}

/* -----------------------------------------------------------
   FOOTER & BOUTON RETOUR EN HAUT
----------------------------------------------------------- */
.site-footer {
    background: var(--dark-bg);
    color: #fff;
    padding: 60px 0 30px;
    margin-top: 60px;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; }
.social-icons { display: flex; gap: 15px; margin-top: 15px; }
.social-icons a { background: #333; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; }

/* STYLE BOUTON RETOUR EN HAUT (DYNAMIQUE) */
#backToTop {
    display: none; 
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 999;
    background-color: var(--primary-red);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s, background-color 0.3s;
    line-height: 45px;
    text-align: center;
}
#backToTop:hover { transform: scale(1.1); background-color: var(--dark-bg); }

/* -----------------------------------------------------------
   RESPONSIVE (Optimisé pour l'accueil et la lisibilité)
----------------------------------------------------------- */
@media (max-width: 992px) {
    .nav-links { display: none !important; }
    .main-layout { flex-direction: column; padding: 0 15px; } /* Ajout de padding latéral */
    .sidebar { width: 100%; margin-top: 40px; }
    .contact-container { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 600px) {
    .container { width: 100%; padding: 0 10px; } /* Pleine largeur avec marges internes */
    .logo { font-size: 1.4rem; }
    .grid-2-cols { grid-template-columns: 1fr; }
    
    /* Correction de l'affichage horizontal des cartes sur mobile */
    .card-horizontal { 
        flex-direction: column; 
        gap: 10px; 
    }
    .card-img-small { 
        width: 100%; 
        height: 180px; 
    }
    .card-body h3 { font-size: 1.2rem; }

    #backToTop { bottom: 15px; right: 15px; width: 40px; height: 40px; font-size: 18px; }
}