/* /assets/style.css */

/* ------------------------- */
/* --- DESIGN SYSTEM --- */
/* ------------------------- */
:root {
    /* --- Typography --- */
    --font-family-serif: 'Playfair Display', 'Georgia', serif; /* DA : Serif pour l'élégance et l'émotion */
    --font-family-sans: 'Lato', 'Helvetica Neue', sans-serif;
    
    --font-size-base: 16px;
    --font-size-h1: 2.5rem;
    --font-size-h2: 2rem;
    --font-size-h3: 1.5rem;
    --font-size-large: 1.25rem;
    --font-size-small: 0.875rem;

    /* --- Colors --- */
    --color-background: #F0F0E8; /* Fond légèrement cassé */
    --color-text: #333333;
    --color-primary: #325A40; /* Vert foncé */
    --color-secondary: #C98F00; /* Jaune/Or pour le CTA */
    --color-accent: #A9B29D; /* Vert Sauge */
    
    /* --- UI Colors --- */
    --color-footer-bg: #2C4B3A;
    --color-light-gray: #f4f4f4;
    --color-dark-gray: #555555;

    /* --- Spacing --- */
    --spacing-xs: 0.25rem;
    --spacing-s: 0.5rem;
    --spacing-m: 1rem;
    --spacing-l: 2rem;
    --spacing-xl: 4rem;

    /* --- UI Elements --- */
    --border-radius: 12px; /* DA : Angles plus doux et organiques */
    --box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01); /* Ombres plus douces et modernes */
    --transition-speed: 0.3s ease;

    --container-width: 1100px;
}

/* ------------------------- */
/* --- RESET & GLOBALS --- */
/* ------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-sans);
    font-size: var(--font-size-base);
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-serif);
    color: var(--color-primary);
    line-height: 1.2;
    margin-bottom: var(--spacing-m);
    font-weight: 700;
}
h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }

p { margin-bottom: var(--spacing-m); }
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-speed);
}
a:hover {
    text-decoration: underline;
    color: var(--color-secondary);
}

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

/* ------------------------- */
/* --- LAYOUT & HELPERS --- */
/* ------------------------- */
.container {
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding: 0 var(--spacing-m);
}

.section {
    padding: var(--spacing-m) 0 var(--spacing-l) 0;
    scroll-margin-top: 120px; /* Marge pour compenser le header sticky */
}
.section h2 {
    text-align: center;
}

.section--accent {
    background-color: var(--color-accent);
}

.text-center {
    text-align: center;
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-l);
}

.hidden {
    display: none !important;
}

/* ------------------------- */
/* --- COMPONENTS --- */
/* ------------------------- */

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-family: var(--font-family-sans);
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed);
    border: 2px solid transparent;
}

.btn--primary {
    background-color: var(--color-primary);
    color: white;
    box-shadow: 0 4px 6px rgba(50, 90, 64, 0.2);
}
.btn--primary:hover {
    background-color: #1e422b;
    color: white;
}

.btn--secondary {
    background-color: var(--color-secondary);
    color: white;
    box-shadow: 0 4px 6px rgba(201, 143, 0, 0.2);
}
.btn--secondary:hover {
    background-color: #af7c00;
    color: white;
}

.btn--outline {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn--outline:hover {
    background-color: var(--color-primary);
    color: white;
}

.btn--light-outline {
    background-color: transparent;
    color: white;
    border-color: white;
}
.btn--light-outline:hover {
    background-color: white;
    color: var(--color-primary);
}

/* --- Cards --- */
.card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: var(--spacing-l);
    display: flex;
    flex-direction: column;
    height: 100%; /* Pour l'alignement flexbox */
}

.card__title {
    font-size: var(--font-size-h3);
    margin-bottom: var(--spacing-s);
}

.card__content {
    flex-grow: 1; /* Pousse le footer de la carte en bas */
}

.card__footer {
    margin-top: var(--spacing-m);
}

/* --- Header & Footer --- */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.9); /* Fond blanc semi-transparent */
    backdrop-filter: blur(10px);
    padding: var(--spacing-m) 0;
    border-bottom: 1px solid rgba(50, 90, 64, 0.1);
    transition: padding 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}
