/* --- VARIABLES & RESET --- */
:root {
    --primary-green: #4a7c59;
    --secondary-green: #2e523e;
    --accent-color: #d4a373;
    --bg-light: #fdfcf8;
    --bg-card: #ffffff;
    --text-dark: #333333;
    --text-light: #555555;
    --font-heading: 'Fraunces', serif;
    --font-body: 'Inter', sans-serif;
    --font-hand: 'WindSong', cursive;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: 0.3s; cursor: pointer; }
img { max-width: 100%; display: block; object-fit: cover; }
ul { list-style: none; }

/* --- HEADER --- */
header {
    background: rgba(255, 255, 255, 0.98);
    padding: 1rem 5%;
    position: fixed; width: 100%; top: 0; z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex; justify-content: space-between; align-items: center;
}

.logo { font-family: var(--font-heading); font-weight: 700; font-size: 1.3rem; color: var(--primary-green); }
.logo span { color: var(--accent-color); }

nav ul { display: flex; gap: 2rem; align-items: center; }
nav a { font-weight: 600; font-size: 0.95rem; color: var(--text-dark); }
nav a:hover { color: var(--primary-green); }

.btn-cta {
    background: var(--primary-green); color: white; padding: 0.6rem 1.4rem; 
    border-radius: 30px; font-weight: 600; display: inline-block;
}
.btn-cta:hover { background: var(--secondary-green); color: white; transform: translateY(-2px); }
.btn-white { background: white; color: var(--primary-green); }
.btn-outline { background: white; color: var(--primary-green); border: 2px solid var(--primary-green); }

.mobile-menu-btn { display: none; font-size: 1.5rem; background: none; border: none; cursor: pointer; }

/* --- HERO --- */
.hero {
    min-height: 85vh;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    /* Pense à vérifier ce chemin d'image */
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.4)), url('../img/hero/banniere-accueil.jpg') center/cover;
    color: white; padding-top: 80px;
}
.hero h1 { font-family: var(--font-heading); font-size: 3.5rem; margin-bottom: 1rem; line-height: 1.2; }
.hero p { font-size: 1.2rem; max-width: 700px; margin: 0 auto 2rem; }
.hero-subtitle { font-family: var(--font-hand); font-size: 2.5rem; margin-bottom: 0; }

