/* ==========================================================================
   ONG FOYER POUR TOUS - DESIGN SYSTEM & FEUILLES DE STYLES INSTITUTIONNELLES
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette */
    --primary: #0f2b5c;
    --primary-hover: #0a1e42;
    --primary-light: #eef2ff;
    
    --accent-teal: #0d9488;
    --accent-teal-hover: #0f766e;
    --accent-teal-light: #ccfbf1;
    
    --accent-orange: #f97316;
    --accent-orange-hover: #ea580c;
    
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, ::before, ::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Containers */
.container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Typography & Headings */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary);
    font-weight: 700;
    line-height: 1.25;
}

.heading-xl { font-size: 2.75rem; font-weight: 800; letter-spacing: -0.02em; }
.heading-lg { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.01em; }
.heading-md { font-size: 1.75rem; font-weight: 700; }
.heading-sm { font-size: 1.25rem; font-weight: 600; }

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    background-color: var(--accent-teal-light);
    color: var(--accent-teal-hover);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-teal {
    background-color: var(--accent-teal);
    color: #ffffff;
}
.btn-teal:hover {
    background-color: var(--accent-teal-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-orange {
    background-color: var(--accent-orange);
    color: #ffffff;
}
.btn-orange:hover {
    background-color: var(--accent-orange-hover);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-outline {
    border-color: var(--primary);
    color: var(--primary);
    background-color: transparent;
}
.btn-outline:hover {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Header & Navbar */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--primary);
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-teal) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.35rem;
    box-shadow: var(--shadow-md);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    list-style: none;
}

.nav-link {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.82rem;
    position: relative;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--accent-teal);
    border-radius: var(--radius-full);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: 1.5px solid var(--border-color);
    font-size: 1.75rem;
    color: var(--primary);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-md);
    line-height: 1;
}

/* Hero Section */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, rgba(15, 43, 92, 0.95) 0%, rgba(13, 148, 136, 0.85) 100%), url('https://images.unsplash.com/photo-1488521787991-ed7bbaae773c?auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    color: #ffffff;
    padding: 6rem 0 7rem 0; /* Plus de padding en bas pour compenser le débordement */
}

/* Hero 2-column layout */
.hero-layout {
    display: grid;
    grid-template-columns: 1fr 460px; /* Élargi (était 400px) */
    gap: 3rem;
    align-items: center;
}

.hero-left {
    /* colonne gauche */
}

.hero-title {
    color: #ffffff;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    line-height: 1.15;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.92;
    margin-bottom: 2rem;
    font-weight: 400;
}

.hero-actions {
    display: flex;
    gap: 0.875rem;
    flex-wrap: wrap;
}

/* ===== Carrousel d'actualités dans le Hero ===== */
.hero-news-carousel {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 35px 60px -15px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10;
    margin-bottom: -10rem; /* Effet de débordement sur la section suivante */
    transform: translateY(1rem);
}

.hero-news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-news-slider {
    position: relative;
    overflow: hidden;
    min-height: 400px; /* Plus haut (était 340px) */
}

.hero-news-slide {
    position: absolute;
    top: 0; left: 0; right: 0;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.hero-news-slide.active {
    opacity: 1;
    transform: translateX(0);
    position: relative;
    pointer-events: auto;
}

.hero-news-slide.exiting {
    opacity: 0;
    transform: translateX(-30px);
    position: absolute;
    pointer-events: none;
}

/* Image de l'article */
.hero-news-img {
    position: relative;
    height: 220px; /* Plus haut (était 180px) */
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}

.hero-news-img--empty {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.4), rgba(15, 43, 92, 0.6));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.5);
}

.hero-news-img::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0,0,0,0.65), transparent);
    border-radius: 0;
}

.hero-news-badge {
    position: relative;
    z-index: 2;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.625rem;
    background: var(--accent-orange);
    color: #fff;
    border-radius: 999px;
}

/* Corps du slide */
.hero-news-body {
    padding: 1.1rem 1.25rem 1rem;
}

.hero-news-title {
    font-size: 1.1rem; /* Plus grand */
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 0.6rem;
    color: #ffffff;
}

.hero-news-title a {
    color: #ffffff;
    transition: color 0.2s;
}

.hero-news-title a:hover {
    color: var(--accent-teal-light);
}

.hero-news-summary {
    font-size: 0.9rem; /* Plus grand */
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.hero-news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.hero-news-footer a {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s;
}

.hero-news-footer a:hover {
    color: var(--accent-teal-light);
}

/* Dots de navigation */
.hero-news-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 0 0.5rem;
}

.hero-news-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    border: none;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.35s ease;
    padding: 0;
}

.hero-news-dot.active {
    background: #ffffff;
    width: 24px;
}

/* Barre de progression */
.hero-news-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.hero-news-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-teal), #ffffff);
    transition: width linear;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .hero-news-carousel {
        max-width: 600px;
        margin: 0 auto -6rem auto; /* Conserve un petit effet sur mobile */
    }
}

@media (max-width: 640px) {
    .hero-title { font-size: 2.25rem; }
}

/* Feature Cards & Grid */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.card-body {
    padding: 1.75rem;
}