/* État réduit au scroll */
.main-header.scrolled {
    padding: var(--spacing-s) 0; /* Réduit de 1rem à 0.5rem */
    background-color: rgba(255, 255, 255, 0.98); /* Plus opaque pour la lisibilité */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.main-header__logo {
    font-family: var(--font-family-serif);
    font-size: var(--font-size-large);
    font-weight: bold;
    color: var(--color-primary);
    display: flex; /* Ajouté pour l'alignement de l'icône */
}
.main-header__nav {
    display: flex;
    flex-wrap: wrap; /* Permet aux liens de passer à la ligne si besoin */
    justify-content: flex-end; /* Aligne les liens à droite */
    gap: var(--spacing-s); /* Espace entre les liens */
}

.main-header__nav a {
    margin-left: var(--spacing-m);
    font-weight: bold;
}
.main-header__logo .logo-icon {
    font-size: 1.5em;
    margin-right: var(--spacing-s);
}
.header-right-group {
    display: flex;
    align-items: center;
}
.main-header__cta {
    /* Style pour le bouton Participer, s'il a besoin de styles spécifiques */
    margin-left: var(--spacing-m);
}

.main-footer {
    background-color: var(--color-footer-bg);
    color: white;
    padding: var(--spacing-l) 0;
    margin-top: var(--spacing-xl);
}
.main-footer a {
    color: white;
}
.main-footer .container {
    text-align: center;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--spacing-l);
    text-align: left;
    padding-bottom: var(--spacing-l);
    margin-bottom: var(--spacing-l);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.footer-col h4 {
    color: white;
    margin-bottom: var(--spacing-s);
}
.footer-col p, .footer-col a {
    color: rgba(255, 255, 255, 0.8);
    display: block;
    margin-bottom: var(--spacing-s);
}
.footer-bottom {
    font-size: var(--font-size-small);
    color: rgba(255, 255, 255, 0.6);
}

/* --- Specific Sections --- */

/* Hero Section */
.hero {
    position: relative;
    padding: 6rem 0;
    text-align: center;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.hero__video-background {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 160%; /* Hauteur augmentée (zoom) pour permettre un parallaxe plus fort */
    transform: translate(-50%, -50%);
    z-index: 0;
    will-change: transform;
}

.hero__video-background video {
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
}

.hero__content {
    position: relative;
    z-index: 2;
}

/* Animation d'apparition du Hero */
@keyframes heroFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero__title {
    margin-bottom: var(--spacing-s);
    color: white;
    opacity: 0; /* Caché au départ */
    animation: heroFadeInUp 1s cubic-bezier(0.215, 0.610, 0.355, 1.000) forwards; /* Apparition fluide */
    animation-delay: 0.3s;
}
.hero__subtitle {
    font-size: var(--font-size-large);
    color: rgba(255, 255, 255, 0.9);
    max-width: 700px;
    margin: 0 auto var(--spacing-l);
    opacity: 0;
    animation: heroFadeInUp 1s cubic-bezier(0.215, 0.610, 0.355, 1.000) forwards;
    animation-delay: 0.5s; /* Léger retard pour l'effet cascade */
}
.hero__actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-m);
    margin-top: var(--spacing-l);
    opacity: 0;
    animation: heroFadeInUp 1s cubic-bezier(0.215, 0.610, 0.355, 1.000) forwards;
    animation-delay: 0.7s; /* Encore plus de retard */
}

/* Animation "Pulse" pour attirer l'attention sur le bouton de don */
@keyframes pulse-gold {
    /* DA : Animation plus douce, moins "alarme" */
    0% { box-shadow: 0 0 0 0 rgba(201, 143, 0, 0.4); transform: scale(1); }
    70% { box-shadow: 0 0 0 10px rgba(201, 143, 0, 0); transform: scale(1.02); }
    100% { box-shadow: 0 0 0 0 rgba(201, 143, 0, 0); }
}

.hero__actions .btn--secondary {
    animation: pulse-gold 3s infinite ease-in-out; /* Plus lent pour être apaisant */
}

/* --- Section Projet --- */
#project h2 {
    margin-bottom: var(--spacing-s);
    text-align: center;
}

#library h2 {
    text-align: center;
}

