/* ==========================================================================
   Variables de thème (Palette de couleurs et Typographie)
   ========================================================================== */
:root {
    /* L'hommage au papier et l'élégance */
    --bg-papier: #FDFBF7; /* Blanc cassé / coquille d'œuf [cite: 312, 490] */
    --texte-encre: #2C2C2C; /* Gris anthracite profond [cite: 313, 490] */
    --accent-bordeaux: #722F37; /* Rouge bordeaux (reliure classique) [cite: 314, 490] */
    --accent-dore: #C5A059; /* Doré cuivré subtil [cite: 314, 490] */
    
    /* Le mariage du classique et du moderne */
    --police-titre: 'Playfair Display', 'Garamond', serif; /* [cite: 315, 491] */
    --police-texte: 'Lato', 'Montserrat', sans-serif; /* [cite: 316, 491] */
}

/* ==========================================================================
   Reset de base et Paramètres généraux
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-papier);
    color: var(--texte-encre);
    font-family: var(--police-texte);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Pour que le footer reste toujours en bas */
}

h1, h2, h3 {
    font-family: var(--police-titre);
    font-weight: normal;
}

a {
    color: var(--texte-encre);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-bordeaux);
}

/* ==========================================================================
   En-tête (Header)
   ========================================================================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 5%;
    border-bottom: 1px solid rgba(44, 44, 44, 0.1);
}

.header-gauche .logo {
    max-height: 80px;
}

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

.header-centre h1 {
    font-size: 2.5rem;
    color: var(--accent-bordeaux);
    letter-spacing: 2px;
}

.header-centre .sous-titre {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
}

.header-droite .maxime {
    font-style: italic;
    font-family: var(--police-titre);
    font-size: 1.1rem;
    max-width: 250px;
    text-align: right;
    color: var(--accent-dore);
}

/* ==========================================================================
   Barre de Navigation
   ========================================================================== */
.menu-principal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.menu-principal ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.menu-principal a {
    text-transform: uppercase;
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.btn-connexion {
    background-color: var(--accent-bordeaux);
    color: #fff !important;
    padding: 10px 20px;
    border-radius: 3px;
    font-size: 0.9rem;
}

.btn-connexion:hover {
    background-color: var(--texte-encre);
}

/* ==========================================================================
   Corps de page et Grille des Livres (Beaucoup d'espace vide pour la respiration) [cite: 317, 318]
   ========================================================================== */
main {
    flex: 1; 
    padding: 50px 5%;
}

.presentation-accueil {
    text-align: center;
    margin-bottom: 50px;
}

.presentation-accueil h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* La grille dynamique sur 3 colonnes [cite: 496, 497] */
.grille-livres {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 40px;
}

/* Cartes des livres */
.carte-livre {
    background: #fff;
    padding: 20px;
    border: 1px solid rgba(44, 44, 44, 0.05);
    border-radius: 4px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.carte-livre:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.couverture-placeholder {
    width: 100%;
    height: 350px;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-style: italic;
    margin-bottom: 20px;
}

.carte-livre h3 {
    font-size: 1.4rem;
    margin-bottom: 5px;
    color: var(--accent-bordeaux);
}

.carte-livre .auteur {
    font-weight: bold;
    margin-bottom: 5px;
}

.carte-livre .categorie, .carte-livre .pages {
    font-size: 0.85rem;
    color: #777;
    text-transform: uppercase;
}

.carte-livre .synopsis {
    margin: 15px 0;
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-detail {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 25px;
    border: 1px solid var(--accent-dore);
    color: var(--accent-dore) !important;
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: bold;
}

.carte-livre:hover .btn-detail {
    background-color: var(--accent-dore);
    color: #fff !important;
}

/* ==========================================================================
   Pied de page (Footer)
   ========================================================================== */
footer {
    text-align: center;
    padding: 40px 5%;
    background-color: #fff;
    border-top: 1px solid rgba(44, 44, 44, 0.1);
    font-size: 0.85rem;
}

.liens-legaux {
    margin-bottom: 15px;
}

.liens-legaux a {
    margin: 0 10px;
}

/* ==========================================================================
   Responsive (Adaptation pour Tablettes et Mobiles) [cite: 492]
   ========================================================================== */
@media (max-width: 900px) {
    .grille-livres {
        grid-template-columns: repeat(2, 1fr); /* 2 colonnes sur tablette [cite: 499] */
    }
    
    header {
        flex-direction: column;
        gap: 20px;
    }
    
    .header-droite .maxime {
        text-align: center;
    }
}

@media (max-width: 600px) {
    .grille-livres {
        grid-template-columns: 1fr; /* 1 colonne sur smartphone [cite: 499] */
    }
    
    .menu-principal {
        flex-direction: column;
        gap: 15px;
    }
    
    .menu-principal ul {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
}