/* --- SECTIONS --- */
.section-text { padding: 5rem 5%; max-width: 1200px; margin: 0 auto; }
.section-alt { background-color: #f2f4f1; } 
.full-width { max-width: 100%; }
.container { max-width: 1200px; margin: 0 auto; }

h2 { 
    font-family: var(--font-heading); font-size: 2.5rem; color: var(--secondary-green); 
    text-align: center; margin-bottom: 3rem; position: relative;
}
h2::after {
    content: ''; display: block; width: 60px; height: 3px; 
    background: var(--accent-color); margin: 15px auto 0;
}
h3 { font-family: var(--font-heading); color: var(--primary-green); font-size: 1.5rem; margin-bottom: 1rem; }

mark { background: transparent; color: var(--accent-color); }

.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.two-cols img { border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }

.check-list li { margin-bottom: 0.8rem; position: relative; padding-left: 1.5rem; }
.check-list li::before { content: '✔'; color: var(--accent-color); position: absolute; left: 0; font-weight: bold; }

.emoji-list li { margin-bottom: 10px; font-size: 0.95rem; }

/* --- PRODUCTEURS GRID --- */
.producer-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2.5rem;
    min-height: 200px; 
}
.producer-card {
    background: var(--bg-card); border-radius: 12px; overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); transition: 0.3s; cursor: pointer;
    display: flex; flex-direction: column; border: 1px solid #eee;
}
.producer-card:hover { transform: translateY(-8px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }

.card-img-container { height: 200px; overflow: hidden; background: #f0f0f0; }
.card-img { 
    width: 100%; height: 100%; 
    object-fit: cover; 
    /* LA SOLUTION POUR NE PAS COUPER LES TETES */
    object-position: top center; 
    transition: transform 0.5s; 
}
.producer-card:hover .card-img { transform: scale(1.05); }

.card-content { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.card-cat { color: var(--accent-color); font-weight: 700; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 1px; margin-bottom: 0.5rem; }
.card-title { font-family: var(--font-heading); font-size: 1.3rem; color: var(--secondary-green); margin-bottom: 0.8rem; line-height: 1.3; }
.card-desc { font-size: 0.9rem; color: #666; margin-bottom: 1.5rem; flex-grow: 1; }
.card-link { color: var(--primary-green); font-weight: 700; font-size: 0.9rem; margin-top: auto; display: flex; align-items: center; gap: 5px; }

/* --- STEPS --- */
.steps-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem;
    text-align: center;
}
.step-card {
    background: white; padding: 2rem; border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); border-top: 4px solid var(--accent-color);
}
.step-number { 
    font-family: var(--font-heading); font-size: 3rem; color: var(--primary-green); opacity: 0.2; 
    margin-bottom: -1rem; display: block;
}
.center-btn { text-align: center; margin-top: 3rem; }

/* --- FOOTER --- */
footer { background: var(--secondary-green); color: white; padding: 3rem 5%; text-align: center; }
footer a { color: var(--accent-color); }
.footer-links { margin-top: 1rem; font-size: 0.9rem; opacity: 0.8; }
.footer-links a { margin: 0 10px; color: white; text-decoration: underline; }

/* --- MODAL --- */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 2000;
    backdrop-filter: blur(5px);
    align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s;
}
.modal-overlay.active { opacity: 1; }

.modal-content {
    background: white; width: 95%; max-width: 1000px; max-height: 90vh;
    border-radius: 12px; overflow: hidden; position: relative;
    display: grid; grid-template-columns: 1.2fr 1fr;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px); transition: transform 0.3s;
    min-height: 550px; /* Hauteur minimum garantie sur PC */
}
.modal-overlay.active .modal-content { transform: translateY(0); }
.legal-content { display: block; padding: 2rem; max-width: 800px; grid-template-columns: 1fr; }

/* --- CSS SPECIFIQUE MENTIONS LEGALES --- */
.legal-content {
    display: flex;
    flex-direction: column;
    padding: 0; /* On retire le padding global pour gérer le header et le contenu séparement */
    max-width: 800px;
    height: 85vh; /* Hauteur max fixe pour permettre le scroll */
    background: white;
}

.legal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #eee;
    background: #fff;
    flex-shrink: 0; /* Empêche le header de rétrécir */
}

.legal-header h2 {
    margin: 0;
    text-align: left;
    font-size: 2rem;
}
.legal-header h2::after { margin: 10px 0 0; } /* Ajustement du petit trait sous le titre */

.legal-text {
    padding: 2rem;
    overflow-y: auto; /* C'est ici que le scroll se fait */
    font-size: 0.95rem;
    color: #444;
    line-height: 1.6;
}

