/* ===================================================
   FEUILLE DE STYLE PERSONNALISÉE : LA MISÉRICORDE
   Thème : Moderne, Chaleureux et Axé sur l'Espoir
   =================================================== */

/* 1. VARIABLES DE COULEUR GLOBALES (Palette Douce) */
:root {
    /* Couleurs Primaires */
    --color-primary: #1F98F4;       /* Bleu Vif pour l'Espoir/Ciel */
    --color-secondary: #FF6B6B;     /* Rouge Doux pour l'Amour/Cœur */
    --color-cta: #FFC300;           /* Jaune Vif pour les CTA (Bouton DON) */
    
    /* Couleurs de Texte et Fond */
    --color-text-dark: #333333;     /* Texte foncé (presque noir) */
    --color-text-light: #555555;    /* Texte secondaire (gris) */
    --color-light: #F4F8FB;         /* Fond léger (gris très clair) */
    --color-white: #ffffff;
    --color-dark: #1F2A38;          /* Fond sombre (Footer) */
    
    /* Typographie */
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Inter', sans-serif;
}

/* 2. RÉINITIALISATION ET BASE */
body {
    font-family: var(--font-secondary);
    color: var(--color-text-dark);
    line-height: 1.7;
    background-color: var(--color-white);
}

/* Styles pour les sections (cohérence avec AOS) */
section {
    padding: 70px 0;
    overflow-x: hidden; /* Prévient les barres de défilement dues aux animations */
}

/* 3. TYPOGRAPHIE ET TITRES */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-dark);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4); /* Ombre pour la lisibilité sur l'image */
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--color-primary);
}

.section-subtitle {
    font-family: var(--font-secondary);
    font-weight: 600;
    color: var(--color-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
}

/* 4. NAVIGATION ET EN-TÊTE */

/* --- Top Header Bar --- */
.top-header-bar {
    background-color: var(--color-dark);
    color: var(--color-white);
    padding: 8px 0;
    font-size: 0.85rem;
}

.top-cta-text a {
    color: var(--color-cta);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s;
}

.top-bar-social-icons a {
    color: var(--color-white);
    margin-left: 15px;
    font-size: 1rem;
    transition: color 0.3s, transform 0.3s;
}

.top-bar-social-icons a:hover {
    color: var(--color-cta);
    transform: scale(1.1); /* Micro-animation */
}

/* --- Navigation Bar --- */
.navbar {
    border-bottom: 3px solid var(--color-primary); /* Ligne de séparation moderne */
}

.navbar-brand-custom {
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--color-dark) !important;
    text-decoration: none;
}

.nav-link-custom {
    font-weight: 600;
    color: var(--color-text-dark) !important;
    padding: 15px 15px;
    position: relative;
    transition: color 0.3s;
}

.nav-link-custom:hover {
    color: var(--color-primary) !important;
}

.nav-link-custom.active::after,
.nav-link-custom:hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 3px;
    background-color: var(--color-primary);
    transition: width 0.3s ease-out;
}

.nav-link-custom.active::after {
    width: 100%; /* Barre complète pour le lien actif */
}

/* 5. BOUTONS (CTA) */