.projet-details {
    display: flex;
    gap: var(--spacing-l);
    align-items: flex-start;
    flex-wrap: wrap; /* Permet le retour à la ligne pour les piliers sur desktop */
}
.projet-text {
    flex: 1; /* Prend 50% de l'espace */
    text-align: justify;
}
.projet-details img {
    flex: 1; /* Prend 50% de l'espace */
    max-width: 50%; /* Assure que l'image ne dépasse pas sa colonne */
    order: 2; /* Affiche l'image à droite du bloc texte */
}
.piliers-container {
    flex: 1 0 100%;
    order: 3; /* Force les piliers à rester sous le bloc texte */
}

/* --- Histoire & Piliers Section --- */
.histoire-content {
    display: flex;
    gap: var(--spacing-l);
    align-items: flex-start;
    margin-bottom: var(--spacing-l);
    text-align: left;
}
.histoire-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 4px solid white;
    box-shadow: var(--box-shadow);
}
.histoire-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.histoire-text h3 {
    margin-top: 0;
}

.piliers-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--spacing-l);
    text-align: center;
    margin: 0 0 var(--spacing-l) 0;
}

.pilier-item {
    cursor: pointer;
    padding: var(--spacing-s); /* Padding réduit pour compacité */
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pilier-item:hover {
    transform: translateY(-2px);
    color: var(--color-primary);
}

.pilier-item.active {
    /* DA : Suppression du fond gris "fichier sélectionné" pour un style plus épuré */
    background-color: transparent;
    border-bottom-color: var(--color-secondary); /* Soulignement Or */
    opacity: 1;
}
.pilier-item .icon {
    font-size: 1.5rem; /* Icône réduite de moitié */
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.pilier-item p {
    font-size: 0.85rem; /* Texte plus petit */
    margin-bottom: 0;
    line-height: 1.2;
    font-weight: bold;
}

/* Piliers inactifs un peu plus discrets */
.pilier-item:not(.active) {
    opacity: 0.6;
}

/* Masquer les flèches de défilement par défaut (Desktop) */
.scroll-arrow {
    display: none;
}

/* --- Actualités (Homepage) --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-l);
}
.actu-card {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    text-align: left;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--color-text);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}
.actu-card__image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.actu-card__content {
    padding: var(--spacing-m);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.actu-card__content .date {
    font-size: var(--font-size-small);
    color: var(--color-dark-gray);
}
.actu-card__content h4 {
    font-size: 1.1rem;
    margin: var(--spacing-s) 0;
    color: var(--color-primary);
}
.actu-card__content p {
    font-size: 0.9rem;
    flex-grow: 1;
}
.actu-card__link {
    margin-top: auto;
    font-weight: bold;
    color: var(--color-accent);
}
.actu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* Donation Section */
#donation {
    background-color: #E3E8E5; /* UX : Couleur "Brume" plus douce et cohérente avec la charte */
}

.donation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-l);
}
.donation-card__stats {
    margin: var(--spacing-m) 0;
    text-align: center;
}
.donation-card__amount {
    font-size: var(--font-size-h2);
    font-weight: bold;
    color: var(--color-primary);
}
.donation-card__participants {
    color: var(--color-dark-gray);
}
.donation-card__buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-s); 
}

/* --- Section CTA Bibliothèque (Homepage) --- */
.library-cta-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-l);
}
.library-cta-text {
    flex: 1;
}
.library-cta-text h2 {
    color: var(--color-primary);
    text-align: center;
}
.library-cta-text p {
    color: var(--color-text);
}
.library-cta-image {
    flex-shrink: 0;
}
.library-cta-image img {
    border-radius: 50%;
}

/* --- Scroll to Top Button --- */
.scroll-to-top {
    position: fixed;
    bottom: var(--spacing-l);
    right: var(--spacing-l);
    width: 50px;
    height: 50px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background-color: var(--color-secondary);
    transform: translateY(-5px);
}

