@import url('https://fonts.googleapis.com/css2?family=Marianne:wght@400;700&family=Spectral:wght@400;700&display=swap');

html {
    font-family: 'Spectral', serif;
}

h1,
h2,
h3,
.nav,
.menu,
.btn {
    font-family: 'Marianne', sans-serif;
}

:root {
    --primary-green: #008751;
    --primary-yellow: #fcd116;
    --primary-red: #e8112d;
    --light-gray: #f5f5f5;
    --dark-gray: #333333;
    --divider-color: #e0e0e0;
    --light-yellow: #fef9e6;
    --gray-hover: #cccccc; 
    --light-shadow: rgba(0, 0, 0, 0.1);
    --text-color: #333; 
    --dark-gray: #333;
    --light-gray: #6c757d;
    --gray-hover: #cccccc;
    --light-shadow: rgba(0, 0, 0, 0.1);
    --light-gray: #f5f5f5;
    --dark-text: #333;
}

body {
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #fff;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/* Header principal */
.main-header {
            background-color: #fff;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            padding: 10px 0;
            position: relative;
            z-index: 1000;
        }

        /* Grille du header corrigée */
        .header-grid {
            display: grid;
            grid-template-columns: 1fr auto 300px;
            align-items: center;
            gap: 20px;
            height: 120px;
            width: 100%;
        }

        /* Container de l'image */
        .logo-image-container {
            display: flex;
            align-items: center;
            height: 100%;
            overflow: hidden;
            min-width: 0; /* Important pour éviter l'overflow */
        }

        /* Image composite du header */
        .header-composite-image {
            height: 100px;
            width: auto;
            max-width: 100%;
            object-fit: contain;
            object-position: left center;
            transition: transform 0.3s ease;
        }

        .header-composite-image:hover {
            transform: scale(1.02);
        }

        /* Séparateur vertical */
        .divider {
            width: 2px;
            height: 80px;
            background: linear-gradient(to bottom, 
                transparent 0%,
                var(--primary-yellow) 20%,
                var(--primary-yellow) 80%,
                transparent 100%
            );
            flex-shrink: 0;
        }

        /* Colonne de recherche corrigée */
        .search-column {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            height: 100%;
            min-width: 300px; /* Assure une largeur minimale */
        }

        /* Formulaire de recherche corrigé */
        .search-form1 {
            display: flex;
            width: 100%;
            max-width: 280px;
            min-width: 200px;
            border-radius: 25px;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            background-color: #fff;
            border: 1px solid #e0e0e0; /* Ajout d'une bordure pour la visibilité */
        }

        .search-input1 {
            flex: 1;
            padding: 12px 20px;
            border: none;
            outline: none;
            font-size: 14px;
            background-color: #fff; /* Couleur de fond explicite */
            color: var(--dark-gray);
            min-width: 0;
        }

        .search-input1::placeholder {
            color: #999;
        }

        .search-btn1 {
            padding: 12px 20px;
            background-color: var(--primary-yellow);
            color: var(--dark-gray);
            border: none;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            min-width: 50px;
        }

        .search-btn1:hover {
            background-color: #e8b800;
            transform: translateY(-1px);
        }

        .search-btn1 i {
            font-size: 16px;
        }

        /* Responsive Design amélioré */
        @media (max-width: 992px) {
            .header-grid {
                grid-template-columns: 1fr;
                gap: 15px;
                height: auto;
                padding: 15px 0;
            }
            
            .logo-image-container {
                justify-content: center;
                order: 1;
            }
            
            .header-composite-image {
                height: 80px;
            }
            
            .divider {
                display: none;
            }
            
            .search-column {
                justify-content: center;
                order: 2;
                min-width: auto;
            }
            
            .search-form1 {
                max-width: 100%;
                width: 300px;
            }
        }

        @media (max-width: 768px) {
            .main-header {
                padding: 8px 0;
            }
            
            .header-grid {
                gap: 10px;
            }
            
            .header-composite-image {
                height: 70px;
                max-width: 90%;
            }
            
            .search-form1 {
                width: 280px;
            }
            
            .search-input1,
            .search-btn1 {
                padding: 10px 15px;
                font-size: 13px;
            }
        }

        @media (max-width: 576px) {
            .header-composite-image {
                height: 60px;
                max-width: 95%;
            }
            
            .search-form1 {
                width: 100%;
                max-width: 250px;
            }
            
            .search-input1 {
                padding: 8px 12px;
                font-size: 12px;
            }
            
            .search-btn1 {
                padding: 8px 12px;
            }
            
            .search-btn1 i {
                font-size: 14px;
            }
        }

        /* Animation d'apparition */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .main-header {
            animation: fadeInUp 0.6s ease-out;
        }

        /* Focus states pour l'accessibilité */
        .search-input1:focus {
            box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.3);
        }

        .search-btn1:focus {
            outline: 2px solid var(--primary-yellow);
            outline-offset: 2px;
        }

