/* =========================================
   1. CHARTE GRAPHIQUE & BASE
   ========================================= */
:root {
    --bg-body: #FFFBF2;       /* Beige Crème */
    --bg-sidebar: #1A4D2E;    /* Vert Forêt */
    --accent-color: #FFC107;  /* Jaune Or */
    --text-main: #263238;     
    --white: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    color: var(--bg-sidebar);
    font-weight: 700;
}

/* =========================================
   2. SIDEBAR (Colonne Gauche)
   ========================================= */
.app-container { display: flex; min-height: 100vh; }

.sidebar {
    background-color: var(--bg-sidebar);
    
    /* 1. LA MATIÈRE : Dégradé diagonal doux pour l'effet glacé/brillant */
    /* La lumière vient d'en haut à gauche (plus clair) vers le bas à droite (plus sombre) */
    background: linear-gradient(135deg, #2a6640 0%, #1A4D2E 50%, #123821 100%);
    
    width: 280px;
    height: 100vh;
    position: fixed; /* Le bandeau reste fixe */
    left: 0; top: 0;
    
    display: flex; 
    flex-direction: column;
    padding: 20px;
    padding-bottom: 100px; /* Sécurité pour que le bas ne soit pas coupé sur mobile */
    overflow-y: auto;      /* Permet de scroller DANS le menu si l'écran est minuscule */
    
    color: white;
    z-index: 100;
    
    /* 2. LA FORME : On enlève le gros arrondi du haut. */
    /* Juste un micro-arrondi sur le bord droit pour adoucir la coupe, très léger (4px) */
    border-radius: 0 4px 4px 0; 
    
    /* 3. LE BOMBÉ 3D (Effet Faïence sur les 4 faces) */
    box-shadow: 
        /* Lumière interne (Biseautage blanc doux en haut et à gauche) */
        inset 4px 4px 10px rgba(255, 255, 255, 0.25),
        
        /* Ombre interne (Biseautage sombre en bas et à droite) */
        inset -4px -4px 10px rgba(0, 0, 0, 0.4),
        
        /* Ombre portée externe (pour décoller la brique du fond de page) */
        10px 0 20px rgba(0, 0, 0, 0.25);
        
    /* Petit contour très fin pour la netteté */
    border-right: 1px solid rgba(0,0,0,0.1);
    /* Cache la barre pour Firefox */
    scrollbar-width: none; 
    -ms-overflow-style: none; 
    
}
/* Cache la barre pour Chrome, Safari et le téléphone */
.sidebar::-webkit-scrollbar {
    display: none;
}


/* LOGO */
.logo-container { text-align: center; }
.sidebar-logo {
    width: 70%; max-width: 130px; height: auto;
    display: block; margin: 10px auto 20px auto;
    border-radius: 8px; 
}

/* NAVIGATION */
.main-nav { flex-grow: 1; display: flex; flex-direction: column; gap: 8px; }

.nav-link {
    text-decoration: none; color: var(--white);
    padding: 12px 15px; border-radius: 8px;
    font-weight: 600; font-size: 0.95em;
    transition: all 0.3s ease; border-left: 4px solid transparent;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(255, 202, 40, 0.2);
    border-left-color: var(--accent-color);
    padding-left: 20px; color: var(--accent-color);
}

.shop-link { margin-top: 20px; border: 1px solid var(--accent-color); }

/* BOUTON DON & INFO FISCALE (MODIFIÉ) */
.donate-container { text-align: center; margin-top: 20px; margin-bottom: 20px; }
.btn-donate {
    display: block; background-color: var(--accent-color);
    color: var(--bg-sidebar); padding: 12px; border-radius: 30px;
    font-weight: 800; text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2); transition: transform 0.2s;
}
.btn-donate:hover { transform: scale(1.05); background-color: #ffd54f; }

/* C'est ICI qu'on gère le texte "Défiscalisable" pour qu'il flashe */
.tax-info { 
    font-size: 1.1em;       /* Plus gros */
    margin-top: 10px; 
    color: #ffffff;         /* Blanc pur */
    font-weight: 800;       /* Très gras */
    /* Effet de halo lumineux blanc autour du texte */
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8); 
}

/* Bouton ADHÉRER (Style contour) */
.btn-adhere {
    display: block; 
    background-color: transparent; /* Fond transparent */
    border: 2px solid var(--accent-color); /* Bordure Jaune */
    color: var(--white); /* Texte blanc */
    padding: 10px; 
    border-radius: 30px;
    font-weight: 700; 
    text-decoration: none;
    text-align: center;
    margin-top: 10px; /* Espace avec le bouton Don */
    transition: all 0.2s;
    cursor: pointer;
    font-size: 0.9em;
}

