/* =============================================================
   /recherche — moteur de recherche full-texte transverse
   ============================================================= */

/* Mode clair/sombre : ce fichier n'a pas de palette propre. La plupart
   de ses couleurs passent déjà par les tokens neutres de tokens.css
   (--color-neutral-666/777/888/999/ccc/e0deda), qui ont leur contrepartie
   sombre, ou par --bs-body-bg / --bs-body-color que Bootstrap 5.3 remappe.
   Ne restaient que les valeurs d'accent bleu nuit (--color-services et
   --color-services-mid), invisibles ou presque sur une page sombre : elles
   sont remplacées ci-dessous par les tokens de rôle --text-accent /
   --text-accent-mid / --accent-border, dont la valeur claire est
   strictement identique (aucun pixel changé en thème clair).
   Le héro reste volontairement en bleu nuit dans les deux thèmes, comme
   les autres bandeaux sombres auto-cohérents du site (navbar, héros
   publications/services). Le bouton Claudine garde son jaune d'identité,
   conformément à l'arbitrage retenu sur les fiches publication/emploi. */

/* ---------- Héro ---------- */

.rech-hero {
    width: 100%;
    min-height: 170px;
    background: var(--color-services);
    position: relative;
    overflow: hidden;
    color: var(--bs-white);
    padding: 36px 0 28px;
}
.rech-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 80% 0%, rgba(200,16,46,.35) 0%, transparent 60%);
    pointer-events: none;
}
.rech-hero .container { position: relative; }
.rech-hero__accent {
    width: 40px;
    height: 3px;
    background: #C8102E;
    border-radius: 2px;
    margin-bottom: 12px;
}
.rech-hero h1 {
    color: var(--bs-white);
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 8px;
}
.rech-hero__subtitle {
    color: rgba(255,255,255,.72);
    font-size: 0.95rem;
    margin: 0;
    max-width: 620px;
}

/* ---------- Barre de recherche ---------- */

.rech-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bs-body-bg);
    border: 1px solid var(--color-neutral-e0deda);
    border-radius: 999px;
    padding: 6px 8px 6px 18px;
    margin-bottom: 28px;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    transition: border-color .15s, box-shadow .15s;
}
.rech-bar:focus-within {
    /* Bleu nuit plein en clair ; sur fond sombre il se confondrait avec la
       page, d'où le bleu éclairci de --accent-border (même valeur en clair). */
    border-color: var(--accent-border);
    box-shadow: 0 3px 16px rgba(0,0,0,.10);
}
.rech-bar__icon {
    color: var(--color-neutral-888);
    font-size: 1.05rem;
    line-height: 1;
}
.rech-bar__input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--bs-body-color);
    font-size: 1.05rem;
    padding: 10px 0;
    outline: none;
}
.rech-bar__input::placeholder { color: var(--color-neutral-999); }
.rech-bar__input::-webkit-search-cancel-button { cursor: pointer; }

/* Indicateur de chargement HTMX */
.rech-bar__spinner {
    color: var(--color-neutral-888);
    line-height: 1;
    display: none;
}
.rech-bar.htmx-request .rech-bar__spinner { display: inline-block; }

/* ---------- Résumé + navigation par rubrique ---------- */

.rech-summary {
    margin-bottom: 22px;
}
.rech-summary__count {
    font-size: .95rem;
    color: var(--color-neutral-666);
    margin: 0 0 10px;
}
.rech-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.rech-jump__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    /* Conteneur en surbrillance, et non badge statique : sa pastille de
       comptage interne est en --bs-body-bg, donc suit déjà le thème. La puce
       suit la surface avec elle. Valeurs claires inchangées (#eeeef4/#0d0d1c). */
    background: var(--surface-highlight);
    color: var(--text-strong);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: .82rem;
    font-weight: 500;
    text-decoration: none;
    transition: border-color .15s;
}
.rech-jump__item:hover {
    border-color: var(--text-accent-mid);
    color: var(--text-strong);
}
.rech-jump__count {
    background: var(--bs-body-bg);
    border-radius: 999px;
    padding: 1px 8px;
    font-size: .75rem;
    color: var(--color-neutral-666);
}

/* ---------- Sections de résultats ---------- */

.rech-section {
    margin-bottom: 34px;
    scroll-margin-top: 90px;
}
.rech-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--color-neutral-e0deda);
    padding-bottom: 8px;
    margin-bottom: 16px;
}
.rech-section__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--bs-body-color);
    margin: 0;
}
.rech-section__title i { color: var(--text-accent-mid); }
.rech-section__count {
    font-size: .82rem;
    color: var(--color-neutral-777);
    white-space: nowrap;
}
.rech-section__more {
    margin-top: 14px;
    text-align: right;
}
.rech-section__more a {
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-accent);
    text-decoration: none;
}
.rech-section__more a:hover { text-decoration: underline; }

/* Espacement des cartes agenda, qui ne sont pas dans une grille Bootstrap */
#rech-agenda .agenda-card { margin-bottom: 10px; }

/* ---------- États vides ---------- */

.rech-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--color-neutral-666);
}
.rech-empty__icon {
    font-size: 2.2rem;
    color: var(--color-neutral-ccc);
    display: block;
    margin-bottom: 12px;
}
.rech-empty__title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin: 0 0 6px;
}
.rech-empty__text {
    font-size: .9rem;
    max-width: 520px;
    margin: 0 auto 18px;
}

/* ---------- Renvoi vers Claudine ---------- */

.rech-claudine {
    text-align: center;
    border-top: 1px solid var(--color-neutral-e0deda);
    padding-top: 24px;
    margin-top: 8px;
}
.rech-claudine__text {
    font-size: .9rem;
    color: var(--color-neutral-666);
    margin: 0 0 12px;
}
.rech-claudine-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffd75e;
    color: #7a5200;
    border-radius: 999px;
    padding: 10px 22px;
    font-size: .92rem;
    font-weight: 600;
    text-decoration: none;
    transition: filter .15s;
}
.rech-claudine-btn:hover { filter: brightness(.95); color: #7a5200; }

/* ---------- Mobile ---------- */

@media (max-width: 767.98px) {
    .rech-hero { min-height: 0; padding: 26px 0 20px; }
    .rech-hero h1 { font-size: 1.4rem; }
    .rech-hero__subtitle { font-size: .88rem; }

    .rech-bar {
        flex-wrap: wrap;
        border-radius: 20px;
        padding: 8px 12px;
    }
    .rech-bar__input { font-size: 1rem; }
    .rech-section__head {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
}
