/* =========================================
   STYLE.CSS - FONDATION MITONWÈ (ULTIMATE PREMIUM)
   ========================================= */

:root {
    /* --- COULEURS --- */
    --primary: #6A0DAD;       /* Violet Marque */
    --primary-dark: #4b0082;  /* Violet Profond */
    --secondary: #0f172a;     /* Noir/Bleu Nuit (Textes forts) */
    --accent: #FFD700;        /* Or (Badges & Détails) */
    --text-body: #334155;     /* Gris Lecture */
    --text-light: #64748b;    /* Gris Clair */
    --white: #ffffff;
    
    /* --- FONDS --- */
    --bg-body: #ffffff;
    --bg-light: #f8fafc;
    --bg-dark: #0f172a;
    
    /* --- EFFETS --- */
    --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1);
    --shadow-hover: 0 25px 50px -12px rgba(106, 13, 173, 0.25);
    --radius: 12px;
    
    /* --- POLICES --- */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
    --max-width: 1280px;
}

/* --- RESET --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--text-body); background: var(--bg-body); line-height: 1.7; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* --- TYPOGRAPHIE --- */
h1, h2, h3, h4, h5 { font-family: var(--font-heading); color: var(--secondary); font-weight: 700; line-height: 1.2; margin-bottom: 1rem; }

.display-1 { 
    font-size: clamp(2.5rem, 5vw, 4.5rem); 
    text-transform: uppercase; 
    letter-spacing: -1px; 
    color: var(--white); 
    text-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.section-header { text-align: center; max-width: 800px; margin: 0 auto 60px; }
.section-title { font-size: 2.5rem; position: relative; display: inline-block; }
.section-title::after { content:''; display:block; width:60px; height:4px; background:var(--primary); margin:15px auto 0; }

.subtitle { color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: 2px; font-size: 0.85rem; display: block; margin-bottom: 10px; }
.lead { font-size: 1.2rem; color: var(--text-light); font-weight: 300; }
.text-violet { color: var(--primary) !important; }

/* --- LAYOUT --- */
.container { width: 90%; max-width: var(--max-width); margin: 0 auto; padding: 0 15px; }
.section { padding: 100px 0; position: relative; }
.bg-light { background-color: var(--bg-light); }
.bg-dark { background-color: var(--bg-dark); color: white; }
.bg-dark h2, .bg-dark h3, .bg-dark p { color: white; }
.bg-primary { background-color: var(--primary); color: white; }
.bg-primary h2, .bg-primary p { color: white; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 60px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 30px; }

/* --- COMPONENTS --- */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 15px 35px; border-radius: 50px; font-weight: 700; text-transform: uppercase; transition: 0.3s; border: none; cursor: pointer; letter-spacing: 1px; font-size: 0.85rem; }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 10px 20px rgba(106,13,173,0.3); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-3px); }
.btn-white { background: white; color: var(--primary); box-shadow: var(--shadow-sm); }
.btn-white:hover { background: #f0f0f0; transform: translateY(-3px); }
.btn-outline { border: 2px solid white; color: white; background: transparent; }
.btn-outline:hover { background: white; color: var(--secondary); }

.btn-donate { padding: 12px 25px; background: var(--primary); color: white !important; border-radius: 50px; box-shadow: 0 5px 15px rgba(106,13,173,0.2); }
.btn-donate:hover { background: var(--secondary); transform: translateY(-2px); }

/* --- NAVBAR --- */
.navbar { position: fixed; top: 0; width: 100%; z-index: 1000; padding: 15px 0; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(0,0,0,0.05); transition: 0.3s; }
.navbar.scrolled { box-shadow: var(--shadow-sm); padding: 10px 0; }
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.5rem; color: var(--secondary); letter-spacing: -1px; }
.logo img { height: 50px; }
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-link { font-weight: 600; text-transform: uppercase; font-size: 0.85rem; color: var(--secondary); position: relative; }
.nav-link::after { content:''; position:absolute; bottom:-5px; left:0; width:0; height:2px; background:var(--primary); transition:0.3s; }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.burger { display: none; font-size: 1.5rem; cursor: pointer; }

/* --- HERO --- */
.hero { height: 85vh; min-height: 600px; display: flex; align-items: center; justify-content: center; text-align: center; color: white; position: relative; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; z-index: -1; transition: transform 10s; }
.hero.zoom .hero-bg { transform: scale(1.1); }
.overlay-dark { background-color: rgba(0,0,0,0.5); }
.hero-content { z-index: 2; max-width: 900px; padding: 20px; }
.badge { display: inline-block; padding: 8px 20px; background: rgba(255,255,255,0.15); backdrop-filter: blur(5px); border: 1px solid rgba(255,255,255,0.3); border-radius: 30px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; margin-bottom: 25px; }

/* --- CARDS & BLOCS --- */
.card { background: white; padding: 40px; border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: 0.4s; border: 1px solid rgba(0,0,0,0.03); position: relative; overflow: hidden; height: 100%; }
.card:hover { transform: translateY(-10px); box-shadow: var(--shadow-hover); border-bottom: 4px solid var(--primary); }
.icon-box { width: 70px; height: 70px; background: #f3e8ff; color: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; margin-bottom: 20px; transition: 0.4s; }
.card:hover .icon-box { background: var(--primary); color: white; transform: rotateY(180deg); }

/* Images */
.img-frame { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); height: 100%; min-height: 350px; position: relative; }
.img-cover { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: 0.5s; }
.img-frame:hover .img-cover { transform: scale(1.05); }

