/*
 * webmention.css - restrained styling for the Webmention display widget.
 * Scoped under .webmention. Reuses --border-color if the theme defines
 * it, otherwise falls back to a neutral grey. No !important.
 */

.webmention {
  --wm-border: var(--border-color, #e2e2e2);
  --wm-muted: #6b6b6b;
  --wm-avatar-size: 40px;
  margin: 2.5rem 0 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.webmention-heading {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--wm-border);
}

/* ---- shared avatar ------------------------------------------------ */

.webmention-avatar-link {
  display: inline-flex;
  text-decoration: none;
  flex: 0 0 auto;
}

.webmention-avatar {
  width: var(--wm-avatar-size);
  height: var(--wm-avatar-size);
  border-radius: 50%;
  object-fit: cover;
  background: var(--wm-border);
  display: inline-block;
}

.webmention-avatar-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: calc(var(--wm-avatar-size) * 0.42);
  color: #fff;
  background: #9a9a9a;
  text-transform: uppercase;
  line-height: 1;
}

/* ---- facepiles (likes / reposts / bookmarks) ---------------------- */

.webmention-facepiles {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  margin: 0 0 1.5rem;
}

.webmention-facepile-count {
  font-size: 0.85rem;
  color: var(--wm-muted);
  margin-bottom: 0.4rem;
}

.webmention-faces {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.webmention-face {
  margin-left: -8px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--background-color, #fff);
  transition: transform 0.12s ease;
}

.webmention-face:first-child {
  margin-left: 0;
}

.webmention-face:hover {
  transform: translateY(-2px);
  z-index: 1;
}

.webmention-face .webmention-avatar {
  width: 34px;
  height: 34px;
}

.webmention-face .webmention-avatar-initial {
  font-size: 14px;
}

/* ---- conversation list (replies / mentions) ----------------------- */

.webmention-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.webmention-item {
  padding: 1rem 0;
  border-top: 1px solid var(--wm-border);
}

.webmention-item:first-child {
  border-top: 0;
}

.webmention-item-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.webmention-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}

.webmention-author-name {
  font-weight: 600;
  color: inherit;
}

a.webmention-author-name:hover {
  text-decoration: underline;
}

.webmention-time,
.webmention-source-link {
  font-size: 0.8rem;
  color: var(--wm-muted);
}

.webmention-source-link {
  text-decoration: none;
}

.webmention-source-link:hover {
  text-decoration: underline;
}

.webmention-content {
  margin-left: calc(var(--wm-avatar-size) + 0.65rem);
  color: inherit;
}

.webmention-content p {
  margin: 0 0 0.6rem;
}

.webmention-content p:last-child {
  margin-bottom: 0;
}

.webmention-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.webmention-content pre {
  overflow-x: auto;
  padding: 0.6rem 0.8rem;
  background: var(--wm-border);
  border-radius: 4px;
}

.webmention-content blockquote {
  margin: 0.6rem 0;
  padding-left: 0.9rem;
  border-left: 3px solid var(--wm-border);
  color: var(--wm-muted);
}

/* ---- quiet states ------------------------------------------------- */

.webmention-empty,
.webmention-error {
  color: var(--wm-muted);
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

@media (max-width: 480px) {
  .webmention-content {
    margin-left: 0;
  }
}
