/* =============================================================================
   Santélite Académie - RECHERCHE GLOBALE (05/11/2026)
   =============================================================================
   Panneau de suggestions des barres de recherche (site public et espaces apprenant, formateur, administrateur) et
   page « Voir tous les résultats ». Rendu par public/assets/js/recherche-globale.js.

   Positionnement : même principe que les menus déroulants des notifications et du panier (assets/css/
   panier-deroulant.css) : panneau en position absolue, accroché sous la barre (top: 100%), au premier plan. Il ne
   participe pas à la mise en page : la hauteur de l'en-tête et la position du contenu ne changent pas à l'ouverture.
   Sa largeur ne dépasse jamais celle de l'écran (calculée par le script, 12 px de marge de chaque côté).
   ========================================================================== */

.rg-conteneur { position: relative; }

/* Bouton d'effacement : dans le champ, à gauche de la loupe existante. */
.rg-effacer {
    position: absolute;
    top: 50%;
    right: 2.85rem;
    transform: translateY(-50%);
    z-index: 2;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #6B7280;
    cursor: pointer;
}
.rg-effacer[hidden] { display: none; }
.rg-effacer:hover, .rg-effacer:focus-visible { background: rgba(0, 0, 0, .06); color: #000000; outline: none; }
.rg-effacer .rg-icone { width: 16px; height: 16px; }
.rg-conteneur.rg-a-texte input[type="search"] { padding-right: 5rem; }
/* La croix native du champ « search » ferait doublon avec le bouton d'effacement. */
.rg-conteneur input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }

.rg-icone { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------------------------------------------------------------- panneau flottant */
.rg-panneau {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 90;
    width: 100%;
    max-height: min(70vh, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
    margin: 0;
    padding: .35rem 0 0;
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, .10);
    border-top: 0;
    border-radius: 0;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .18);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1rem;
    line-height: 1.45;
    color: #000000;
    text-align: left;
}
.rg-panneau[hidden] { display: none; }

