<style>
.mentions, .mention {
  --color-bg: var(--color-bg-mentions, #f8f8f8);
  --color-fg: var(--color-fg-mentions, #3a3a3a);
  --color-fg-secondary: var(--color-fg-mentions-secondary, #555);
  --color-fg-tertiary: var(--color-fg-mentions-tertiary, #999);
  --color-border: var(--color-mentions-border, #ccc);
}

@media (prefers-color-scheme: dark) {
  .mentions, .mention {
    --color-bg: var(--color-bg-mentions, #202020);
    --color-fg: var(--color-fg-mentions, #ccc);
    --color-fg-secondary: var(--color-fg-mentions-secondary, #aaa);
    --color-fg-tertiary: var(--color-fg-mentions-tertiary, #666);
    --color-border: var(--color-mentions-border, #666);
  }
}

.mentions {
  margin-top: 1.5em;
  border-top: 3px solid var(--color-border);
}

.mention {
  margin-bottom: 0.5em;
  padding: 1em;
  border: 1px solid var(--color-border);
  border-radius: 0.6em;
  background: var(--color-bg);
  color: var(--color-fg);
}

.mention .mention-header {
  display: flex;
  align-items: center;
  gap: 0.75em;
}

.mention .mention-title {
  margin: 0;
  flex: 1;
  font-size: 1.05em;
}

.mention .mention-source {
  text-decoration: none;
}

.mention .mention-author {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-width: 0;
}

.mention .mention-author-photo {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--color-border);
}

.mention .mention-author-name {
  font-size: 0.85em;
  color: var(--color-fg-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention .mention-published {
  font-size: 0.75em;
  color: var(--color-fg-tertiary);
  white-space: nowrap;
}

.mention .mention-published .label {
  margin-right: 0.35em;
}

.mention .mention-body {
  margin-top: 0.75em;
}

.mention .mention-excerpt {
  margin: 0;
  line-height: 1.45em;
}

.mention h2 {
  color: var(--color-fg-secondary);
  margin-top: 0.5em;
  margin-bottom: 1em;
  padding-top: 0.5em;
  font-weight: normal;
}

.mention .mention-date {
  font-size: 0.6em;
  color: var(--color-fg-tertiary);
}

.mention .mention-domain {
  font-size: 0.75em;
  color: var(--color-fg-tertiary);
  margin-left: 0.5em;
}

.mention img,
.mention video,
.mention audio {
  max-height: 75vh;
}

.mention .mention-mf2 {
  padding-top: 1em;
}
</style>

{% if mentions is defined and mentions|length > 0 %}
<div class="mentions">
  <h2>💬 &nbsp; {{ mentions | length }} Mention{% if mentions | length != 1 %}s{% endif %}</h2>
  {% for html in mentions %}
    {{ html }}
  {% endfor %}
</div>
{% endif %}
