/* ----------------------
Page individuelle (Single book)
----------------------- */
/* Reset des marges pour le conteneur principal */
.single-book .site-main, 
.single-book .content-area {
    padding: 0;
    margin: 0;
    max-width: 100%;
}

/* Conteneur du livre */
.dl-book-reader-container {
    width: 100%;
    margin: 0;
    padding: 10px 0;
    box-sizing: border-box;
    border: 2px solid #009E49; /* VERT */
    border-radius: 8px;
    background: #f8f8f8;
}

/* Tableau des métadonnées */
.dl-single-book-table {
    width: 100%;
    margin: 0 0 20px 0;
    border-collapse: collapse;
}

/* Cellule de la couverture */
.dl-single-cover-cell {
    width: 150px;
    padding: 0 15px 0 0;
    vertical-align: top;
}

/* Cellule des métadonnées */
.dl-single-meta-cell {
    vertical-align: top;
    padding: 0;
}

/* Image de couverture */
.dl-book-cover img {
    max-width: 100%;
    height: auto;
    display: block;
    border: 3px solid #FCD116; /* JAUNE */
    border-radius: 5px;
}

/* Titre du livre */
.dl-book-title {
    margin: 0 0 10px 0;
    font-size: 1.5em;
    line-height: 1.2;
    color: #009E49; /* VERT */
}

/* Grille des métadonnées */
.dl-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin: 0 0 15px 0;
}

/* Conteneur du lecteur EPUB*/
.dl-epub-viewer {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Conteneur du lecteur PDF */
.dl-pdf-viewer {
    width: 100%;
    max-width: 100%; /* Ignore la limite de 1200px du thème */
    overflow: auto; /* Permet le défilement */
    margin: 0 auto;
    position: relative; /* Pour z-index */
    z-index: 100; /* Met au-dessus des éléments du thème */
    border: 1px solid #009E49; /* VERT */
    border-radius: 5px;
}

/* Conteneur PDF */
#dl-pdf-container {
    width: 100% !important;
    height: calc(100vh - 150px) !important;
    padding: 0;
    border: none;
    display: block;
    margin: 0 auto;
    background: white;
}

/* Correction pour les barres latérales/thème */
body.single-book {
    overflow-x: hidden; /* Empêche le débordement horizontal global */
}

/* Conteneur EPUB */
#dl-epub-container {
    width: 100% !important;
    height: calc(100vh - 150px) !important;
    margin: 0;
    padding: 0;
    border: none;
}

/* Contrôles du lecteur */
.dl-pdf-controls, 
.dl-epub-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 0 0 10px 0;
    padding: 10px;
    background: rgba(0, 158, 73, 0.1); /* VERT très clair */
    border-radius: 5px;
}

/* Boutons de contrôle */
.dl-pdf-prev, 
.dl-pdf-next, 
.dl-epub-prev, 
.dl-epub-next, 
.dl-read-button {
    padding: 8px 12px;
    background: #009E49; /* VERT */
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s;
}

.dl-pdf-prev:hover, 
.dl-pdf-next:hover, 
.dl-epub-prev:hover, 
.dl-epub-next:hover, 
.dl-read-button:hover {
    background: #EF2B2D; /* ROUGE au survol */
    transform: translateY(-2px);
}

/* Zoom PDF */
.dl-pdf-zoom {
    padding: 8px;
    margin-left: auto;
    border: 1px solid #009E49; /* VERT */
    border-radius: 3px;
    color: #009E49; /* VERT */
}

