/* =============================================================
   @-MENTIONS — inline reference links in story bodies plus the
   dialog that opens when a mention is clicked (reader),
   and the autocomplete dropdown (admin editor).
   ============================================================= */

/* Inline mention links inside story text. */
a.mention {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  cursor: pointer;
}

a.mention:hover {
  text-decoration-style: solid;
}

/* Mention dialog (reader). */
.mention-dialog {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 0;
  max-width: min(430px, calc(100vw - 48px));
  width: 100%;
}

.mention-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.mention-shell {
  position: relative;
  padding: 26px 26px 30px;
}

.mention-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 6px;
}

.mention-close:hover {
  color: var(--ink);
}

.mention-media {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--soft);
  flex: none;
}

.mention-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mention-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 24px/1 var(--reader-ui, system-ui, sans-serif);
  color: var(--muted);
}

.mention-kicker {
  font: 600 10px/1.4 var(--reader-ui, system-ui, sans-serif);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}

.mention-copy h2 {
  font-family: var(--reader-display, Georgia, serif);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.mention-meta {
  font: 400 0.78rem/1.5 var(--reader-ui, system-ui, sans-serif);
  color: var(--muted);
  margin: 0 0 14px;
}

.mention-body {
  font-family: var(--reader-display, Georgia, serif);
  font-size: 1rem;
  line-height: 1.65;
  margin: 0;
  white-space: pre-wrap;
}

/* Autocomplete dropdown (admin editor). */
.mention-picker {
  position: fixed;
  z-index: 1200;
  min-width: 240px;
  max-width: 320px;
  max-height: 260px;
  overflow-y: auto;
  background: var(--paper, #fff);
  color: var(--ink, #111);
  border: 1px solid var(--line, #ddd);
  border-radius: 8px;
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.35);
  padding: 6px;
}

.mention-picker-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  font: 500 0.85rem/1.35 var(--reader-ui, system-ui, sans-serif);
  color: inherit;
}

.mention-picker-row small {
  margin-left: auto;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #777);
  white-space: nowrap;
}

.mention-picker-row.is-active,
.mention-picker-row:hover {
  background: color-mix(in srgb, var(--ink, #111) 7%, transparent);
}

.mention-picker-empty {
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--muted, #777);
}
