/* 1. RESET & VARIABLES */
:root {
    --primary-blue: #003366;
    --dark-blue: #002244;
    --glass-bg: rgba(255, 255, 255, 0.15);
    --text-white: #ffffff;
    --text-dark: #333333;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #f4f7f6; color: var(--text-dark); line-height: 1.6; }

/* 2. HEADER & NAVIGATION */
.site-header { background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.top-bar { display: flex; justify-content: space-between; align-items: center; padding: 5px 5%; }
.logo img { height:100px; }
.btn-sub { background: var(--primary-blue); color: #fff; padding: 10px 20px; text-decoration: none; font-weight: bold; border-radius: 4px; }

.main-nav { background: var(--primary-blue); padding: 0 5%; }
.main-nav > ul { display: flex; list-style: none; }
.main-nav a { color: #fff; padding: 15px 20px; display: block; text-decoration: none; font-size: 0.9em; font-weight: 600; }
.main-nav a:hover { background: rgba(255,255,255,0.1); }

/* Menu déroulant */
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; background: var(--dark-blue); min-width: 220px; z-index: 1000; list-style: none; }
.dropdown-menu li a { padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.dropdown:hover .dropdown-menu { display: block; }

/* 3. HOME PAGE - GRILLES */
.home-container { padding: 30px 5%; }
.featured-section { display: grid; grid-template-columns: 2fr 1fr; gap: 15px; height: 500px; }
.main-featured, .small-post { position: relative; border-radius: 8px; overflow: hidden; }
.main-featured img, .small-post img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.main-featured:hover img, .small-post:hover img { transform: scale(1.05); }

.side-featured { display: grid; grid-template-rows: repeat(4, 1fr); gap: 10px; }
.overlay { position: absolute; bottom: 0; width: 100%; padding: 20px; background: linear-gradient(transparent, rgba(0,0,0,0.85)); color: #fff; }

.grid-recent { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; margin-top: 20px; }
.post-card { background: #fff; padding: 15px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.post-card img { width: 100%; height: 180px; object-fit: cover; border-radius: 4px; }

/* 4. CARROUSEL & GLASS EFFECTS */
.carousel-track { display: flex; overflow-x: auto; gap: 20px; padding: 20px 0; }
.carousel-item { min-width: 280px; padding: 15px; border-radius: 12px; backdrop-filter: blur(10px); background: var(--glass-bg); border: 1px solid rgba(255,255,255,0.2); }

/* 5. FOOTER */
.site-footer { background: #1a1a1a; color: #fff; padding: 60px 5% 20px; margin-top: 50px; }
.footer-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.recent-post-item { display: flex; gap: 12px; margin-bottom: 20px; }
.recent-post-item img { width: 70px; height: 70px; object-fit: cover; border-radius: 4px; }
.category-list li a { color: #bbb; text-decoration: none; display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #333; }
.footer-bottom { display: flex; justify-content: space-between; border-top: 1px solid #333; padding-top: 30px; margin-top: 40px; }

/* Responsive simple */
@media (max-width: 768px) {
    .featured-section, .footer-container, .grid-recent { grid-template-columns: 1fr; height: auto; }
}


/* --- AMÉLIORATION DES BOUTONS ET ONGLETS --- */

/* Centrage global du menu de navigation */
.main-nav { 
    background: var(--primary-blue); 
    display: flex; 
    justify-content: center; /* Centre le menu */
    padding: 0 5%; 
}

/* Onglets du header */
.main-nav > ul { 
    display: flex; 
    list-style: none; 
    align-items: center; 
}

.main-nav a { 
    color: white; 
    padding: 20px 25px; 
    text-decoration: none; 
    font-size: 0.9em; 
    font-weight: 600; 
    transition: all 0.3s ease; /* Animation fluide */
    border-bottom: 3px solid transparent; 
}

.main-nav a:hover { 
    background: rgba(255, 255, 255, 0.1); 
    border-bottom: 3px solid #ffcc00; /* Soulignement élégant au survol */
}

/* Boutons (Abonnement & Newsletter) */
.btn-sub, .newsletter button {
    background: #003366;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px; /* Boutons arrondis (pilule) */
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-sub:hover, .newsletter button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
    background: #004a99;
}

/* Centrage du footer */
.site-footer { 
    text-align: center; /* Centre le texte des colonnes */
}

.footer-container { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 40px; 
    text-align: left; /* Garde le texte à gauche pour la lisibilité */
    max-width: 1200px; /* Limite la largeur pour éviter l'étirement */
    margin: 0 auto; 
}

/* Style des liens de catégories */
.category-list li a {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    transition: color 0.2s;
}

.category-list li a:hover { color: #ffcc00; }


/* Bouton "..." (More) */
.more-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 15px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Effet au survol */
.more-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    color: #ffcc00; /* Rappel la couleur de survol de vos autres menus */
}

/* Optionnel : Supprimer le contour bleu par défaut du navigateur */
.more-btn:focus {
    outline: none;
}


/* Style du lien "..." dans la nav */
.more-link {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 8px 15px !important;
    margin: 5px 10px;
    transition: all 0.3s ease;
}

.more-link:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: #fff;
    color: #ffcc00 !important;
}


.categories-wrapper { padding: 50px 5%; }
.categories-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 25px; 
}

.category-card { 
    padding: 30px; 
    text-align: center; 
    border-radius: 15px; 
    background: white; 
    transition: 0.3s;
}

.cat-stats { 
    margin: 20px 0; 
    display: flex; 
    justify-content: center; 
    gap: 20px; 
    color: #666; 
}

.btn-view { 
    display: inline-block; 
    padding: 10px 20px; 
    background: var(--primary-blue); 
    color: white; 
    text-decoration: none; 
    border-radius: 5px; 
}


/* Style du conteneur des icônes */
.social-icons {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Style commun des icônes */
.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%; /* Rend les boutons circulaires */
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

/* Effets de couleur spécifiques par réseau au survol */
.social-icons a:hover {
    color: white;
    transform: translateY(-3px); /* Petit effet de soulèvement */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.social-icons a:nth-child(1):hover { background: #1877f2; } /* Facebook */
.social-icons a:nth-child(2):hover { background: #e1306c; } /* Instagram */
.social-icons a:nth-child(3):hover { background: #ff0000; } /* YouTube */
.social-icons a:nth-child(4):hover { background: #0077b5; } /* LinkedIn */


/* --- SECTION VEDETTE CORRIGÉE (Grille Magazine) --- */
.featured-section {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Le grand fait 2/3, la colonne de droite 1/3 */
    gap: 15px;
    height: 500px; /* Hauteur fixe pour garantir l'aspect magazine */
    padding: 20px 5%;
    margin-bottom: 30px;
}

/* Le grand article */
.main-featured {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

/* La colonne des 4 petits articles */
.side-featured {
    display: grid;
    grid-template-rows: repeat(4, 1fr); /* Divise la hauteur en 4 parts égales */
    gap: 10px;
}

.small-post {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

/* Images remplissant bien l'espace */
.main-featured img, .small-post img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Important : coupe proprement l'image pour éviter les déformations */
    transition: transform 0.4s ease;
}

/* Overlay texte pour lisibilité */
.overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    color: #fff;
}

.main-featured h2 { font-size: 1.8rem; margin: 0; }
.small-post h3 { font-size: 1rem; margin: 0; }

/* Effet zoom au survol */
.main-featured:hover img, .small-post:hover img {
    transform: scale(1.05);
}


/* Conteneur principal de la section vedette */
.featured-section {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 2/3 pour la gauche, 1/3 pour la droite */
    gap: 15px;
    height: 500px; /* Hauteur fixe pour forcer le design magazine */
    padding: 20px 5%;
}

/* Le grand article */
.featured-main {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

/* Colonne de droite (4 petits articles) */
.featured-side {
    display: grid;
    grid-template-rows: repeat(4, 1fr); /* 4 lignes égales */
    gap: 10px;
}

.featured-small {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

/* Force les images à remplir leur bloc sans déformer */
.featured-main img, .featured-small img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* C'est cette ligne qui empêche le débordement */
}

/* Overlay de texte en bas */
.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    color: white;
}

.overlay h2, .overlay h3 { margin: 0; line-height: 1.2; }
.overlay .meta { font-size: 0.75rem; opacity: 0.8; }


/* Conteneur de la section vedette */
.featured-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 2/3 pour la gauche, 1/3 pour la droite */
    gap: 15px;
    height: 500px; /* Force la hauteur totale */
    margin: 20px auto;
    max-width: 1200px;
    padding: 0 20px;
}

/* Bloc principal */
.featured-main {
    position: relative;
    border-radius: 10px;
    overflow: hidden; /* Empêche l'image de dépasser */
}

/* Bloc secondaire (grille 4 lignes) */
.featured-side {
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    gap: 15px;
}

.featured-small {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

/* RÈGLE CRUCIALE POUR LES IMAGES */
.featured-main img, .featured-small img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Recadre l'image proprement sans déformer */
    display: block;
}

/* Overlay pour le texte */
.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
}







/* --- ÉLÉMENTS DU MENU MOBILE (Base) --- */
.mobile-toggle {
    display: none;
    font-size: 1.8rem;
    color: var(--primary-blue);
    cursor: pointer;
    z-index: 2001; /* Toujours visible au-dessus du menu */
    transition: all 0.3s ease;
}

/* Zone sombre d'arrière-plan */
.menu-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.6); z-index: 1998;
    opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease;
}
.menu-overlay.active { opacity: 1; visibility: visible; }

/* --- RESPONSIVITÉ DU HEADER (Tablettes et Mobiles) --- */
@media (max-width: 992px) {
    /* Réorganisation de la barre supérieure */
    .top-bar { padding: 10px 5%; flex-wrap: wrap; position: relative; }
    .social-icons { display: none; } /* Masquage des réseaux pour alléger l'en-tête */
    
    /* Affichage du bouton Hamburger à gauche */
    .mobile-toggle { display: block; order: -1; position: relative; }
    
    /* Ajustement des tailles */
    .logo img { height: 55px; }
    .btn-sub { padding: 8px 15px; font-size: 0.8rem; }

    /* Configuration du Menu Latéral (Tiroir coulissant) */
    .main-nav {
        display: flex !important;
        position: fixed; top: 0; left: 0;
        width: 280px; height: 100vh;
        background: var(--dark-blue); z-index: 1999;
        flex-direction: column; justify-content: flex-start;
        padding: 80px 0 30px 0;
        
        /* État fermé (Hors écran à gauche) */
        transform: translateX(-100%); 
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3); overflow-y: auto;
    }
    
    /* État ouvert (Glisse dans l'écran) */
    .main-nav.active { transform: translateX(0); }
    
    /* Style des liens dans le menu latéral */
    .main-nav > ul { flex-direction: column; width: 100%; align-items: stretch; }
    .main-nav a { text-align: left; padding: 15px 25px; border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important; font-size: 0.95rem; }
    .main-nav a:hover { background: rgba(255, 255, 255, 0.05); }

    /* Intégration verticale des sous-menus */
    .dropdown-menu { position: static; width: 100%; background: rgba(0, 0, 0, 0.2); box-shadow: none; }
    .dropdown-menu li a { padding-left: 40px; font-size: 0.9rem; color: #ccc; }

    /* Ajustement du bouton "More" (...) */
    .more-link { margin: 0; border: none; background: transparent; justify-content: flex-start; }
}