:root {
    --primary: #1e3a8a; /* Bleu foncé */
    --secondary: #d97706; /* Orange */
    --accent: #7c2d12; /* Marron/Bordeaux */
    --light: #f8fafc; /* Gris très clair */
    --dark: #1e293b; /* Gris très foncé/bleu */
}

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

html, body {
    margin: 0;
    padding: 0;
}

#hautpage {
    /* *** Cette règle est cruciale pour l'isoler du flux et résoudre la marge *** */
    position: absolute;
    height: 0; 
    width: 0;
    margin: 0; 
    padding: 0;
}

body {
    font-family: 'Georgia', serif;
    line-height: 1.2;
    color: var(--dark);
    background-color: var(--light);
    
    /* Les marges de réinitialisation restent */
    margin-top: 0; 
    padding-top: 0;
    
    /* *** AJOUTS CLÉS POUR LE COLLAGE TOTAL EN HAUT *** */
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Pour que le body prenne toute la hauteur de la fenêtre */
}

.page-accueil {
    font-family: 'Georgia', serif;
    line-height: 1.2;
    color: var(--dark);
    background-color: var(--light);
}


/* Style par défaut appliqué à toutes les pages (y compris le header) */
.container-accueil {
    width: 90%;
    max-width: 1200px; /* Doit correspondre à la règle ci-dessus */
    margin: 0 auto;
    padding: 0 1.5rem;
}

header {
    background: var(--primary);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-height: 70px;
    margin-top: 0;
}

header .container, header .container-accueil {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    flex-direction: row; /* Rétablit l'alignement horizontal */
}

.logo-container {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
}

.logo {
    height: 60px;
    width: auto;
}

.site-title {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
    line-height: 1;
}

.ligne-separation {
    background-color: var(--light); 
    border-top: 3px solid var(--secondary);
    margin: 1.5em 1.5em 1.5em 1.5em; 
    text-align: center;
}

nav {
    display: flex;
    align-items: flex-end;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.3rem;
    margin: 0;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    border-radius: 5px;
    transition: all 0.3s;
}

nav a:hover { background: var(--secondary); }

.croix-lorraine {
    width: 4em; 
    height: 4em; 
    
    /* Propriétés fixes qui ne changent pas */
    position: fixed; 
    z-index: 1000; 
    right: 5px; /* Toujours à 5px du bord droit */
    
    /* Propriétés de l'état initial (haut de page) */
    top: 10px; 
    transform: translateY(0); /* Initialement, pas de translation */
    
    /* Transition pour un mouvement fluide entre les états */
    transition: top 0.5s ease, transform 0.5s ease;
}

/* Nouvel état appliqué par JavaScript après défilement */
.croix-lorraine.scrolled {
    top: 50%; /* Descend au milieu de la fenêtre */
    transform: translateY(-50%); /* Décale l'élément vers le haut de 50% de sa propre hauteur pour le centrer parfaitement */
}

/* 2. Hero Section: aligné à gauche */
.hero {
    text-align: left;
    padding: 2rem 0;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
    color: var(--primary);
}

.hero p {
    font-size: 1.0rem;
    max-width: 1000px; 
    margin: 0 0 1.5rem 0;
    opacity: 0.9;
}
    
.hero ul {
    font-size: 1.0rem;
    max-width: 1000px; 
    margin: 0 0 1.5rem 0;
    opacity: 0.9;
}
    
.hero-list {
    list-style-position: inside; 
    padding-left: 0; 
    margin-bottom: 1.5rem; 
    font-size: 1.1rem;
}

.hero-list li {
    margin-bottom: 0.5rem;
}
    
.hero-content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center; 
    gap: 2rem;
    flex-direction: row;
}

.hero-text-content {
    flex: 3; 
}

.hero-image {
    flex: 1;
    text-align: right;
    display: none; 
}

