/* --- Variables de couleur & Reset --- */
:root {
    --bg-color: #f4eae1;       /* Fond crème/vintage */
    --text-color: #4a2e1b;     /* Brun foncé pour les textes */
    --accent-color: #b07d4d;   /* Doré/marron clair pour les bordures/boutons */
    --btn-bg: #fdf8f4;         /* Fond des boutons clair */
    --font-title: 'Great Vibes', cursive;
    --font-text: 'Playfair Display', serif;
}

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

/* L'état normal de la page */
/* --- Styles de base pour la transition globale --- */
body {
    /* Au chargement, la page est invisible et légèrement décalée vers le bas */
    opacity: 0;
    transform: translateY(10px);
    
    /* On définit une transition douce sur l'opacité et la position */
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
    
    /* Petit correctif pour éviter les barres de défilement pendant l'animation */
    overflow-x: hidden;
}

/* --- ÉTATE 1 : L'entrée douce (Fade In) --- */
/* Cette classe sera ajoutée par JavaScript dès que la page est chargée */
body.loaded {
    opacity: 1;
    transform: translateY(0); /* La page reprend sa place */
}

/* --- ÉTAT 2 : La sortie douce (Fade Out) --- */
/* Cette classe est ajoutée temporairement juste avant de quitter la page */
body.fade-out {
    opacity: 0;
    transform: translateY(-10px); /* Léger effet de glissement vers le haut */
    /* On force la transition même si 'loaded' est présente */
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Optionnel : vous pourrez ajouter ici un léger grain ou dégradé pour imiter le fond texturé de votre maquette */
}

/* --- Navigation --- */
header {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    padding: 30px 8%;
}

.navbar {
    display: flex;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.1rem;
    transition: opacity 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    border-bottom: 1px solid var(--text-color);
}

/* --- Section Hero (Haut) --- */
.hero-section {
    position: relative;
    min-height: 80vh; /* Donnez-lui de la hauteur */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Important pour que le fond ne déborde pas */
}

.hero-content {
    position: relative;
    z-index: 2; /* Supérieur au fond, donc passe au-dessus */
    text-align: center;
}

.names {
    font-family: var(--font-title);
    font-size: 5.5rem;
    font-weight: 400;
    margin-bottom: 10px;
}

.separator {
    width: 60%;
    height: 1px;
    background-color: rgba(74, 46, 27, 0.3);
    margin: 0 auto 20px auto;
}

.subtitle {
    font-style: italic;
    font-size: 1.5rem;
    margin-bottom: 50px;
}

/* --- Boutons --- */
.cta-container {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    text-decoration: none;
    color: var(--text-color);
    background-color: var(--btn-bg);
    padding: 14px 30px;
    font-size: 1.1rem;
    border: 2px solid var(--accent-color);
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(74, 46, 27, 0.15);
    transition: all 0.3s ease;
}

.btn i {
    margin-right: 8px;
    color: var(--text-color);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(74, 46, 27, 0.25);
}

/* --- Section 3 Colonnes (Bas) --- */
.info-grid-section {
    background-color: rgba(255, 255, 255, 0.2); /* Léger contraste pour le bas */
    padding: 60px 10%;
    border-top: 1px solid rgba(74, 46, 27, 0.1);
}

.info-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 200px;
    max-width: 1100px;
    margin: 0 auto;
}

.info-card {
    text-align: center;
    /* position: relative; */
}

/* Séparateurs verticaux entre les colonnes */
.info-card:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -20px;
    top: 20%;
    height: 60%;
    width: 1px;
    background-color: rgba(74, 46, 27, 0.2);
}

.icon-wrapper {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--text-color);
    opacity: 0.8;
}

.info-card h2 {
    z-index: 2;
    font-size: 1.6rem;
    font-weight: 400;
    margin-bottom: 10px;
}

.info-card p {
      z-index: 2;
    font-size: 1.1rem;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 40px 20px;
    font-size: 1.1rem;
    border-top: 1px solid rgba(74, 46, 27, 0.1);
}

.icon {
    position: absolute;
    top:10vh;
    left: 20vh;
    margin-top: 15px;
    font-size: 1.2rem;
    z-index: 1;
}

.icon2 {
    position: absolute;
    top:6vh;
    left: 30vh;
    margin-top: 15px;
    font-size: 1.2rem;
    z-index: 1;
    transform: rotate(120deg);
}

