/* ==========================================================================
   1. CONFIGURATION GÉNÉRALE & RESETS
   ========================================================================== */
* {
    box-sizing: border-box;
}

body {
    background-color: #141414;
    color: white;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body > main {
    flex: 1;
}

/* Cache la barre de défilement verticale du site pour Chrome, Safari et Edge */
html::-webkit-scrollbar {
    display: none;
}

/* Cache la barre de défilement verticale du site pour Firefox et IE/Edge moderne */
html {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.container {
    margin-top: 1px; 
    padding: 1px;
}

/* ==========================================================================
   2. HEADER & NAVIGATION (STYLE NETFLIX)
   ========================================================================== */
header {
    padding: 20px 30px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    
    /* AU DÉBUT : Transparent (avec un léger dégradé pour que le texte reste blanc) */
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    
    z-index: 1000;
    transition: background 0.4s ease; /* Animation fluide quand la couleur change */
}

/* QUAND ON SCROLL : Cette classe sera ajoutée par le JavaScript */
header.scrolled {
    background: #141414 !important; /* Devient le gris foncé du site */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important; /* Petite ombre sous la barre */
}

.logo {
    color: #E50914;
    font-size: 30px;
    font-weight: bold;
    margin-right: 25px;
    letter-spacing: 1px;
}

.logo a {
    color: #e50914; /* Le beau rouge Netflix */
    text-decoration: none; /* Enlève le soulignement moche sous le logo */
    font-weight: bold;
    font-size: 1.8rem; 
}

.logo a:hover {
    color: #ff1e27; /* Un rouge légèrement plus clair quand on passe dessus */
}

nav a {
    color: #e5e5e5;
    text-decoration: none;
    margin-right: 15px;
    font-size: 14px;
    transition: 0.3s;
}

nav a:hover { 
    color: white; 
}

/* ==========================================================================
   3. BANNIÈRE (HERO) - LOOK UNIVERSEL ADAPTATIF
   ========================================================================== */

.badge {
    display: inline-block;
    background-color: #E50914; /* Rouge Netflix */
    color: #FFFFFF;            /* Texte blanc */
    font-weight: bold;         /* Texte gras */
    padding: 6px 12px;
    font-size: 0.9rem;
    text-transform: uppercase; /* Force les majuscules */
    letter-spacing: 1px;
    border-radius: 4px;        /* Légèrement arrondi sur les bords */
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero {
    position: relative;
    height: 520px;
    background-color: #000;
    display: flex;
    overflow: hidden;
    margin-top: 30px;
}

/* Le fond avec la couverture agrandie */
.hero-background-blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    filter: blur(8px) brightness(1);
    transform: scale(1.1);
    z-index: 1;
}

/* L'ombre cinéma par-dessus */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(0,0,0,1) 5%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0.8) 100%);
    z-index: 2;
}

/* Conteneur principal du contenu dans la bannière */
.hero-content {
    position: absolute; 
    bottom: 0;          
    left: 0;
    width: 100%;
    padding: 0 4% 30px 4%; /* C'est ce padding-bottom (30px) qui gère la hauteur de TOUT le texte */
    z-index: 3;
    box-sizing: border-box;
}

/* Disposition : pousse le texte à gauche et le poster à droite */
.hero-dynamic-layout {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    width: 100%;
    gap: 40px; 
    margin-top: 15px;
}

/* Bloc texte bien aligné à gauche */
.hero-text {
    flex: 1;
    max-width: 850px; 
    text-align: left; 
}

.hero-text h1 {
    font-size: 3.5rem;
    margin: 10px 0;
    color: #fff;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.hero-soustitre {
    font-size: 1.15rem;
    color: #e5e5e5;
    margin-bottom: 20px;
    line-height: 1.4;

    /* === REGLAGE SOUPLE UNE OU DEUX LIGNES === */
    max-width: 2000px; 
    display: block;
}


