:root {
    --vert: #2f7a4f;
    --vert-fonce: #1f5536;
    --beige: #f7f4ee;
    --texte: #2b2b2b;
    --blanc: #ffffff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--texte);
    background: var(--beige);
    line-height: 1.5;
}

a { color: var(--vert-fonce); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
    background: var(--blanc);
    border-bottom: 3px solid var(--vert);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    flex-wrap: wrap;
}
.logo-link { display: flex; align-items: center; gap: 12px; }
.logo { height: 50px; width: auto; }
.site-name { font-weight: bold; font-size: 1.2rem; color: var(--vert-fonce); }

.main-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.main-nav a {
    color: var(--texte);
    font-weight: 600;
    padding: 6px 4px;
    border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a.active {
    color: var(--vert-fonce);
    border-bottom-color: var(--vert);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--vert-fonce);
}

@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .main-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 10px 0; border-bottom: 1px solid #eee; }
}

/* Main content */
main { max-width: 1100px; margin: 0 auto; padding: 30px 20px 60px; min-height: 60vh; }

h1 { color: var(--vert-fonce); }

.hero {
    position: relative;
    margin-bottom: 40px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.55) 100%);
    z-index: 1;
}
.hero-text {
    position: relative;
    z-index: 2;
    color: var(--blanc);
    text-align: center;
    padding: 30px;
}
.hero-text h1 {
    color: var(--blanc);
    margin-top: 0;
    font-size: 2.6rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}
