:root {
    --primary-color: #EF476F; /* Rose/Rouge */
    --secondary-color: #1B9AAA; /* Bleu/Cyan */
    --accent-color: #06BD8C; /* Vert */
    --highlight-color: #FFC43D; /* Jaune */
    --light-bg: #f0f8f9;
    --white: #FFFFFF;
    --text-main: #2b2d42;
    --text-muted: #6c757d;
    --transition: all 0.3s ease;
    --radius: 12px;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.15);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 65px;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-main);
    background-color: var(--white);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    font-weight: 900 !important;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center { text-align: center; }
.text-white { color: var(--white) !important; }
.bg-light { background-color: var(--light-bg); }
.bg-primary { background-color: var(--primary-color); }
.mt-4 { margin-top: 2rem; }
.lead { font-size: 1.2rem; margin-bottom: 1.5rem; opacity: 0.9; }

/* Buttons */
.btn-primary, .btn-secondary, .btn-accent {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.3);
}

.btn-primary:hover {
    background-color: #d83c61;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #157c8a;
    transform: translateY(-2px);
}

.btn-accent {
    background-color: var(--accent-color);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(6, 189, 140, 0.3);
}

.btn-accent:hover {
    background-color: #05a076;
    transform: translateY(-2px);
}

.btn-hero-primary {
    display: inline-block;
    padding: 15px 35px;
    border-radius: 35px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.1rem;
    background-color: var(--primary-color);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(239, 71, 111, 0.3);
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-hero-primary:hover {
    background-color: #d83c61;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 71, 111, 0.5);
}

.btn-hero-secondary {
    display: inline-block;
    padding: 15px 35px;
    border-radius: 35px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.1rem;
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-hero-secondary:hover {
    background-color: var(--white);
    color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
}

/* Header & Hero */
.hero {
    position: relative;
    height: 66vh;
    min-height: 470px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    /* Placeholder background image, user will change it */
    background: url('images/foire.jpg') center/cover no-repeat;
}

.hero-home {
    height: 75vh;
    min-height: 550px;
}

.hero-event {
    height: 58vh;
    min-height: 410px;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: transparent; /* Filtre enlevé */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 50px 60px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(4px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    max-width: 90%;
}

.hero-event .hero-content {
    margin-top: 40px;
    padding: clamp(25px, 4vh, 45px) clamp(30px, 5vw, 60px);
}

.hero.hero-event h1 {
    font-size: clamp(2rem, 6vw, 4.5rem);
    margin-bottom: 5px;
}

.hero.hero-event p {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    margin-bottom: 15px;
}

.hero-event-date {
    display: inline-block;
    padding: 15px 35px;
    border-radius: 35px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.4rem;
    background-color: var(--accent-color);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(6, 189, 140, 0.3);
    cursor: default;
    margin-top: 20px;
}

.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 40px;
    z-index: 1000;
    background: transparent;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 15px 40px;
    background: rgba(27, 154, 170, 0.95); /* matching secondary-color */
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-links a {
    font-weight: 400;
    font-size: 1rem;
    position: relative;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--highlight-color);
}

.nav-links a.active {
    font-weight: 700;
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger span {
    width: 30px;
    height: 3px;
    background-color: var(--white);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
}

.hamburger.toggle span:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

.hamburger.toggle span:nth-child(2) {
    opacity: 0;
}

.hamburger.toggle span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

.hero h1 {
    font-size: 5.5rem;
    font-weight: 900;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.6);
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 30px;
    font-weight: 500;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}

.hero-home .hero-content {
    padding: clamp(30px, 6vh, 60px) clamp(20px, 5vw, 60px);
}

.hero-home h1 {
    font-size: clamp(2.5rem, 8vw, 5.5rem);
}

.hero-home p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.6;
    max-width: 800px;
    margin: 15px auto 25px;
}

/* Sections */
.section {
    padding: 50px 0 80px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 50px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: currentColor;
    margin: 15px auto 0;
    border-radius: 2px;
}

/* Text Colors */
.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.text-accent { color: var(--accent-color) !important; }
.text-highlight { color: var(--highlight-color) !important; }

/* Featured Event */
.featured-event-link {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius);
    transition: var(--transition);
}

