/* Variables CSS (Thème Clair par défaut) */
:root {
    --green: #2a9d8f;
    --yellow: #e9c46a;
    --dark-blue: #264653;
    --light-gray: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --text-color: #555555;
    --header-bg: #ffffff;
}

/* Variables CSS (Thème Sombre) */
[data-theme="dark"] {
    --light-gray: #121212;
    --white: #1e1e1e;
    --dark-blue: #f8f9fa;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    --text-color: #bbbbbb;
    --header-bg: #1e1e1e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--light-gray);
    color: var(--dark-blue);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 1. En-tête */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--header-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

header img {
    max-height: 62.5px; /* Augmenté de 25% (auparavant 50px) */
    object-fit: contain;
    transition: transform 0.3s ease;
}

header img:hover {
    transform: scale(1.05);
}

nav {
    display: flex;
    gap: 25px;
    align-items: center;
}

/* Menu burger pour mobile */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
}

.menu-toggle span {
    display: block;
    width: 30px;
    height: 3px;
    background-color: var(--dark-blue);
    border-radius: 3px;
    transition: 0.3s;
}

@media (max-width: 850px) {
    .menu-toggle {
        display: flex;
    }

    nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--header-bg);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        gap: 15px;
    }

    nav.active {
        display: flex;
    }
}

nav a {
    text-decoration: none;
    color: var(--dark-blue);
    font-weight: 600;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--green);
}

/* Bouton Thème Sombre */
.theme-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.3s ease;
    color: var(--dark-blue);
}

.theme-btn:hover {
    transform: scale(1.1);
}

/* Conteneur principal */
main {
    margin-top: 115px;
    padding: 0 5% 60px 5%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

section {
    margin-bottom: 80px;
    scroll-margin-top: 110px; 
}

h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 10px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--yellow);
    border-radius: 2px;
}

/* Style global des cartes */
.card {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 14px 32px;
    background-color: var(--green);
    color: #ffffff; /* Fixé à blanc même en dark mode */
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: #238579;
    transform: scale(1.05);
}

/* 2. Section Hero */
.hero {
    text-align: center;
    padding: 80px 20px;
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 80px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.hero h1 {
    font-size: 3.5rem;
    color: var(--dark-blue);
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero h1 span {
    color: var(--green);
}

.hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 40px auto;
    color: var(--text-color);
}

/* 3. Missions */
.missions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.mission-card {
    text-align: center;
}

.mission-card .emoji {
    font-size: 4rem;
    margin-bottom: 20px;
    display: inline-block;
}

.mission-card h3 {
    font-size: 1.5rem;
    color: var(--green);
    margin-bottom: 15px;
}

.mission-card p {
    color: var(--text-color);
}

/* 4. Réseaux Sociaux */
.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.social-network-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.social-network-card h3 {
    color: var(--dark-blue);
    margin-bottom: 20px;
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

.hero-logo {
    max-width: 250px;
    height: auto;
    margin: 0 auto 30px auto;
    display: block;
}

.qr-code {
    max-width: 150px;
    width: 100%;
    height: auto;
    margin-bottom: 20px;
    /* border-radius: 8px; */
    background-color: transparent;
}

.social-btn {
    padding: 12px 25px;
    background-color: var(--dark-blue);
    color: var(--white); /* S'adapte au thème sombre */
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
    width: 100%;
}

.social-btn:hover {
    background-color: var(--green);
    color: #ffffff; /* Reste blanc sur fond vert */
}

/* 5. Inscription & Contact */
.contact-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.iframe-container {
    width: 100%;
    height: 600px;
    background-color: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.contact-info {
    text-align: center;
}

.contact-info p {
    margin-bottom: 20px;
    color: var(--text-color);
}

/* Section Annonces - Carrousel */
#annonces {
    display: none; /* Masquée par défaut, affichée par JS si des annonces existent */
    margin-bottom: 60px;
}

.carousel-wrapper {
    position: relative;
    overflow: hidden;
    padding: 10px 5px;
}

.carousel-track {
    display: flex;
    gap: 25px;
    transition: transform 0.4s ease;
    align-items: stretch;
}

.annonce-card {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 300px;
    max-width: 320px;
    max-height: 380px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}

.annonce-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.annonce-card img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    background-color: var(--light-gray);
}

.annonce-card-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 10px;
    overflow: hidden;
}

.annonce-card-body h3 {
    font-size: 1.1rem;
    color: var(--dark-blue);
    margin: 0;
    line-height: 1.3;
}

/* .annonce-card-body p {
    color: var(--text-color);
    font-size: 0.88rem;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    margin: 0;
} */

.annonce-card-body p {
    color: var(--text-color);
    font-size: 0.88rem;
    flex-grow: 1;
    margin: 0;
    /* Prise en compte automatique des sauts de ligne */
    white-space: pre-line;
    /* Défilement vertical pour le texte long */
    overflow-y: auto;
    padding-right: 5px; /* Évite que le texte colle au curseur */
}

/* Personnalisation légère de la barre de défilement */
.annonce-card-body p::-webkit-scrollbar {
    width: 4px;
}

.annonce-card-body p::-webkit-scrollbar-thumb {
    background-color: var(--green);
    border-radius: 4px;
}

.annonce-card-body p::-webkit-scrollbar-track {
    background-color: transparent;
}

.annonce-card-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.annonce-card-body .btn-annonce {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--yellow);
    color: var(--dark-blue);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.82rem;
    transition: all 0.3s ease;
    text-align: center;
}

.annonce-card-body .btn-annonce.btn-internal {
    background-color: var(--green);
    color: #ffffff;
}

.annonce-card-body .btn-annonce:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.carousel-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 25px;
}

.carousel-btn {
    background-color: var(--white);
    border: 2px solid var(--green);
    color: var(--green);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background-color: var(--green);
    color: #ffffff;
}

.carousel-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ccc;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: var(--green);
}

/* Section Ressources */
.ressource-card {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;

/* NOUVEAU : Garantit une taille uniforme */
    width: 100%;
    max-width: 360px;
    box-sizing: border-box;
}

.ressource-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.ressource-icon {
    background-color: #f1f8f7;
    color: var(--green);
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ressource-info {
    flex-grow: 1;
}

.ressource-info h3 {
    color: var(--dark-blue);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.ressource-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--green);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background-color 0.3s ease;
}

.ressource-btn:hover {
    background-color: #21867a;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 15px;
    }

    nav {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    main {
        margin-top: 150px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }
}
