/*
Theme Name: Theme Napollon
Author: Toi
Description: Thème sur mesure pour l'association Napollon
Version: 1.4
*/

/* =========================================
   1. VARIABLES & RESET
========================================== */
:root {
    --color-primary: #535D55;   
    --color-secondary: #A0AEAD; 
    --color-accent: #CBD02B;    
    --color-bg: #FFFFFF;        
    --color-bg-alt: #F9FAFA;
    
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --max-width: 1200px;
    --border-radius: 12px;
    --shadow-soft: 0 10px 40px -10px rgba(0,0,0,0.08);
    --shadow-hover: 0 20px 40px -10px rgba(0,0,0,0.15);
    
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- CORRECTIF SCROLL DÉFINITIF (MÉTHODE PUISSANTE) --- */
html {
    scroll-behavior: smooth;
}

/* On cible tous les éléments susceptibles d'être des ancres (Titres, Sections, Divs avec ID) */
section[id], 
div[id], 
h1[id], 
h2[id], 
h3[id] {
    /* C'est ICI que la magie opère. On force une marge invisible de 220px au-dessus */
    scroll-margin-top: 220px !important;
}

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

body {
    font-family: var(--font-main);
    color: var(--color-primary);
    background-color: var(--color-bg);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased; 
    overflow-x: hidden;
    
    /* IMPORTANT : Espace pour que le contenu ne soit pas caché sous le menu fixe */
    padding-top: 170px; 
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
    display: inline-block; 
}

ul { list-style: none; }

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.page-spacing {
    margin-top: 5rem;
}

/* Correction espace Accueil */
.map-section {
    margin-top: 6rem;
}

/* =========================================
   2. HEADER & NAVIGATION (FIXE & CORRIGÉ)
========================================== */
.site-header {
    position: fixed;       /* Fige le menu */
    top: 0;
    left: 0;
    width: 100%;
    background-color: #FFFFFF; /* Fond blanc opaque pour ne rien voir à travers */
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    z-index: 9999;         /* Toujours au-dessus du reste */
    height: auto;
}

/* --- CORRECTIF SPÉCIAL BARRE ADMIN WORDPRESS --- */
/* Si la barre noire de l'admin est là, on descend le menu pour ne pas le couper */
body.admin-bar .site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px; /* La barre admin est plus grande sur mobile */
    }
}
/* ----------------------------------------------- */

/* --- Barre Principale --- */
.main-navbar-container {
    padding: 0.8rem 0;
}

.main-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 55px;
    width: auto;
    transition: var(--transition-smooth);
    border-radius: 0;
}

.logo a:hover img {
    transform: scale(1.05);
}

/* Navigation Principale */
.primary-nav .nav-links {
    display: flex;
    gap: 40px;
}

.primary-nav .nav-links a {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    padding: 5px 0;
    position: relative;
    color: var(--color-primary);
}

.primary-nav .nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--color-accent);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.primary-nav .nav-links a:hover::after,
.primary-nav .nav-links a.active::after {
    width: 100%;
}

.primary-nav .nav-links a:hover {
    color: var(--color-accent);
}

/* --- Sous-barre (Bas) --- */
.sub-navbar {
    background-color: var(--color-primary);
    color: #fff;
    font-size: 0.85rem;
    padding: 0.6rem 0;
    font-weight: 500;
}

.flex-space-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-icons a, 
.secondary-links a {
    color: rgba(255, 255, 255, 0.85);
    margin-right: 20px;
    transition: all 0.3s ease;
}

.social-icons a:hover,
.secondary-links a:hover {
    color: var(--color-accent);
    transform: translateY(-2px);
    opacity: 1;
}

.secondary-links {
    display: flex;
    gap: 10px;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--color-primary);
    cursor: pointer;
    padding: 5px;
}

/* =========================================
   3. CONTENU PRINCIPAL
========================================== */
main {
    padding-bottom: 6rem;
}

