/* ===========================================================
   Assemblées Citoyennes — Styles communs
   Version : 1.0
   ========================================================= */

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

html {
    font-size: 16px;
    line-height: 1.6;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img { max-width: 100%; height: auto; }
a { color: var(--couleur-secondaire); transition: color 0.2s; }
a:hover { color: var(--couleur-principale); }

/* --- Variables --- */
:root {
    --couleur-principale: #2c3e50;
    --couleur-secondaire: #3498db;
    --largeur-max: 1200px;
    --padding: 1.5rem;
    --border-radius: 8px;
    --ombre-legere: 0 1px 3px rgba(0,0,0,0.1);
    --ombre-moyenne: 0 2px 8px rgba(0,0,0,0.12);
}

/* --- En-tête --- */
.menu-principal {
    background: var(--couleur-principale);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--ombre-moyenne);
}

.menu-conteneur {
    max-width: var(--largeur-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--padding);
}

.menu-logo a {
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.2rem;
    padding: 1rem 0;
    display: block;
}

.menu-liens {
    list-style: none;
    display: flex;
    gap: 0.25rem;
}

.menu-liens > li { position: relative; }
.menu-liens a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 1rem 0.8rem;
    display: block;
    transition: color 0.2s, background 0.2s;
    font-size: 0.9rem;
}
.menu-liens a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.sous-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: var(--ombre-moyenne);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    min-width: 200px;
    z-index: 100;
}
.menu-liens > li:hover .sous-menu { display: block; }
.sous-menu a { color: var(--couleur-principale); padding: 0.75rem 1rem; }
.sous-menu a:hover { background: #f0f0f0; color: var(--couleur-secondaire); }

.menu-toggle { display: none; background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; }

/* --- Contenu --- */
.contenu {
    max-width: var(--largeur-max);
    margin: 2rem auto;
    padding: 0 var(--padding);
    flex: 1;
    width: 100%;
}

/* --- Fil d'Ariane --- */
.breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #666;
}
.breadcrumb a { color: var(--couleur-secondaire); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* --- Titres --- */
h1 { font-size: 2rem; margin-bottom: 1rem; color: var(--couleur-principale); }
h2 { font-size: 1.5rem; margin: 1.5rem 0 0.75rem; color: var(--couleur-principale); }
h3 { font-size: 1.2rem; margin: 1rem 0 0.5rem; }

.sous-titre { font-size: 1.1rem; color: #666; margin-bottom: 2rem; }

/* --- Articles --- */
article, .rubrique {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--ombre-legere);
    margin-bottom: 1.5rem;
}

article h2 { margin-top: 0; }
article h2 a { color: var(--couleur-principale); text-decoration: none; }
article h2 a:hover { color: var(--couleur-secondaire); }

.meta {
    font-size: 0.85rem;
    color: #666;
    margin: 0.5rem 0 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.introduction { margin: 0.5rem 0; line-height: 1.7; }
.texte { margin: 1rem 0; line-height: 1.8; }
.chapo { font-size: 1.1rem; font-weight: 500; color: #555; margin-bottom: 1rem; line-height: 1.7; }
.soustitre { font-size: 1.1rem; color: #666; font-style: italic; margin-bottom: 0.5rem; }

/* --- Ville carte --- */
.grille-villes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.ville-carte {
    background: white;
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--ombre-legere);
    transition: transform 0.2s, box-shadow 0.2s;
}
.ville-carte:hover {
    transform: translateY(-2px);
    box-shadow: var(--ombre-moyenne);
}
.ville-carte h3 { margin-top: 0; }
.ville-carte h3 a { color: var(--couleur-principale); text-decoration: none; }

.btn {
    display: inline-block;
    background: var(--couleur-secondaire);
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: 0.75rem;
    transition: background 0.2s;
}
.btn:hover { background: var(--couleur-principale); }

/* --- Pagination --- */
.pagination {
    text-align: center;
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

/* --- Footer --- */
.pied {
    background: var(--couleur-principale);
    color: rgba(255,255,255,0.9);
    padding: 3rem var(--padding);
    margin-top: 3rem;
}

.pied-contenu {
    max-width: var(--largeur-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.pied h4 { color: white; margin-bottom: 0.75rem; font-size: 1rem; }
.pied ul { list-style: none; }
.pied a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.9rem; }
.pied a:hover { color: white; }

.pied-copyright {
    max-width: var(--largeur-max);
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.15);
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}

/* --- Navigation articles --- */
.navigation-articles {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
    padding: 1rem 0;
    border-top: 1px solid #eee;
}
.navigation-articles a { text-decoration: none; font-size: 0.9rem; }

/* --- Mots-clés --- */
.mots-cles {
    margin: 1rem 0;
    font-size: 0.9rem;
}
.mot-cle {
    display: inline-block;
    background: #f0f0f0;
    color: #555;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    text-decoration: none;
    margin: 0.2rem;
    font-size: 0.85rem;
}

/* --- Documents --- */
.documents { margin: 1.5rem 0; }
.documents ul { list-style: none; }
.documents li {
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
}
.documents a { text-decoration: none; }

/* --- Sections --- */
.presentation { margin: 2rem 0; line-height: 1.8; }
.actualites { margin: 2rem 0; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .menu-liens {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--couleur-principale);
    }
    .menu-liens.menu-ouvert { display: flex; }
    .menu-toggle { display: block; }

    .sous-menu {
        position: static;
        box-shadow: none;
        background: rgba(0,0,0,0.1);
        border-radius: 0;
    }
    .sous-menu a { color: rgba(255,255,255,0.8); }

    .grille-villes { grid-template-columns: 1fr; }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    article, .rubrique { padding: 1rem; }
    .contenu { margin: 1rem auto; }
}
