/* Styles pour le shortcode dossiers - Layout horizontal uniquement images */

.cdt-dossiers-horizontal {
    margin: 30px 0;
    overflow: hidden;
    position: relative;
    z-index: 100;
}

.cdt-dossiers-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 15px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Scrollbar styling pour desktop */
.cdt-dossiers-scroll::-webkit-scrollbar {
    height: 8px;
}

.cdt-dossiers-scroll::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

.cdt-dossiers-scroll::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.cdt-dossiers-scroll::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Masquer scrollbar sur mobile */
@media (max-width: 768px) {
    .cdt-dossiers-scroll::-webkit-scrollbar {
        display: none;
    }
    .cdt-dossiers-scroll {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

.cdt-dossier-image-item {
    flex: 0 0 auto;
    height: 120px;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8f9fa;
    position: relative;
    z-index: 1;
}

.cdt-dossier-image-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(238, 20, 44, 0.05), rgba(238, 20, 44, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.cdt-dossier-image-item:hover::before {
    opacity: 1;
}

.cdt-dossier-image-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.dossier-image-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    position: relative;
    z-index: 3;
}

.cdt-dossier-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.cdt-dossier-image-item:hover img {
    transform: scale(1.1);
}

.dossier-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 2.5em;
    opacity: 0.9;
    position: relative;
}

.dossier-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(1px);
}

/* Boutons de navigation */
.cdt-scroll-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    z-index: 9999;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.cdt-scroll-button:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.cdt-scroll-button.prev {
    left: 10px;
}

.cdt-scroll-button.next {
    right: 10px;
}

.cdt-scroll-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Animation de chargement */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cdt-dossier-image-item {
    animation: slideInFromLeft 0.8s ease forwards;
}

.cdt-dossier-image-item:nth-child(1) { animation-delay: 0s; }
.cdt-dossier-image-item:nth-child(2) { animation-delay: 0.1s; }
.cdt-dossier-image-item:nth-child(3) { animation-delay: 0.2s; }
.cdt-dossier-image-item:nth-child(4) { animation-delay: 0.3s; }
.cdt-dossier-image-item:nth-child(5) { animation-delay: 0.4s; }
.cdt-dossier-image-item:nth-child(6) { animation-delay: 0.5s; }
.cdt-dossier-image-item:nth-child(7) { animation-delay: 0.6s; }
.cdt-dossier-image-item:nth-child(8) { animation-delay: 0.7s; }

/* Responsive */
@media (max-width: 1024px) {
    .cdt-dossier-image-item {
        height: 110px;
    }
    
    .cdt-dossiers-scroll {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .cdt-dossier-image-item {
        height: 100px;
    }
    
    .cdt-dossiers-scroll {
        gap: 12px;
        padding: 10px 0;
    }
    
    .dossier-placeholder {
        font-size: 2em;
    }
    
    /* Masquer les boutons sur mobile, utiliser le scroll tactile */
    .cdt-scroll-button {
        display: none;
    }
}

@media (max-width: 480px) {
    .cdt-dossier-image-item {
        height: 80px;
    }
    
    .cdt-dossiers-scroll {
        gap: 10px;
    }
    
    .dossier-placeholder {
        font-size: 1.5em;
    }
}

/* Effet de focus pour l'accessibilité */
.dossier-image-link:focus {
    outline: 3px solid #ee142c;
    outline-offset: 2px;
}

/* Boutons mobiles de scroll */
.cdt-mobile-scroll-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    z-index: 9999;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: pulse 2s infinite;
}

.cdt-mobile-scroll-button.prev {
    left: 5px;
}

.cdt-mobile-scroll-button.next {
    right: 5px;
}

.cdt-mobile-scroll-button:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    animation: none;
}

.cdt-mobile-scroll-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
    animation: none;
}

/* Afficher les boutons mobiles seulement sur mobile */
@media (max-width: 768px) {
    .cdt-mobile-scroll-button {
        display: flex;
    }
}

/* Supprimer l'ancien indicateur pseudo-élément */
@media (max-width: 768px) {
    .cdt-dossiers-horizontal::after {
        display: none;
    }
}

/* Animation pulse pour le bouton mobile */
@keyframes pulse {
    0%, 100% { 
        opacity: 0.8; 
        transform: translateY(-50%) scale(1); 
    }
    50% { 
        opacity: 1; 
        transform: translateY(-50%) scale(1.1); 
    }
}

/* === STYLES POUR LE TEMPLATE TAXONOMY DOSSIER === */

/* Header du dossier avec image de couverture */
.dossier-header {
    margin-bottom: 40px;
    padding: 30px;
    border-bottom: 2px solid #f8f9fa;
    background: #f8f9fa;
    border-radius: 8px;
    position: relative;
    z-index: 1;
}

.dossier-header-content {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.dossier-header-image {
    flex: 0 0 30%;
    position: relative;
    z-index: 3;
}

.dossier-cover-image {
    max-height: 350px;
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 4;
}

.dossier-cover-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.dossier-header-text {
    flex: 1;
    max-width: 70%;
    min-width: 0; /* Permet au texte de se rétrécir si nécessaire */
}

.dossier-title {
    margin: 0 0 10px 0;
    color: #1e1e1e;
    font-size: 2.5em;
    font-weight: 700;
}

.dossier-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #5a6c7d;
    margin: 0;
}

.dossier-description p {
    margin: 0 0 15px 0;
}

.dossier-description p:last-child {
    margin-bottom: 0;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .dossier-header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .dossier-header-image {
        align-self: center;
    }
    
    .dossier-cover-image {
        max-height: 250px;
        max-width: 100%;
    }
    
    .dossier-title {
        font-size: 2rem;
        text-align: center;
    }
    
    .dossier-description {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .dossier-header {
        padding: 20px 0;
        margin-bottom: 30px;
    }
    
    .dossier-cover-image {
        max-height: 200px;
    }
    
    .dossier-title {
        font-size: 1.75rem;
        margin-bottom: 15px;
    }
    
    .dossier-description {
        font-size: 1rem;
    }
}