/* ------------------------- */
/* --- RESPONSIVE --- */
/* ------------------------- */
@media (max-width: 768px) {
    :root {
        --font-size-h1: 2rem;
        --font-size-h2: 1.75rem;
    }
    .donation-grid {
        grid-template-columns: 1fr;
    }
    .hero__actions {
        flex-direction: column;
    }
    .histoire-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .main-header .container {
        flex-wrap: wrap; /* Permet aux éléments de passer à la ligne */
        justify-content: space-between; /* Espace entre le logo et le bouton */
    }
    .header-right-group {
        /* Sur mobile, ce groupe ne sert plus de conteneur flex, on le "dissout" */
        display: contents;
    }
    .main-header__logo {
        align-items: center; /* Centre l'icône verticalement */
        flex-grow: 1; /* Le logo prend l'espace disponible */
        flex-basis: 0; /* Permet au logo de se réduire si nécessaire */
        text-align: left;
    }
    .logo-text-wrapper {
        display: flex;
        flex-direction: column;
    }
    .logo-title-line1, .logo-title-line2 {
        font-size: 1rem;
        line-height: 1.2;
        font-weight: bold;
    }
    .main-header__cta {
        order: 1; /* Le bouton "Participer" vient après le logo sur la 1ère ligne */
    }
    .main-header__nav {
        order: 2; /* Place la navigation en dernier dans l'ordre visuel */
        flex-basis: 100%; /* La navigation prend toute la largeur */
        justify-content: center; /* Centre les liens du menu */
        margin-top: var(--spacing-m);
        transition: margin-top 0.3s ease;
    }
    /* Réduire l'espace au-dessus du menu quand on scrolle */
    .main-header.scrolled .main-header__nav {
        margin-top: var(--spacing-s);
    }
    .piliers-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: var(--spacing-s);
        padding-bottom: var(--spacing-s);
        -webkit-overflow-scrolling: touch; /* Défilement fluide sur iOS */
        
        /* Cacher la barre de défilement pour un look plus propre */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none;  /* IE and Edge */
    }
    .piliers-grid::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
    
    /* Configuration du conteneur sur mobile */
    .piliers-container {
        display: block;
        position: relative;
        margin-top: var(--spacing-m);
        margin-bottom: var(--spacing-m);
    }
    
    /* Afficher les flèches sur mobile */
    .scroll-arrow {
        display: flex !important;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
    }
    .scroll-left {
        left: -10px;
    }
    .scroll-right {
        right: -10px;
    }
    
    .pilier-item {
        flex: 0 0 130px; /* Largeur fixe réduite pour le carrousel */
        scroll-snap-align: center; /* L'élément se cale au centre au relâchement */
        padding: var(--spacing-s);
        font-size: 0.85rem; /* Texte plus petit */
    }
    .pilier-item .icon {
        font-size: 2rem; /* Icône réduite */
        margin-bottom: var(--spacing-xs);
    }
    .projet-details {
        flex-direction: column;
        text-align: center;
    }
    .projet-text {
        order: 1;
    }
    .projet-details img {
        max-width: 100%; /* L'image peut prendre toute la largeur sur mobile */
        order: 3;
    }
    .news-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .books-grid {
        /* Sur mobile, on réduit juste l'espacement. La grille s'adapte. */
        gap: var(--spacing-m);
    }
    .book-grid-item .message,
    .book-grid-item .submitted-by {
        /* Sur mobile, on masque les textes longs pour la lisibilité */
        display: none;
    }
    .library-cta-container {
        flex-direction: column;
        text-align: center;
    }
    .library-cta-text h2 {
        text-align: center;
        font-size: var(--font-size-h2);
    }
    .scroll-to-top {
        bottom: var(--spacing-m);
        right: var(--spacing-m);
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* --- Classes utilitaires et spécifiques --- */
.note-transparence {
    font-style: italic;
    margin-top: var(--spacing-l);
    font-size: var(--font-size-small);
    color: var(--color-dark-gray);
}

/* --- Page de détail d'article --- */
.back-link {
    display: inline-flex;
    align-items: center;
    margin-top: var(--spacing-s); /* Espace de sécurité par rapport au header */
    margin-bottom: var(--spacing-m);
    color: var(--color-dark-gray);
    font-weight: bold;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}
.back-link:hover {
    color: var(--color-primary);
    transform: translateX(-4px); /* Petit mouvement vers la gauche */
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
}
.article-content h3 {
    font-size: 1.6rem;
    margin-top: var(--spacing-l);
    margin-bottom: var(--spacing-m);
}
.article-content figure {
    margin: var(--spacing-l) 0;
}
.article-content img {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}
.article-content figcaption {
    text-align: center;
    font-style: italic;
    color: var(--color-dark-gray);
    margin-top: var(--spacing-s);
    font-size: var(--font-size-small);
}
.article-content blockquote {
    border-left: 4px solid var(--color-accent);
    padding-left: var(--spacing-m);
    margin: var(--spacing-l) 0;
    font-style: italic;
}

/* --- Formulaires Publics (ex: page livres) --- */
.form-group {
    margin-bottom: var(--spacing-m);
}
.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: var(--spacing-s);
    color: var(--color-primary);
}
.form-group input[type="text"],
.form-group input[type="search"],
.form-group input[type="email"],
.form-group textarea,
.search-wrapper input {
    width: 100%;
    padding: var(--spacing-s);
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

/* Champ Honeypot pour la protection anti-spam */
.honeypot {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    height: 0;
    width: 0;
    z-index: -1;
}

/* --- Page Bibliothèque --- */
.books-grid {
    display: grid; 
    /* Grille responsive unique : crée des colonnes de 250px min. sur desktop, et s'adapte sur mobile */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-l); 
    margin-top: var(--spacing-l); 
    text-align: left; 
}

