/**
 * CSS Frontend pour Physical Library Manager
 * Compatible avec Customizr et TinyMCE
 * Fichier: assets/css/frontend.css
 */

/* === Fil d'Ariane Customizr === */
.czr-hot-crumble.page-breadcrumbs {
    margin-bottom: 30px;
}

.czr-hot-crumble .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.czr-hot-crumble .breadcrumb-item {
    display: inline-flex;
    align-items: center;
}

.czr-hot-crumble .breadcrumb-item a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.czr-hot-crumble .breadcrumb-item a:hover {
    color: #005a87;
    text-decoration: underline;
}

.czr-hot-crumble .breadcrumb-item.active {
    color: #555;
    font-weight: 600;
}

.czr-hot-crumble .breadcrumb-separator {
    color: #999;
    padding: 0 5px;
}

.czr-hot-crumble .fa {
    margin-right: 5px;
}

/* === Navigation précédent/suivant === */
.plm-post-navigation {
    margin: 30px 0;
    padding: 20px 0;
    border-top: 2px solid #e0e0e0;
    border-bottom: 2px solid #e0e0e0;
}

.plm-post-navigation-bottom {
    margin-top: 50px;
    border-top: 2px solid #0073aa;
    border-bottom: none;
}

.plm-nav-links {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.plm-nav-previous,
.plm-nav-next {
    flex: 1;
    max-width: 48%;
}

.plm-nav-previous a,
.plm-nav-next a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.plm-nav-previous a:hover,
.plm-nav-next a:hover {
    background: #fff;
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0,115,170,0.1);
    transform: translateY(-2px);
}

.plm-nav-arrow {
    font-size: 1.5em;
    color: #0073aa;
    flex-shrink: 0;
}

