
html {
    scroll-behavior: smooth;
}

/* --- RESET & BASICS --- */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f9fafb;
    color: #111;
    overflow-x: hidden;
}

/* --- HEADER (Transparent sur Image) --- */
.header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    box-sizing: border-box;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
}

.logo {
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.4);
    margin-bottom: 0;
    line-height: 1.1;
}

.phone-link {
    color: white !important;
    text-decoration: none !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 0.9rem;
    opacity: 0.9;
    display: block;
    margin-top: -2px;
    font-style: italic;
    transition: opacity 0.3s;
}

.phone-link:hover { opacity: 1; }
a[href^="tel"] { color: inherit; text-decoration: none; }

/* --- BANDEAU HERO --- */
.hero-banner {
    position: relative;
    width: 100%;
    height: 100vh; /* Garde 100vh pour l'index, mais pense à mettre 40vh sur commune.html */
    
    /* On regroupe tout proprement */
background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.2)), 
                      url('../images/bandeau-index.jpg');    background-repeat: no-repeat;
    background-size: cover;
    
    /* On utilise 50% (milieu) ou ton 80% si tu veux voir le bas de l'image */
    background-position: center center; 
    
    /* On active le fixed uniquement pour les grands écrans via la media query plus bas */
    background-attachment: scroll; 

    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
}



.hero-content h1 {
    font-size: 5.5rem;
    line-height: 1.1;
    margin: 0;
    text-transform: uppercase;
    font-weight: 900;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.hero-content h1 i {
    display: block;
    font-size: 0.7em;
    font-style: italic;
    text-transform: none;
    margin-top: 10px;
    opacity: 0.95;
}

.hero-content p {
    font-size: 2rem;
    margin-top: 20px;
    letter-spacing: 1px;
}

/* --- NAVIGATION --- */
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 30px;
    height: 25px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10000;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background: white;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.menu-mobile {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background: white;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 80px;
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    z-index: 9999;
}

.menu-mobile.active { transform: translateX(0); }
.menu-mobile ul { list-style: none; padding: 0; }
.menu-mobile li { padding: 15px 30px; border-bottom: 1px solid #eee; }
.menu-mobile a { text-decoration: none; font-size: 18px; color: #111; font-weight: 500; }

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(6px);
    display: none;
    z-index: 999;
}
.overlay.active { display: block; }

/* --- FOOTER (Optimisé) --- */
.footer {
    background: #111;
    color: white;
    padding: 60px 5% 20px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-col h3 { 
    color: #3498db; 
    margin-top: 0;      
    margin-bottom: 5px; /* Espace très réduit sous le titre */
    font-size: 1.1rem;
    line-height: 1.2;
}

.footer-col p {
    margin-top: 0;      
    margin-bottom: 20px; /* Espace pour séparer les blocs de texte */
    line-height: 1.4;
    color: #ccc;
}

.footer-bottom {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #333;
    color: #777;
    font-size: 0.9rem;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .hero-content h1 { font-size: 3.2rem; }
    .hero-content p { font-size: 1.4rem; }
    .hero-banner { background-attachment: scroll; }
}

@media (min-width: 768px) {
    .menu-toggle { display: none; }
    .menu-mobile {
        position: static;
        transform: translateX(0);
        height: auto;
        width: auto;
        background: transparent;
        box-shadow: none;
        padding: 0;
    }
    .menu-mobile ul { display: flex; gap: 25px; }
    .menu-mobile li { padding: 0; border: none; }
    .menu-mobile a { color: white; font-size: 16px; }
    .menu-mobile a:hover { text-decoration: underline; }
}

.no-scroll { overflow: hidden; }


/* --- BOUTON RETOUR EN HAUT --- */
#scrollTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #3498db;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 1000;
    transition: all 0.3s ease;
    
    /* --- LES AJOUTS POUR LE CONTRASTE --- */
    border: 3px solid white; /* Bordure blanche épaisse pour bien détacher le bouton */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4); /* Ombre un peu plus sombre pour la profondeur */
    
    opacity: 0; /* On le laisse à 0, le JS s'occupe de l'afficher */
}

/* On garde le hover pour que ce soit interactif */
#scrollTop:hover {
    background-color: #2980b9;
    transform: scale(1.1);
    border-color: #f1f1f1; /* La bordure change légèrement au survol */
}

/* Style de l'icône à l'intérieur du rond */
#scrollTop span {
    font-size: 32px;        /* On augmente la taille (auparavant 24px) */
    font-weight: 900;       /* On met l'épaisseur maximale */
    line-height: 1;         /* Pour éviter que la flèche ne soit décentrée */
    
    /* Petite astuce pour remonter la flèche visuellement */
    /* car le caractère ↑ a souvent un espace vide en dessous */
    transform: translateY(-3px); 
    display: block;
}