/* Modules Spécifiques */
.stat-item { padding: 30px; text-align: center; background: rgba(255,255,255,0.05); border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.1); }
.stat-number { display: block; font-size: 3.5rem; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 5px; }
.bg-dark .stat-number { color: white; }

.timeline-item { padding-left: 30px; border-left: 3px solid rgba(255,255,255,0.2); position: relative; padding-bottom: 30px; }
.timeline-item::before { content:''; width:15px; height:15px; background:var(--primary); border-radius:50%; position:absolute; left:-9px; top:0; }
.timeline-year { font-size: 1.5rem; font-weight: 700; color: var(--primary); }

.team-card { text-align: center; padding: 30px; background: white; border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: 0.3s; border-top: 4px solid transparent; }
.team-card:hover { transform: translateY(-5px); border-top-color: var(--primary); }
.team-img { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; margin: 0 auto 20px; border: 4px solid #f3e8ff; }

.blog-card { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: white; box-shadow: var(--shadow-sm); transition: 0.4s; }
.blog-thumb { height: 250px; overflow: hidden; position: relative; }
.blog-thumb img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.blog-card:hover .blog-thumb img { transform: scale(1.1); }
.blog-content { padding: 30px; flex: 1; display: flex; flex-direction: column; }
.read-more { margin-top: auto; color: var(--primary); font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }

input, textarea { width: 100%; padding: 15px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; font-family: inherit; margin-bottom: 20px; }
input:focus, textarea:focus { outline: none; border-color: var(--primary); background: white; }

/* Footer */
footer { background: #0b0f19; color: #94a3b8; padding: 80px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 40px; }
.footer-col h4 { color: white; margin-bottom: 20px; }
.footer-col a { color: #94a3b8; display: block; margin-bottom: 10px; transition: 0.3s; }
.footer-col a:hover { color: var(--primary); padding-left: 5px; }
.footer-bottom { text-align: center; margin-top: 60px; padding-top: 30px; border-top: 1px solid #1e293b; }

/* Animations */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s ease; }
.reveal.active { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 900px) {
    .grid-2, .grid-3, .grid-4, .footer-grid { grid-template-columns: 1fr; }
    
    /* --- FIX NAVBAR ET LOGO --- */
    .nav-container {
        flex-wrap: nowrap; /* Assure que tout reste sur une ligne */
        gap: 5px; /* Réduit l'espace entre le logo et les boutons */
    }
    .logo {
        flex-shrink: 1; /* Permet au logo de se contracter un peu */
        min-width: 0; /* Permet la contraction du contenu flex */
        gap: 4px; /* Réduit l'espace entre l'image et le texte du logo */
    }
    .logo img {
        height: 35px; /* Réduit la taille de l'image du logo */
        flex-shrink: 0; 
    }
    .logo span {
        /* NOUVEAU FIX : Utilise clamp pour une taille adaptable et force la visibilité */
        font-size: clamp(0.7rem, 2.5vw, 1.2rem) !important; /* Taille min/adaptable/max */
        white-space: nowrap; /* Force le texte sur une ligne */
        overflow: hidden; 
        text-overflow: ellipsis; 
        display: inline !important; /* Rétabli la visibilité du texte */
    }
    .btn-donate {
        padding: 8px 14px; /* Réduit le padding du bouton */
        font-size: 0.75rem;
        margin-left: 5px; 
        flex-shrink: 0; 
    }
    .burger { 
        display: block; 
        margin-left: 5px; /* Rétablit l'espace */
    }
    /* --- FIN FIX NAVBAR ET LOGO --- */

    .nav-links { 
        position: fixed; top: 70px; right: -100%; width: 80%; height: 100vh; background: white; flex-direction: column; padding: 50px; transition: 0.4s; box-shadow: -5px 0 20px rgba(0,0,0,0.1); 
    }
    .nav-links.active { right: 0; }
    
    /* --- FIX HERO / DISPLAY-1 --- */
    .display-1 { 
        /* Nouvelle taille pour éviter la coupure et le dépassement */
        font-size: clamp(2.2rem, 8vw, 3.5rem); 
    }
    .hero-content { padding-top: 60px; }
    .hero {
        padding-top: 100px; 
        min-height: 550px;
    }
    .img-frame { min-height: 300px; }
    /* --- FIN FIX HERO / DISPLAY-1 --- */
}

/* Règle pour réafficher le texte du logo sur les grands écrans */
@media (min-width: 901px) {
    .logo span {
        display: inline !important;
    }
}

/* ... (Gardez tout votre CSS existant au dessus) ... */

/* --- MODAL / POP-UP BLOG --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Fond sombre */
    z-index: 9999;
    display: none; /* Caché par défaut */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--white);
    width: 90%;
    max-width: 900px;
    max-height: 90vh; /* Hauteur max */
    overflow-y: auto; /* Scroll si texte long */
    border-radius: var(--radius-md);
    position: relative;
    transform: translateY(50px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-overlay.open .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: 0.3s;
    z-index: 10;
    color: var(--secondary);
}

.modal-close:hover {
    background: var(--primary);
    color: white;
    transform: rotate(90deg);
}

.modal-header-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.modal-body {
    padding: 50px;
}

.modal-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.modal-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 30px;
    color: var(--secondary);
}

.modal-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-main);
    white-space: pre-line; /* Conserve les sauts de ligne */
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-header-img { height: 250px; }
    .modal-body { padding: 25px; }
    .modal-title { font-size: 1.8rem; }
}