/* Règles globales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    line-height: 1.6;
    color: var(--gray-dark);
    background-color: #f1f1f1;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Header */
header {
    background: var(--secondary-color);
    color: var(--white);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: box-shadow 0.3s ease; /* Animation de transition de l'ombre */
}

/* Ombre qui apparaît lorsque l'on scrolle */
header.scrolled {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.8); /* Ombre légère sur le header vers 0=plus clair vers 1=foncée */
}


nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

nav h1 {
    font-size: 1.5rem;
}

nav h1 a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s;
}

nav h1 a:hover {
    color: var(--primary-color);
}

nav ul {
    list-style: none;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: var(--white);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: var(--background-color);
}

/* Styles pour les icônes des sections */
.section-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-top: 20px;
    margin-bottom: 0px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Animation de l'icône au chargement */
@keyframes fadeInIcon {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* message retour envoi de formulaire*/
.success-message {
    color: #28a745;
    font-weight: bold;
    text-align: center;
    margin: 10px 0;
}
.error-message {
    color: #dc3545;
    font-weight: bold;
    text-align: center;
    margin: 10px 0;
}

.section-icon {
    animation: fadeInIcon 1s ease-out;
}

/* Ajout du logo à gauche du nom du site */
#logo-link {
    display: flex;
    align-items: center;  /* Aligne verticalement le texte et le logo */
    color: var(--logo-color);
    text-decoration: none;
    transition: color 0.3s;
}

#logo {
    width: 60px;  /* Ajustez la taille du logo selon vos besoins */
    height: auto;
    margin-right: 10px;  /* Espace entre le logo et le nom du site */
}

#logo-link:hover {
    color: white;
}

#logo-link:focus,
#logo-link:active {
    outline: none;
    color: var(--logo-color);
}

/* Menu Burger */
.burger {
    display: none;
    font-size: 2rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

.burger-icon {
    display: inline-block;
    transition: all 0.3s ease; /* Transition fluide */
}

.burger.active .burger-icon {
    content: "X"; /* Ne fonctionne pas ici, géré via JS */
    font-size: 2rem;
    color: var(--white);
}

/* Section Accueil avec Parallax et effet de zoom */
#accueil {
    position: relative;
    padding: 80px 20px;
    color: var(--white);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    text-align: center;
    overflow: hidden;
    margin-top: 60px;
}

#accueil .background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/hero.jpg') no-repeat center center;
    background-size: cover;
    transform: scale(1);
    transition: transform 0.1s ease-out;
    z-index: 0;
    will-change: transform;
}

#accueil::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-overlay);
    z-index: 1;
}

#accueil .content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
}

#accueil .btn {
    margin-bottom: 24px;
}

/* Sections Générales */
section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    opacity: 0;
    transform: translateY(50px);
    animation: fadeInUp 0.8s ease forwards;
    will-change: opacity, transform;
}

section:nth-child(odd) {
    background: var(--white);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--footer-background-color);
}

#accueil h2 {
    color: var(--white);
}

p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    background: var(--primary-color);
    color: var(--white) !important;
    text-decoration: none;
    border-radius: 40px;
    border: none;
    transition: box-shadow 0.3s, transform 0.3s;
    text-shadow: 1px 1px 2px #000 !important; /* Détourage noir pour améliorer la lisibilité */
    opacity: 0;
}

.btn:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* Classes pour déclencher l'animation */
.btn.visible {
    animation: fadeInScale 0.8s ease-out forwards;
}

/* Galerie Photos */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

/* Styles spécifiques pour la galerie dans #galerie */
#galerie .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

#galerie .gallery img {
    width: 100%;
    max-width: 600px; /* Limite la largeur maximale */
    aspect-ratio: 4 / 3; /* Force le ratio 4:3 */
    object-fit: cover; /* Remplit le conteneur en rognant si nécessaire */
    object-position: center; /* Centre l'image dans le conteneur */
    border-radius: 20px;
    opacity: 0;
    transform: scale(0.8);
    transition: transform 0.6s ease-out, opacity 0.6s ease-out;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    will-change: transform;
    display: block; /* Permet à l'image de se comporter comme un bloc */
    margin: 0 auto; /* Centre l'image horizontalement */
}

.gallery img {
    width: 100%;
    max-width: 600px; /* Limite la largeur maximale */
    height: auto; /* Garde les proportions de l'image */
    border-radius: 20px;
    opacity: 0;
    transform: scale(0.8);
    transition: transform 0.6s ease-out, opacity 0.6s ease-out;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    will-change: transform;
    display: block; /* Permet à l'image de se comporter comme un bloc */
    margin: 0 auto; /* Centre l'image horizontalement */
}