.icon3 {
    position: absolute;
    top:20vh;
    right: 30vh;
    margin-top: 15px;
    font-size: 1.2rem;
    transform: rotate(220deg);
    z-index: 1;
}

.icon4 {
    position: absolute;
    top:40vh;
    right: 45vh;
    margin-top: 15px;
    font-size: 1.2rem;
    transform: rotate(260deg);
    z-index: 1;
}
/* Zone pour afficher vos dalles au milieu en arrière-plan */
.tiles-background {
    position: absolute;
    bottom: 0;   /* On fixe le fond en bas */
    left: 0;
    width: 100%;
    height: 50vh; /* Sa hauteur totale souhaitée */
    
    /* L'image de fond */
    background-image: url('images/dalles2.png');
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: 75% 100%;

    z-index: 1;    /* Au-dessus de rien, en dessous de tout */
    pointer-events: none;
    
    /* LA CORRECTION : Masquage graduel (le haut est invisible, le bas est visible) */
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%);
            mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%);
    
    /* Ajustement de la zone de masquage : on efface les premiers 100px */
    -webkit-mask-position: 0 -100px;
            mask-position: 0 -100px;
    -webkit-mask-size: 100% calc(100% + 100px);
            mask-size: 100% calc(100% + 100px);
}

/* --- Responsive (Pour les téléphones) --- */
@media (max-width: 768px) {
    header {
        justify-content: center;
        padding: 20px;
    }
    .names {
        font-size: 4rem;
    }
    .info-container {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    .info-card:not(:last-child)::after {
        display: none; /* On enlève les barres verticales sur mobile */
    }

    .tiles-background {
        height: 40vh; /* On réduit la hauteur du fond sur mobile */
        background-size: 100% 100%; /* On ajuste la taille de l'image pour qu'elle remplisse bien le fond */
    }
}

/* Style pour vos icônes personnalisées générées */
.custom-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

/* La carte a une forme plus allongée */
.custom-icon-card {
    width: 50px;
    height: 70px;
    object-fit: contain;
}



/* On s'assure que le contenu reste au-dessus des dalles arrière-plan */
.hero-content {
    position: relative;
    z-index: 2;
}

/* --- Page RSVP --- */

.form-group {
    margin-bottom: 35px; /* Espace généreux entre les champs */
    padding-bottom: 25px; /* Espace avant la ligne de séparation */
    border-bottom: 1px dashed rgba(176, 125, 77, 0.25); /* Ligne pointillée fine et élégante (couleur dorée/brune) */
}


.radio-label, .checkbox-label {
    display: inline-flex;
    align-items: center; /* Aligne verticalement le bouton et le texte sur le même axe */
    gap: 10px;           /* Crée un espace propre de 10px entre le bouton et le texte */
    margin-right: 20px;  /* Espace à droite pour ne pas coller l'option suivante */
    margin-bottom: 10px; /* Espace en dessous si les options passent à la ligne */
    cursor: pointer;     /* Change le curseur en main au survol pour une meilleure UX */
}

/* On s'assure que le bouton garde sa taille d'origine et ne s'écrase pas */
.radio-label input[type="radio"],
.checkbox-label input[type="checkbox"] {
    margin: 0;         /* Supprime les marges par défaut du navigateur */
    flex-shrink: 0;    /* Empêche le bouton de se déformer si le texte est long */
    width: 18px;       /* Optionnel : ajuste légèrement la taille pour une meilleure lisibilité */
    height: 18px;
}

/* Optionnel : aligner toute la liste des checkboxes ou radios en ligne ou en colonne propre */
.radio-group, .checkbox-list {
    display: flex;
    flex-wrap: wrap;   /* Permet de passer à la ligne proprement sur les écrans de téléphones */
    gap: 15px;         /* Espace global entre les différents choix */
    margin-top: 8px;
}

.rsvp-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

/* Conteneur principal qui superpose le texte sur l'image du livre */
.rsvp-book-container {
    position: relative;
    width: 100%;
    max-width: 650px; /* S'adapte à la forme verticale du livre généré */
    aspect-ratio: 2 / 3;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* L'image du livre prend toute la place en fond */
.book-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
    opacity: 0.3;
}

/* Le contenu textuel écrit "par-dessus" les pages */
.book-content-overlay {
    min-height: 100vh;
    position: relative;
    z-index: 2;
    width: 75%; /* Laisse une marge pour voir les bords du livre */
    height: 75%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Aligne le contenu vers le haut au lieu de le centrer verticalement */
    
    padding-top: 60px;    /* Espace de sécurité en haut pour que le H1 respire */
    padding-bottom: 60px; /* Espace en bas pour pouvoir scroller confortablement */
    box-sizing: border-box;
    padding: 20px;
    text-align: center;
}

.rsvp-title {
    font-family: var(--font-title);
    font-size: 3rem;
    font-weight: 400;
    margin-bottom: 5px;
    color: var(--text-color);
}

.rsvp-subtitle {
    font-style: italic;
    font-size: 1rem;
    margin-bottom: 25px;
    opacity: 0.8;
}

/* --- Styles des champs du Formulaire --- */
.rsvp-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    font-family: var(--font-text);
    font-size: 0.95rem;
    border: 1px solid rgba(74, 46, 27, 0.3);
    border-radius: 4px;
    background-color: rgba(253, 248, 244, 0.7); /* Fond semi-transparent pour voir le grain du papier dessous */
    color: var(--text-color);
    outline: none;
    transition: all 0.3s ease;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: var(--accent-color);
    background-color: rgba(253, 248, 244, 0.95);
    box-shadow: 0 0 5px rgba(176, 125, 77, 0.2);
}

