/**
 * Imagilire Studio - Styles pour la fonctionnalité de recherche
 */

/* Overlay du modal */
.recherche-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.recherche-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal principal */
.recherche-modal {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90vw;
    max-width: 800px;
    max-height: 85vh;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.recherche-modal-overlay.active .recherche-modal {
    transform: scale(1) translateY(0);
}

/* En-tête du modal */
.recherche-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #2e8b57 0%, #3cb371 100%);
    color: white;
}

.recherche-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.recherche-modal-title i {
    font-size: 1.25rem;
}

.recherche-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.recherche-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Section de recherche */
.recherche-search-section {
    padding: 32px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.recherche-search-form {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.recherche-search-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    transition: all 0.2s ease;
    outline: none;
}

.recherche-search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.recherche-search-btn {
    background: linear-gradient(135deg, #2e8b57 0%, #3cb371 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
}

.recherche-search-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.recherche-search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Options de recherche */
.recherche-search-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.recherche-search-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.recherche-search-option:hover {
    border-color: #667eea;
    background: #f8faff;
}

.recherche-search-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
    cursor: pointer;
}

.recherche-search-option label {
    font-size: 0.95rem;
    color: #374151;
    cursor: pointer;
    font-weight: 500;
}

/* Section des résultats */
.recherche-results-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.recherche-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.recherche-results-info {
    font-weight: 600;
    color: #374151;
}

.recherche-results-info .count {
    color: #667eea;
    font-weight: 700;
}

.recherche-clear-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.recherche-clear-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.recherche-results-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    min-height: 300px;
}

/* États vides */
.recherche-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.recherche-empty-state i {
    font-size: 4rem;
    margin-bottom: 24px;
    color: #d1d5db;
}

.recherche-empty-state h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #374151;
}

.recherche-empty-state p {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    max-width: 500px;
}

/* Éléments de résultat */
.recherche-result-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.recherche-result-item:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.recherche-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.recherche-result-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #1f2937;
    line-height: 1.4;
    flex: 1;
    margin-right: 20px;
}

.recherche-result-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.recherche-result-date {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

.recherche-result-matches {
    margin-bottom: 20px;
}

.recherche-result-match-count {
    font-size: 0.9rem;
    color: #059669;
    font-weight: 600;
    margin-bottom: 12px;
}

.recherche-result-match-count .count {
    background: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-right: 6px;
}

/* Surlignage des correspondances */
.highlight {
    background: linear-gradient(120deg, #fbbf24 0%, #f59e0b 100%);
    color: #92400e;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.2);
}

/* Actions des résultats */
.recherche-result-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.recherche-result-action {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.recherche-result-action:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.recherche-result-action.primary {
    background: linear-gradient(135deg, #2e8b57 0%, #3cb371 100%);
    color: white;
    border-color: transparent;
}

.recherche-result-action.primary:hover {
    background: linear-gradient(135deg, #2e8b57 0%, #3cb371 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Pied de page */
.recherche-modal-footer {
    padding: 24px 32px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    justify-content: flex-end;
}

.recherche-modal-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.recherche-modal-btn-secondary {
    background: #6b7280;
    color: white;
}

.recherche-modal-btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 768px) {
    .recherche-modal {
        width: 95vw;
        max-height: 90vh;
        margin: 20px;
    }
    
    .recherche-modal-header,
    .recherche-search-section,
    .recherche-results-header,
    .recherche-results-container,
    .recherche-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .recherche-search-form {
        flex-direction: column;
        gap: 16px;
    }
    
    .recherche-search-options {
        grid-template-columns: 1fr;
    }
    
    .recherche-result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .recherche-result-meta {
        align-items: flex-start;
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }
    
    .recherche-result-actions {
        flex-direction: column;
    }
    
    .recherche-result-action {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .recherche-modal-title {
        font-size: 1.25rem;
    }
    
    .recherche-search-input {
        padding: 12px 16px;
    }
    
    .recherche-search-btn {
        padding: 12px 20px;
        min-width: 120px;
    }
    
    .recherche-result-item {
        padding: 20px;
    }
    
    .recherche-result-title {
        font-size: 1.1rem;
    }
}

.recherche-search-input-group {
    flex: 1;
}

.recherche-search-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.recherche-search-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    transition: all 0.2s ease;
    outline: none;
}

.recherche-search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.recherche-search-btn {
    background: linear-gradient(135deg, #2e8b57 0%, #3cb371 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
}

.recherche-search-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.recherche-search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.recherche-search-btn.searching {
    background: #6b7280;
}

.recherche-search-btn.searching i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Options de recherche */
.recherche-search-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.recherche-search-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.recherche-search-option:hover {
    border-color: #667eea;
    background: #f8faff;
}

.recherche-search-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
    cursor: pointer;
}

.recherche-search-option label {
    font-size: 0.95rem;
    color: #374151;
    cursor: pointer;
    font-weight: 500;
}

/* Section des résultats */
.recherche-results-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.recherche-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.recherche-results-info {
    font-weight: 600;
    color: #374151;
}

.recherche-results-info .count {
    color: #667eea;
    font-weight: 700;
}

.recherche-clear-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.recherche-clear-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.recherche-results-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    min-height: 300px;
}

/* États vides */
.recherche-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.recherche-empty-state i {
    font-size: 4rem;
    margin-bottom: 24px;
    color: #d1d5db;
}

.recherche-empty-state h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #374151;
}

.recherche-empty-state p {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    max-width: 500px;
}

.recherche-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
}

.recherche-loading-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #667eea;
    animation: spin 1s linear infinite;
}

.recherche-loading-state p {
    font-size: 1.1rem;
    color: #374151;
    font-weight: 600;
}

/* Éléments de résultat */
.recherche-result-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.recherche-result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #2e8b57 0%, #3cb371 100%);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.recherche-result-item:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.recherche-result-item:hover::before {
    transform: scaleY(1);
}