/* --- LE BOUTON "PLUS D'INFOS" (STYLE NETFLIX) --- */
#heroBtn {
    display: inline-block;
    background-color: #ffffff; 
    color: #000000;            
    border: none;
    padding: 14px 32px;        
    font-size: 1.2rem;         
    font-weight: bold;         
    border-radius: 4px;        
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Petit effet de survol pour faire pro */
#heroBtn:hover {
    background-color: #e6e6e6; 
    transform: scale(1.05);    
}

/* Bloc couverture nette à droite */
.hero-poster {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 240px;
}

.hero-poster img {
    height: 450px;
    width: auto;
    border-radius: 1px;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    user-select: none;
}

/* Sur petit écran, on cache l'image à droite */
@media (max-width: 800px) {
    .hero-poster {
        display: none;
    }
}

/* ==========================================================================
   4. RANGÉES DE LIVRES (CAROUSEL FLUIDE)
   ========================================================================== */
main { 
    margin-top: -80px; 
    position: relative; 
    z-index: 10; 
}

.row {
    padding: 35px 0 35px 30px;
}

.selection-theme {
    color: #aaa;
    font-size: 0.95rem;
    font-style: italic;
    margin: -6px 0 10px 0;
}

.row h2 {
    font-size: 1.4rem;
    color: #e5e5e5;
    margin-bottom: 5px;
}

/* Flèches de navigation carrousel */
.carousel-wrap {
    position: relative;
}

.carousel-arrow {
    display: none;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 36px;
    align-items: center;
    justify-content: center;
    background: rgba(30, 30, 30, 0.45);
    border: none;
    color: #fff;
    font-size: 1.6rem;
    font-weight: 300;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    transition: background 0.2s;
    user-select: none;
}
.carousel-arrow:hover { background: rgba(30, 30, 30, 0.7); }
.carousel-arrow-left  { left: 0;  border-radius: 4px 0 0 4px; }
.carousel-arrow-right { right: 0; border-radius: 0 4px 4px 0; }

@media (min-width: 769px) {
    .carousel-wrap:hover .carousel-arrow { display: flex; }
}

/* Liste des livres avec défilement horizontal parfait et aimanté */
.book-list {
    display: flex !important; 
    flex-direction: row !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    gap: 12px;
    padding: 15px 0;
    scrollbar-width: none; 
    -ms-overflow-style: none; 
    scroll-snap-type: x mandatory; 
    -webkit-overflow-scrolling: touch; 
}

.book-list::-webkit-scrollbar { 
    display: none; 
}

/* Conteneur individuel de chaque livre */
.book-list .book-item, .book-list .book-card, .search-grid .book-card {
    position: relative !important;
    display: inline-block !important; 
    flex: 0 0 auto !important; 
    overflow: hidden !important; 
    border-radius: 4px;
    scroll-snap-align: start;
    
    /* TAILLE DES COUVERTURES REHAUSSÉE */
    width: 150px !important;
    height: 225px !important;
}

/* L'image forcée à remplir exactement le rectangle */
.book-list .book-item img, .book-list .book-card img, .search-grid .book-card img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; 
    background-color: transparent !important;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Effet de survol sur la couverture */
.book-item img:hover, .book-card img:hover {
    transform: scale(1.12);
    cursor: pointer;
    box-shadow: 0px 10px 20px rgba(0,0,0,0.6);
}

/* ==========================================================================
   5. LE BANDEAU "AJOUT RÉCENT" (BAS - MILIEU)
   ========================================================================== */
.bandeau-recent {
    position: absolute !important;
    top: auto !important;
    bottom: 0px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    
    background-color: #E50914 !important;
    color: #ffffff !important;
    
    font-size: 11px !important;
    font-weight: bold !important;
    padding: 5px 10px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    
    z-index: 5 !important;
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.4) !important;
    border-radius: 4px !important;
    
    white-space: nowrap !important;
    pointer-events: none !important;
    width: auto !important;
}