.legal-text h3 {
    color: var(--primary-green);
    font-family: var(--font-heading);
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.legal-text h3:first-child { margin-top: 0; }

.legal-text p { margin-bottom: 1rem; }
.legal-text a { color: var(--primary-green); text-decoration: underline; }
.legal-text a:hover { color: var(--accent-color); }

/* CSS DU DIAPORAMA */
.modal-left { background: #1a1a1a; 
    position: relative; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    overflow: hidden; 
    height: 100%; /* Prend toute la hauteur disponible de la modale */
    width: 100%  /* Prend toute la largeur de sa colonne */}

.slide { display: none; width: 100%; height: 100%; }
.slide.active { display: block; animation: fade 0.5s; }
.slide img {
    width: 100%;
    height: 100%;
    
    /* C'est la clé magique : */
    object-fit: cover; /* Remplit tout l'espace (comme un fond d'écran) */
    object-position: center top; /* Si ça coupe, on privilégie le haut (visages) */
}

.prev-slide, .next-slide {
    cursor: pointer; position: absolute; top: 50%; width: auto; padding: 16px; margin-top: -22px;
    color: white; font-weight: bold; font-size: 18px; transition: 0.3s ease;
    border-radius: 0 3px 3px 0; user-select: none; background-color: rgba(0,0,0,0.3); border: none; z-index: 10;
}
.next-slide { right: 0; border-radius: 3px 0 0 3px; }
.prev-slide { left: 0; border-radius: 3px 0 0 3px; }
.prev-slide:hover, .next-slide:hover { background-color: rgba(0,0,0,0.8); }

@keyframes fade { from {opacity: .4} to {opacity: 1} }

.modal-right { padding: 3rem; overflow-y: auto; }
.modal-category { color: var(--accent-color); font-weight: bold; text-transform: uppercase; font-size: 0.9rem; }
.modal-desc-long { color: var(--text-dark); line-height: 1.8; font-size: 1rem; }
.modal-desc-long p { margin-bottom: 1rem; }

.close-modal {
    position: absolute; top: 15px; right: 20px;
    background: white; border: none; width: 40px; height: 40px; border-radius: 50%;
    font-size: 1.5rem; color: var(--text-dark); cursor: pointer; z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); display: flex; align-items: center; justify-content: center;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    /* 1. Ajustement général */
    .two-cols { grid-template-columns: 1fr; gap: 2rem; }
    .modal-content { grid-template-columns: 1fr; overflow-y: auto; min-height: auto; }
    .modal-left { height: 300px; min-height: 300px; width: 100%; }
    .hero h1 { font-size: 2.5rem; }

    /* 2. Affichage du bouton hamburger */
    .mobile-menu-btn { display: block; z-index: 1001; position: relative; }

    /* 3. CORRECTION DU MENU MOBILE */
    /* On cache le conteneur principal par défaut */
    #main-nav { 
        display: none; 
        /* Le JS passera ceci en 'flex' lors de l'ouverture */
    }

    /* On force la liste à être visible et en colonne */
    #main-nav ul { 
        display: flex;           /* Important : on écrase le display:none des versions précédentes */
        flex-direction: column;  /* Les liens les uns sous les autres */
        gap: 1.5rem;             /* Espace entre les liens */
        align-items: center;     /* Tout le monde centré */
        width: 100%;
        margin-top: 1rem;
    }

    /* On s'assure que les liens sont assez gros */
    nav a { font-size: 1.1rem; display: block; }

    /* 4. GESTION SPÉCIALE DES BOUTONS DANS LE MENU MOBILE */
    #main-nav .btn-cta {
        display: inline-block !important; /* Force l'affichage du bouton */
        margin-top: 10px;
        width: auto; /* Ou 80% si tu veux qu'il soit large */
        text-align: center;
    }
}
/* --- ACTUALITÉS (BEEHIIV) --- */
.news-card {
    background: #fdfdfd;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-color: var(--accent-color);
}

.news-date {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.5rem;
    display: block;
    text-transform: uppercase;
    font-weight: 600;
}

.news-title h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--secondary-green);
    margin: 0 0 0.8rem 0;
}

.news-title { text-decoration: none !important; }

.news-desc {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.news-link {
    display: inline-block;
    color: var(--primary-green);
    font-weight: 700;
    font-size: 0.9rem;
    transition: 0.2s;
}
.news-link:hover { text-decoration: underline; color: var(--accent-color); }

/* --- ACTUALITÉS DÉPLOYÉES --- */

.news-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--secondary-green);
    margin: 0.5rem 0 1rem 0;
}

/* Style du contenu complet (HTML de Beehiiv) */
.news-full-content {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed #eee;
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
}

/* IMPORTANT : Empêche les images de l'article de casser le site */
.news-full-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    margin: 1rem 0;
    display: block;
}

/* Espacement des paragraphes dans l'article */
.news-full-content p {
    margin-bottom: 1rem;
}

/* Le bouton d'ouverture */
.news-toggle-btn {
    margin-top: 0.5rem;
    width: 100%; /* Bouton pleine largeur sur mobile, c'est plus facile */
    text-align: center;
    cursor: pointer;
}
@media (min-width: 768px) {
    .news-toggle-btn { width: auto; } /* Retour à la normale sur PC */
}