.cta-button {
    display: inline-block;
    background-color: var(--color-cta);
    color: var(--color-dark) !important;
    font-weight: 700;
    text-transform: uppercase;
    padding: 10px 25px;
    border-radius: 50px;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cta-button:hover {
    background-color: #ffda6a; /* Teinte plus claire */
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.cta-button-secondary {
    display: inline-block;
    background: transparent;
    color: var(--color-primary) !important;
    border: 2px solid var(--color-primary);
    font-weight: 700;
    text-transform: uppercase;
    padding: 10px 25px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s;
}

.cta-button-secondary:hover {
    background-color: var(--color-primary);
    color: var(--color-white) !important;
}

/* 6. SECTION HÉROS (INDEX.HTML) */
.hero-section {
    background-size: cover;
    background-position: center center;
    position: relative;
    padding: 120px 0;
    color: var(--color-white);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4); /* Voile sombre pour lisibilité */
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 700px;
}

.hero-button-primary {
    /* Style du CTA dans le HERO */
    display: inline-block;
    background-color: var(--color-primary);
    color: var(--color-white) !important;
    font-weight: 700;
    text-transform: uppercase;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s;
    border: 2px solid var(--color-primary);
}

.hero-button-primary:hover {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
}

.hero-button-secondary {
    /* Style du bouton secondaire dans le HERO */
    display: inline-block;
    background: transparent;
    color: var(--color-white) !important;
    border: 2px solid var(--color-white);
    font-weight: 700;
    text-transform: uppercase;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s;
}

.hero-button-secondary:hover {
    background-color: var(--color-white);
    color: var(--color-dark) !important;
}


/* 7. SECTION COMPTEURS (INDEX.HTML) - Styles Améliorés */
.counter-section-wrap {
    background-color: var(--color-light); 
    border-radius: 15px;
    margin-top: -60px; /* Remonte sur la section HERO (pour les grands écrans) */
    padding: 0; /* Géré dans l'HTML */
    box-shadow: 0 1rem 3rem rgba(0,0,0,.175)!important; /* Ombre plus marquée */
}

.counter-item {
    text-align: center;
    border-right: 1px solid rgba(0, 0, 0, 0.1); /* Bordure de séparation nette */
    transition: background-color 0.3s ease-in-out;
    padding: 15px 0; /* Garde l'ancien padding */
}

.counter-item:last-child {
    border-right: none;
}

.counter-item:hover {
    background-color: var(--color-white); /* Effet de survol moderne */
}

.counter-number {
    font-size: 2.5rem;
    color: var(--color-primary); /* Bleu Vif pour les chiffres */
    font-weight: 900;
    margin-bottom: 5px;
}

/* Style spécifique pour les liens dans les compteurs (comme l'adresse) */
.counter-item p a {
    text-decoration: none !important; /* Supprime le soulignement */
    border-bottom: none !important;   /* Supprime la ligne pointillée (fixe le bug du lien) */
    color: var(--color-text-light) !important; 
}


/* 8. FOOTER */
footer a {
    color: var(--color-white);
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--color-primary);
}


/* 9. STYLES SPÉCIFIQUES À L'ACCUEIL (Superposition d'Images) */

.image-stack {
    position: relative;
    width: 100%;
    /* Ratio 4:3 du conteneur pour éviter le débordement */
    padding-bottom: 75%; 
    margin-bottom: 30px; 
}

.image-stack img {
    position: absolute;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    width: 90%; 
    height: 90%;
    transition: transform 0.5s ease-out; 
    border: 5px solid var(--color-white); /* Bordure blanche pour séparer visuellement */
}

.image-stack img:nth-child(1) { 
    /* Image du bas */
    top: 5%;
    left: 0;
    z-index: 1;
    transform: rotate(-5deg);
}
.image-stack img:nth-child(2) { 
    /* Image du milieu */
    top: 0;
    left: 10%;
    z-index: 2;
    transform: rotate(2deg);
}
.image-stack img:nth-child(3) { 
    /* Image du haut */
    top: 10%;
    left: 20%;
    z-index: 3;
    transform: rotate(-1deg);
}

/* Styles pour les cartes de besoins (visuel plus sympa) */
.card.shadow-sm.h-100 {
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    border: 1px solid rgba(0,0,0,.05) !important;
}

.card.shadow-sm.h-100:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15) !important;
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}


/* 10. MEDIA QUERIES (Responsive Design) - Styles globaux et spécifiques */

@media (max-width: 991.98px) {
    .hero-title {
        font-size: 2.5rem;
    }
    .section-title {
        font-size: 1.8rem;
    }
    
    /* CORRECTION DU CHEVAUCHEMENT MOBILE - Problème visible sur les captures */
    .counter-section-wrap {
        margin-top: 0 !important; /* Annule le remontage sur petits écrans */
        margin-bottom: 20px !important;
    }

    /* Supprime la bordure de séparation des compteurs sur mobile */
    .counter-item {
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1); /* Bordure horizontale claire */
    }
    .counter-item:last-child {
        border-bottom: none;
    }
    
    /* Ajoute un espacement autour des boutons du menu mobile */
    .d-lg-none .cta-button {
        margin-top: 15px !important;
        margin-bottom: 15px !important;
    }
}

/* MEDIA QUERY spécifique pour les images superposées sur mobile */
@media (max-width: 767.98px) {
    .image-stack {
        padding-bottom: 100%; /* Ratio 1:1 pour une meilleure vue mobile */
    }
    .image-stack img {
        width: 95%; 
        height: 95%;
        border: 3px solid var(--color-white); 
        transform: none !important; /* Retire les rotations sur mobile */
    }
    .image-stack img:nth-child(1) {
        top: 0;
        left: 0;
    }
    .image-stack img:nth-child(2) {
        top: 10%;
        left: 5%;
    }
    .image-stack img:nth-child(3) {
        top: 20%;
        left: 10%;
    }
}