/* ==========================================================================
   1. VARIABLES & RESET
   ========================================================================== */
:root {
    /* Couleurs principales (Thème RossoGalNero) */
    --color-primary: #e32221; /* Rouge Milan */
    --color-black: #111111;   /* Noir profond */
    --color-dark: #1a1a1a;    /* Gris très foncé */
    --color-light: #f4f4f4;   /* Gris très clair pour les fonds */
    --color-white: #ffffff;
    --color-text: #333333;
    
    /* Typographie */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Roboto', sans-serif;
    
    /* Espacements & Ombres */
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --shadow-card: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.2);
    --border-radius: 8px;
    --transition-speed: 0.3s;
}

/* Reset CSS basique */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    /* Optimisation pour éviter le pull-to-refresh accidentel sur mobile */
    overscroll-behavior-y: none; 
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-light);
    line-height: 1.6;
    overflow-x: hidden; /* Empêche le scroll horizontal indésirable */
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed) ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   2. HEADER & NAVIGATION
   ========================================================================== */
.site-header {
    background-color: var(--color-white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Logo */
.brand-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logo-rosso { color: var(--color-primary); }
.logo-nero { color: var(--color-black); }

/* Navigation Desktop */
.nav-list {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
    position: relative;
    padding-bottom: 5px;
}

.nav-link:hover, .nav-link.active {
    color: var(--color-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--color-primary);
    transition: width var(--transition-speed) ease;
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

/* Bouton Menu Mobile (Hamburger) */
.mobile-menu-toggle {
    display: none; /* Caché sur Desktop */
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 24px;
    position: relative;
    z-index: 1001;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--color-black);
    position: absolute;
    left: 0;
    transition: all var(--transition-speed) ease;
    border-radius: 2px;
}

.hamburger-line:nth-child(1) { top: 0; }
.hamburger-line:nth-child(2) { top: 10px; }
.hamburger-line:nth-child(3) { top: 20px; }

/* Animation du Hamburger vers la Croix */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    top: 10px;
    transform: rotate(45deg);
    background-color: var(--color-white);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    top: 10px;
    transform: rotate(-45deg);
    background-color: var(--color-white);
}

/* Overlay sombre pour le menu mobile */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px); /* Effet verre dépoli */
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed) ease;
    z-index: 998;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   3. BLOCS DU CMS MODULAIRE
   ========================================================================== */
.site-content {
    min-height: calc(100vh - 200px); /* Pour garder le footer en bas si page vide */
}

/* Bloc : Hero Header */
.block-hero {
    position: relative;
    padding: 6rem 2rem;
    text-align: center;
    color: var(--color-white);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 50vh;
}

/* Surcouche sombre sur l'image de fond pour lire le texte */
.block-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-content h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Bloc : Texte & Image */
.block-text-image {
    padding: var(--spacing-lg) 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.text-image-container {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.text-image-content {
    flex: 1;
}

.text-image-content h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--color-black);
    margin-bottom: 1.5rem;
    position: relative;
}

/* Petite barre rouge sous le titre */
.text-image-content h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--color-primary);
    margin-top: 10px;
}

.text-image-media {
    flex: 1;
}

.text-image-media img {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    width: 100%;
    object-fit: cover;
}

/* Bloc : Cards (Cartes Grid) */
.block-cards {
    padding: var(--spacing-lg) 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.block-cards > h2 {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background-color: var(--color-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-image {
    height: 200px;
    width: 100%;
    object-fit: cover;
}

.card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--color-black);
}

.card-text {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.card-btn {
    align-self: flex-start;
    background-color: var(--color-black);
    color: var(--color-white);
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.card-btn:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* ==========================================================================
   4. FOOTER
   ========================================================================== */
.site-footer {
    background-color: var(--color-black);
    color: var(--color-white);
    padding: var(--spacing-lg) 2rem 1rem;
    font-size: 0.9rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h3 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-btn {
    background-color: #333;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.social-btn:hover {
    background-color: var(--color-primary);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #333;
    padding-top: 1rem;
    color: #888;
}

/* ==========================================================================
   5. RESPONSIVE DESIGN (Tablettes & Mobiles)
   ========================================================================== */

/* Tablettes (max-width: 1024px) */
@media screen and (max-width: 1024px) {
    .text-image-container {
        gap: 2rem;
    }
    
    .hero-content h1 {
        font-size: 2.8rem;
    }
}

/* Mobiles (max-width: 768px) */
@media screen and (max-width: 768px) {
    /* Menu Mobile */
    .mobile-menu-toggle {
        display: block; /* Affiche le bouton hamburger */
    }

    .main-navigation {
        position: fixed;
        top: 0;
        right: -100%; /* Caché sur la droite hors écran */
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--color-black);
        padding: 80px 2rem 2rem;
        transition: right var(--transition-speed) ease-in-out;
        z-index: 999;
        overflow-y: auto;
    }

    .main-navigation.active {
        right: 0; /* Fait glisser le menu dans l'écran */
    }

    .nav-list {
        flex-direction: column;
        gap: 1.5rem;
    }

    .nav-link {
        color: var(--color-white);
        font-size: 1.2rem;
        display: block;
    }

    /* Adaptation des blocs CMS pour mobile */
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .block-hero {
        padding: 4rem 1rem;
        min-height: 60vh;
    }

    .text-image-container {
        flex-direction: column; /* Empile le texte et l'image */
        text-align: center;
    }

    .text-image-content h2::after {
        margin: 10px auto 0; /* Centre la petite barre rouge */
    }

    .block-text-image, .block-cards {
        padding: var(--spacing-md) 1rem;
    }
    
    .footer-container {
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}