/* --- FIX FINAUX (BEEHIIV & BOUTON) --- */

/* 1. Cacher la ligne de séparation Beehiiv */
hr.beehiiv__footer__line, 
.beehiiv__footer {
    display: none !important;
}

/* 2. Réparer le bouton "Replier" (Blanc sur Blanc) */
/* On utilise un sélecteur très précis (#news-container + .btn-cta + .open-state) 
   pour gagner la priorité sur les règles précédentes. */

#news-container .btn-cta.open-state {
    background-color: white !important;       /* Fond blanc */
    color: var(--primary-green) !important;   /* Texte vert */
    border: 2px solid var(--primary-green) !important; /* Bordure verte */
}

/* Petit effet gris au survol du bouton replier pour bien voir qu'il est actif */
#news-container .btn-cta.open-state:hover {
    background-color: #f4f4f4 !important;
    color: var(--secondary-green) !important;
    transform: translateY(0); /* On évite qu'il bouge trop quand on le ferme */
}

/* --- CORRECTION CIBLÉE POUR LE BOUTON ACTUALITÉS --- */
/* On cible seulement le bouton .btn-cta qui est DANS #news-container */

#news-container .btn-cta {
    color: white !important;       /* Force le texte en blanc */
    background: var(--primary-green); /* Assure le fond vert */
    text-decoration: none !important; /* Enlève le soulignement */
    display: inline-block;
    margin-top: 10px;
}

#news-container .btn-cta:hover {
    background: var(--secondary-green);
    color: white !important;
}
/* --- MINIATURES IMAGES BEEHIIV --- */

/* Style de l'image réduite */
.beehiiv-thumb {
    width: 100px !important;
    height: 100px !important;
    object-fit: cover; /* Coupe l'image pour qu'elle soit carrée sans déformer */
    border-radius: 8px;
    margin: 5px 10px 5px 0; /* Un peu d'espace autour */
    border: 1px solid #ddd;
    transition: transform 0.2s;
    cursor: zoom-in; /* Curseur loupe pour indiquer qu'on peut cliquer */
    display: inline-block;
}

.beehiiv-thumb:hover {
    transform: scale(1.05);
    border-color: var(--primary-green);
}

/* On s'assure que le lien autour de l'image ne souligne pas */
.news-full-content a:has(.beehiiv-thumb) {
    text-decoration: none !important;
    border: none !important;
}

/* --- GESTION DES ICÔNES SVG (BEEHIIV) --- */
.news-full-content svg {
    width: 20px !important;           /* Force une petite taille */
    height: 20px !important;
    max-width: 20px !important;
    
    display: inline-block !important; /* Reste sur la ligne du texte */
    vertical-align: middle;           /* S'aligne verticalement */
    
    margin: 0 5px;                    /* Petit espace autour */
    fill: #888;                       /* Couleur grise discrète (ou var(--primary-green)) */
}

/* --- SECTION VIDÉO --- */
.video-section {
    background-color: #fff; /* Fond blanc pour casser avec le gris précédent */
    text-align: center;
}

.video-wrapper {
    max-width: 900px; /* Largeur max pour ne pas que ce soit gigantesque sur grand écran */
    margin: 0 auto;
    position: relative;
    border-radius: 20px; /* Coins bien arrondis */
    overflow: hidden; /* Important pour que la vidéo respecte les coins arrondis */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15); /* Belle ombre portée "effet cinéma" */
    border: 4px solid white; /* Petit cadre blanc esthétique */
    background: black; /* Fond noir au cas où la vidéo charge mal */
}

video {
    width: 100%;
    height: auto;
    display: block; /* Enlève l'espace vide sous la vidéo */
    outline: none;
}

.video-credits {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
}

/* Petit ajustement responsive */
@media (max-width: 900px) {
    .video-wrapper {
        border-radius: 12px;
        border-width: 2px;
    }
}