/* ────────────────────────────────────────────────────────────────────────────
 * Sistema di mention — stili condivisi
 *
 * Caricato da due catene di template con framework diversi:
 *   base.j2            → sito pubblico, Bootstrap 5
 *   admin/master.html  → Flask-Admin, Bootstrap 4.2.1
 *
 * 🔴 Per questo il dropdown e la legenda hanno regole proprie invece di
 * appoggiarsi alle utility del framework: `form-text`, per dirne una, in
 * Bootstrap 4 non e' grigio di suo. L'aspetto non deve dipendere da quale
 * Bootstrap ha caricato la pagina.
 * ──────────────────────────────────────────────────────────────────────────── */

/* ── mention rese dal filtro `mentions` ─────────────────────────────────── */
.mention {
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
}
.mention:hover { text-decoration: none; opacity: .8; }

.mention-tablet { color: #6f42c1; }
.mention-biblio { color: #0d6efd; }
.mention-named  { color: #d63384; }
.mention-person { color: #b02a37; }
.mention-lemma  { color: #0d6efd; }
.mention-seal   { color: #fd7e14; }
.mention-segno  { color: #198754; }

/* Riferimento non risolvibile: mai un link rotto, e visibilmente diverso da
   una citazione valida. */
.mention-dead {
    color: #adb5bd;
    border-bottom: 1px dashed #adb5bd;
    cursor: help;
}

/* ── suggeritore (#mention-dropdown, creato da mentions.js) ─────────────── */
#mention-dropdown {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: .25rem;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
    margin: 0;
    padding: 0;
    list-style: none;
}
#mention-dropdown .list-group-item {
    border: 0;
    border-bottom: 1px solid #f1f3f5;
    background: transparent;
}
#mention-dropdown .list-group-item:last-child { border-bottom: 0; }
#mention-dropdown .list-group-item.active {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: inherit;
}

/* ── legenda dei marker, inserita al primo focus del campo ──────────────── */
.mention-hint {
    color: #6c757d;
    font-size: .8rem;
    margin-top: .25rem;
}
.mention-hint code {
    color: #d63384;
    background: #f8f9fa;
    padding: 0 .2rem;
    border-radius: .2rem;
}

/* ── markdown reso nei campi mention ────────────────────────────────────
 * `render_mentions` toglie il <p> quando l'output e' un paragrafo solo (le
 * note di una riga dentro le celle restano identiche a prima); quando i
 * blocchi sono piu' d'uno li avvolge in `.md`, e qui si azzerano i margini
 * esterni perche' il blocco non spinga il contenitore che lo ospita. */
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md ul,
.md ol { padding-left: 1.25rem; margin-bottom: .5rem; }
.md blockquote {
    border-left: 3px solid #dee2e6;
    padding-left: .6rem;
    margin-left: 0;
    color: #6c757d;
}
.md code {
    color: #d63384;
    background: #f8f9fa;
    padding: 0 .2rem;
    border-radius: .2rem;
}
.md pre {
    background: #f8f9fa;
    padding: .5rem .6rem;
    border-radius: .25rem;
    overflow-x: auto;
}
.md pre code { background: none; padding: 0; color: inherit; }