/* Bouton envoyer personnalisé "plume" */
.btn-submit {
    margin-top: 10px;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
}

/* --- Responsive RSVP (Mobile) --- */
@media (max-width: 600px) {
    .rsvp-book-container {
        max-width: 100%;
        aspect-ratio: auto; /* On casse la forme du livre sur mobile pour que le texte ne soit pas minuscule */
        background-color: rgba(255, 255, 255, 0.5);
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.05);
        padding: 20px 10px;
    }
    
    .book-background {
        display: none; /* On cache le livre sur petit écran pour privilégier la lisibilité */
    }
    
    .book-content-overlay {
        width: 100%;
        height: auto;
        padding: 0;
    }

    .rsvp-title {
        font-size: 2.5rem;
    }
}

/* --- PAGE FAQ --- */

.faq-container {
    max-width: 800px;
    margin: 60px auto;
    padding: 0 20px;
    z-index: 2; /* On s'assure que le contenu FAQ est au-dessus des dalles de fond */
}

.faq-subtitle {
    text-align: center;
    font-style: italic;
    opacity: 0.8;
    margin-bottom: 40px;
}

.faq-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Équivalent de l'aération de notre formulaire */
}

/* Structure de chaque ligne de FAQ */
.faq-item {
    background-color: #fdf8f4; /* Votre couleur crème */
    border: 1px solid rgba(176, 125, 77, 0.2);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Le bouton de la question */
.faq-question {
    width: 100%;
    background: none;
    border: none;
    outline: none;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    font-family: inherit;
}

/* La petite flèche */
.faq-question .arrow {
    transition: transform 0.3s ease;
    color: #b07d4d; /* Votre touche dorée/brune */
    margin-left: 15px;
}

/* Le bloc de la réponse (caché par défaut) */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
    padding: 0 25px;
    opacity: 0;
    border-top: 1px transparent solid;
}

.faq-answer p, .faq-answer ul {
    margin: 0;
    padding-bottom: 20px;
    line-height: 1.6;
    opacity: 0.9;
}

.faq-answer ul {
    padding-left: 20px;
}

/* --- ÉTATS ACTIFS (Quand on clique) --- */

.faq-item.active {
    box-shadow: 0 4px 15px rgba(176, 125, 77, 0.1);
    border-color: rgba(176, 125, 77, 0.4);
}

/* La flèche tourne à 180° */
.faq-item.active .arrow {
    transform: rotate(180deg);
}

/* La réponse se déploie */
.faq-item.active .faq-answer {
    max-height: 300px; /* Hauteur max de sécurité pour l'animation */
    padding-top: 15px;
    opacity: 1;
    border-top: 1px dashed rgba(176, 125, 77, 0.15);
}

/* 1. Sur le bloc de réponse : on retire la hauteur statique */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 25px;
    /* On garde des transitions douces */
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    border-top: 1px solid transparent;
}

/* 2. Sur l'état actif : ON SUPPRIME max-height d'ici car JavaScript s'en charge ! */
.faq-item.active .faq-answer {
    /* max-height: 1000px;  <-- SUPPRIMEZ OU COMMENTEZ CETTE LIGNE */
    padding-top: 15px;
    opacity: 1;
    border-top: 1px dashed rgba(176, 125, 77, 0.15);
}