.btn-adhere:hover { 
    background-color: rgba(255, 193, 7, 0.2); /* Légère couleur au survol */
    transform: scale(1.05); 
}

/* Style spécifique pour la fenêtre de choix (Modal) */
.modal-choice-grid {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}
.choice-card {
    flex: 1;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}
.choice-card:hover {
    transform: translateY(-3px);
    border-color: var(--bg-sidebar);
    background: #e8f5e9;
}

/* =========================================
   3. CONTENU PRINCIPAL & HERO
   ========================================= */
.content-area { margin-left: 280px; flex-grow: 1; width: calc(100% - 280px); }
.content-section { padding: 40px; }
.bg-white { background-color: white; }

.hero-section {
    position: relative; height: 220px; min-height: 220px;
    background: linear-gradient(rgba(0, 77, 64, 0.7), rgba(0, 77, 64, 0.5)), url('images/photo-madagascar.jpg');
    background-size: cover; background-position: center 40%;
    display: flex; align-items: center; justify-content: center; 
    color: var(--white); box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    margin-bottom: 40px;
}

.hero-overlay { text-align: center; padding: 0 20px; }
.hero-overlay h1 { font-size: 1.8em; margin-bottom: 5px; color: white; text-shadow: 2px 2px 4px rgba(0,0,0,0.6); }
.hero-overlay p { font-size: 1.1em; opacity: 0.9; }

.flags-container { position: absolute; top: 15px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 20; }
.flag-pill { width: 70px; height: 45px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.5); position: relative; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.mada-pill { background: linear-gradient(90deg, #FFFFFF 30%, transparent 30%), linear-gradient(180deg, #EF4135 50%, #007E3A 50%); }
.france-pill { background: linear-gradient(90deg, #0055A4 33.3%, #FFFFFF 33.3%, #FFFFFF 66.6%, #EF4135 66.6%); }

/* =========================================
   4. PAGE ACCUEIL (CARTES)
   ========================================= */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.card {
    background: var(--white); padding: 25px; border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); border-top: 4px solid var(--bg-sidebar);
    text-align: center; transition: transform 0.3s ease;
}
.card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0, 77, 64, 0.25); }
.card-icon { font-size: 2.5em; margin-bottom: 15px; }

/* =========================================
   5. PAGE ÉQUIPE (LE CADRE POLAROID)
   ========================================= */
.founders-container { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; justify-content: center; }
.founders-text { flex: 1; min-width: 300px; }

/* C'est ICI que la magie du cadre opère */
.photo-wrapper { flex: 0 0 auto; text-align: center; }

.photo-cadre {
    background: white; 
    padding: 15px;               /* Espace blanc autour de la photo */
    display: inline-block;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transform: rotate(-3deg);    /* Rotation initiale */
    transition: all 0.4s ease; 
    border-radius: 4px;
    border: 4px solid transparent; /* Prépare la bordure pour le survol */
    max-width: 350px;
}

.photo-cadre img { width: 100%; height: auto; display: block; }

/* Au survol : on redresse et on met la bordure ORANGE */
.photo-cadre:hover { 
    transform: rotate(0deg) scale(1.03); 
    box-shadow: 0 15px 35px rgba(0,0,0,0.3); 
    border-color: var(--accent-color); /* Bordure orange/jaune */
}

.photo-caption { margin-top: 10px; font-weight: bold; color: var(--bg-sidebar); font-family: 'Montserrat'; }

.dual-structure-grid { display: flex; justify-content: center; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 30px; }
.structure-card { background: white; padding: 20px; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); flex: 1; min-width: 250px; text-align: center; }
.connector-icon { font-size: 2em; }
.btn-text-link { color: var(--bg-sidebar); font-weight: bold; text-decoration: none; border-bottom: 2px solid var(--accent-color); }

/* =========================================
   6. PAGE BOUTIQUE
   ========================================= */
