/* ===== PARTIE 1: FONDATIONS ET VARIABLES ===== */

/* Import des polices Google Fonts - avec variantes de poids */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Montserrat:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&display=swap');

/* Variables et réinitialisation */
:root {
    /* Palette de couleurs principale */
    --primary-dark: #0a3d62;     /* Bleu très foncé */
    --primary: #1e5f8c;          /* Bleu principal */
    --primary-light: #3498db;    /* Bleu clair */
    --primary-pale: #e6f2fa;     /* Bleu très pâle */
    
    /* Palette secondaire */
    --secondary-dark: #1f6650;   /* Vert foncé */
    --secondary: #2E8B57;        /* Vert principal */
    --secondary-light: #4bc687;  /* Vert clair */
    --secondary-pale: #e7f8ef;   /* Vert très pâle */
    
    /* Palette accentuation */
    --gold: #d4a017;             /* Or */
    --gold-light: #f0c75e;       /* Or clair */
    --gold-pale: #fcf3de;        /* Beige doré */
    --accent: #e74c3c;           /* Rouge accent */
    --accent-light: #f7aca6;     /* Rouge clair */
    
    /* Palette neutre */
    --dark: #1a2a36;             /* Presque noir */
    --gray-dark: #4a5f70;        /* Gris foncé */
    --gray: #7f8c8d;             /* Gris moyen */
    --gray-light: #bdc3c7;       /* Gris clair */
    --light: #ecf0f1;            /* Blanc cassé */
    --white: #ffffff;            /* Blanc pur */
    
    /* Typographie */
    --font-heading: 'Playfair Display', serif;
    --font-subheading: 'Cormorant Garamond', serif;
    --font-body: 'Montserrat', sans-serif;
    
    /* Tailles de police */
    --fs-xxl: 3.2rem;    /* Très grand titre */
    --fs-xl: 2.5rem;     /* Grand titre */
    --fs-lg: 2rem;       /* Titre moyen */
    --fs-md: 1.5rem;     /* Sous-titre */
    --fs-normal: 1rem;   /* Texte normal */
    --fs-sm: 0.9rem;     /* Petit texte */
    --fs-xs: 0.8rem;     /* Très petit texte */
    
    /* Espacements */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 3rem;
    --space-xl: 5rem;
    --space-xxl: 8rem;
    
    /* Éléments d'interface */
    --radius-sm: 5px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 50px;
    --radius-circle: 50%;
    
    /* Ombres */
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);
    --shadow-inner: inset 0 2px 5px rgba(0, 0, 0, 0.05);
    
    /* Transitions */
    --transition-fast: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-medium: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-slow: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    
    /* Bordures */
    --border-thin: 1px solid rgba(0, 0, 0, 0.1);
    --border-medium: 2px solid rgba(0, 0, 0, 0.1);
    --border-thick: 3px solid rgba(0, 0, 0, 0.1);
    
    /* Dimensions maximales */
    --max-width: 1300px;
    --content-width: 1200px;
    
    /* Couleurs spécifiques aux services */
    --pompier-color: #e74c3c;
    --gendarmerie-color: #3498db;
    --finances-color: #f39c12;
    --dechets-color: #27ae60;
    --retraite-color: #9b59b6;
    --vosges-color: #2980b9;
    --france-service-color: #c0392b;
    --periscolaire-color: #16a085;
    --creche-color: #f1c40f;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition-medium);
    position: relative;
}

a:hover {
    color: var(--secondary);
}

img, video, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

main {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

/* Animations principales */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(50, 50);
        opacity: 0;
    }
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

@keyframes shine {
    0% { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}

/* ===== TITRE DE LA PAGE ===== */

.page-title {
    color: var(--primary-dark);
    text-align: center;
    font-size: var(--fs-xl);
    font-family: var(--font-heading);
    margin-bottom: var(--space-lg);
    padding-bottom: 15px;
    margin-top: 150px;
    position: relative;
    display: inline-block;
    width: 100%;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, var(--secondary), var(--gold), var(--secondary));
}

/* ===== CONTAINER DES SERVICES ===== */

.services-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

section{
    margin-bottom: 50px;
}

/* ===== CARDS DES SERVICES ===== */

.service-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: row;
    transition: var(--transition-bounce);
    border-left: 4px solid var(--primary);
    position: relative;
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
    min-height: auto;
    align-items: stretch;
}

.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5) { animation-delay: 0.5s; }
.service-card:nth-child(6) { animation-delay: 0.6s; }
.service-card:nth-child(7) { animation-delay: 0.7s; }
.service-card:nth-child(8) { animation-delay: 0.8s; }
.service-card:nth-child(9) { animation-delay: 0.9s; }

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