/* Section des commentaires */
.dl-book-comments {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #FCD116; /* JAUNE */
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .dl-single-book-table {
        display: block;
    }
    
    .dl-single-cover-cell, 
    .dl-single-meta-cell {
        display: block;
        width: 100%;
        padding: 0;
    }
    
    .dl-single-cover-cell {
        margin-bottom: 15px;
        text-align: center;
    }
    
    .dl-meta-grid {
        grid-template-columns: 1fr;
    }
    
    #dl-pdf-container, 
    #dl-epub-container {
        height: 70vh !important;
    } 
    
    .dl-pdf-controls, 
    .dl-epub-controls {
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
    }

    /* Style de la barre de défilement */
    .dl-pdf-controls::-webkit-scrollbar,
    .dl-epub-controls::-webkit-scrollbar {
        height: 4px;
    }
    
    .dl-pdf-controls::-webkit-scrollbar-thumb,
    .dl-epub-controls::-webkit-scrollbar-thumb {
        background: #009E49; /* VERT */
        border-radius: 2px;
    }

    /* Ajustement des boutons pour mobile */
    .dl-pdf-prev, 
    .dl-pdf-next, 
    .dl-epub-prev, 
    .dl-epub-next,
    .dl-epub-toc-toggle,
    .dl-epub-bookmark {
        padding: 6px 10px;
        font-size: 0.85em;
        flex-shrink: 0;
    }

    .dl-pdf-zoom {
        flex: 0 0 90px;
        padding: 6px;
        font-size: 0.85em;
    }

    .dl-epub-position {
        min-width: 70px;
        font-size: 0.85em;
        flex-shrink: 0;
    }
}

/* Correction pour les thèmes avec sidebars */
.single-book .content-area {
    float: none;
    width: 100%;
}

.single-book .site-content {
    display: block;
}

/* Pleine largeur pour les iframes */
.dl-pdf-viewer iframe {
    width: 100%;
    min-height: 80vh;
    border: none;
}

/* Optimisation du bouton EPUB */
.dl-read-button {
    display: block;
    width: 100%;
    text-align: center;
    padding: 15px;
    margin: 10px 0;
    font-size: 1.1em;
    background: #009E49; /* VERT */
    color: white;
}

.dl-read-button:hover {
    background: #EF2B2D; /* ROUGE */
}

/* Ajustement des marges internes */
.dl-book-meta, 
.dl-book-excerpt {
    margin: 8px 0;
    padding: 0;
}

/* Suppression des espaces superflus */
.dl-book-reader-container > *:last-child {
    margin-bottom: 0;
}

/* Mode paysage */
@media screen and (orientation: landscape) {
    #dl-pdf-container iframe,
    #dl-epub-container {
        width: 100%;
        height: 100vh;
        max-width: 100%;
    }
}

/* Désactiver le menu contextuel */
.dl-pdf-viewer {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
} 

.dl-pdf-viewer canvas {
    pointer-events: auto;
}



/*-------------------------
Formulaire de recherche 
-------------------------*/
.dl-search-form {
    max-width: 1000px;
    margin: 0 auto 40px;
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border: 2px solid #009E49; /* VERT */
}

.dl-search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.dl-search-field {
    margin-bottom: 15px;
}

.dl-search-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #009E49; /* VERT */
}

.dl-search-field input,
.dl-search-field select {
    width: 100%;
    padding: 10px;
    border: 1px solid #009E49; /* VERT */
    border-radius: 4px;
    font-size: 14px;
    color: #333;
}

.dl-year-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dl-year-range span {
    color: #009E49; /* VERT */
}

.dl-search-button {
    background: #009E49; /* VERT */
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.dl-search-button:hover {
    background: #EF2B2D; /* ROUGE */
    transform: translateY(-2px);
}

/* restriction d'accès */
.dl-access-denied {
    background: #fff0f0; /* ROUGE très clair */
    border: 2px solid #EF2B2D; /* ROUGE */
    border-radius: 8px;
    padding: 20px 25px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 2px 6px rgba(239, 43, 45, 0.1);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.6;
}

.dl-access-message {
    max-width: 650px;
    margin: 0 auto;
    color: #333;
}

.dl-access-message h3 {
    color: #EF2B2D; /* ROUGE */
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.dl-access-message p {
    color: #444;
    font-size: 1rem;
    margin-bottom: 15px;
}

.dl-access-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.dl-access-actions .button {
    padding: 10px 18px;
    border-radius: 5px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    color: #fff;
    background-color: #009E49; /* VERT */
    border: none;
}

.dl-access-actions .button:hover {
    background-color: #007a3a; /* VERT plus foncé */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Styles supplémentaires pour harmoniser */
.dl-book-meta strong {
    color: #009E49; /* VERT */
}

.dl-book-excerpt {
    color: #555;
    border-left: 3px solid #FCD116; /* JAUNE */
    padding-left: 10px;
}