.impact-box { background-color: #E8F5E9; border: 2px solid #4CAF50; border-radius: 12px; padding: 30px; margin-bottom: 40px; }
.impact-list { list-style: none; margin-top: 15px; }
.impact-list li { margin-bottom: 10px; }
.price-tag { background-color: var(--bg-sidebar); color: white; padding: 5px 15px; border-radius: 20px; display: inline-block; margin: 10px 0; font-weight: bold; }
.btn-action { display: inline-block; background-color: var(--accent-color); color: var(--bg-sidebar); padding: 10px 20px; border-radius: 5px; text-decoration: none; font-weight: bold; margin-top: 15px; }
.btn-secondary { background-color: #ddd; color: #333; border: none; cursor: pointer; padding: 10px 20px; border-radius: 5px; }
.btn-outline { background: transparent; border: 2px solid var(--accent-color); color: var(--text-main); }

/* =========================================
   8. SECTION PARTENAIRES
   ========================================= */
.partner-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 25px;
    width: 250px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.partner-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border-color: var(--bg-sidebar);
}

.partner-logo {
    font-size: 3em;
    margin-bottom: 15px;
    background: #f5f5f5;
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
    color: var(--bg-sidebar);
    font-weight: bold;
}

.partner-card h3 {
    margin-bottom: 5px;
    font-size: 1.1em;
    color: var(--bg-sidebar);
}

.partner-tag {
    display: inline-block;
    background-color: #E8F5E9;
    color: #1A4D2E;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: bold;
    margin-top: 15px;
}


/* =========================================
   7. MOBILE - VERSION FLEXIBLE (La plus sûre)
   ========================================= */
.mobile-header { display: none; }

@media (max-width: 768px) {

    /* 1. ON CACHE LES ÉLÉMENTS GÊNANTS */
    .hero-section .flags-container { display: none !important; }

    /* 2. LE BANDEAU DU HAUT (Header) */
    .mobile-header { 
        display: flex; justify-content: space-between; align-items: center; 
        padding: 5px 15px; background-color: var(--bg-sidebar); 
        color: white; position: sticky; top: 0; z-index: 2000; 
        box-shadow: 0 4px 10px rgba(0,0,0,0.3); height: 80px; 
    }
    .mobile-logo { height: 60px !important; width: auto; border-radius: 6px; background: white; padding: 2px; }
    .mh-left { display: flex; align-items: center; gap: 10px; }
    .brand-name { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1.1rem; text-transform: uppercase; }
    .mh-right { display: flex; align-items: center; gap: 15px; }
    .mobile-flags { display: flex; flex-direction: column; gap: 4px; }
    .mini-flag { width: 30px; height: 20px; border: 1px solid white; border-radius: 3px; }
    .menu-toggle { background: none; border: none; color: white; font-size: 2.5em; cursor: pointer; padding: 0; width: 40px; }

    /* 3. LE MENU VERT (LA STRUCTURE) */
    .sidebar { 
        position: fixed !important;
        top: 80px !important; 
        left: 0; 
        width: 100% !important;
        height: calc(100vh - 80px) !important;
        background-color: #1A4D2E !important; 
        z-index: 1500; 
        transform: translateX(-100%); 
        transition: transform 0.3s ease-in-out;
        
        /* C'EST ICI LE CHANGEMENT : FLEXBOX CLASSIQUE */
        display: flex !important;
        flex-direction: row; /* On aligne horizontalement */
        flex-wrap: wrap;     /* On autorise le retour à la ligne */
        align-content: flex-start; /* On colle tout en haut */
        padding: 15px;
        box-sizing: border-box; /* Empêche de dépasser de l'écran */
    }
    
    .sidebar.active { transform: translateX(0) !important; }

    /* --- 4. LES ÉLÉMENTS --- */

    /* A. Le Logo (40% de largeur) */
    .sidebar .logo-container {
        display: block !important;
        width: 40%; 
        margin: 0; padding: 0;
        text-align: left;
    }
    .sidebar .sidebar-logo {
        width: 100%; max-width: 90px;
        margin: 0; 
        border-radius: 6px;
    }

    /* B. Le Bouton Don (60% de largeur) */
    .sidebar .donate-container {
        display: block !important;
        width: 60%; 
        margin: 0; padding: 0; padding-left: 10px; /* Un peu d'espace */
        text-align: right;
    }

    .btn-donate {
        background-color: #FFC107 !important;
        color: #1A4D2E !important;
        font-weight: 800; font-size: 0.8rem; text-transform: uppercase;
        width: 100%; /* Prend toute la place dispo */
        padding: 12px 5px;
        border-radius: 8px;
        display: inline-block;
        border: 2px solid white;
        text-align: center;
    }
    .tax-info { color: #FFC107 !important; font-size: 0.65rem !important; margin-bottom: 3px; display: block; text-align: right; }

    /* C. Le Menu (Passe à la ligne tout seul) */
    .sidebar .main-nav {
        width: 100%; /* Prend toute la largeur */
        margin-top: 30px; 
        padding-top: 20px;
        border-top: 1px solid rgba(255,255,255,0.2);
        display: flex; flex-direction: column; gap: 10px;
    }
    
    .nav-link { padding: 10px; border-radius: 4px; }

    /* 5. RESTE DU SITE */
    .hero-section { background-image: none !important; background-color: #1A4D2E !important; height: auto !important; padding: 40px 20px !important; }
    .hero-overlay h1, .hero-overlay h2, .hero-overlay p { color: white !important; text-shadow: none !important; }
    .content-area { margin-left: 0; width: 100%; }
    .founders-container, .dual-structure-grid { flex-direction: column; }
    .connector-icon { transform: rotate(90deg); margin: 10px 0; }
}