.rg-surtitre { margin: .35rem 1rem .1rem; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6B7280; }
.rg-groupe { padding: .25rem .5rem .35rem; }
.rg-groupe + .rg-groupe { border-top: 1px solid rgba(0, 0, 0, .08); }
.rg-groupe__titre { display: flex; align-items: center; justify-content: space-between; margin: .35rem .5rem .25rem; font-size: .75rem; font-weight: 700; color: #374151; }
.rg-groupe__nb { font-weight: 600; color: #6B7280; }

.rg-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: .5rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.rg-item:hover, .rg-item--actif { background: #F3F4F6; }
.rg-item:focus-visible { outline: 2px solid #0B5FFF; outline-offset: -2px; }
.rg-texte { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.rg-titre { font-size: .875rem; font-weight: 600; color: #000000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-meta { display: flex; align-items: center; gap: .3rem; font-size: .75rem; color: #6B7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-meta--fort { color: #111827; font-weight: 600; }
.rg-point { color: #9CA3AF; }
.rg-icone--etoile { width: 12px; height: 12px; fill: #F59E0B; stroke: #F59E0B; }
.rg-desc { margin-top: .2rem; font-size: .8rem; color: #4B5563; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }

.rg-vignette { flex-shrink: 0; display: grid; place-items: center; width: 56px; height: 40px; border-radius: 6px; overflow: hidden; background: #EEF2FF; color: #3B5BDB; }
.rg-vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rg-avatar { flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: #E0E7FF; color: #1E3A8A; font-size: .8rem; font-weight: 700; }
.rg-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rg-pastille { flex-shrink: 0; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: #F3F4F6; color: #374151; }

.rg-tout {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-top: .25rem;
    padding: .75rem 1rem;
    border-top: 1px solid rgba(0, 0, 0, .10);
    background: #FFFFFF;
    font-size: .85rem;
    font-weight: 600;
    color: #0B5FFF;
    text-decoration: none;
}
.rg-tout:hover, .rg-tout.rg-item--actif { background: #F3F4F6; }
.rg-tout .rg-icone { width: 16px; height: 16px; }

.rg-etat { display: flex; align-items: center; gap: .6rem; margin: 0; padding: 1rem; font-size: .85rem; color: #4B5563; }
.rg-etat--erreur { color: #B42318; }
.rg-vide { padding: 1rem; }
.rg-vide__titre { margin: 0 0 .25rem; font-size: .9rem; font-weight: 600; }
.rg-vide__conseil { margin: 0; font-size: .8rem; color: #6B7280; }
.rg-roue { width: 16px; height: 16px; border: 2px solid #D1D5DB; border-top-color: #0B5FFF; border-radius: 50%; animation: rg-tourne .7s linear infinite; }
@keyframes rg-tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rg-roue { animation: none; } }

.rg-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------------------------------------------------------------- page « Voir tous les résultats » */
.rg-page { max-width: 1040px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; box-sizing: border-box; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.rg-page__titre { margin: 0 0 1rem; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
.rg-page__form { display: flex; gap: .5rem; max-width: 640px; margin-bottom: 1.25rem; }
.rg-page__form input { flex: 1 1 auto; min-width: 0; padding: .75rem 1rem; border: 1px solid rgba(0, 0, 0, .15); border-radius: 10px; font: inherit; font-size: .95rem; background: #FFFFFF; }
.rg-page__form input:focus { outline: none; border-color: #0B5FFF; }
.rg-page__bouton { display: inline-flex; align-items: center; gap: .4rem; padding: .7rem 1.1rem; border: 0; border-radius: 10px; background: #0B5FFF; color: #FFFFFF; font: inherit; font-weight: 600; cursor: pointer; }
.rg-page__resume { margin: 0 0 1rem; font-size: .95rem; color: #374151; }
.rg-filtres { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.5rem; }
.rg-filtre { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .85rem; border: 1px solid rgba(0, 0, 0, .12); border-radius: 999px; font-size: .85rem; font-weight: 600; color: #111827; text-decoration: none; background: #FFFFFF; }
.rg-filtre span { color: #6B7280; font-weight: 500; }
.rg-filtre:hover { border-color: #0B5FFF; }
.rg-filtre--actif { background: #0B5FFF; border-color: #0B5FFF; color: #FFFFFF; }
.rg-filtre--actif span { color: rgba(255, 255, 255, .85); }
.rg-page__groupe { margin-bottom: 2rem; }
.rg-page__groupe h2 { display: flex; align-items: baseline; gap: .5rem; margin: 0 0 .75rem; font-size: 1.15rem; font-weight: 700; }
.rg-page__groupe h2 span { font-size: .85rem; font-weight: 600; color: #6B7280; }
.rg-page__liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: .5rem; }
.rg-page__liste .rg-item { border: 1px solid rgba(0, 0, 0, .08); padding: .75rem; background: #FFFFFF; }
.rg-page__liste .rg-item:hover { background: #F9FAFB; border-color: rgba(0, 0, 0, .18); }
.rg-item--grand .rg-vignette { width: 88px; height: 60px; }
.rg-item--grand .rg-avatar { width: 52px; height: 52px; }
.rg-item--grand .rg-titre { white-space: normal; }
.rg-page__plus { display: inline-flex; align-items: center; gap: .35rem; margin-top: .75rem; font-size: .875rem; font-weight: 600; color: #0B5FFF; text-decoration: none; }
.rg-page__plus .rg-icone { width: 16px; height: 16px; }
.rg-pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.25rem; font-size: .875rem; }
.rg-pagination a { padding: .45rem .9rem; border: 1px solid rgba(0, 0, 0, .15); border-radius: 8px; color: #111827; text-decoration: none; font-weight: 600; }
.rg-pagination a:hover { border-color: #0B5FFF; color: #0B5FFF; }
.rg-pagination [aria-disabled="true"] { padding: .45rem .9rem; color: #9CA3AF; }
.rg-pagination__etat { color: #4B5563; }
.rg-vide--page { padding: 1.5rem; border: 1px dashed rgba(0, 0, 0, .15); border-radius: 12px; background: #FAFAFA; }

@media (max-width: 640px) {
    .rg-panneau { max-height: min(75vh, 560px); }
    .rg-page { padding: 1.5rem 1rem 3rem; }
    .rg-page__bouton span { display: none; }
}
