/*
Theme Name: CWAPE Impact
Version: 3.2 (Final - No Conflicts)
*/

/* =========================================================
   1. BASE & LAYOUT GLOBAL
   ========================================================= */
html, body { height: 100%; margin: 0; }

body {
    margin: 0;
    font-family: "Segoe UI", sans-serif;
    background-color: #f2f4f7;
    color: #1d6d86;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Alignement strict sur la ligne rose (1140px) */
.container-2, 
#main-content, 
.frame-1,
main#main-content > .wp-block-group.is-layout-flex {
    max-width: 1140px !important; 
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

main#main-content {
    flex: 1 0 auto; 
    display: block !important; /* Force le bloc à ne pas être une boîte 'flex' qui centre */
    padding-top: 60px !important; /* Un peu d'espace avec le menu pour la "grâce" */
    padding-bottom: 40px;
    text-align: left !important;
}

/* =========================================================
   2. HEADER & NAVIGATION (Définitif)
   ========================================================= */
.navbar-logo-left-2 {
    position: relative !important;
    width: 100%;
    z-index: 1000;
    background-color: #ffffff;
    border-bottom: 1px solid #f2f4f7;
}

.navbar-wrapper-2 {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 1140px !important;
    margin: 0 auto !important;
    padding: 10px 0 !important;
}

.navbar-brand-2 { flex-shrink: 0 !important; width: 140px !important; }
.navbar-brand-2 img { width: 100% !important; height: auto !important; }

/* --- DESKTOP : GESTION DES TITRES LONGS --- */
@media (min-width: 1201px) {
    .menu-button-2 { display: none !important; }
    .nav-menu-wrapper-2 { display: flex !important; flex: 1 !important; justify-content: flex-end !important; }
    .nav-menu-two-2 { display: flex !important; list-style: none !important; margin: 0 !important; padding: 0 !important; flex-wrap: nowrap !important; }
    .nav-menu-two-2 li { margin-left: 10px !important; }
    .nav-menu-two-2 a { 
        white-space: nowrap !important; 
        font-size: 14px !important; 
        color: #1d6d86; 
        text-decoration: none; 
        font-weight: 500; 
        padding: 10px 8px !important; /* On serre un peu pour les titres longs */
    }
    .language-switcher { margin-left: 15px !important; }
}

/* Optimisation spécifique pour écrans moyens (Titres très longs) */
@media (min-width: 1201px) and (max-width: 1400px) {
    .nav-menu-two-2 a { font-size: 13px !important; padding: 8px 5px !important; }
}