.page-title {
    text-align: center;
    margin-bottom: 4rem;
    color: var(--color-primary);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Intro */
.intro-section {
    text-align: center;
    padding: 4rem 0;
}

.intro-section h1 {
    font-size: 2.8rem;
    margin-bottom: 2rem;
    color: var(--color-primary);
    font-weight: 800;
}

.text-content {
    max-width: 750px;
    margin: 0 auto;
    font-size: 1.2rem;
    color: #555;
    line-height: 1.8;
}

section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--color-primary);
    font-weight: 700;
}

/* Cartes */
.news-card, 
.news-card-horizontal,
.news-card-compact,
.service-box,
.listing-card,
.contact-box,
.auth-box,
.partner-card,
.trust-item,
.event-card,
.sitemap-container,
.legal-container,
.map-container {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.news-card:hover, 
.news-card-horizontal:hover,
.news-card-compact:hover,
.service-box:hover,
.listing-card:hover,
.partner-card:hover,
.trust-item:hover,
.event-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: var(--shadow-hover) !important;
    border-color: transparent;
}

.map-container iframe {
    border: none !important;
}

/* =========================================
   4. FOOTER
========================================== */
.site-footer {
    background-color: var(--color-primary);
    color: #fff;
    padding: 5rem 0 2rem;
    margin-top: auto;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 3rem;
}

.footer-col h3 {
    color: var(--color-accent);
    font-size: 1rem;
    margin-bottom: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}

.footer-col ul li {
    margin-bottom: 0.8rem;
}

.footer-col ul li a {
    opacity: 0.8;
    transition: all 0.3s;
}

.footer-col ul li a:hover {
    color: #fff;
    opacity: 1;
    transform: translateX(5px);
}

.footer-col:last-child {
    text-align: right;
}

.footer-col:last-child ul li a:hover {
    transform: translateX(-5px); 
}

.footer-socials {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.footer-socials a {
    font-size: 1.4rem;
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.1);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0;
}

.footer-socials a:hover {
    background-color: var(--color-accent);
    color: var(--color-primary);
    transform: translateY(-5px);
}

.footer-bottom {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.6;
}

/* =========================================
   5. RESPONSIVE
========================================== */
@media (max-width: 1024px) {
    /* Ajustement padding du body pour mobile */
    body {
        padding-top: 140px;
    }

    .primary-nav .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #fff;
        border-top: 1px solid rgba(0,0,0,0.05);
        padding: 1.5rem 0;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        gap: 0;
        z-index: 1000;
    }

    .primary-nav .nav-links.active { display: flex; }

    .primary-nav .nav-links li a {
        display: block;
        padding: 1rem 24px;
        border-bottom: 1px solid #f5f5f5;
        color: var(--color-primary);
    }
    
    .primary-nav .nav-links li a:hover {
        background-color: var(--color-bg-alt);
        padding-left: 30px;
    }

    .mobile-toggle { display: block; }
    
    .logo img { height: 45px; }

    .sub-navbar .container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .secondary-links { justify-content: center; }

    /* --- MISE A JOUR FOOTER RESPONSIVE (CENTRÉ) --- */
    .footer-grid {
        flex-direction: column;
        align-items: center; /* Centre les blocs */
        text-align: center;  /* Centre le texte interne */
        gap: 2rem;
    }
    
    .footer-col {
        width: 100%;
        text-align: center !important; /* Force le centrage */
    }

    /* Force la colonne de droite (social) à se centrer aussi */
    .footer-col:last-child { 
        text-align: center !important; 
    }
    
    .footer-socials { 
        justify-content: center !important; 
        width: 100%;
        display: flex;
    }
    
    .intro-section h1 { font-size: 2rem; }
}

/* =========================================
   6. ANIMATIONS
========================================== */
.reveal-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.215, 0.61, 0.355, 1), 
                transform 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
    will-change: opacity, transform;
}

.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal-hidden {
        opacity: 1;
        transform: none;
        transition: none;
    }
}