/* === Fichier style1.css | Thème Nature Moderne === */
/* Créé pour moderniser oiseaux-des-jardins.htm sans modifier le HTML */

/* === CSS Reset (Simple) & Variables Modernes (de style.css) === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

:root {
    /* Palette Nature Moderne */
    --primary-color: #2d5a3d; /* Vert forêt profond */
    --secondary-color: #4a7c59; /* Vert moyen */
    --accent-color: #8ab48a; /* Vert sage */
    --warm-accent: #d4a574; /* Beige doré (plumage) */
    --text-color: #1a1a1a; /* Noir naturel */
    --text-light: #4a5568; /* Gris ardoise */
    --background-color: #fefefe;
    --light-bg: #f7faf7; /* Vert très pâle */
    --card-bg: #ffffff;
    --border-color: #e2e8e2;
    --shadow-light: rgba(45, 90, 61, 0.08);
    --shadow-medium: rgba(45, 90, 61, 0.15);
    --gradient-primary: linear-gradient(135deg, #2d5a3d 0%, #4a7c59 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f7faf7 100%);
    
    /* Footer */
    --footer-bg: linear-gradient(135deg, #1a2f20 0%, #2d5a3d 100%);
    --footer-text: #e2f2e2;
    --footer-link: #8ab48a;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    /* Espacements */
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    
    /* Rayons */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --container-max-width: 1200px;
}

/* === Typographie & Styles de Base === */
body {
    font-family: var(--font-primary);
    color: var(--text-color);
    background: var(--background-color);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--text-color);
    line-height: 1.2;
    font-weight: 600;
    margin-bottom: var(--space-md);
}

h1 { 
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-lg);
}

h2 { 
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    position: relative;
    padding-bottom: var(--space-sm);
    margin-top: 0;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

h3 { font-size: clamp(1.25rem, 3vw, 1.875rem); }

p {
    margin-bottom: var(--space-md);
    max-width: 75ch;
    color: var(--text-light);
}

p strong {
    color: var(--text-color);
}

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

a:hover, a:focus {
    color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
}

/* === Header Moderne === */
.site-header {
    background: var(--gradient-primary);
    padding: var(--space-md) 0;
    position: relative;
    box-shadow: 0 4px 20px var(--shadow-medium);
}

.header-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container .site-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.main-navigation ul {
    list-style: none;
    padding: 0;
    display: flex;
    gap: var(--space-sm);
}

.main-navigation a {
    color: white;
    font-weight: 500;
    padding: 0.5rem var(--space-md);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition-smooth);
}

.main-navigation a:hover, .main-navigation a:focus {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.mobile-menu-toggle { display: none; }

/* === Barre de recherche Moderne === */
.search-container {
    position: relative;
    margin: 0 var(--space-md);
    flex-grow: 1;
    max-width: 450px;
}

#search-input {
    width: 100%;
    padding: 0.75rem var(--space-md);
    font-size: 1rem;
    border-radius: var(--radius-xl);
    border: 1px solid transparent;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    outline: none;
    transition: var(--transition-smooth);
    backdrop-filter: blur(5px);
}

#search-input::placeholder { color: rgba(255, 255, 255, 0.7); }

#search-input:focus {
    background-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

#search-results {
    display: none;
    position: absolute;
    top: 105%; left: 0; right: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px var(--shadow-light);
    z-index: 2000;
    max-height: 300px;
    overflow-y: auto;
}
#search-results a {
    display: block; padding: var(--space-sm) var(--space-md);
    color: var(--text-color);
}
#search-results a:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

/* === Layout Principal === */
.site-container {
    display: grid;
    grid-template-columns: 1fr 336px; /* Ajusté à la taille de la pub */
    gap: var(--space-xl);
    max-width: var(--container-max-width);
    margin: var(--space-xl) auto;
    padding: 0 var(--space-md);
}
.main-content { min-width: 0; }
.sidebar { width: 100%; }

/* === Section Héros === */
.hero-section {
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: 0 10px 40px var(--shadow-light);
}

.hero-section .subtitle {
    max-width: 80ch;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    display: inline-block;
    background: var(--gradient-primary);
    color: white;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    font-weight: 600;
    margin-top: var(--space-md);
    box-shadow: 0 4px 15px var(--shadow-medium);
    transition: var(--transition-smooth);
}
.cta-button:hover {
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow-medium);
}

/* === Table des matières (Sommaire) === */
.table-of-contents {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 25px var(--shadow-light);
}

.table-of-contents ul {
    list-style: none;
    padding: 0;
}

.table-of-contents li a {
    display: block;
    padding: var(--space-sm);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.table-of-contents li a:hover {
    background: rgba(45, 90, 61, 0.05);
    transform: translateX(5px);
}

/* === Sections de Contenu Génériques === */
.categories-overview, .upcoming-species-section, .intro-oiseaux {
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    border-radius: var(--radius-xl);
    background: var(--gradient-card);
    box-shadow: 0 10px 40px var(--shadow-light);
    border: 1px solid var(--border-color);
}
.intro-oiseaux ul {
    list-style-position: inside;
    padding-left: 0;
}

/* === Grille des Espèces (Species Grid) === */
.species-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-lg);
}