/* --- Pagination --- */
.pagination {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: var(--spacing-s);
}
.pagination li {
    margin: 0;
    padding: 0;
    display: inline;
}

.book-grid-item {
    position: relative; /* Contexte de positionnement pour la superposition */
    background: white;
    padding: var(--spacing-m);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    aspect-ratio: 1 / 1; /* Force la carte à être carrée */
    overflow: hidden; /* Cache les parties de l'image qui dépassent */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card__content {
    position: relative; /* Pour être au-dessus de l'image */
    z-index: 2;
    padding: var(--spacing-m);
    color: var(--color-primary);
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
}

.book-card__cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* S'assure que l'image couvre la zone sans se déformer */
    z-index: 1;
    transition: transform 0.4s ease;
}

.book-grid-item:hover .book-card__cover {
    transform: scale(1.05); /* Effet de zoom subtil au survol */
}

.book-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.book-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Aligne en haut */
    gap: var(--spacing-s);
    margin-bottom: var(--spacing-xs);
}

.book-grid-item h4 {
    font-size: 1.2rem;
    color: var(--color-primary);
    margin-bottom: 0; /* La marge est maintenant sur le header */
    flex-grow: 1; /* Le titre prend l'espace disponible */
}

.book-grid-item .author {
    font-style: italic;
    color: var(--color-dark-gray);
    margin-bottom: var(--spacing-m);
}

.book-grid-item .message {
    font-size: 0.95rem;
    flex-grow: 1;
    border-left: 3px solid var(--color-accent);
    padding-left: var(--spacing-m);
    margin-bottom: var(--spacing-m);
}
.book-grid-item .submitted-by {
    margin-top: auto; /* Pousse ce texte en bas de la carte */
    font-size: var(--font-size-small);
    color: var(--color-dark-gray);
}
.book-grid-item .message p {
    /* Coupe le texte sur plusieurs lignes */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4; /* Nombre de lignes à afficher */
    line-clamp: 4; /* Propriété standard pour le futur */
    -webkit-box-orient: vertical;
}

.book-card__cta {
    width: 40px;
    height: 40px;
    background-color: rgba(50, 90, 64, 0.1); /* Ton sur ton, vert primaire avec opacité */
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Empêche le bouton de se réduire */
    transition: background-color var(--transition-speed);
}
.book-card__cta:hover {
    background-color: rgba(50, 90, 64, 0.2);
}
.book-card__cta::before {
    content: '✒️'; /* Icône de plume */
    font-size: 1.2rem;
    color: var(--color-primary);
    opacity: 0.8;
}

/* --- Modale Livre --- */
.book-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: var(--spacing-m);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed), visibility 0s var(--transition-speed);
    backdrop-filter: blur(8px); /* Ajoute un flou moderne sur l'arrière-plan */
}
.book-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}
.book-modal-content {
    background: white;
    padding: var(--spacing-l);
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;

    /* Animation d'ouverture */
    transform: scale(0.8) translateY(100px); /* Départ beaucoup plus bas et plus petit */
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease; /* Effet de rebond élastique */
}
.book-modal-overlay.visible .book-modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.book-modal-close-cross {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--color-dark-gray);
    cursor: pointer;
    z-index: 10;
    padding: 0.5rem;
}
.book-modal-close-cross:hover {
    color: var(--color-primary);
}

