/* ===== VARIABLES ===== */
:root {
    --primary-green: #275a1f;
    --secondary-green: #3d7c2f;
    --light-green: #6eb859;
    --cream: #f5f1e8;
    --dark-brown: #3d2817;
    --text-dark: #2c2c2c;
    --white: #ffffff;

    /* Variables pour le mode clair */
    --bg-color: #f5f1e8;
    --text-color: #2c2c2c;
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary-green: #4a7c35;
        --secondary-green: #5fa044;
        --light-green: #8fd374;
        --bg-color: #251F10;
        --text-color: #e5e5e5;
        --card-bg: #181A1B;
        --card-shadow: rgba(0, 0, 0, 0.4);
        --cream: #251F10;
    }
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

a {
    text-decoration: none;
    color: inherit;
}

/* ===== HEADER & NAVIGATION ===== */
header {
    background-color: var(--primary-green);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

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

.logo {
    height: 60px;
    width: auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.logo-container a:hover .logo {
    transform: scale(1.05);
    opacity: 0.9;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: var(--white);
    font-weight: 500;
    transition: color 0.3s;
    white-space: nowrap;
}

nav a:hover {
    color: var(--light-green);
}

nav a.active {
    color: var(--light-green);
    font-weight: 600;
    border-bottom: 2px solid var(--light-green);
    padding-bottom: 0.25rem;
}

/* Menu Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 30px;
    height: 3px;
    background-color: var(--white);
    transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

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

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ===== MAIN CONTENT ===== */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ===== HERO SECTION (Accueil) ===== */
.hero-card {
    position: relative;
    background-color: var(--primary-green);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 3rem;
    min-height: 400px;
    display: flex;
    align-items: center;
}

.hero-overlay {
    padding: 3rem;
    color: var(--white);
    width: 100%;
}

.hero-card h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.hero-card p {
    font-size: 1.1rem;
    max-width: 800px;
    line-height: 1.8;
}

/* ===== UNIT CARDS ===== */
.units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.unit-card {
    position: relative;
    background-size: cover;
    background-position: center;
    border-radius: 15px;
    overflow: hidden;
    min-height: 350px;
    display: flex;
    align-items: flex-end;
}

.unit-overlay {
    background: linear-gradient(
        to top,
        rgba(39, 90, 31, 0.95) 0%,
        rgba(39, 90, 31, 0.85) 20%,
        rgba(39, 90, 31, 0.65) 40%,
        rgba(39, 90, 31, 0.45) 60%,
        rgba(39, 90, 31, 0.25) 80%,
        rgba(39, 90, 31, 0.05) 100%
    );
    padding: 2rem;
    color: var(--white);
    width: 100%;
}

.unit-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.unit-card p {
    font-size: 1rem;
    line-height: 1.6;
}

/* ===== CONTENT SECTIONS ===== */
.content-section {
    margin: 4rem 0;
}

.section-title {
    font-size: 2rem;
    color: var(--primary-green);
    margin-bottom: 2rem;
    text-align: center;
}

/* Alternating Text-Image Layout */
.alternating-section {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-bottom: 4rem;
}

.alternating-section.reverse {
    flex-direction: row-reverse;
}

.alternating-text {
    flex: 1;
    max-width: 600px;
}

.alternating-text h2 {
    font-size: 1.8rem;
    color: var(--primary-green);
    margin-bottom: 1rem;
}

.alternating-text p {
    font-size: 1.1rem;
    line-height: 1.8;
}

.alternating-image {
    flex: 1;
    max-width: 500px;
}

.alternating-image img {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* ===== PEDAGOGIE SECTIONS ===== */
.pedagogy-section {
    display: flex;
    gap: 3rem;
    margin-bottom: 4rem;
    align-items: flex-start;
}

.pedagogy-images {
    flex: 0 0 40%;
}

.pedagogy-text {
    flex: 1;
}

.pedagogy-text h2 {
    font-size: 2rem;
    color: var(--primary-green);
    margin-bottom: 0.5rem;
}

.pedagogy-text h3 {
    font-size: 1.3rem;
    color: var(--secondary-green);
    margin-bottom: 1rem;
    font-style: italic;
}

.pedagogy-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* Vertical Images Layout */
.vertical-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.vertical-images img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 10px;
}

/* Square Images Layout */
.square-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.square-images img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
}

/* ===== FAQ ===== */
.faq-container {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.faq-image {
    flex: 0 0 35%;
}

.faq-image img {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.faq-questions {
    flex: 1;
}

.faq-item {
    margin-bottom: 2rem;
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px var(--card-shadow);
}

.faq-question {
    font-size: 1.2rem;
    color: var(--primary-green);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.faq-answer {
    font-size: 1rem;
    line-height: 1.7;
}

/* ===== CONTACT PAGE ===== */
.contact-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    background-color: var(--card-bg);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--card-shadow);
}

.contact-container h1 {
    font-size: 2.5rem;
    color: var(--primary-green);
    margin-bottom: 2rem;
}

.contact-container p {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.contact-btn {
    display: inline-block;
    background-color: var(--secondary-green);
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background-color 0.3s;
}

.contact-btn:hover {
    background-color: var(--light-green);
}

/* ===== FOOTER ===== */
footer {
    background-color: var(--primary-green);
    color: var(--white);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

footer a {
    color: var(--white);
    text-decoration: underline;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--light-green);
}

footer p {
    margin: 0.5rem 0;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.social-icons a {
    display: inline-block;
    transition: transform 0.3s, opacity 0.3s;
    text-decoration: none;
}

.social-icons a:hover {
    transform: translateY(-3px);
    opacity: 0.8;
}

.social-icons img {
    width: 32px;
    height: 32px;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--secondary-green);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    z-index: 999;
}

.back-to-top:hover {
    background-color: var(--light-green);
    transform: translateY(-3px);
}

.back-to-top.show {
    display: flex;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    /* Navigation Mobile */
    .hamburger {
        display: flex;
    }

    nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--primary-green);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    nav.active {
        max-height: 500px;
    }

    nav ul {
        flex-direction: column;
        padding: 1rem 0;
        gap: 0;
    }

    nav li {
        width: 100%;
        text-align: center;
        padding: 1rem 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Hero & Cards */
    .hero-card h1 {
        font-size: 1.8rem;
    }

    .hero-overlay {
        padding: 2rem;
    }

    .units-grid {
        grid-template-columns: 1fr;
    }

    /* Alternating Sections */
    .alternating-section,
    .alternating-section.reverse {
        flex-direction: column;
    }

    .alternating-text {
        max-width: 100%;
        order: 1;
    }

    .alternating-image {
        max-width: 100%;
        order: 2;
    }

    /* Pedagogy Sections */
    .pedagogy-section {
        flex-direction: column;
    }

    .pedagogy-text {
        order: 1;
    }

    .pedagogy-images {
        flex: 1;
        width: 100%;
        order: 2;
    }

    /* FAQ */
    .faq-container {
        flex-direction: column;
    }

    .faq-image {
        flex: 1;
        width: 100%;
    }

    /* Typography */
    .section-title {
        font-size: 1.6rem;
    }

    main {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 1rem;
    }

    .logo {
        height: 50px;
    }

    .hero-card h1 {
        font-size: 1.5rem;
    }

    .hero-card p {
        font-size: 1rem;
    }
}
