/**
 * @file
 * Styles pour les résultats de recherche personnalisés.
 */

/* Conteneur principal du résultat de recherche */
.search-result {
  margin-bottom: 30px;
  padding: 20px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  transition: box-shadow 0.3s ease;
  width: 95%;
}

.search-result:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* En-tête avec le badge du type de contenu */
.search-result__header {
  margin-bottom: 10px;
}

/* Badge du type de contenu */
.content-type-badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 3px;
  background-color: #235d79;
}

/* Couleurs spécifiques par type de contenu */
.content-type--reference_biblio .content-type-badge {
  background-color: #5bc0de;
  color: #fff;
}

.content-type--retour_d_experience .content-type-badge {
  background-color: #5cb85c;
  color: #fff;
}

.content-type--fiche_entreprise_ge .content-type-badge {
  background-color: #f0ad4e;
  color: #fff;
}

.content-type--formation .content-type-badge {
  background-color: #d9534f;
  color: #fff;
}

.content-type--agenda .content-type-badge {
  background-color: #9b59b6;
  color: #fff;
}

.content-type--actualite .content-type-badge,
.content-type--article .content-type-badge {
  background-color: #3498db;
  color: #fff;
}

/* Wrapper du contenu */
.search-result__wrapper {
  position: relative;
}

.search-result__content {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* Image/vignette */
.search-result__image {
  flex-shrink: 0;
  width: 150px;
}

.search-result__image img {
  height: auto;
  border-radius: 4px;
}

/* Zone de texte */
.search-result__text {
  flex: 1;
  min-width: 0; /* Pour permettre le text-overflow */
}

/* Titre */
.search-result__title {
  margin: 0 0 10px 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.search-result__title a {
  text-decoration: none;
  transition: color 0.2s ease;
}

.search-result__title a:hover {
  color: #27ae60;
  text-decoration: underline;
}

/* Extrait/snippet */
.search-result__snippet {
  margin-bottom: 10px;
  color: #555;
  line-height: 1.6;
}

.search-result__snippet strong,
.search-result__snippet em {
  background-color: #fff3cd;
  padding: 2px 4px;
  border-radius: 2px;
  font-weight: 600;
}

/* Métadonnées */
.search-result__meta {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: #777;
  margin-top: 10px;
}

.search-result__date,
.search-result__author {
  display: flex;
  align-items: center;
  gap: 5px;
}

.search-result__meta .glyphicon {
  font-size: 12px;
}

/* Responsive - mobile */
@media (max-width: 768px) {
  .search-result {
    padding: 15px;
  }

  .search-result__content {
    flex-direction: column;
  }

  .search-result__image {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
  }

  .search-result__title {
    font-size: 18px;
  }

  .search-result__meta {
    flex-direction: column;
    gap: 8px;
  }
}

/* Liste des résultats */
.search-results ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: search-counter;
}

.search-results ol > li {
  counter-increment: search-counter;
  position: relative;
  padding-left: 0;
}

/* Numéro du résultat (optionnel) */
.search-results ol > li::before {
  content: counter(search-counter) ".";
  position: absolute;
  left: -30px;
  top: 20px;
  font-weight: 700;
  color: #bdc3c7;
  font-size: 18px;
}

/* Message "Aucun résultat" */
.search-results--empty {
  padding: 40px 20px;
  text-align: center;
  background: #f8f9fa;
  border-radius: 4px;
  color: #6c757d;
}