/* Couleurs spécifiques par service */
.pompier {
    border-left-color: var(--pompier-color);
}

.gendarmerie {
    border-left-color: var(--gendarmerie-color);
}

.finances-publics {
    border-left-color: var(--finances-color);
}

.ramassage-ordure {
    border-left-color: var(--dechets-color);
}

.retraite {
    border-left-color: var(--retraite-color);
}

.vosges-sud-ouest {
    border-left-color: var(--vosges-color);
}

.france-service {
    border-left-color: var(--france-service-color);
}

.service-periscolaire {
    border-left-color: var(--periscolaire-color);
}

.creche {
    border-left-color: var(--creche-color);
}

/* Images des services */
.service-image {
    width: 200px;
    height: auto;
    min-height: 150px;
    max-height: 250px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.service-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: var(--transition-medium);
}

.service-card:hover .service-image img {
    transform: scale(1.03);
}

/* Contenu des services */
.service-content {
    padding: var(--space-md);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.service-content h2 {
    color: var(--primary-dark);
    font-size: 1.2rem;
    font-family: var(--font-heading);
    margin-bottom: var(--space-sm);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-pale);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.service-content h2 .fas {
    color: var(--secondary);
    font-size: 1.1em;
    flex-shrink: 0;
}

.service-details {
    font-size: 0.9rem;
    flex-grow: 1;
    overflow: visible;
}

.service-details p {
    margin-bottom: 8px;
    color: var(--gray-dark);
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.service-details strong {
    color: var(--primary-dark);
    font-weight: 600;
}

.service-details address {
    margin-bottom: 12px;
    font-style: normal;
    color: var(--gray-dark);
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.service-details .fas {
    width: 16px;
    color: var(--secondary);
    margin-right: 6px;
    flex-shrink: 0;
}

.service-details .horaires {
    margin-top: 15px;
    background: linear-gradient(135deg, var(--primary-pale), #f8fafc);
    padding: 12px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--secondary);
    box-shadow: var(--shadow-sm);
}

.service-details .horaires p:first-child {
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 0.85rem;
}

.service-details .horaires p {
    font-size: 0.8rem;
    margin-bottom: 4px;
    color: var(--gray-dark);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Blocs d'informations */
.info-block {
    margin-bottom: var(--space-sm);
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--gray-light);
}

.info-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.info-block h3 {
    color: var(--primary-dark);
    font-size: 1rem;
    font-family: var(--font-heading);
    margin-bottom: 8px;
    padding-left: 12px;
    border-left: 3px solid var(--secondary);
    position: relative;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.info-block p {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 6px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Alerte */
.alert {
    background: linear-gradient(135deg, #fef2f2, #fef7f7);
    border-left: 4px solid var(--accent);
    padding: 12px 16px;
    margin: 15px 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    box-shadow: var(--shadow-sm);
    font-size: 0.9rem;
}

.alert .fas {
    color: var(--accent);
    margin-right: 6px;
}

/* Image secondaire */
.secondary-image {
    margin-top: 20px;
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.secondary-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    transition: var(--transition-medium);
}

.secondary-image:hover img {
    transform: scale(1.03);
}

/* Gestionnaire */
.gestionnaire {
    margin-top: 15px;
    padding: 12px;
    background: linear-gradient(135deg, var(--secondary-pale), #e8f5e8);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--secondary);
    box-shadow: var(--shadow-sm);
}

.gestionnaire p {
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--gray-dark);
}

/* Services fournis */
.services-fournis {
    margin-top: var(--space-sm);
}

.services-fournis h3 {
    color: var(--primary-dark);
    font-size: 1.1rem;
    font-family: var(--font-heading);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--secondary);
    display: inline-block;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.services-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.services-list li {
    background: linear-gradient(135deg, var(--primary-pale), #f8fafc);
    padding: 10px;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--secondary);
    transition: var(--transition-medium);
    box-shadow: var(--shadow-sm);
}

.services-list li:hover {
    background: linear-gradient(135deg, var(--secondary-pale), #e8f5e8);
    transform: translateX(3px);
    box-shadow: var(--shadow-md);
}

.services-list h4 {
    color: var(--primary-dark);
    font-size: 0.9rem;
    font-family: var(--font-heading);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.services-list h4 .fas {
    color: var(--secondary);
    font-size: 0.8em;
    flex-shrink: 0;
}

.services-list p {
    margin-bottom: 0;
    color: var(--gray-dark);
    line-height: 1.3;
    font-size: 0.8rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (min-width: 768px) {
    .services-container {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
    
    .france-service {
        grid-column: span 2;
    }
    
    .services-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .services-container {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
        max-width: 1400px;
        margin: 0 auto var(--space-xl);
    }
    
    .france-service {
        grid-column: span 2;
    }
    
    .ramassage-ordure {
        grid-column: span 2;
    }
    
    .service-image {
        width: 220px;
        min-height: 160px;
        max-height: 300px;
    }
    
    .service-content h2 {
        font-size: 1.3rem;
    }
    
    .service-details {
        font-size: 0.95rem;
    }
    
    .services-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 768px) {
    :root {
        --space-md: 1.5rem;
        --space-lg: 2rem;
        --space-xl: 3rem;
        --space-xxl: 4rem;
        --fs-xxl: 2.2rem;
        --fs-xl: 1.8rem;
        --fs-lg: 1.5rem;
        --fs-md: 1.3rem;
    }
    
    html {
        font-size: 15px;
    }

    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        top: -160px;
        right: -280px;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: linear-gradient(to bottom, var(--primary-dark), var(--primary));
        flex-direction: column;
        padding: 100px 0 30px;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
        transition: right var(--transition-medium);
        z-index: 100;
        overflow-y: auto;
    }
    
    .nav-menu::before {
        width: 100%;
        height: 5px;
    }
    
    .nav-menu.show {
        right: 0;
    }
    
    .nav-menu li {
        width: 100%;
        margin: 0;
    }
    
    .nav-menu a {
        width: 100%;
        padding: 15px 25px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-menu a::before {
        display: none;
    }
    
    .submenu {
        position: static;
        width: 100%;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        padding: 0;
        background-color: rgba(0, 0, 0, 0.1);
        border-top: none;
    }
    
    .dropdown:hover .submenu {
        display: none;
    }
    
    .dropdown.active .submenu {
        display: block;
    }
    
    .submenu a {
        padding-left: 40px;
        color: rgba(255, 255, 255, 0.9);
        font-size: 0.9rem;
    }
    
    .submenu a:hover {
        color: var(--white);
        background-color: rgba(0, 0, 0, 0.1);
        padding-left: 45px;
    }
    
    .submenu a::after {
        display: none;
    }
    
    .service-card {
        flex-direction: column;
        min-height: auto;
    }
    
    .service-image {
        width: 50%;
        height: auto;
    }
    
    .page-title {
        font-size: var(--fs-lg);
    }
    
    .service-content h2 {
        font-size: 1.4rem;
    }
    
    .services-list {
        display: block;
    }
    
    .services-list li {
        margin-bottom: 15px;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .footer-column {
        flex-basis: 100%;
    }
    
    .footer-column:not(:last-child) {
        border-bottom: 1px solid #444;
        padding-bottom: 30px;
    }
}

@media (max-width: 576px) {
    :root {
        --space-sm: 0.8rem;
        --space-md: 1.2rem;
        --space-lg: 1.8rem;
        --space-xl: 2.5rem;
        --space-xxl: 3.5rem;
        --fs-xxl: 2rem;
        --fs-xl: 1.6rem;
        --fs-lg: 1.4rem;
        --fs-md: 1.2rem;
    }
    
    html {
        font-size: 14px;
    }
    
    .logo-container {
        flex-direction: column;
        text-align: center;
    }
    
    .logo {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .logo-container h1 {
        font-size: 1.8rem;
    }
    
    .slogan {
        font-size: 0.9rem;
    }
    
    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        top: -200px;
        right: -150px;
    }
    
    .service-card {
        flex-direction: column;
        min-height: auto;
    }
    
    .service-image {
        width: auto;
        height: auto;
    }
    
    .service-content {
        padding: var(--space-sm);
    }
    
    .service-content h2 {
        font-size: 1.1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .service-details {
        font-size: 0.85rem;
    }
    
    .info-block h3 {
        font-size: 1rem;
    }
    
    .services-list h4 {
        font-size: 0.9rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .services-list p {
        font-size: 0.8rem;
    }
    
    .footer-waves {
        height: 60px;
        margin-top: -60px;
    }
    
    .footer-waves svg {
        height: 60px;
    }
    
    .social-icons {
        justify-content: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 8px;
    }
    
    .footer-links a {
        display: block;
        padding: 5px 0;
    }
    
    .separator {
        display: none;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form input {
        border-radius: 4px;
        margin-bottom: 10px;
    }
    
    .newsletter-form button {
        border-radius: 4px;
        width: 100%;
    }

    section{
        margin-bottom: 120px;
    }
}

/* Correction pour le script JS du menu mobile */
.submenu-toggle {
    display: inline-block;
    position: absolute;
    right: 15px;
    top: 15px;
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 2;
}

.submenu-active {
    display: block !important;
}