.hero-image img {
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Affichage uniquement à partir d'une certaine largeur (e.g., 992px) */
@media (min-width: 992px) {
    .hero-image {
        display: block; 
    }
}


.section { padding: 4rem 0; }
/* Règle de grille : Définition des colonnes */
.grid { 
    display: grid; 
    /* Crée autant de colonnes de 300px que possible */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 2rem; 
}

/* Règle pour TOUTES les cartes (y compris celles qui n'ont pas la structure image/texte) */
.card {
    background: white;
    border-radius: 15px;
    /* *** MODIFICATION CLÉ : Réduction du padding pour moins de blanc *** */
    padding: 0.75rem; 
    
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%; 
    
    display: flex; 
    flex-direction: column; 
    align-items: flex-start; 
    text-align: left; 

    /* AJOUTS POUR LIEN (conservés) */
    text-decoration: none; 
    color: var(--dark); 
    display: flex; 
}

/* Règle spécifique pour les cartes dans la grille, pour les forcer à respecter la largeur de la cellule */
.grid .card {
    min-height: 100%; 
    /* width: 100% est toujours supprimé pour la grille */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* Conteneur Flex pour l'image et le texte (structure horizontale) */
.card-content-wrapper {
    display: flex;
    /* *** MODIFICATION : aligne tout en haut (pour coller l'image) *** */
    align-items: flex-start; 
    /* *** MODIFICATION : supprime l'espace entre l'image et le texte *** */
    gap: 0.5rem; 
    /* *** MODIFICATION : réduit ou supprime la marge inférieure *** */
    width: 100%; 
}

.card-content {
    flex-grow: 1; 
    min-width: 0; 
}


/* Règle pour l'image de la carte */
.card-img {
    width: 100px; 
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    /* *** MODIFICATION : supprime toute marge pour coller l'image *** */
    margin: 0; 
    display: block;
    flex-shrink: 0; 
}

.card h3 {
    color: var(--primary);
    margin-top: 0; 
    margin-bottom: 0.5rem; 
    font-size: 1.4rem;
}

.card p {
    font-size: 1rem;
    margin-bottom: 0;
}

.btn {
    display: inline-block;
    background: var(--primary); 
    color: white;
    padding: 0.8rem 2rem;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s;
    /* CORRECTION : Marge ajustée pour un alignement parfait à gauche sous le texte */
    margin: 1rem 0 0 0; 
    align-self: flex-start; 
}

.btn:hover {
    background: var(--accent); 
    transform: scale(1.05);
    color: white;
}

/* Style de section pour Focus, Nouveautés et Thèmes Principaux */
.focus-saison, .featured, .focus-style {
    background-color: var(--light); 
    border-top: 3px solid var(--secondary); 
    padding: 1.5rem 0; 
}

/* Règle pour le titre H2 dans les sections Focus, Featured et Focus-Style */
.focus-saison h2, .featured h2, .focus-style h2 { 
    color: var(--accent); 
    text-align: left; 
    margin-bottom: 2rem; 
    font-size: 2.5rem; 
}

/* Réinitialisation des styles de cartes pour la section Featured (qui n'est plus sombre) */
.featured .card {
    background: white; 
    color: var(--dark); 
    backdrop-filter: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); 
}

.featured .card h3 { color: var(--primary); }
.featured .card p { opacity: 1; }
.featured .card a.btn { background: var(--primary); } 
.featured .card a.btn:hover { background: var(--accent); } 


/* Style par défaut pour les H2 (seulement si non dans focus-saison, featured ou focus-style) */
h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary);
    font-size: 2.5rem;
}


footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

.footer-link {
    color: var(--secondary);
    text-decoration: none;
}

.footer-link:hover { text-decoration: underline; }

/* 3. Focus Section: utilise .container pour l'alignement */
.focus-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.focus-text {
    flex: 2;
    text-align: justify;
    line-height: 1.3;
}

.focus-text p { margin-bottom: 1rem; }

.focus-image {
    flex: 1;
    text-align: right; 
}

.focus-image img {
    max-width: 300px; 
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}


/* ===================================== */
/* === RÈGLES RESPONSIVES (Mobile) === */
/* ===================================== */

}

@media (max-width: 992px) {
    header .container {
        flex-direction: column;
        gap: 1rem; /* <-- C'est ici que l'espace est défini entre les enfants */
        align-items: center;
        min-height: auto;
        }
        
   header .container, header .container-accueil {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    flex-wrap: wrap;
    flex-direction: row; /* Rétablit l'alignement horizontal */
}
   
   
    
    .container-accueil, {
        /* Un padding beaucoup plus petit pour les téléphones */
        padding: 0 1rem; 
    }

    .logo-container-accueil { justify-content: center; }
    .logo { height: 50px; }
    .site-title { font-size: 1.3rem; }

    nav {
        width: 100%;
        justify-content: center;
        align-items: center;
    }

    nav ul {
        gap: 1rem;
        font-size: 0.9rem;
        justify-content: center;
        flex-wrap: wrap;
        margin-top: 0.5rem;
    }

    .container { padding: 0 1rem; }

    .hero { padding: 2rem 0; }

    .focus-content {
        flex-direction: column-reverse;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    .focus-image {
        text-align: center; 
    }
    
    .focus-saison h2, .featured h2, .focus-style h2 { 
        text-align: center; 
    }
    .focus-text { text-align: center; }
    .focus-image { max-width: 50%; } 
    
    /* *** RÈGLE MOBILE POUR LA CARTE : Empilement centré *** */
    .card-content-wrapper {
        flex-direction: column;
        align-items: center;
        text-align: center;
        /* AJOUT : Permet le retour à la ligne forcé pour les petits écrans */
        flex-wrap: wrap; 
    }
    .card-img {
        margin-bottom: 1rem;
    }
    .card h3, .card p {
        text-align: center;
    }
    .btn {
        /* Centrage du bouton dans la carte colonne sur mobile */
        align-self: center;
        margin: 1rem auto 0 auto;
    }
}

@media (max-width: 480px) {
    nav ul { gap: 0.5rem; }
    nav a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}