.gallery img.visible {
    opacity: 1;
    transform: scale(1);
}

#galerie .gallery img.visible {
    opacity: 1;
    transform: scale(1);
}

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

#galerie .gallery img:hover {
    transform: scale(1.05);
}

/* Styles pour l'accordéon */
.accordion {
    margin: 30px 0;
    width: 100%;
}

.accordion-item {
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    background-color: #fff;
    transition: all 0.3s ease;
}

.accordion-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.accordion-header {
    display: flex;
    justify-content: flex-start; /* Alignement à gauche */
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f8f8;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.accordion-header:hover {
    background-color: #f0f0f0;
}

.accordion-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
    flex-grow: 1; /* Permet au titre de prendre tout l'espace disponible */
    text-align: left; /* Justification à gauche */
}

.accordion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #e7e7e7;
    transition: all 0.3s ease;
}

.accordion-icon i {
    font-size: 0.8rem;
    color: #555;
    transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon i {
    transform: rotate(45deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 20px;
}

.accordion-item.active .accordion-content {
    max-height: 200px; /* Ajustez selon le contenu */
    padding: 20px;
}

/* Formulaire de contact */
.contact-box {
    max-width: 650px;
    margin: 40px auto;
    padding: 20px 10px; 
    background: white;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s;
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.2);
}

/* Style pour les placeholders */
::placeholder {
    color: var(--gray-light);
    opacity: 1;
}

/* Back-to-Top Button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3); /* Ombre portée légère */
    transition: box-shadow 0.3s ease-in-out; /* Effet de transition fluide */
}

#back-to-top i {
    font-size: 1.2rem;  /* Ajustez la taille de l'icône */
    display: inline-block;
}

#back-to-top.visible {
    opacity: 1;
}

#back-to-top:hover {
    background: var(--primary-color-backtop-hover);
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4); /* Ombre plus marquée au survol */
}

#galerie {
    background: #f8f8f8;
}

/* Footer */
footer {
    background: var(--footer-background-color);
    color: var(--background-color);
    padding: 40px 20px;
    text-align: center;
}

footer p {
    margin: 10px 0;
    font-size: 0.9rem;
}

footer p:first-child {
    font-size: 1.3rem; /* Augmente la taille du texte */
    font-weight: bold; /* Met en gras pour plus de visibilité */
    color: var(--white);
}

/* Style pour les liens dans le footer */
footer a {
    color: inherit;
    text-decoration: none;
}

/* Icônes dans le footer (téléphone et enveloppe) */
footer a i {
    text-decoration: none;
    color: var(--white); /* Applique la couleur blanche très claire aux icônes */
}

footer .refweb-color {
    color: var(--white); 
}

footer a:focus,
footer a:active {
    outline: none;
    color: inherit;
}

/* Responsive Design */
@media (max-width: 768px) {
    .burger {
        display: block;
    }

    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: var(--secondary-color);
        padding: 20px 0;
        font-size: 1.7rem;
        text-align: center;
        transition: transform 0.3s ease;
        transform: translateX(-100%);
    }

    nav ul.active {
        display: flex;
        transform: translateX(0);
        background-color: rgba(20, 20, 20, 0.85); /* background du menu burger transparence */
    }

    nav ul li {
        margin: 20px 0;
    }

    nav ul li a {
        color: var(--white);
        text-decoration: none;
        font-weight: bold;
        transition: color 0.3s;
    }

    nav ul li a:hover {
        color: var(--background-color);
    }
    
    #accueil {
        padding: 100px 15px 60px 15px;
        margin-top: 0;
    }

    #accueil .background {
        background-attachment: scroll;
    }

    h2 {
        font-size: 1.5rem;
    }

    p {
        font-size: 1rem;
    }

    .btn {
        padding: 10px 20px;
    }

    #back-to-top {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        bottom: 20px;
        right: 20px;
    }

    /* Ajustement pour la galerie sur smartphone */
    #galerie .gallery {
        grid-template-columns: 1fr; /* Une seule colonne pour agrandir les images */
        padding: 20px 4px; /* Marge de 4px de chaque côté de l'écran */
        gap: 10px; /* Réduction de l'espacement entre les images */
    }

    #galerie .gallery img {
        width: 100%;
        max-width: none; /* Supprime la limite pour occuper toute la largeur disponible */
    }
}

/* Désactiver parallax sur iOS */
@supports (-webkit-overflow-scrolling: touch) {
    #accueil .background {
        background-attachment: scroll;
    }
}