/* Bandeau Top 10 — même style que bandeau-recent */
.bandeau-top10 {
    position: absolute !important;
    top: auto !important;
    bottom: 0px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;

    background-color: #E50914 !important;
    color: #ffffff !important;

    font-size: 11px !important;
    font-weight: bold !important;
    padding: 5px 10px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;

    z-index: 5 !important;
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.4) !important;
    border-radius: 4px !important;

    white-space: nowrap !important;
    pointer-events: none !important;
    width: auto !important;
}

/* Bandeau TW (trigger warning) — même principe que bandeau-recent */
.bandeau-tw {
    position: absolute !important;
    bottom: 0px !important;
    left: 0 !important;
    right: 0 !important;
    background-color: #c0392b !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: bold !important;
    padding: 7px 6px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    z-index: 6 !important;
    pointer-events: none !important;
    text-align: center !important;
}
/* Pills TW dans la modale */
.tw-pill {
    display: inline-block;
    background: #c0392b;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    margin: 2px 2px;
}
#modalTW {
    display: inline-block;
    background: #1a0a0a;
    border: 1px solid #c0392b;
    border-radius: 5px;
    padding: 5px 10px;
    margin-bottom: 12px;
}
#modalTW .tw-header {
    color: #e74c3c;
    font-size: 0.65rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.tw-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    font-size: 9px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 4px;
    vertical-align: middle;
    pointer-events: all;
    text-transform: none;
    letter-spacing: 0;
}
.tw-info-btn:hover { background: #e74c3c; color: #fff; }
.tw-info-text {
    font-size: 0.7rem;
    color: #ccc;
    line-height: 1.5;
    margin-top: 6px;
    font-weight: normal;
    text-transform: none;
    letter-spacing: 0;
}

/* ==========================================================================
   6. FENÊTRE MODALE (POPUP INFOS)
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.9);
    animation: fadeIn 0.4s ease-out;
}

.modal-content {
    background-color: #181818;
    margin: 5% auto;
    max-height: 88vh;
    overflow-y: auto;
    padding: 40px;
    width: 80%;
    max-width: 900px;
    border-radius: 12px;
    position: relative;
    color: white;
    animation: zoomIn 0.45s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.modal-body { 
    display: flex; 
    gap: 35px; 
    align-items: flex-start; 
}

.modal-body img { 
    width: 300px; 
    border-radius: 6px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
}

.modal-text h2 { 
    font-size: 2.8rem; 
    margin-top: 0; 
    color: #E50914; 
    margin-bottom: 15px; 
}

.modal-text p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #ccc;
}

.modal-meta {
    font-size: 0.95rem !important;
    color: #888 !important;
    margin-bottom: 14px !important;
}
.modal-meta-sep { opacity: 0.5; }

.modal-btns-row {
    display: flex;
    gap: 8px;
    margin-top: 18px;
}
.btn-genre {
    flex: 1;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-left: 3px solid #e50914;
    color: #bbb;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-size: 0.82rem;
    font-family: inherit;
    text-align: center;
    transition: background 0.2s, color 0.2s;
    min-width: 0;
}
.btn-genre:hover { background: rgba(229, 9, 20, 0.1); color: #fff; }
.btn-genre.active { background: rgba(229, 9, 20, 0.18); color: #fff; border-left-width: 4px; }

.btn-lire-suite {
    background: none;
    border: none;
    color: #e50914;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 0 8px;
    text-decoration: underline;
    display: block;
}

.modal-similaires {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-top: 14px;
}
.similar-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    display: block;
    transition: transform 0.2s;
}
.similar-card img:hover { transform: scale(1.07); }

.close {
    position: absolute; 
    right: 25px; 
    top: 15px; 
    font-size: 40px;
    color: #777; 
    cursor: pointer; 
    transition: 0.3s;
    background: none;
    border: none;
}

.close:hover { 
    color: white; 
    transform: rotate(90deg); 
}

/* ==========================================================================
   7. ANIMATIONS KEYFRAMES
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   STRUCTURE COMPLÈTE : TOP 10 NETFLIX (CHIFFRE GÉANT REPOSITIONNÉ)
   ========================================================================== */

/* 1. Le conteneur global de chaque élément du Top 10 */
html body .book-list .book-item.top10-item,
html body .book-list .book-card.top10-item {
    display: block !important;
    position: relative !important;
    width: 150px !important;       
    height: 260px !important;      
    margin-right: 140px !important; 
    overflow: visible !important;  
    background: transparent !important;
}

/* 2. Cas particulier du tout PREMIER livre (Le numéro 1) */
html body .book-list .book-item.top10-item:first-child,
html body .book-list .book-card.top10-item:first-child {
    margin-left: 100px !important;  
}

/* 3. Le style des chiffres géants (Nombres 1 à 9) */
html body .book-list .book-item.top10-item .top10-number,
html body .book-list .book-card.top10-item .top10-number {
    font-family: 'Impact', 'Arial Black', sans-serif !important;
    font-size: 200px !important;   
    font-weight: 900 !important;
    line-height: 1 !important;
    color: #000000 !important;
    -webkit-text-stroke: 2px #777777 !important;
    position: absolute !important;
    bottom: -10px !important;      
    left: -75px !important;        
    z-index: 1 !important;         
    margin: 0 !important;
    padding: 0 !important;
    user-select: none !important;
}

/* 4. La couverture du livre calée à droite du chiffre */
html body .book-list .book-item.top10-item img,
html body .book-list .book-card.top10-item img {
    position: absolute !important;
    left: 0 !important;              
    bottom: 0 !important;
    width: 150px !important;         
    height: 225px !important;        
    z-index: 2 !important;           
    object-fit: cover !important;    
    border-radius: 4px !important;
    box-shadow: -8px 0px 15px rgba(0, 0, 0, 0.9) !important; 
}

/* 5. Le bandeau "Ajout récent" aligné sur l'image du Top 10 */
html body .book-list .book-item.top10-item .bandeau-recent,
html body .book-list .book-card.top10-item .bandeau-recent {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 150px !important;         
    right: auto !important;
    transform: none !important;
    z-index: 3 !important;           
}

/* 6. Cas particulier pour le nombre 10 (Le dernier élément) */
html body .book-list .book-item.top10-item:last-child .top10-number,
html body .book-list .book-card.top10-item:last-child .top10-number {
    letter-spacing: -15px !important;
    left: -120px !important;
}

/* --- SÉCURITÉ ANTI-COUPURE --- */
html body .row.top10-row {
    overflow: visible !important;
}
html body .row.top10-row #top10-container {
    scroll-snap-type: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-left: 10px !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

html body .row.top10-row #top10-container::-webkit-scrollbar {
    display: none !important;
}