.plm-nav-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.plm-nav-label {
    font-size: 0.85em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.plm-nav-title {
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plm-nav-next {
    text-align: right;
}

.plm-nav-next a {
    flex-direction: row-reverse;
}

/* Navigation avec miniatures */
.plm-nav-with-thumbnail a {
    padding: 10px;
}

.plm-nav-thumbnail {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

/* === Container principal === */
.plm-library-container,
.plm-archive-container,
.plm-taxonomy-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* === Headers === */
.plm-archive-header,
.plm-taxonomy-header {
    text-align: center;
    margin: 30px 0 40px;
}

.plm-archive-title,
.plm-taxonomy-title {
    font-size: 2.5em;
    color: #333;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.plm-taxonomy-term {
    color: #0073aa;
}

.plm-archive-description,
.plm-taxonomy-description,
.plm-taxonomy-count {
    font-size: 1.1em;
    color: #666;
    max-width: 600px;
    margin: 0 auto 15px;
}

/* === Filtres === */
.plm-filters {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.plm-filters-title {
    margin: 0 0 20px 0;
    font-size: 1.3em;
    color: #333;
}

.plm-filters-group {
    margin-bottom: 15px;
}

.plm-filters-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.plm-filter-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s;
}

.plm-filter-select:focus {
    outline: none;
    border-color: #0073aa;
}

.plm-reset-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.plm-reset-button:hover {
    background: #005a87;
}

/* === Compteur de résultats === */
.plm-results-count,
.plm-taxonomy-count {
    margin-bottom: 20px;
    font-size: 1.1em;
    color: #666;
}

#plm-count-books {
    font-weight: bold;
    color: #0073aa;
}

/* === Grille de livres === */
.plm-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

/* === Carte de livre === */
.plm-book-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.plm-book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.plm-book-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.plm-book-cover {
    width: 100%;
    height: 350px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plm-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.plm-book-card:hover .plm-book-cover img {
    transform: scale(1.05);
}

.plm-book-info {
    padding: 15px;
}

.plm-book-title {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: #333;
    line-height: 1.4;
    min-height: 50px;
}

/* === Étiquettes === */
.plm-book-tags,
.plm-single-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.plm-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s;
}

.plm-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.plm-tag-type {
    background: #e3f2fd;
    color: #1565c0;
}

.plm-tag-type:hover {
    background: #1565c0;
    color: white;
}

.plm-tag-region {
    background: #f3e5f5;
    color: #7b1fa2;
}

.plm-tag-region:hover {
    background: #7b1fa2;
    color: white;
}

.plm-tag-department {
    background: #e8f5e9;
    color: #2e7d32;
}

.plm-tag-department:hover {
    background: #2e7d32;
    color: white;
}

/* === Page de détail === */
.plm-single-book {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.plm-single-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    align-items: start;
    margin-top: 30px;
}

/* === Colonne de droite: Couverture === */
.plm-single-cover {
    position: sticky;
    top: 20px;
}

.plm-cover-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* === Colonne de gauche: Détails === */
.plm-single-details {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.plm-single-title {
    margin: 0 0 30px 0;
    font-size: 2em;
    color: #333;
    line-height: 1.3;
}

.plm-detail-row {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.plm-detail-row:last-of-type {
    border-bottom: none;
}

.plm-detail-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #555;
    margin-right: 10px;
}

.plm-detail-label .fa {
    color: #0073aa;
}

.plm-detail-value {
    color: #333;
}

/* === Étiquettes dans le détail === */
.plm-tags-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.plm-tags-group strong {
    color: #555;
}

/* === Lien externe === */
.plm-external-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.3s;
}

.plm-external-link:hover {
    background: #005a87;
}

.plm-external-link .fa {
    font-size: 1.1em;
}

/* === Section sommaire avec styles TinyMCE === */
.plm-summary-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.plm-summary-title {
    margin: 0 0 20px 0;
    font-size: 1.5em;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.plm-summary-title .fa {
    color: #0073aa;
}

/* Styles pour le contenu TinyMCE */
.plm-summary-content,
.plm-tinymce-content {
    line-height: 1.8;
    color: #555;
}

.plm-summary-content p,
.plm-tinymce-content p {
    margin-bottom: 15px;
}

.plm-summary-content h1,
.plm-tinymce-content h1 {
    font-size: 1.8em;
    margin: 25px 0 15px;
    color: #333;
}

.plm-summary-content h2,
.plm-tinymce-content h2 {
    font-size: 1.5em;
    margin: 20px 0 12px;
    color: #333;
}

.plm-summary-content h3,
.plm-tinymce-content h3 {
    font-size: 1.3em;
    margin: 18px 0 10px;
    color: #333;
}

.plm-summary-content ul,
.plm-summary-content ol,
.plm-tinymce-content ul,
.plm-tinymce-content ol {
    margin: 15px 0 15px 30px;
}

.plm-summary-content ul li,
.plm-tinymce-content ul li {
    list-style-type: disc;
    margin-bottom: 8px;
}

.plm-summary-content ol li,
.plm-tinymce-content ol li {
    list-style-type: decimal;
    margin-bottom: 8px;
}

.plm-summary-content strong,
.plm-tinymce-content strong {
    font-weight: 700;
    color: #333;
}

.plm-summary-content em,
.plm-tinymce-content em {
    font-style: italic;
}

.plm-summary-content a,
.plm-tinymce-content a {
    color: #0073aa;
    text-decoration: underline;
}

.plm-summary-content a:hover,
.plm-tinymce-content a:hover {
    color: #005a87;
}

.plm-summary-content blockquote,
.plm-tinymce-content blockquote {
    border-left: 4px solid #0073aa;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #666;
}

.plm-summary-content code,
.plm-tinymce-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

.plm-summary-content pre,
.plm-tinymce-content pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 15px 0;
}

.plm-summary-content img,
.plm-tinymce-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 15px 0;
}

/* === Navigation === */
.plm-navigation {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.plm-back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.plm-back-button:hover {
    background: #e0e0e0;
}

/* === Pagination === */
.plm-pagination {
    margin-top: 40px;
}

.plm-pagination-list {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
}

.plm-pagination-item a,
.plm-pagination-item span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.plm-pagination-item a:hover {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.plm-pagination-item .current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* === Messages === */
.plm-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    font-size: 1.2em;
    color: #999;
}

/* === Loader === */
.plm-loader {
    text-align: center;
    padding: 40px;
}

.plm-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: plm-spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes plm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === Responsive === */
@media (max-width: 768px) {
    .czr-hot-crumble .breadcrumb {
        font-size: 12px;
    }
    
    .plm-nav-links {
        flex-direction: column;
    }
    
    .plm-nav-previous,
    .plm-nav-next {
        max-width: 100%;
    }
    
    .plm-nav-thumbnail {
        width: 60px;
        height: 90px;
    }
    
    .plm-books-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .plm-single-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .plm-single-cover {
        position: relative;
        top: 0;
    }
    
    .plm-single-details {
        padding: 20px;
    }
    
    .plm-single-title {
        font-size: 1.5em;
    }
    
    .plm-archive-title,
    .plm-taxonomy-title {
        font-size: 1.8em;
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .plm-books-grid {
        grid-template-columns: 1fr;
    }
}