.main-header .search-container {
    position: relative;
    width: 100%;
    margin: 0;
}

.main-header .search-input-group {
    border-radius: 20px;
    height: 40px;
}

.main-header .search-input {
    padding: 10px 15px;
    font-size: 14px;
}

.main-header .search-button {
    padding: 10px 15px;
    width: 40px;
}

.main-header .search-suggestions {
    top: 45px;
    left: 0;
    right: 0;
}

/* Adaptation pour mobile */
@media (max-width: 768px) {
    .main-header .search-column {
        order: 3;
        width: 100%;
        margin-top: 10px;
    }
}




/*navbar*/
.navbar {
    position: sticky;
    top: 0;
    background: white;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
}

.navbar.scrolled {
    background: white !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar.scrolled .nav-link,
.navbar.scrolled .navbar-brand,
.navbar.scrolled .dropdown-toggle {
    color: #333 !important;
}

.navbar.scrolled .fa-search {
    color: #333 !important;
}

.navbar-nav {
    gap: 15px;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: var(--dark-gray) !important;
    padding: 8px 15px !important;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-link:hover {
    color: var(--primary-green) !important;
    /* Couleur au survol */
    background-color: transparent !important;
}


/* Style des dropdown */
.dropdown-toggle::after {
    margin-left: 5px;
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
    vertical-align: middle;
}

.dropdown-toggle::after {
    display: none !important;
}

.dropdown-menu {
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    margin-top: 8px !important;
    z-index: 1050 !important; /* S'assurer que les dropdowns sont au-dessus de tout */
    /* Supprimer display: none pour laisser Bootstrap gérer l'affichage */
}

/* Afficher quand la classe 'show' est présente */
.dropdown-menu.show {
    display: block !important;
    position: absolute;
    z-index: 1060;
    min-width: 200px;
}

.dropdown-item {
    padding: 8px 16px;
    color: var(--dark-gray);
    transition: all 0.2s;
}

.dropdown-item:hover {
    background-color: #f8f8f8;
    color: var(--primary-green);
}

/* Toggler pour mobile */
.navbar-toggler {
    border: none;
    padding: 8px 10px;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 0, 0, 0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    border-radius: 0 6px 6px 6px;
}

/* Supprimer le hover automatique pour laisser Bootstrap gérer */
/* .dropdown-submenu:hover .dropdown-menu {
    display: block;
} */

@media (max-width: 767px) {
    .dropdown-submenu .dropdown-menu {
        position: static !important;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: #f8f9fa;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
}

/* Responsive */
@media (max-width: 992px) {
    .navbar-nav {
        gap: 5px;
        padding-top: 15px;
    }

    .nav-link {
        padding: 10px !important;
    }

    .dropdown-menu {
        margin-left: 15px;
        width: calc(100% - 30px);
    }
}
        .breadcrumb {
            padding: 0.5rem 0;
        }
        
        .breadcrumb-item a {
            color: #fcd116;
            text-decoration: none;
        }
        
        .breadcrumb-item a:hover {
            text-decoration: underline;
        }

/*footer*/
.back-to-top {
    text-align: right;
    padding: 15px 0;
    border-bottom: 1px solid var(--divider-color);
}

.back-to-top a {
    color: var(--primary-green);
    font-size: 14px;
    position: relative;
    display: inline-block;
    font-weight: 600;
    text-decoration: none; 
}

.back-to-top a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    height: 2px;
    width: 0; 
    background-color: var(--primary-green);
    border-radius: 2px;
    transition: width 0.3s ease-in-out; 
}

.back-to-top a:hover::after {
    width: 100%;
}


.social-section {
    background-color: var(--light-yellow);
    padding: 20px 0;
    border-bottom: 1px solid var(--divider-color);
}

.social-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 0;
}

.social-icons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    align-items: center;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    color: white;
    font-size: 18px;
    transition: transform 0.2s;
}

