/* ========================================
   ENCART CHAPITRES DE DOSSIER
   ======================================== */

/* Encart principal des chapitres */
.dossier-chapters-navigation {
    margin: 2.5rem 0;
    padding: 1.8rem;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-radius: 12px;
    border: 2px solid #f39c12;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.2);
}

/* En-tête de la section */
.chapters-header {
    text-align: center;
    margin-bottom: 2rem;
}

.chapters-title {
    font-size: 1.6rem;
    color: #d63031;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.chapters-subtitle {
    color: #e17055;
    font-size: 1rem;
    margin: 0;
    font-weight: 500;
}

/* Grille des chapitres */
.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

/* Carte de chapitre */
.chapter-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid #e9ecef;
    cursor: pointer;
    position: relative;
}

.chapter-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(214, 48, 49, 0.2);
    border-color: #d63031;
}

/* Carte cliquable */
.chapter-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.chapter-card-link:hover {
    text-decoration: none;
    color: inherit;
}

/* Image de couverture du chapitre */
.chapter-image {
    position: relative;
    height: 140px;
    overflow: hidden;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
}

.chapter-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.chapter-card:hover .chapter-image img {
    transform: scale(1.05);
}

/* Badge numéro de chapitre */
.chapter-number {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    background: linear-gradient(135deg, #d63031, #a02929);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(214, 48, 49, 0.3);
    border: 2px solid #ffffff;
}

/* Contenu de la carte */
.chapter-content {
    padding: 1.2rem;
}

.chapter-title {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.chapter-title {
    color: #2d3436;
    font-weight: 600;
    margin: 0;
}

/* Extrait du chapitre */
.chapter-excerpt {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Métadonnées du chapitre */
.chapter-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.chapter-reading-time {
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.chapter-status {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.chapter-status.published {
    background: #00b894;
    color: #ffffff;
    border: 1px solid #00a085;
    font-weight: 600;
}

.chapter-status.draft {
    background: #fdcb6e;
    color: #2d3436;
    border: 1px solid #e17055;
    font-weight: 600;
}

/* Actions de la section */
.chapters-actions {
    text-align: center;
    margin-top: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #d63031, #a02929);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(214, 48, 49, 0.3);
    border: 2px solid #d63031;
}

.btn:hover {
    background: linear-gradient(135deg, #a02929, #7a1f1f);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(214, 48, 49, 0.4);
    color: white;
    text-decoration: none;
    border-color: #a02929;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dossier-chapters-navigation {
        margin: 2rem 0;
        padding: 1.5rem;
    }
    
    .chapters-title {
        font-size: 1.5rem;
    }
    
    .chapters-subtitle {
        font-size: 1rem;
    }
    
    .chapters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chapter-image {
        height: 120px;
    }
    
    .chapter-content {
        padding: 1rem;
    }
    
    .chapter-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .dossier-chapters-navigation {
        padding: 1rem;
    }
    
    .chapters-title {
        font-size: 1.3rem;
    }
    
    .chapter-image {
        height: 100px;
    }
    
    .chapter-number {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Animation d'apparition */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chapter-card {
    animation: fadeInUp 0.6s ease forwards;
}

.chapter-card:nth-child(1) { animation-delay: 0.1s; }
.chapter-card:nth-child(2) { animation-delay: 0.2s; }
.chapter-card:nth-child(3) { animation-delay: 0.3s; }
.chapter-card:nth-child(4) { animation-delay: 0.4s; }
.chapter-card:nth-child(5) { animation-delay: 0.5s; }
.chapter-card:nth-child(6) { animation-delay: 0.6s; }

/* États de chargement */
.chapters-loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.chapters-empty {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
}

/* Amélioration de l'accessibilité */
.chapter-card:focus-within {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.chapter-title a:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Thème sombre (optionnel) */
@media (prefers-color-scheme: dark) {
    .dossier-chapters-navigation {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        border-color: #495057;
    }
    
    .chapters-title {
        color: #ecf0f1;
    }
    
    .chapters-subtitle {
        color: #bdc3c7;
    }
    
    .chapter-card {
        background: #34495e;
        border-color: #495057;
    }
    
    .chapter-title a {
        color: #ecf0f1;
    }
    
    .chapter-excerpt {
        color: #bdc3c7;
    }
    
    .chapter-reading-time {
        color: #bdc3c7;
    }
}