.species-card {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: 0 15px 50px var(--shadow-light);
    background: var(--gradient-card);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.species-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px var(--shadow-medium);
}

.species-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.species-card h3 { padding: var(--space-lg) var(--space-lg) 0; margin: 0; }
.species-card p { padding: 0 var(--space-lg); flex-grow: 1; }
.species-card .species-link-container { padding: 0 var(--space-lg) var(--space-lg); }

/* Style pour les Quick-Facts dans les cartes */
.quick-facts {
    padding: 0 var(--space-lg);
    margin: var(--space-md) 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.fact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-light);
    background: var(--light-bg);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
}
.fact-item .fact-text strong { color: var(--text-color); }

/* === Section "À venir" === */
.upcoming-species-section {
    text-align: center;
    background: var(--light-bg);
}
.upcoming-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}
.upcoming-grid a {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-xl);
    box-shadow: 0 2px 5px var(--shadow-light);
}
.upcoming-grid a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* === Blocs "Conseils et Astuces" === */
.expert-tip {
    background: linear-gradient(135deg, #f0fff4 0%, #f5fffa 100%);
    border-left: 5px solid var(--secondary-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin: var(--space-lg) 0;
    box-shadow: 0 8px 30px rgba(74, 124, 89, 0.1);
}
.expert-tip h3 { display: flex; align-items: center; gap: 0.5rem; }

.practical-tips-section { margin-top: var(--space-xl); }
.tips-list {
    list-style: none;
    padding-left: 0;
    counter-reset: tips-counter;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}
.tips-list li {
    background-color: var(--light-bg);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-md) var(--space-md) 60px;
    position: relative;
    box-shadow: 0 2px 5px var(--shadow-light);
}
.tips-list li::before {
    counter-increment: tips-counter;
    content: counter(tips-counter);
    position: absolute; left: var(--space-md); top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    font-family: var(--font-primary);
    border-radius: 50%;
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tips-list li strong { color: var(--primary-color); }

/* === Sidebar & Widgets === */
.ads-block, .relevant-links, .language-switcher {
    background-color: var(--light-bg);
    margin-bottom: var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: var(--space-lg);
}
.ads-block {
    padding: 0;
    overflow: hidden;
    line-height: 0;
}
.relevant-links ul, .language-switcher ul { list-style: none; padding: 0; }
.relevant-links li a { display: block; padding: 0.5rem 0; }
.relevant-links li a:hover { color: var(--secondary-color); }

/* === Footer Moderne === */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: var(--space-xl) var(--space-md);
    margin-top: var(--space-xl);
}
.footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-xl);
    max-width: var(--container-max-width);
    margin: 0 auto;
}
.footer-column h4 { color: white; font-weight: 600; }
.footer-column ul { list-style: none; padding: 0; }
.footer-column li a { color: var(--footer-link); }
.footer-column li a:hover { color: white; transform: translateX(5px); }
.copyright {
    text-align: center;
    font-size: 0.9rem;
    padding-top: var(--space-lg);
    margin-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--footer-link);
}

/* === Bouton Retour en Haut === */
.back-to-top {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--shadow-medium);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition-smooth);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    transform: scale(1.1);
}

/* Ensure these (or similar) rules are in your style-fille.css */

.faq-item {
    margin-bottom: 10px; /* Space between FAQ items */
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden; /* Important for the max-height transition */
}

.faq-question {
    background-color: #f7f7f7;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee; /* Optional */
}

/* Optional: Add an indicator for the active question */
.faq-question::after {
    content: '+';
    font-size: 1.5em;
    line-height: 1;
    transition: transform 0.3s ease;
}

.faq-question.active::after {
    content: '−'; /* Change to minus when active */
    transform: rotate(0deg); /* Or could be rotate(45deg) if you use a plus for both */
}


.faq-answer {
    max-height: 0; /* THIS IS CRUCIAL: Keeps the answer hidden initially */
    overflow: hidden; /* THIS IS CRUCIAL: Hides content that exceeds max-height */
    transition: max-height 0.3s ease-out, padding 0.3s ease-out; /* Smooth transition */
    padding: 0 20px; /* No vertical padding when closed */
    color: #555;
    background-color: #ffffff;
}

/* When the answer is open, give it some padding */
.faq-question.active + .faq-answer {
    padding-top: 15px;
    padding-bottom: 15px;
}

/* If your original .faq-answer had a default display, you might need to ensure it's removed */
/* For example, if it was display: block, max-height 0 might not work as expected */

/* === Responsive Design === */
@media (max-width: 1024px) {
    .site-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        justify-content: space-between;
    }
    .logo-container {
        flex-basis: 80%;
    }
    .search-container {
        order: 3;
        width: 100%;
        margin-top: var(--space-md);
        max-width: none;
    }
    .main-navigation {
        display: none;
        order: 2;
        width: 100%;
        background: var(--secondary-color);
        margin-top: var(--space-md);
        border-radius: var(--radius-md);
        padding: var(--space-sm);
    }
    .main-navigation.active {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 100;
    }
    .main-navigation ul {
        flex-direction: column;
        width: 100%;
    }
    .main-navigation li a { display: block; text-align: center; padding: var(--space-md); }
    
    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        color: white;
        font-size: 2rem;
        cursor: pointer;
    }
}