.social-icons a:hover {
    transform: scale(1.1);
}

.social-facebook { background-color: #1877f2; }
.social-twitter { background-color: #000; }
.social-youtube { background-color: var(--primary-red); }

.main-footer {
    background-color: white;
    /* Reduced padding for a more compact top section */
    padding: 15px 0;
    border-bottom: 1px solid var(--primary-green); /* Slightly thinner border */
}

/* New style to organize elements in a column */
.logo-column-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

.logo {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.ministry-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ministry-name {
    font-size: 10px; /* Taille très petite */
    font-weight: 600;
    color: var(--dark-gray);
    margin: 0;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ministry-values {
    font-style: italic;
    color: #666;
    font-size: 12px;
    line-height: 1.2;
    margin: 0;
}
@media (max-width: 768px) {
    .logo-column-group {
        align-items: center;
        text-align: center;
    }
    
    .ministry-name {
        font-size: 9px;
    }
    
    .ministry-values {
        font-size: 11px;
    }
}

.footer-links {
    display: flex;
    /* Reduced gap between external links */
    gap: 15px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap; /* Allow links to wrap on smaller screens */
}

.footer-links a {
    color: var(--dark-gray);
    text-decoration: none;
    font-size: 12px; /* Smaller font size for links */
    font-weight: 500;
    /* Add some padding for better clickability on smaller screens if they wrap */
    padding: 2px 0;
}

.footer-links a:hover {
    color: var(--primary-green);
    text-decoration: underline;
}

.footer-legal {
    /* Reduced padding for the legal section */
    padding: 10px 0;
    border-top: 1px solid var(--divider-color);
}

.legal-links {
    display: flex;
    gap: 0;
    margin-bottom: 5px; /* Reduced margin below legal links */
    align-items: center;
    flex-wrap: wrap;
    justify-content: center; /* Center legal links by default */
}

.legal-links a {
    color: #666;
    text-decoration: none;
    font-size: 11px; /* Even smaller font size for legal links */
    padding: 0 8px; /* Reduced padding */
    border-right: 1px solid var(--divider-color);
    line-height: 1;
}

.legal-links a:last-child {
    border-right: none;
}

.legal-links a:hover {
    color: var(--primary-green);
    text-decoration: underline;
}

.legal-text {
    font-size: 11px; /* Smaller font size for copyright text */
    color: #666;
    margin: 0;
    text-align: center; /* Center copyright text */
}

.legal-text a {
    color: var(--primary-green);
    text-decoration: none;
}

.legal-text a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .social-icons {
        justify-content: center;
        margin-top: 10px; /* Reduced margin */
    }

    .footer-links {
        flex-direction: column;
        gap: 10px; /* Reduced gap */
        text-align: center;
        margin-top: 15px; /* Reduced margin */
    }

    .legal-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px 0; /* Reduced gap */
    }

    .legal-links a {
        border-right: none;
        border-bottom: 1px solid var(--divider-color);
        padding-bottom: 5px; /* Reduced padding */
        width: 100%;
        text-align: center;
    }

    .legal-links a:last-child {
        border-bottom: none;
    }
}
/* Corrections pour éliminer les espaces indésirables sur mobile */

.image-cover {
    height: 350px;
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Effet de superposition pour le texte */
.image-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 100%);
}

.grayscale {
    filter: grayscale(100%);
}

/* Style pour l'image du logo - 90% du cercle */
.logo-image {
    width: 90%;
    height: 90%;
    object-fit: contain;
    object-position: center;
}

/* Section EMA - suppression des espaces */
.ema-section-logo {
    margin: 0 !important;
    padding: 0 !important;
    /* Force l'élément à coller au précédent */
    margin-top: 0 !important;
    border-top: none !important;
}

.ema-section-logo .d-flex {
    margin: 0 !important;
    padding: 0 !important;
}

.ema-section-logo [class*="col-"] {
    padding: 0 !important;
    margin: 0 !important;
}

/* Section armée avec suppression des espaces */
.army-section {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--light-yellow);
    margin: 0 !important;
    padding: 50px 20px;
    position: relative;
    z-index: 1;
}

