/* Comments plugin — public styles. Uses the site design tokens from style.css
   (--card, --border, --primary, --muted, --foreground, --destructive, --radius).
   The whole section is scoped under .mp-comments so it never leaks into content. */

.mp-comments {
  max-width: 80rem; /* match the article container (max-w-7xl) — full site width */
  margin: 28px auto 0;
  padding: 0 1rem 8px;
  width: 100%;
}
.mp-c-title {
  display: flex; align-items: center; gap: 8px;
  font-family: Cinzel, serif; font-weight: 700; font-size: 1.4rem;
  color: var(--foreground); margin: 0 0 18px;
}
.mp-c-title .mp-c-count { color: var(--muted-foreground); font-weight: 600; font-size: 1.05rem; }

/* ---- full-width single-column layout: list, then composer, both full width ---- */
.mp-c-layout { display: flex; flex-direction: column; gap: 24px; }
.mp-c-list-col { min-width: 0; }
.mp-c-form-col { min-width: 0; }

/* ---- list ---- */
.mp-c-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.mp-c-empty { color: var(--muted-foreground); font-size: .92rem; padding: 14px 2px; }
.mp-c-item { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px); background: var(--card); }
.mp-c-avatar {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 999px;
  display: grid; place-items: center; font-family: Cinzel, serif; font-weight: 700;
  background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary);
}
.mp-c-main { min-width: 0; flex: 1 1 auto; }
.mp-c-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mp-c-author { font-weight: 700; font-size: .9rem; color: var(--foreground); }
.mp-c-date { font-size: .78rem; color: var(--muted-foreground); }
.mp-c-del {
  margin-left: auto; background: none; border: 0; cursor: pointer; line-height: 0;
  color: var(--muted-foreground); border-radius: 6px; padding: 3px; transition: .15s;
}
.mp-c-del:hover { color: #fff; background: var(--destructive); }
.mp-c-body { margin-top: 5px; font-size: .94rem; line-height: 1.6; color: var(--foreground); overflow-wrap: anywhere; }
.mp-c-body p { margin: 0 0 8px; }
.mp-c-body a { color: var(--primary); text-decoration: underline; overflow-wrap: anywhere; }
.mp-c-body img.mp-c-img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); margin: 6px 0; display: block; }

/* ---- pagination ---- */
.mp-c-pager { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.mp-c-page {
  min-width: 32px; text-align: center; padding: 5px 9px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card); color: var(--foreground);
  font-size: .85rem; font-weight: 600; text-decoration: none; transition: .15s;
}
.mp-c-page:hover { background: var(--muted); }
.mp-c-page.is-active { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }

/* ---- shared buttons ---- */
.mp-c-btn {
  display: inline-flex; align-items: center; gap: 7px; border-radius: 999px;
  padding: 9px 18px; font-weight: 600; font-size: .88rem; cursor: pointer;
  border: 1px solid transparent; transition: .15s; line-height: 1; text-decoration: none;
}
.mp-c-btn-primary { background: var(--primary); color: var(--primary-foreground); }
.mp-c-btn-primary:hover { filter: brightness(1.08); color: var(--primary-foreground); }
.mp-c-btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.mp-c-btn-outline { background: var(--card); border-color: var(--border); color: var(--foreground); }
.mp-c-btn-outline:hover { background: var(--muted); color: var(--foreground); }

/* ---- logged-out box ---- */
.mp-c-login {
  padding: 20px; border: 1px dashed var(--border);
  border-radius: calc(var(--radius) + 4px); background: var(--muted);
  text-align: center;
}
.mp-c-login-text { margin: 0 0 12px; color: var(--foreground); font-weight: 500; }
.mp-c-login-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---- banned notice ---- */
.mp-c-banned {
  padding: 14px 16px; display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid color-mix(in srgb, var(--destructive) 35%, var(--border));
  background: color-mix(in srgb, var(--destructive) 8%, var(--card));
  border-radius: calc(var(--radius) + 2px); color: var(--foreground);
}
.mp-c-banned p { margin: 0; font-size: .9rem; }
.mp-c-banned svg { color: var(--destructive); flex: 0 0 auto; }

/* ---- editor / form ---- */
.mp-c-form { border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); background: var(--card); overflow: hidden; }
.mp-c-toolbar { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--muted); flex-wrap: wrap; }
.mp-c-tool {
  min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid transparent; background: transparent;
  border-radius: 7px; cursor: pointer; font-size: 15px; line-height: 1; color: var(--foreground);
  display: inline-flex; align-items: center; justify-content: center; transition: .12s;
}
.mp-c-tool:hover { background: var(--card); border-color: var(--border); }
.mp-c-tool.is-active { background: var(--primary); color: var(--primary-foreground); }
.mp-c-tool-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.mp-c-emoji-wrap { position: relative; }
.mp-c-emoji-pop {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0;
  width: 232px; padding: 8px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.18);
}
.mp-c-emoji { font-size: 18px; line-height: 1; padding: 6px; background: none; border: 0; border-radius: 7px; cursor: pointer; }
.mp-c-emoji:hover { background: var(--muted); }
.mp-c-editor {
  min-height: 96px; max-height: 360px; overflow: auto; padding: 12px 14px; outline: none;
  font-size: .94rem; line-height: 1.6; color: var(--foreground); word-break: break-word;
}
.mp-c-editor:empty::before { content: attr(data-placeholder); color: var(--muted-foreground); }
.mp-c-editor img { max-width: 100%; height: auto; border-radius: 8px; }
.mp-c-form-foot { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); }
.mp-c-error { color: var(--destructive); font-size: .85rem; flex: 1 1 auto; min-width: 0; }
.mp-c-form-foot .mp-c-btn { margin-left: auto; }

@media (max-width: 480px) {
  .mp-c-form-foot { flex-wrap: wrap; }
  .mp-c-form-foot .mp-c-btn { margin-left: 0; width: 100%; justify-content: center; }
  .mp-c-error { flex-basis: 100%; }
}