/* --- MOBILE & TABLETTE (Menu Hamburger) --- */
@media (max-width: 1200px) {
    .menu-button-2 { 
        display: flex !important; 
        align-items: center; justify-content: center;
        width: 45px; height: 40px;
        background: #f2f4f7 !important;
        border-radius: 4px;
    }
    
    /* ÉTAT FERMÉ : Masqué proprement au chargement */
    .nav-menu-wrapper-2 {
        display: none !important; 
        position: absolute !important;
        top: 100% !important; left: 0 !important; right: 0 !important;
        background-color: #ffffff !important;
        padding: 20px !important;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
        z-index: 999 !important;
        flex-direction: column !important;
        border-top: 1px solid #f2f4f7 !important;
    }

    /* ÉTAT OUVERT (via clic JS) */
    .nav-menu-wrapper-2.w--nav-menu-open { display: flex !important; }

    .nav-menu-two-2 { flex-direction: column !important; width: 100% !important; padding: 0 !important; }
    .nav-menu-two-2 li { margin: 12px 0 !important; text-align: center !important; width: 100% !important; }
    .nav-menu-two-2 a { font-size: 18px !important; color: #1d6d86 !important; padding: 10px !important; }
}

/* =========================================================
   3. SÉLECTEUR DE LANGUE
   ========================================================= */
.language-switcher { position: relative; cursor: pointer; display: flex; align-items: center; }
.lang-current { font-weight: 700; font-size: 14px; color: #1d6d86; text-transform: uppercase; }

.lang-dropdown { 
    display: none !important; 
    list-style: none !important; padding: 10px !important; margin: 0 !important;
    background: #ffffff; border-radius: 4px; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    position: absolute; top: 100%; left: 0; min-width: 60px; z-index: 1001;
}

.language-switcher:hover .lang-dropdown { display: block !important; }

@media (max-width: 1200px) {
    .language-switcher { margin: 20px auto 0 !important; padding-top: 20px; border-top: 1px solid #f2f4f7; width: 100%; justify-content: center; }
    .language-switcher:hover .lang-dropdown { position: static; box-shadow: none; background: #f9f9f9; margin-top: 10px; }
}

/* =========================================================
   4. TYPOGRAPHIE & ACCORDÉONS
   ========================================================= */
h1.wp-block-heading { font-size: 58px !important; font-weight: 800; color: #1d6d86 !important; line-height: 1.1; }
h3.wp-block-heading { font-size: 38px !important; font-weight: 600; color: #1d6d86 !important; line-height: 1.2; text-align: left !important; }

#main-content p, #main-content ul li { font-size: 16px !important; color: #4b8da0 !important; line-height: 1.6 !important; text-align: left !important; }
#main-content ul li { margin-bottom: 8px !important; }

/* Grille de la Homepage - Alignée vers le haut */
main#main-content > .wp-block-group.is-layout-flex {
    display: grid !important;
    grid-template-columns: 1.2fr 1fr !important;
    gap: 60px !important;
    align-items: start !important; /* Aligne le haut du texte avec le haut de l'image */
    align-content: start !important; /* Aligne la grille entière vers le haut du conteneur */
}

/* Image Style */
.wp-block-image img { width: 100% !important; height: auto !important; border-radius: 40px !important; box-shadow: 20px 20px 0px 0px #f38b00 !important; }

/* Fix Accordéon */
.accordion-item, .wp-block-accordion-item { overflow: hidden !important; width: 100% !important; border-bottom: 1px solid #e0e0e0; }
.accordion-panel { padding-right: 40px !important; box-sizing: border-box !important; }

/* =========================================================
   5. BOUTONS & FOOTER
   ========================================================= */
.wp-block-button__link { background-color: #f38b00 !important; color: #ffffff !important; border-radius: 50px !important; padding: 18px 35px !important; font-weight: 700; font-size: 18px !important; display: inline-block !important; }
.footer { background-color: #1d6d86 !important; padding: 30px 0 !important; width: 100% !important; }
.footer .frame-1 { display: flex !important; justify-content: space-between !important; align-items: center !important; }
.footer p, .footer a { color: #ffffff !important; font-size: 14px !important; }

/* =========================================================
   6. IMPRESSION PDF
   ========================================================= */
@media print {
    header, nav, footer, .navbar-logo-left-2, .btn-container { display: none !important; }
    @page { size: landscape; margin: 0.5cm; }
    body, html { min-width: 1024px !important; background: white !important; }
    .force-full-width { position: static !important; width: 100% !important; }
    iframe { width: 1100px !important; height: 750px !important; border: none !important; }
}

/* --- PASSAGE EN UNE COLONNE (Mobile & Tablette) --- */
@media (max-width: 991px) {
    /* 1. On casse la grille pour empiler les éléments */
    main#main-content > .wp-block-group.is-layout-flex { 
        display: flex !important;
        flex-direction: column !important; /* Force l'empilement vertical */
        flex-wrap: wrap !important;
        gap: 30px !important; 
        padding: 0 20px !important;
    }

    /* 2. On remet l'image dans le flux normal (au-dessus ou en dessous du titre) */
    main#main-content > .wp-block-group.is-layout-flex > .wp-block-group {
        width: 100% !important;
        max-width: 100% !important;
        flex-basis: auto !important;
    }

    /* 3. On centre l'image sur mobile pour faire joli */
    .wp-block-image {
        text-align: center !important;
        margin: 20px 0 !important;
    }

    .wp-block-image img {
        max-width: 80% !important; /* L'image ne prend pas tout l'écran pour rester élégante */
        margin: 0 auto !important;
        box-shadow: 15px 15px 0px 0px #f38b00 !important; /* Ombre un peu plus petite sur mobile */
    }

    /* 4. On s'assure que les titres ne sont pas trop énormes */
    h1.wp-block-heading { font-size: 38px !important; }
    h3.wp-block-heading { font-size: 24px !important; }
}