.hero-text p { font-size: 1.1rem; margin-bottom: 22px; text-shadow: 0 1px 6px rgba(0,0,0,0.4); }
.hero-btn {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.6);
    color: var(--blanc);
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-decoration: none;
}
.hero-btn:hover { background: rgba(255,255,255,0.3); text-decoration: none; }
@media (max-width: 600px) {
    .hero { min-height: 320px; }
    .hero-text h1 { font-size: 1.8rem; }
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Cartes professionnels */
.pro-card {
    background: var(--blanc);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    border: 1px solid #e5e0d5;
    transition: transform 0.15s, box-shadow 0.15s;
}
.pro-card:hover { transform: translateY(-4px); box-shadow: 0 6px 16px rgba(0,0,0,0.12); }
.pro-card img { width: 90px; height: 90px; object-fit: cover; object-position: top; border-radius: 50%; margin-bottom: 12px; background: #ddd; }
.pro-card h3 { margin: 8px 0 4px; color: var(--vert-fonce); }
.pro-card .fonction { color: #666; font-size: 0.95rem; }

/* Carrés actions */
.action-square {
    background: var(--vert-fonce);
    color: var(--blanc);
    border-radius: 10px;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.15s, background 0.15s;
}
.action-square:hover { transform: scale(1.03); text-decoration: none; filter: brightness(1.04); }

/* Couleurs pastel variées pour chaque carré d'action, avec contour plus foncé de la même teinte (en rotation) */
.actions-grid .action-square { color: #3a3a3a; border: 3px solid; }
.actions-grid .action-square:nth-child(6n+1) { background: #ffdcb8; border-color: #e8743b; }
.actions-grid .action-square:nth-child(6n+2) { background: #cdeccf; border-color: #2f7a4f; }
.actions-grid .action-square:nth-child(6n+3) { background: #d3e0ff; border-color: #3b6fe8; }
.actions-grid .action-square:nth-child(6n+4) { background: #f6d2e3; border-color: #c2417a; }
.actions-grid .action-square:nth-child(6n+5) { background: #fdeeb8; border-color: #c79a1f; }
.actions-grid .action-square:nth-child(6n+6) { background: #c7efe9; border-color: #2bb3a3; }

/* Icônes et couleurs pastel pour la grille de l'accueil */
.square-icon { width: 42px; height: 42px; margin-top: 10px; }
.home-grid .action-square { color: #3a3a3a; border: 3px solid; font-size: 1rem; }
.home-grid .action-square:nth-child(7n+1) { background: #ffdcb8; border-color: #e8743b; }
.home-grid .action-square:nth-child(7n+2) { background: #cdeccf; border-color: #2f7a4f; }
.home-grid .action-square:nth-child(7n+3) { background: #d3e0ff; border-color: #3b6fe8; }
.home-grid .action-square:nth-child(7n+4) { background: #f6d2e3; border-color: #c2417a; }
.home-grid .action-square:nth-child(7n+5) { background: #fdeeb8; border-color: #c79a1f; }
.home-grid .action-square:nth-child(7n+6) { background: #c7efe9; border-color: #2bb3a3; }
.home-grid .action-square:nth-child(7n+7) { background: #e3d6f9; border-color: #8b5fd1; }
.action-square img { width: 100%; height: 60%; object-fit: cover; border-radius: 6px; margin-top: 10px; }

/* Modal popup */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: var(--blanc);
    border-radius: 10px;
    max-width: 420px;
    width: 100%;
    padding: 30px;
    position: relative;
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    color: #888;
}
.modal-box h2 { margin-top: 0; color: var(--vert-fonce); }
.modal-info { margin: 14px 0; }
.modal-info strong { display: block; color: var(--vert-fonce); margin-bottom: 2px; }

/* Agenda */
.event-item {
    background: var(--blanc);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 14px;
    border-left: 5px solid var(--vert);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.event-date { font-weight: bold; color: var(--vert-fonce); }

/* Articles / journal */
.article-card {
    background: var(--blanc);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.article-date { color: #888; font-size: 0.9rem; }

/* Contact form */
.contact-form { background: var(--blanc); padding: 30px; border-radius: 10px; max-width: 600px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.contact-form label { display: block; margin-top: 14px; font-weight: 600; }
.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
}
.contact-form button {
    margin-top: 20px;
    background: var(--vert-fonce);
    color: var(--blanc);
    border: none;
    padding: 12px 26px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}
.contact-form button:hover { background: var(--vert); }

.alert-success { background: #e1f3e1; color: #1f5536; padding: 14px; border-radius: 8px; margin-bottom: 20px; }
.alert-error { background: #fbe5e5; color: #9b2c2c; padding: 14px; border-radius: 8px; margin-bottom: 20px; }

.charte-content { background: var(--blanc); padding: 30px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.affiche-box { margin-bottom: 24px; }
.affiche-img { max-width: 220px; width: 100%; display: block; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.12); margin-bottom: 10px; }

/* Partenaires */
.partenaire-card {
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    border: 3px solid;
    color: #3a3a3a;
    transition: transform 0.15s, box-shadow 0.15s;
}
.partenaire-card:hover { transform: translateY(-4px); box-shadow: 0 6px 16px rgba(0,0,0,0.12); }
.partenaire-card img { width: 80px; height: 80px; object-fit: contain; margin-bottom: 10px; background: rgba(255,255,255,0.6); border-radius: 8px; }
.partenaire-card h3 { margin: 6px 0 0; color: #2b2b2b; font-size: 1rem; }

.partenaire-card:nth-child(6n+1) { background: #ffdcb8; border-color: #e8743b; }
.partenaire-card:nth-child(6n+2) { background: #cdeccf; border-color: #2f7a4f; }
.partenaire-card:nth-child(6n+3) { background: #d3e0ff; border-color: #3b6fe8; }
.partenaire-card:nth-child(6n+4) { background: #f6d2e3; border-color: #c2417a; }
.partenaire-card:nth-child(6n+5) { background: #fdeeb8; border-color: #c79a1f; }
.partenaire-card:nth-child(6n+6) { background: #c7efe9; border-color: #2bb3a3; }

/* Dernière action mise en avant (accueil) */
.featured-action { margin-top: 40px; }
.featured-action-row { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.featured-action-main { flex: 2; min-width: 300px; max-width: 380px; }
.featured-action-main h2 { margin-top: 0; }
.featured-side-column { flex: 2; min-width: 240px; display: flex; flex-direction: row; gap: 24px; flex-wrap: wrap; }
.featured-journal-main { flex: 1; min-width: 220px; }
.featured-usagers-recrutement { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 24px; }
.featured-usagers-main h2 { margin-top: 0; }
.featured-usagers, .featured-action-card, .featured-journal-card, .featured-recrutement-card {
    background: var(--blanc);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.featured-usagers .event-item { margin-bottom: 10px; padding: 10px 14px; }
.featured-action-img { width: 100%; max-width: 320px; height: 180px; object-fit: cover; border-radius: 8px; margin-bottom: 14px; display: block; }
.featured-action-card h3 { margin-top: 0; color: var(--vert-fonce); font-size: 1.2rem; }

/* Dernier journal publié (accueil) */
.featured-journal-main h2 { margin-top: 0; }
.featured-journal-img { width: 100%; height: 130px; object-fit: cover; border-radius: 8px; margin-bottom: 10px; display: block; }
.featured-journal-card h3 { margin: 4px 0 8px; color: var(--vert-fonce); font-size: 1.1rem; }

/* Recrutement (accueil) */
.featured-recrutement-main h2 { margin-top: 0; font-size: 1.2rem; }
.featured-recrutement-card h3 { margin: 0 0 4px; color: var(--vert-fonce); font-size: 1.1rem; }
.featured-recrutement-card { margin-bottom: 10px; }
.featured-recrutement-card:last-of-type { margin-bottom: 0; }

/* Carte de localisation */
.map-section { margin-top: 40px; }
.map-section h2 { margin-bottom: 4px; }
.map-section p { color: #555; margin-top: 0; }
.map-embed {
    position: relative;
    width: 100%;
    padding-bottom: 45%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.map-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 20px;
    color: #777;
    font-size: 0.9rem;
    border-top: 1px solid #e5e0d5;
}