/* ==========================================================================
   MENU DÉROULANT DOCUMENTAIRES
   ========================================================================== */
header nav {
    display: flex;
    align-items: center;
}

header nav .dropdown {
    display: flex;
    align-items: center;
    position: relative;
}

.dropdown .arrow {
    font-size: 0.65rem;
    margin-left: 3px;
    vertical-align: middle;
}

.dropdown-menu {
    display: none; 
    position: absolute; 
    top: 100%; 
    left: 0;
    background-color: #141414; 
    border: 1px solid #333;
    min-width: 160px;
    padding: 5px 0;
    z-index: 9999; 
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.6);
}

.dropdown-menu a {
    display: block !important; 
    padding: 10px 20px;
    color: #fff;
    font-size: 0.85rem;
    text-decoration: none;
    text-align: left;
    transition: background 0.2s ease;
}

.dropdown-menu a:hover {
    background-color: #e50914;
    color: #fff;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

/* ==========================================================================
   9. MOTEUR DE RECHERCHE (STYLE NETFLIX)
   ========================================================================== */
.search-container {
    position: relative;
    margin-left: auto;
    display: flex;
    align-items: center;
}

#searchInput {
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: 1px solid #555;
    padding: 7px 40px 7px 15px;
    font-size: 14px;
    border-radius: 4px;
    outline: none;
    width: 220px;
    transition: all 0.3s ease;
}