.card-title {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.card-icon {
    width: 56px;
    height: 56px;
    background-color: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

/* Stats Counter Section */
.stats-section {
    background: linear-gradient(135deg, var(--primary) 0%, #1e3a8a 100%);
    color: #ffffff;
    padding: 5rem 0;
}

.stat-box {
    text-align: center;
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(5px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--accent-orange);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

.stat-period {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 43, 92, 0.15);
}

/* Alerts & Badges */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.badge-success { background-color: #dcfce7; color: #166534; }
.badge-warning { background-color: #fef3c7; color: #92400e; }
.badge-danger { background-color: #fee2e2; color: #991b1b; }
.badge-info { background-color: #e0f2fe; color: #075985; }

/* Footer */
.site-footer {
    background-color: var(--primary);
    color: #ffffff;
    padding: 4rem 0 2rem 0;
    border-top: 4px solid var(--accent-teal);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    color: #ffffff;
    font-size: 1.15rem;
    margin-bottom: 1.25rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.625rem;
}

.footer-links a {
    color: #cbd5e1;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--accent-orange);
    padding-left: 0.25rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

.footer-bottom-left, .footer-bottom-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-creator-link {
    color: var(--accent-orange);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}
.footer-creator-link:hover {
    color: #fbbf24;
}

.footer-admin-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}
.footer-admin-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}


/* Lightbox Modal */
.lightbox-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #ffffff;
    font-size: 2.5rem;
    cursor: pointer;
}

/* Responsive Rules */
@media (max-width: 992px) {
    .hero-title { font-size: 2.5rem; }
    .heading-xl { font-size: 2.25rem; }
    .nav-menu {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        right: 0;
        width: 100%;
        background-color: #ffffff;
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem 2rem;
        box-shadow: var(--shadow-xl);
        border-bottom: 3px solid var(--accent-teal);
        z-index: 999;
        gap: 0.5rem;
    }
    .nav-menu li { width: 100%; }
    .nav-menu li a.nav-link { display: block; padding: 0.6rem 0; font-size: 1rem; border-bottom: 1px solid var(--border-color); }
    .nav-menu li:last-child a.nav-link { border-bottom: none; }
    .nav-menu.active { display: flex; }
    .mobile-menu-toggle { display: flex; align-items: center; justify-content: center; }
    nav[style*="margin-left: auto"] { margin-left: auto !important; }
}

/* ==========================================
   MODE SOMBRE (DARK MODE) & THÈME INTERACTIF
   ========================================== */
body.dark-theme {
    --primary: #38bdf8;
    --primary-hover: #7dd3fc;
    --primary-light: #1e293b;
    
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --text-light: #94a3b8;
    --border-color: #334155;
}

body.dark-theme .site-header {
    background-color: #1e293b;
    border-bottom-color: #334155;
}

body.dark-theme .nav-link {
    color: #cbd5e1;
}

body.dark-theme .nav-link:hover, body.dark-theme .nav-link.active {
    color: #38bdf8;
}

body.dark-theme section[style*="background-color: #ffffff"],
body.dark-theme section[style*="background-color: var(--bg-main)"] {
    background-color: #0f172a !important;
}

body.dark-theme .card,
body.dark-theme .stat-box {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-theme .nav-menu {
    background-color: #1e293b;
    border-color: #334155;
}

.theme-toggle-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.15rem;
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    background-color: rgba(255,255,255,0.1);
    transform: scale(1.08);
}

/* Brand name text - single line header */
.brand-logo-text {
    white-space: normal;
    max-width: 140px;
    line-height: 1.15;
    word-break: break-word;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Footer - Dark mode compatible */
body.dark-theme .site-footer {
    background-color: #090f1d;
    border-top-color: var(--accent-teal);
}

body.dark-theme .footer-col h4 {
    color: #f8fafc;
}

body.dark-theme .footer-links a {
    color: #94a3b8;
}

body.dark-theme .footer-links a:hover {
    color: var(--accent-orange);
}

body.dark-theme .footer-bottom {
    border-top-color: rgba(255, 255, 255, 0.08);
    color: #64748b;
}

body.dark-theme .footer-admin-link {
    color: #475569;
}

body.dark-theme .footer-admin-link:hover {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.07);
}



/* ==========================================
   SECTION NOS PARTENAIRES - CARROUSEL INFINI
   ========================================== */
.partners-section {
    padding: 5rem 0 4rem;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    border-top: 1px solid var(--border-color);
    overflow: hidden;
}
.partners-track-wrapper {
    position: relative;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}
.partners-track {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    width: max-content;
    animation: partnersScroll 30s linear infinite;
}
.partners-track:hover { animation-play-state: paused; }
@keyframes partnersScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
.partner-item { flex-shrink: 0; }
.partner-card {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 2rem;
    min-width: 180px;
    height: 90px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    cursor: default;
}
a.partner-card { cursor: pointer; }
a.partner-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-teal);
}
.partner-card img {
    max-height: 52px;
    max-width: 140px;
    width: auto;
    object-fit: contain;
    filter: grayscale(40%) opacity(0.8);
    transition: filter 0.3s ease;
}
a.partner-card:hover img { filter: grayscale(0%) opacity(1); }
.partner-name-text {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary);
    text-align: center;
    letter-spacing: 0.02em;
}
body.dark-theme .partners-section { background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%); border-top-color: #334155; }
body.dark-theme .partner-card { background: #1e293b; border-color: #334155; }
body.dark-theme .partner-card img { filter: grayscale(20%) opacity(0.85) brightness(1.1); }
body.dark-theme a.partner-card:hover { border-color: var(--accent-teal); background: #263548; }
body.dark-theme .partner-name-text { color: #e2e8f0; }
