/* ================================================================
   glossaire-sidebar.css — Contenu du panneau latéral Glossaire
   Le chrome (wrapper, header, scrollbar…) est dans auteur-sidebar.css.
   Ce fichier ne contient QUE les styles du contenu .gl-*.
   ================================================================ */

/* ── Bloc recherche + alphabet, figé en haut au scroll ─────────
   (regroupés dans un seul wrapper sticky, comme .rf-toolbar pour les
   références, plutôt que deux éléments sticky indépendants — sinon le
   deuxième recouvre le premier au lieu de s'empiler proprement). */
.gl-toolbar {
    position: sticky;
    /* -2px (pas 0) : sur certains appareils, un liseré du contenu défilé
       reste visible juste au-dessus du bloc figé (arrondi sub-pixel du
       calcul de sticky par le navigateur). Remonter légèrement le point
       d'ancrage referme cet interstice. */
    top: -2px;
    background: var(--panel-light);
    z-index: 1;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* ── Barre de recherche ──────────────────────────────────────── */
.gl-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px 12px;
    border-bottom: 1px solid var(--border-color);
}

.gl-search-icon {
    color: var(--muted);
    flex-shrink: 0;
}

.gl-search {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.9rem;
    color: var(--text-primary);
    min-width: 0;
}

.gl-search::placeholder { color: var(--muted); }

/* ── Alphabet (comportement identique à la popup legacy) ──────── */
.gl-alphabet {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 6px 14px;
}

.gl-alpha-btn {
    min-width: 22px;
    height: 24px;
    padding: 0 3px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    display: flex; align-items: center; justify-content: center;
}

.gl-alpha-btn:not([disabled]):hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* Bouton "Tous" : un peu plus large */
.gl-alpha-all { min-width: 34px; }

/* Lettre active */
.gl-alpha-active {
    background: var(--accent) !important;
    color: white !important;
}

/* Lettre inactive (absent dans les données) */
.gl-alpha-disabled {
    color: var(--border-color);
    cursor: default;
}

/* Compteur : rejoint la fin de la ligne des lettres (dernier enfant de
   .gl-alphabet) au lieu d'une ligne à part — margin-left:auto le pousse à
   l'extrémité droite, comme le badge compagnon des références. Pastille
   arrondie assortie aux boutons alpha voisins plutôt qu'un texte nu. */
.gl-count {
    margin-left: auto;
    align-self: center;
    padding: 3px 9px;
    border-radius: 10px;
    background: var(--hover-bg);
    color: var(--muted);
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Groupes par lettre ──────────────────────────────────────── */
.gl-group-letter {
    padding: 8px 20px 4px;
    font-family: var(--font-serif, 'Lora', serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.02em;
}

/* ── Liste ───────────────────────────────────────────────────── */
.gl-list {
    padding: 0 0 40px;
}

.gl-item {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.gl-item:last-child { border-bottom: none; }

.gl-item:hover { background: var(--hover-bg); }

.gl-item-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.gl-terme {
    font-family: var(--font-serif, 'Lora', serif);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.gl-arabe {
    font-family: var(--font-arabic, 'Amiri', serif);
    font-size: 1rem;
    color: var(--accent-gold);
    line-height: 1.4;
    text-align: right;
    flex-shrink: 0;
}

.gl-def {
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--text-secondary);
    margin: 0;
}

.gl-copy-btn {
    margin-left: auto;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.gl-copy-btn:hover { background: var(--hover-bg); color: var(--text-primary); }
.gl-copy-btn.copy-btn-done { color: var(--accent, #1A5238); }

.gl-empty {
    text-align: center;
    color: var(--muted);
    font-size: 0.88rem;
    padding: 40px 20px;
    margin: 0;
}