#searchInput:focus {
    width: 280px;
    border-color: #E50914;
    background-color: #000000;
}

/* Le bouton loupe transparent */
.search-btn {
    position: absolute;
    right: 5px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 14px;
    cursor: pointer;
    padding: 5px;
}

/* Barre de recherche mobile (visible seulement en dessous de 768px) */
.mobile-search-bar {
    display: none;
}
@media (max-width: 768px) {
    .mobile-search-bar {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0 4vw 18px;
    }
    .mobile-search-bar input {
        flex: 1;
        background: rgba(255,255,255,0.1);
        color: #fff;
        border: 1px solid #555;
        border-radius: 6px;
        padding: 11px 14px;
        font-size: 1rem;
        outline: none;
    }
    .mobile-search-bar input:focus {
        border-color: #E50914;
        background: rgba(255,255,255,0.15);
    }
    .mobile-search-bar button {
        background: #E50914;
        border: none;
        border-radius: 6px;
        color: #fff;
        padding: 11px 16px;
        font-size: 1rem;
        cursor: pointer;
    }
}

/* Grille spéciale pour afficher les résultats de recherche */
.search-grid {
    display: flex;
    flex-wrap: wrap; 
    gap: 20px;
    padding: 20px 0;
}

/* ==========================================================================
   10. FOOTER & MENTION IA (STYLE NETFLIX - SANS ANIMATION)
   ========================================================================== */