.featured-event {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: center;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.featured-event-link:hover .featured-event {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.featured-image-placeholder {
    flex: 1;
    min-width: 300px;
}

.event-poster-large {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 4/3;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-event-link:hover .event-poster-large {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.featured-event-link:hover .btn-accent {
    background-color: #05a076;
    transform: translateY(-2px);
}

.featured-content {
    flex: 1;
    padding: 40px;
    min-width: 300px;
}

.featured-content h3 {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.event-date {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.event-description {
    margin-bottom: 25px;
    color: var(--text-muted);
}

/* Event Grids */
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.event-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

#evenements-passes .event-card:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 3/2;
    overflow: hidden;
}

.card-image-a4 {
    aspect-ratio: 1 / 1.414 !important;
    background-color: var(--light-bg);
}

.poster-overlay-a4 {
    position: absolute;
    top: 50%;
    right: 25px;
    width: 130px;
    aspect-ratio: 1 / 1.414;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    border: 2px solid white;
    background-color: #ddd;
    overflow: hidden;
    z-index: 2;
    transform: translateY(-50%) rotate(5deg);
    transition: transform 0.3s ease;
}

.poster-overlay-a4 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.event-card:hover .card-image img {
    transform: scale(1.05);
}

#evenements-passes .event-card:hover .card-image img {
    transform: none;
}

.card-content {
    padding: 25px;
    text-align: center;
}

.card-content h4 {
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.card-content .event-date {
    margin-bottom: 10px;
    font-size: 0.95rem;
}

/* Asso Grid */
.asso-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    text-align: left;
}

.asso-grid h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

/* Galerie */
.galerie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.galerie-item {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.galerie-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.galerie-item:hover img {
    transform: scale(1.08);
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 40px; height: 2px;
    background-color: var(--white);
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-color);
    color: var(--white) !important;
    transform: translateX(5px);
}

.contact-email {
    display: inline-block;
    margin-top: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--highlight-color);
    position: relative;
    text-decoration: none;
    transition: var(--transition);
}

.contact-email::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--white);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

.footer-col .contact-email:hover {
    color: var(--white);
}

.footer-col .contact-email:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.newsletter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.newsletter-form input {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: none;
    border-radius: 30px;
    font-family: 'Poppins', sans-serif;
    outline: none;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-img {
    max-width: 96%;
    max-height: 96%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 20px; right: 30px;
    color: white;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    transition: color 0.3s;
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    padding: 16px;
    user-select: none;
    z-index: 2001;
    transition: color 0.3s;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover, .lightbox-next:hover, .lightbox-close:hover {
    color: var(--primary-color);
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Compact Event List */
.compact-events-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.compact-event-item {
    background: var(--white);
    padding: 15px 20px;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.compact-event-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-hover);
}

.compact-event-date {
    font-weight: 700;
    color: var(--primary-color);
    min-width: 100px;
}

.compact-event-title {
    font-weight: 600;
    color: var(--text-main);
    flex-grow: 1;
    margin-left: 20px;
}

.compact-event-action a {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary-color);
    text-decoration: none;
}

.compact-event-action a:hover {
    color: var(--primary-color);
}

.event-details {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    width: 100%;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1.2rem; }
    
    .hamburger {
        display: flex;
    }

    .navbar {
        padding: 15px 25px;
        flex-direction: row;
        justify-content: space-between;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--secondary-color);
        padding: 20px;
        gap: 15px;
        text-align: center;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .featured-event { flex-direction: column; }
    .featured-content { padding: 20px; }
    .event-details { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 768px) {
    /* Header (Hero) Mobile Optimizations */
    .hero-home {
        height: auto;
        min-height: auto;
        padding: 100px 15px 50px 15px; /* Empêche le débordement et laisse respirer le bloc */
    }
    
    .hero-event {
        height: auto;
        min-height: auto;
        padding: 95px 15px 45px 15px;
    }
    
    .hero-content {
        padding: 25px 20px;
        max-width: 100%;
        border-radius: 16px;
    }
    
    .hero-home h1 {
        font-size: clamp(1.8rem, 7vw, 2.6rem) !important;
    }
    
    .hero-home p {
        font-size: clamp(0.9rem, 3.5vw, 1.05rem) !important;
        margin: 10px auto 20px;
    }
    
    .hero-event .hero-content {
        margin-top: 0;
    }
    
    .hero.hero-event h1 {
        font-size: clamp(1.5rem, 6vw, 2.0rem) !important;
    }
    
    .hero.hero-event p {
        font-size: clamp(0.85rem, 3.5vw, 1.0rem) !important;
        margin-bottom: 15px;
    }
    
    /* Boutons du Hero et Badge Date */
    .btn-hero-primary, .btn-hero-secondary {
        padding: 12px 24px;
        font-size: 0.85rem;
    }
    
    .hero-event-date {
        padding: 10px 22px !important;
        font-size: 1.0rem !important;
        margin-top: 10px !important;
    }
    
    /* Agenda "Et aussi..." compact */
    .compact-event-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
        padding: 15px;
    }
    
    .compact-event-title {
        margin-left: 0;
        margin-top: 2px;
        margin-bottom: 2px;
    }
    
    .compact-event-date {
        min-width: auto;
    }
    
    .compact-event-action {
        margin-top: 4px;
    }
}