.sticky-suggest-btn {
    position: fixed;
    bottom: var(--spacing-l);
    right: var(--spacing-l);
    z-index: 999;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* --- Animations d'apparition --- */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Animation de chargement de contenu (remplacement skeleton) --- */
.content-loaded {
    animation: fadeInContent 0.8s ease-out forwards;
}

@keyframes fadeInContent {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Contrôles Bibliothèque --- */
.library-controls {
    display: flex;
    flex-direction: column; /* Mobile d'abord : colonne */
    gap: var(--spacing-m);
    max-width: 900px;
    margin: 0 auto var(--spacing-l);
}

.search-wrapper {
    width: 100%;
}

.buttons-wrapper {
    display: flex;
    gap: var(--spacing-s);
    justify-content: center;
}

.buttons-wrapper .btn {
    flex: 1; /* Largeur égale sur mobile */
}

/* Desktop : Alignement horizontal */
@media (min-width: 769px) {
    .library-controls {
        flex-direction: row;
        align-items: center;
    }
    .search-wrapper {
        flex: 2; /* La recherche prend plus de place */
    }
    .buttons-wrapper {
        flex: 3;
        justify-content: flex-start;
    }
    .buttons-wrapper .btn {
        flex: initial; /* Largeur naturelle sur desktop */
    }
}

/* --- Sections Dépliables (Accordeon animé) --- */
.expandable-section {
    /* État fermé (par défaut) */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    transform: translateY(-10px); /* Léger décalage vers le haut */
    display: block; /* S'assure que l'élément peut être animé quand 'hidden' est retiré */
    
    /* Transition fluide pour l'effet "déroulé" */
    transition: 
        max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1), /* Courbe douce */
        opacity 0.4s ease-out,
        padding 0.5s ease,
        margin 0.5s ease,
        transform 0.5s ease;

    /* Styles visuels de base */
    position: relative;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.expandable-section.is-open {
    /* État ouvert */
    max-height: 1500px; /* Valeur suffisante pour tout le contenu */
    opacity: 1;
    padding: var(--spacing-l);
    margin-bottom: var(--spacing-l);
    transform: translateY(0);
}

/* Ajustement pour le formulaire à l'intérieur de la section dépliable */
.expandable-section .card {
    box-shadow: none;
    padding: 0;
}

.close-section-btn {
    position: absolute;
    top: var(--spacing-l);
    right: var(--spacing-l);
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-dark-gray);
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.expandable-section h3 {
    margin-top: 0;
    padding-right: 3rem; /* Évite le chevauchement avec la croix */
}

.why-content-grid {
    display: flex;
    gap: var(--spacing-l);
    align-items: center;
}
.why-text h3 {
    text-align: center;
}

.why-content-grid img {
    border-radius: 50%;
    width: 150px;
    height: 150px;
    object-fit: cover;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .why-content-grid {
        flex-direction: column;
        text-align: center;
    }
}

/* --- NOUVELLE JAUGE DE DONATION --- */
.donation-card-gauge {
    background-color: #F3F1EB; /* Le beige clair du fond */
    border-radius: 20px;
    padding: 40px 30px;
    font-family: var(--font-family-sans);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    text-align: center; /* Centrer le contenu pour l'homogénéité */
}

.stats-row {
    display: flex;
    justify-content: space-between;
    text-align: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    flex: 1;
    min-width: 100px;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.stat-label {
    color: #52525B;
    font-size: 0.95rem;
    font-weight: 400;
}

.text-target { color: #325A40; } /* Vert foncé */
.text-collected { 
    color: #698366; /* Vert sauge */
    font-size: 2.8rem; /* Plus grand que les autres (2rem) pour la hiérarchie */
    line-height: 1; /* Évite de trop décaler la ligne */
    margin-bottom: 10px; /* Ajustement de l'espace */
} 
.text-donors { color: #C5A986; } /* Beige doré */

.progress-container { width: 100%; }

.progress-bar-bg {
    background-color: #FFFFFF;
    height: 16px;
    border-radius: 999px;
    width: 100%;
    overflow: hidden;
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    height: 100%;
    border-radius: 999px;
    transition: width 1s ease-in-out;
}

.progress-text {
    text-align: center;
    color: #52525B;
    margin-top: 15px;
    font-size: 0.95rem;
    margin-bottom: 0;
}