/* ── ADMIN OVERLAY BAR ──────────────────────────────────────────────────────── */
#admin-overlay-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 46px;
    background: #0a0a0a;
    border-top: 2px solid #e50914;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    z-index: 9999;
    font-size: 13px;
}
.admin-bar-label {
    color: #e50914;
    font-weight: 700;
    letter-spacing: 0.4px;
    margin-right: 6px;
    white-space: nowrap;
}
.admin-bar-btn {
    background: #1e1e1e;
    color: #e5e5e5;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 5px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.admin-bar-btn:hover, .admin-bar-btn.active {
    background: #e50914;
    border-color: #e50914;
    color: #fff;
}
.admin-bar-link {
    color: #888;
    text-decoration: none;
    font-size: 13px;
    margin-left: auto;
    white-space: nowrap;
    transition: color 0.15s;
}
.admin-bar-link:hover { color: #fff; }
.admin-bar-close {
    background: none;
    border: none;
    color: #555;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    transition: color 0.15s;
}
.admin-bar-close:hover { color: #e50914; }

.site-footer {
    width: 100%;
    background-color: #000000;
    padding: 28px 4% 22px 4%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    margin-top: 40px;
    border-top: 2px solid #141414;
}

.footer-credit {
    color: #666;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.5px;
    user-select: none;
}

.ai-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    order: -1;
}

.ai-text {
    color: #666;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.5px;
    user-select: none;
}

.ai-logo {
    height: 65px;
    width: auto;
    display: block;
    opacity: 0.7;
}

/* ══════════════════════════════════════════════════════════════════════════════
   11b. FILTRE PAR NOMBRE DE PAGES
   ══════════════════════════════════════════════════════════════════════════════ */
.filtre-pages {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px 4vw 10px;
    flex-wrap: wrap;
}

.filtre-btn {
    padding: 8px 16px;
    min-height: 40px;
    border-radius: 20px;
    border: 1px solid #555;
    background: transparent;
    color: #ccc;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
}

.filtre-btn:hover {
    border-color: #e50914;
    color: #fff;
}

.filtre-btn.active {
    background: #e50914;
    border-color: #e50914;
    color: #fff;
}

.book-list .book-card.filtre-masque {
    display: none !important;
}

/* ══════════════════════════════════════════════════════════════════════════════
   12. NAVIGATION MOBILE
   ══════════════════════════════════════════════════════════════════════════════ */

/* Éléments mobiles invisibles sur desktop */
#mobile-header,
#mobile-bottom-bar,
#mobile-dropdown,
#mobile-overlay { display: none; }

@media (max-width: 768px) {

    /* Cache le header desktop */
    header { display: none !important; }

    body {
        padding-top: var(--mob-header-h, 80px);
        padding-bottom: 64px;
    }

    /* Annule le margin-top inline des pages (ex: recherche.html) */
    main.container { margin-top: 0 !important; }

    /* ── Header mobile ─────────────────────────────────────────────────────── */
    #mobile-header {
        display: block;
        position: fixed;
        top: 0; left: 0; right: 0;
        z-index: 900;
        background: linear-gradient(to bottom, rgba(20,20,20,0.92) 60%, transparent);
        transition: background 0.3s ease;
    }

    #mobile-header.scrolled {
        background: rgba(30, 30, 30, 0.97);
    }

    #mobile-title-bar {
        display: flex;
        align-items: center;
        padding: 8px 16px 4px;
    }

    #mobile-page-title {
        font-size: 1.1rem;
        font-weight: 700;
        color: #fff;
        letter-spacing: -0.3px;
    }

    /* ── Onglets scrollables ───────────────────────────────────────────────── */
    #mobile-tabs {
        display: flex;
        overflow-x: auto;
        gap: 5px;
        padding: 2px 12px 6px;
        scrollbar-width: none;
    }
    #mobile-tabs::-webkit-scrollbar { display: none; }

    .mobile-tab-btn {
        flex-shrink: 0;
        background: rgba(255,255,255,0.12);
        color: #e5e5e5;
        border: none;
        border-radius: 7px;
        padding: 7px 13px;
        font-size: 0.8rem;
        cursor: pointer;
        white-space: nowrap;
        transition: background 0.15s, color 0.15s;
    }
    .mobile-tab-btn.active,
    .mobile-tab-btn.dropdown-open {
        background: #fff;
        color: #000;
        font-weight: 600;
    }

    /* ── Dropdown sous-catégories ─────────────────────────────────────────── */
    #mobile-dropdown {
        position: fixed;
        top: var(--mob-header-h, 100px);
        left: 0; right: 0;
        background: #1c1c1c;
        z-index: 860;
        border-bottom: 1px solid #333;
        max-height: 60vh;
        overflow-y: auto;
    }
    #mobile-dropdown.open { display: block; }

    #mobile-dropdown a {
        display: block;
        padding: 14px 20px;
        color: #e5e5e5;
        text-decoration: none;
        font-size: 0.95rem;
        border-bottom: 1px solid #2a2a2a;
    }
    #mobile-dropdown a:last-child { border-bottom: none; }
    #mobile-dropdown a:active { background: #333; }

    /* ── Overlay ───────────────────────────────────────────────────────────── */
    #mobile-overlay {
        position: fixed;
        inset: 0;
        z-index: 850;
        background: rgba(0,0,0,0.45);
    }
    #mobile-overlay.open { display: block; }

    /* ── Barre du bas ──────────────────────────────────────────────────────── */
    #mobile-bottom-bar {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: 60px;
        background: #141414;
        border-top: 1px solid #252525;
        z-index: 900;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .mobile-bottom-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: #777;
        text-decoration: none;
        font-size: 0.62rem;
        letter-spacing: 0.02em;
    }
    .mobile-bottom-btn.active { color: #fff; }
    .mobile-bottom-btn svg {
        width: 22px; height: 22px;
        stroke: currentColor;
    }

    /* ── Hero (bannière) — remonte sous le header transparent ─────────────── */
    .hero {
        height: 380px !important;
        margin-top: calc(-1 * var(--mob-header-h, 80px)) !important;
    }

    /* Montre la couverture (overrides la règle ≤800px qui la cachait) */
    .hero-poster {
        display: flex !important;
        margin-right: 0 !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .hero-poster img {
        height: 280px !important;
        width: auto !important;
        object-fit: contain !important;
    }

    .hero-background-blur {
        filter: blur(3px) brightness(1) !important;
    }

    .hero-content {
        padding: 0 3% 0 3% !important;
        top: var(--mob-header-h, 80px) !important;
        bottom: 0 !important;
        display: flex !important;
        align-items: center !important;
    }

    .hero-dynamic-layout {
        gap: 14px !important;
        align-items: center !important;
        margin-top: 0 !important;
        width: 100% !important;
    }

    .hero-text h1 {
        font-size: 0.95rem !important;
        margin: 3px 0 !important;
    }

    .hero-soustitre {
        font-size: 0.78rem !important;
        margin-bottom: 8px !important;
    }

    #heroBtn {
        padding: 6px 11px !important;
        font-size: 0.75rem !important;
    }

    /* Chevauchement hero/contenu réduit */
    main { margin-top: -20px !important; }

    /* Filtre pages réduit */
    .filtre-pages {
        gap: 5px !important;
        padding: 10px 3vw 6px !important;
    }
    .filtre-btn {
        padding: 5px 10px !important;
        min-height: 28px !important;
        font-size: 0.72rem !important;
        border-radius: 14px !important;
    }

    /* Marge gauche réduite, espacement carousels réduit */
    .row { padding: 14px 0 14px 14px !important; }

    /* Top 10 redimensionné pour mobile */
    html body .book-list .book-card.top10-item {
        width: 110px !important;
        height: 175px !important;
        margin-right: 80px !important;
    }
    html body .book-list .book-card.top10-item:first-child {
        margin-left: 60px !important;
    }
    html body .book-list .book-card.top10-item .top10-number {
        font-size: 130px !important;
        left: -50px !important;
        color: #000000 !important;
        -webkit-text-stroke: 0px !important;
        text-shadow:
            -4px 0 #666, 4px 0 #666,
            0 -4px #666, 0 4px #666,
            -3px -3px #666, 3px -3px #666,
            -3px 3px #666, 3px 3px #666 !important;
    }
    html body .book-list .book-card.top10-item img {
        width: 110px !important;
        height: 165px !important;
    }
    /* "10" mobile : couverture décalée à droite pour révéler le "0" */
    html body .book-list .book-card.top10-item:last-child img {
        left: 20px !important;
        width: 90px !important;
    }
    html body .book-list .book-card.top10-item:last-child .top10-number {
        letter-spacing: -20px !important;
        left: -90px !important;
    }


    /* Bandeau Ajout récent / Top 10 plus petit */
    .bandeau-recent, .bandeau-top10 {
        font-size: 9px !important;
        padding: 3px 7px !important;
    }

    /* Titres carousels plus petits */
    .row h2 { font-size: 1rem !important; }

    /* Couvertures plus petites */
    .book-list .book-item, .book-list .book-card {
        width: 100px !important;
        height: 150px !important;
    }

    /* ── Modale ────────────────────────────────────────────────────────────── */
    .modal-content {
        position: fixed !important;
        inset: auto 0 0 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 16px 16px 0 0 !important;
        padding: 20px 16px calc(70px + env(safe-area-inset-bottom, 0px)) 16px !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        animation: slideUpModal 0.32s cubic-bezier(0.22, 1, 0.36, 1) !important;
    }

    .modal-body {
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 14px !important;
    }

    .modal-body > img {
        width: 100px !important;
        flex-shrink: 0 !important;
    }

    .modal-text h2 {
        font-size: 1.3rem !important;
        margin-bottom: 8px !important;
    }

    .modal-text p {
        font-size: 0.88rem !important;
        line-height: 1.5 !important;
    }

    .close {
        top: 10px !important;
        right: 16px !important;
        font-size: 32px !important;
    }

    .badge { font-size: 0.72rem !important; padding: 4px 8px !important; white-space: nowrap !important; }
}

@keyframes slideUpModal {
    from { transform: translateY(100%); opacity: 0.6; }
    to   { transform: translateY(0);    opacity: 1; }
}