.army-container {
    max-width: 1200px;
    margin: 0 auto;
}

.army-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    padding: 20px 0;
    align-items: stretch;
    position: relative;
}

/* Icônes légèrement plus petites */
.army-icon-container {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
}

.army-icon {
    width: 50px;
    height: 50px;
}

.army-service-title {
    font-size: 22px;
    margin-bottom: 12px;
}

/* Corrections spécifiques mobile */
@media (max-width: 768px) {
    /* Suppression de l'espace entre header et section EMA */
    header, 
    .header,
    nav,
    .navbar {
        margin-bottom: 0 !important;
    }
    
    /* Force la section EMA à coller au header */
    .ema-section-logo {
        margin: 0 !important;
        padding: 0 !important;
        margin-top: 0 !important;
        position: relative;
        top: 0 !important;
    }
    
    /* Force la section army à coller */
    .army-section {
        padding: 30px 15px 40px !important;
        margin: 0 !important;
        margin-top: 0 !important;
        position: relative;
        z-index: 2;
    }
    
    /* Corrections pour Bootstrap containers */
    body {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Force tous les éléments avant la section EMA à ne pas avoir de margin-bottom */
    * + .ema-section-logo {
        margin-top: 0 !important;
    }
    
    /* Correction pour les éléments qui précèdent directement */
    .ema-section-logo {
        border-top: none !important;
        padding-top: 0 !important;
    }
    
    .army-services-grid {
        gap: 30px;
        padding: 10px 0;
    }
    
    /* Ajustement des colonnes Bootstrap sur mobile */
    .ema-section-logo .col-12 {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .ema-section-logo .col-md-4,
    .ema-section-logo .col-md-8,
    .ema-section-logo .col-md-6 {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Réduction de la hauteur sur mobile pour économiser l'espace */
    .image-cover {
        height: 250px;
    }
    
    /* Ajustement du texte sur mobile */
    .ema-section-logo .display-5 {
        font-size: 1.8rem !important;
        line-height: 1.2;
    }
    
    .ema-section-logo .ps-5 {
        padding-left: 1rem !important;
    }
}

/* Corrections pour très petits écrans */
@media (max-width: 480px) {
    .image-cover {
        height: 200px;
    }
    
    .army-section {
        padding: 20px 10px 30px !important;
    }
    
    .ema-section-logo .display-5 {
        font-size: 1.5rem !important;
    }
    
    .army-services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Correction globale pour éviter les espaces par défaut */
.ema-section-logo + .army-section {
    margin-top: 0 !important;
}

/* Assure que Bootstrap ne crée pas d'espaces indésirables */
.container-fluid,
.row,
[class*="col-"] {
    margin: 0;
}

.ema-section-logo .row {
    margin: 0 !important;
}

.ema-section-logo .d-flex {
    margin: 0 !important;
}