/* Forum post tools (reply / quote / share / report). Behavior lives in wwwroot/js/forum.js. */

/* ─── Icons ──────────────────────────────────────────────────────────────────
   Single-color SVG masks so the icon follows the text color of its button. */
.forum-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: var(--forum-icon) center / contain no-repeat;
  mask: var(--forum-icon) center / contain no-repeat;
}

.forum-icon-reply {
  --forum-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 4 2 8l4 4M2 8h7a5 5 0 0 1 5 5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.forum-icon-quote {
  --forum-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='4.5' cy='10' r='2.5'/%3E%3Ccircle cx='11.5' cy='10' r='2.5'/%3E%3Cpath d='M2 10c0-3.2 1.6-5.3 4.4-6M9 10c0-3.2 1.6-5.3 4.4-6' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

.forum-icon-link {
  --forum-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 9.5l3-3M7 4.5l1.2-1.2a2.8 2.8 0 0 1 4 4L11 8.5M9 11.5l-1.2 1.2a2.8 2.8 0 0 1-4-4L5 7.5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

.forum-icon-flag {
  --forum-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 14.5V2.5M3.5 3h8.5l-2 3 2 3H3.5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.forum-icon-edit {
  --forum-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M10.5 2.5l3 3L6 13H3v-3zM9 4l3 3' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.forum-icon-delete {
  --forum-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 4h11M6 4V2.5h4V4M4 4l.7 9.5h6.6L12 4M6.5 6.5v5M9.5 6.5v5' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ─── Post toolbar ───────────────────────────────────────────────────────── */
.forum-post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.5rem;
  margin-left: -0.5rem;
}

.forum-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.5rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: #6c757d;
  font-size: 0.85rem;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
}

  .forum-action:hover,
  .forum-action:focus-visible {
    background: rgba(0, 0, 0, 0.06);
    color: #212529;
  }

  .forum-action.text-danger:hover {
    background: rgba(220, 53, 69, 0.1);
  }

/* Reply/Quote only make sense when the page has a reply editor (forum.js sets the body class). */
.forum-reply-action {
  display: none;
}

.forum-can-reply .forum-reply-action {
  display: inline-flex;
}

.forum-op .forum-post-actions {
  margin-top: 1rem;
}

/* ─── Post number / permalink ────────────────────────────────────────────── */
.forum-permalink {
  color: inherit;
  font-style: italic;
  text-decoration: none;
}

  .forum-permalink:hover {
    text-decoration: underline;
  }

/* ─── "In reply to" header on a post ─────────────────────────────────────── */
.forum-reply-to {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.85rem;
}

  .forum-reply-to a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.6rem;
    border-radius: 1rem;
    background: #f1f3f5;
    color: #6c757d;
    text-decoration: none;
  }

    .forum-reply-to a:hover {
      background: #e9ecef;
      color: #212529;
    }

  .forum-reply-to img.avatar {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-width: 0;
  }

/* ─── Quotes inside posts ────────────────────────────────────────────────── */
.forum-post-body blockquote,
.comment blockquote {
  margin: 0 0 1rem;
  padding: 0.6rem 1rem;
  border-left: 4px solid #adb5bd;
  border-radius: 0 0.375rem 0.375rem 0;
  background: #f8f9fa;
  color: #495057;
  font-size: inherit;
}

  .forum-post-body blockquote > :last-child,
  .comment blockquote > :last-child {
    margin-bottom: 0;
  }

  .forum-post-body blockquote blockquote,
  .comment blockquote blockquote {
    background: #eef0f2;
  }

/* ─── Highlight when jumping to a post ───────────────────────────────────── */
@keyframes forum-post-flash {
  0%, 30% {
    background-color: #fff3cd;
  }

  100% {
    background-color: transparent;
  }
}

.forum-post-flash {
  animation: forum-post-flash 2s ease-out;
}

.forum-post:target {
  box-shadow: inset 3px 0 0 #6c757d;
}

/* ─── Reply box: "Replying to" bar and draft status ──────────────────────── */
.forum-replying-to {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #dee2e6;
  border-bottom: 0;
  background: #e9ecef;
  font-size: 0.9rem;
}

  .forum-replying-to a {
    color: #212529;
    text-decoration: none;
  }

    .forum-replying-to a:hover {
      text-decoration: underline;
    }

.forum-draft-status:empty {
  display: none;
}

/* ─── Floating "Quote" button over selected text ─────────────────────────── */
.forum-selection-quote {
  position: absolute;
  z-index: 1070;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border: 0;
  border-radius: 0.375rem;
  background: #212529;
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

  .forum-selection-quote:hover {
    background: #000;
  }
