/* ===== PAGE ===== */

body {
    background-color: #121212;
    color: #f1f1f1;
    font-family: Arial, sans-serif;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
}

.book-card {
    background: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

/* conteneur image FIXE */
.book-cover {
    width: 100%;
    height: 240px; /* 🔥 hauteur fixe = clé */
    overflow: hidden;
    border-radius: 6px;
    background: #000; /* fallback */
}

/* image forcée */
.book-cover img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

/* texte */
.book-card h3 {
    color: #fff;
    font-size: 0.9rem;
    margin: 8px 0 4px;
}

.book-card .authors {
    color: #aaa;
    font-size: 0.8rem;
}

.book-card .note {
    margin-top: auto;
    color: #ffd700;
}

.book-detail {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

/* COVER */
.book-detail-cover {
    flex: 0 0 250px;
    max-width: 250px;
}

.book-detail-cover img {
    width: 100%;
    height: auto; /* 🔥 clé */
    object-fit: contain; /* 🔥 important */
    border-radius: 10px;
}

.no-cover {
    height: 350px;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

/* CONTENU */
.book-detail-content {
    flex: 1;
}

.book-detail-content h1 {
    margin-bottom: 10px;
}

.authors {
    color: #aaa;
    margin-bottom: 10px;
}

.series {
    color: #8ab4f8;
}

.type {
    color: #666;
    font-size: 0.8rem;
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    background: #444;
}

.date {
    color: #777;
    font-size: 0.85rem;
}

/* NOTE */
.rating {
    font-size: 1.5rem;
    margin: 15px 0;
}

/* REVIEW */
.review {
    margin-top: 20px;
    padding: 15px;
    background: #1a1a1a;
    border-radius: 10px;
}

.review h3 {
    margin-bottom: 10px;
}

/* BACK */
.back-link {
    margin-top: 20px;
}

.book-language {
    font-size: 1.2rem;
    margin-top: 5px;
}

/*YEAR filter */

.years-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.years-filter a {
    padding: 6px 14px;
    border-radius: 20px;
    background: #222;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: 0.2s;
}

.years-filter a:hover {
    background: #444;
}

.years-filter a.active {
    background: #e50914;
    font-weight: bold;
}