article ul li {
    margin-bottom: 8px; /* Donne de l'air entre chaque conseiller */
}

.hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem) !important;
    text-transform: uppercase; /* Optionnel : pour donner un côté plus institutionnel */
    letter-spacing: 2px;       /* Optionnel : pour aérer les lettres */
}

/* Uniquement pour les écrans larges (PC) */
@media (min-width: 992px) {
    .menu-mobile ul {
        gap: 30px; /* Espace davantage les liens entre eux */
    }

    .menu-mobile ul li a {
        font-size: 1.15rem !important; /* Agrandit le texte (ajuste à 1.2rem si besoin) */
        font-weight: 600 !important;   /* Rend l'écriture un peu plus épaisse */
        text-transform: uppercase;     /* Met en majuscules pour un look plus "Mairie" */
        letter-spacing: 1px;           /* Espace légèrement les lettres */
        transition: all 0.3s ease;
    }

    /* Petit effet au survol pour que ce soit interactif */
    .menu-mobile ul li a:hover {
        color: #3498db !important;
        transform: translateY(-2px);
    }
}


/* --- BOUTONS PRATIQUE : STYLE TITRE & HAUTEUR RÉDUITE --- */
.btn-pratique {
    transition: all 0.3s ease !important;
    min-height: 80px !important; /* Hauteur réduite comme demandé */
    text-transform: uppercase;
    display: flex !important;
    flex-direction: column; /* Pour bien empiler icône et texte */
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    padding: 15px !important;
    background: white;
}

.btn-pratique h3 {
    /* Taille identique à tes titres de sections H2 */
    font-size: 1.8rem !important; 
    font-weight: 800 !important;
    margin: 0 !important;
    line-height: 1.1 !important;
    text-align: center;
    color: #111;
}

/* L'émoji sur sa propre ligne */
.btn-pratique h3 span {
    display: block; 
    font-size: 1.8rem; 
    margin-bottom: 2px;
}

/* Effets de survol pour PC (plus de 1024px) */
@media (min-width: 1024px) {
    .btn-pratique:hover {
        transform: translateY(-5px) !important;
        background-color: #f8fbff !important;
        box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
        border-top-color: #2980b9 !important;
    }
    .btn-pratique:hover h3 {
        color: #3498db !important;
    }
}

/* Ajustements pour Mobile (moins de 768px) */
@media (max-width: 768px) {
    .btn-pratique h3 {
        font-size: 1.3rem !important; /* On réduit un peu pour que ça loge sur smartphone */
    }
    .btn-pratique {
        min-height: 90px !important;
    }
    .btn-pratique:active {
        transform: scale(0.96) !important;
        background-color: #f0f7ff !important;
    }
}



/* Styles Harmonisation Page Pratique */
.btn-pratique-alt {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
    background: #fff;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: 0.3s;
    border-bottom: 3px solid #eee;
}
.btn-pratique-alt:hover {
    transform: translateY(-5px);
    border-bottom-color: #3498db;
    color: #3498db;
}
.btn-pratique-alt span { font-size: 1.5rem; margin-bottom: 8px; }

.card-pratique {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #eee;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.card-pratique img { width: 60px; height: 60px; object-fit: contain; margin-bottom: 15px; }
.card-pratique h4 { margin: 10px 0; text-transform: uppercase; font-size: 0.9rem; }
.card-pratique p { font-size: 0.85rem; color: #666; margin-bottom: 15px; min-height: 40px; }

.btn-small {
    display: inline-block;
    padding: 8px 15px;
    border: 2px solid #3498db;
    color: #3498db;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.8rem;
    transition: 0.3s;
}
.btn-small:hover { background: #3498db; color: #fff; }

.association-block {
    display: flex;
    align-items: center;
    gap: 25px;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
    margin-bottom: 15px;
}
.association-block img { width: 100px; height: 100px; border-radius: 8px; object-fit: cover; }

.tourisme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.tourisme-card { display: flex; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid #eee; }
.tourisme-img { width: 150px; background-size: cover; background-position: center; }
.tourisme-body { padding: 20px; flex: 1; }

.numeros-container { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; background: #fff; padding: 30px; border-radius: 12px; border: 1px solid #eee; }
.urgences ul { list-style: none; padding: 0; }
.urgences li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #eee; color: #e74c3c; font-weight: bold; }
.pharmacie-box { margin-top: 15px; padding: 10px; border: 1px solid #27ae60; border-radius: 8px; color: #27ae60; font-size: 0.9rem; }

/* Responsive */
@media (max-width: 768px) {
    .tourisme-grid, .numeros-container { grid-template-columns: 1fr; }
    .association-block { flex-direction: column; text-align: center; }
}