.recherche-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.recherche-result-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #1f2937;
    line-height: 1.4;
    flex: 1;
    margin-right: 20px;
}

.recherche-result-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.recherche-result-date {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

.recherche-result-folder {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.recherche-result-matches {
    margin-bottom: 20px;
}

.recherche-result-match-count {
    font-size: 0.9rem;
    color: #059669;
    font-weight: 600;
    margin-bottom: 12px;
}

.recherche-result-match-count .count {
    background: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-right: 6px;
}

.recherche-result-excerpts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recherche-result-excerpt {
    background: #f8faff;
    border: 1px solid #e0e7ff;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #374151;
}

.recherche-result-excerpt strong {
    color: #667eea;
    font-weight: 700;
}

.recherche-result-excerpt em {
    color: #6b7280;
    font-style: italic;
}

/* Surlignage des correspondances */
.highlight {
    background: linear-gradient(120deg, #fbbf24 0%, #f59e0b 100%);
    color: #92400e;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.2);
}

/* Actions des résultats */
.recherche-result-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.recherche-result-action {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.recherche-result-action:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.recherche-result-action.primary {
    background: linear-gradient(135deg, #2e8b57 0%, #3cb371 100%);
    color: white;
    border-color: transparent;
}

.recherche-result-action.primary:hover {
    background: linear-gradient(135deg, #2e8b57 0%, #3cb371 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Pied de page du modal */
.recherche-modal-footer {
    padding: 24px 32px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    justify-content: flex-end;
}

.recherche-modal-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.recherche-modal-btn-secondary {
    background: #6b7280;
    color: white;
}

.recherche-modal-btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

/* Responsive design */
@media (max-width: 768px) {
    .recherche-modal {
        width: 95vw;
        max-height: 90vh;
        margin: 20px;
    }
    
    .recherche-modal-header,
    .recherche-search-section,
    .recherche-results-header,
    .recherche-results-container,
    .recherche-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .recherche-search-form {
        flex-direction: column;
        gap: 16px;
    }
    
    .recherche-search-options {
        grid-template-columns: 1fr;
    }
    
    .recherche-result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .recherche-result-meta {
        align-items: flex-start;
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }
    
    .recherche-result-actions {
        flex-direction: column;
    }
    
    .recherche-result-action {
        justify-content: center;
    }
    
    /* Améliorations pour l'accessibilité tactile */
    .recherche-search-btn,
    .recherche-result-action,
    .recherche-modal-close {
        min-height: 44px; /* Taille minimale recommandée pour le tactile */
        min-width: 44px;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        user-select: none;
    }
    
    .recherche-search-input {
        min-height: 44px;
        font-size: 16px; /* Évite le zoom sur iOS */
    }
    
    /* Espacement amélioré pour le tactile */
    .recherche-result-item {
        margin-bottom: 16px;
        padding: 20px;
    }
    
    .recherche-result-actions {
        gap: 12px;
        margin-top: 20px;
    }
    
    /* Améliorations spécifiques pour les boutons d'action */
    .recherche-result-action {
        position: relative;
        overflow: hidden;
    }
    
    .recherche-result-action:active {
        transform: scale(0.95);
    }
    
    /* Effet de ripple pour le feedback tactile */
    .recherche-result-action::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.3);
        transform: translate(-50%, -50%);
        transition: width 0.3s, height 0.3s;
    }
    
    .recherche-result-action:active::after {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .recherche-modal-title {
        font-size: 1.25rem;
    }
    
    .recherche-search-input {
        padding: 12px 16px;
    }
    
    .recherche-search-btn {
        padding: 12px 20px;
        min-width: 120px;
    }
    
    .recherche-result-item {
        padding: 20px;
    }
    
    .recherche-result-title {
        font-size: 1.1rem;
    }
    
    /* Optimisations supplémentaires pour très petits écrans */
    .recherche-modal {
        width: 98vw;
        margin: 10px;
        max-height: 95vh;
    }
    
    .recherche-modal-header,
    .recherche-search-section,
    .recherche-results-header,
    .recherche-results-container,
    .recherche-modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    /* Boutons plus grands pour faciliter le clic */
    .recherche-result-action {
        padding: 14px 20px;
        font-size: 1rem;
        min-height: 48px;
        min-width: 48px;
    }
    
    /* Améliorations supplémentaires pour le tactile sur très petits écrans */
    .recherche-result-actions {
        gap: 16px;
    }
    
    .recherche-result-action.primary {
        background: linear-gradient(135deg, #2e8b57 0%, #3cb371 100%);
        box-shadow: 0 2px 8px rgba(46, 139, 87, 0.3);
    }
    
    .recherche-result-action.primary:active {
        box-shadow: 0 1px 4px rgba(46, 139, 87, 0.4);
        transform: scale(0.95) translateY(1px);
    }
}

/* Animations d'entrée pour les résultats */
.recherche-result-item {
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Effet de focus pour l'accessibilité */
.recherche-modal:focus-within {
    outline: none;
}

.recherche-search-input:focus,
.recherche-search-btn:focus,
.recherche-result-action:focus,
.recherche-modal-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Scrollbar personnalisée */
.recherche-results-container::-webkit-scrollbar {
    width: 8px;
}

.recherche-results-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.recherche-results-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.recherche-results-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* === Correctifs anti-débordement pour la modale de recherche === */

/* 1) Évite tout scroll horizontal parasite dans la liste de résultats */
.recherche-results-container {
    overflow-x: hidden; /* on garde le scroll Y déjà présent */
  }
  
  /* 2) Autoriser la césure/retour à la ligne partout où nécessaire */
  .recherche-result-title,
  .recherche-results-info,
  .recherche-result-match-count {
    overflow-wrap: anywhere;  /* casse même au milieu si aucun point de coupe naturel */
    word-break: break-word;   /* compatibilité */
    hyphens: auto;            /* césure typographique quand possible */
  }
  
  /* 3) Les surlignages peuvent eux aussi se couper si le terme est long */
  .highlight {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  
  /* 4) En-tête de la section résultats : autoriser le retour à la ligne
        pour éviter que le bouton "Effacer" ne sorte du cadre */
  .recherche-results-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  /* Faire en sorte que le bloc d'info puisse rétrécir et passer à la ligne */
  .recherche-results-info {
    flex: 1 1 auto;
    min-width: 0;  /* clé en flex pour autoriser la contraction et la césure */
  }
  
  /* 5) Dans chaque item : permettre au titre (en flex) de se contracter correctement */
  .recherche-result-title {
    min-width: 0; /* évite que le titre force une largeur > conteneur */
  }
  
  /* (Optionnel) Tronquer les titres trop longs à 2 lignes : */
  .recherche-result-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
 
  