* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body { 
    font-family: 'Marianne', Tahoma, Geneva, Verdana, sans-serif;
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    background: #f5f5f5;
    /*background: #c1d1e9;*/
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}


.header {
    background: #465F9D;
    color: white;
    padding: 30px;

    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
}
.header-logo {
    height: 100px;
    width: auto;
    max-width: 150px;
}


.header-text {
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}


.search-container {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.search-box {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;

    max-width: 1000px;     /* CLÉ */
    margin: 0 auto;        /* centre le bloc */
}
#searchBox {
    justify-self: center;
    width: 600px;
    max-width: 100%;
}

input { 
    flex: 1;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    transition: all 0.3s;
}

input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

button { 
    padding: 15px 30px;
    font-size: 16px;
    border: none;
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    background: #3d68a8;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 600;
    margin-bottom: 15px;
}

button:hover { 
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

.stats {
    padding: 15px 30px;
    background: #e7f3ff;
    color: #004085;
    font-size: 14px;
    font-weight: 500;
    border-left: 4px solid #667eea;
}

.content {
    padding: 30px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    word-wrap: break-word;      /* Pour les navigateurs anciens */
    overflow-wrap: break-word;  /* Standard moderne */
    word-break: break-word;     /* Force la coupure si nécessaire */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.card-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
}


.card-image {
    width: 100%;
    height: auto;      /* hauteur automatique pour garder ratio */
    max-height: 150px; /* limite la hauteur */
    object-fit: cover; /* remplit le cadre sans déformer */
    display: block;    /* supprime espaces margin par défaut */
    border-radius: 10px 10px 0 0;

}

.card-title {
    flex: 1;
}

.card-title h3 {
    color: #2c3e50;
    font-size: 1.3em;
    margin-bottom: 5px;
}

.theme {
    background: #a2c7ec;
    color: #2c3e50;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
}

.card-themes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px; /* Espace au-dessus */
}
.card-type {
    display: inline-block;
    background: #465F9D;
    color: white;
    padding:  5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 500;
    margin-bottom: 5px; /* Espace en dessous */
}

.card-description {
    color: #1f1f1f;
    background: #ffffff;
    line-height: 1.6;
    margin-bottom: 15px;
    word-wrap: break-word;      /* Pour les navigateurs anciens */
    overflow-wrap: break-word;  /* Standard moderne */
    word-break: break-word;     /* Force la coupure si nécessaire */
}

.card-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.keyword {
    background: #f8f9fa;
    color: #495057;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    border: 1px solid #dee2e6;
}



.card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.card-link:hover {
    color: #764ba2;
    gap: 12px;
}

.loading, .error, .no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    font-size: 1.1em;
}

.error {
    color: #dc3545;
    background: #f8d7da;
    border-radius: 10px;
    margin: 20px;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
}