/* Comment Action Text — public forms only. Scoped under .comment-rich-text-wrap.
 * Article/admin Action Text uses actiontext.css + .admin-rich-text-wrap instead. */

.comment-section__form {
  margin-top: 1.5rem;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.comment-form__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 639px) {
  .comment-form__fields {
    grid-template-columns: 1fr;
  }
}

.comment-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.comment-form__field--editor {
  gap: 0.5rem;
}

.comment-form__label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.comment-form__input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.4;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.comment-form__input::placeholder {
  color: #9ca3af;
}

.comment-form__input:focus {
  outline: none;
  border-color: #6b7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.15);
}

.comment-form__identity {
  padding: 0.625rem 0.75rem;
  font-size: 0.9375rem;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}

.comment-form__identity strong {
  font-weight: 700;
}

.comment-form__submit {
  align-self: flex-start;
  padding: 0.625rem 1.25rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  color: #111827;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.comment-form__submit:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.comment-rich-text-wrap {
  overflow: hidden;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.comment-rich-text-wrap:focus-within {
  border-color: #6b7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.15);
}

.comment-rich-text-wrap trix-toolbar {
  border: none;
  border-bottom: 1px solid #e5e7eb;
  margin: 0;
  padding: 0.5rem 0.625rem 0;
  background: #f9fafb;
}

.comment-rich-text-wrap trix-toolbar .trix-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.comment-rich-text-wrap trix-toolbar .trix-button-row::-webkit-scrollbar {
  display: none;
}

.comment-rich-text-wrap trix-toolbar .trix-button-group {
  display: flex;
  margin-bottom: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
}

.comment-rich-text-wrap trix-toolbar .trix-button {
  position: relative;
  color: #374151;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0 0.5rem;
  margin: 0;
  border: none;
  border-left: 1px solid #e5e7eb;
  background: transparent;
}

.comment-rich-text-wrap trix-toolbar .trix-button:first-child {
  border-left: 0;
}

.comment-rich-text-wrap trix-toolbar .trix-button.trix-active {
  background: #e5e7eb;
  color: #111827;
}

.comment-rich-text-wrap trix-toolbar .trix-button:not(:disabled) {
  cursor: pointer;
}

.comment-rich-text-wrap trix-toolbar .trix-button:not(:disabled):hover {
  background: #f3f4f6;
}

.comment-rich-text-wrap trix-toolbar .trix-button--icon {
  width: 2rem;
  height: 1.75rem;
  text-indent: -9999px;
}

.comment-rich-text-wrap trix-toolbar .trix-button--icon::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.65;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
}

.comment-rich-text-wrap trix-toolbar .trix-button--icon.trix-active::before {
  opacity: 1;
}

.comment-rich-text-wrap trix-toolbar .trix-button--icon-bold::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.522%2019.242a.5.5%200%200%201-.5-.5V5.35a.5.5%200%200%201%20.5-.5h5.783c1.347%200%202.46.345%203.24.982.783.64%201.216%201.562%201.216%202.683%200%201.13-.587%202.129-1.476%202.71a.35.35%200%200%200%20.049.613c1.259.56%202.101%201.742%202.101%203.22%200%201.282-.483%202.334-1.363%203.063-.876.726-2.132%201.12-3.66%201.12h-5.89ZM9.27%207.347v3.362h1.97c.766%200%201.347-.17%201.733-.464.38-.291.587-.716.587-1.27%200-.53-.183-.928-.513-1.198-.334-.273-.838-.43-1.505-.43H9.27Zm0%205.606v3.791h2.389c.832%200%201.448-.177%201.853-.497.399-.315.614-.786.614-1.423%200-.62-.22-1.077-.63-1.385-.418-.313-1.053-.486-1.905-.486H9.27Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}

.comment-rich-text-wrap trix-toolbar .trix-button--icon-italic::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M9%205h6.5v2h-2.23l-2.31%2010H13v2H6v-2h2.461l2.306-10H9V5Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}

.comment-rich-text-wrap trix-toolbar .trix-button--icon-quote::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.581%208.471c.44-.5%201.056-.834%201.758-.995C8.074%207.17%209.201%207.822%2010%208.752c1.354%201.578%201.33%203.555.394%205.277-.941%201.731-2.788%203.163-4.988%203.56a.622.622%200%200%201-.653-.317c-.113-.205-.121-.49.16-.764.294-.286.567-.566.791-.835.222-.266.413-.54.524-.815.113-.28.156-.597.026-.908-.128-.303-.39-.524-.72-.69a3.02%203.02%200%200%201-1.674-2.7c0-.905.283-1.59.72-2.088Zm9.419%200c.44-.5%201.055-.834%201.758-.995%201.734-.306%202.862.346%203.66%201.276%201.355%201.578%201.33%203.555.395%205.277-.941%201.731-2.789%203.163-4.988%203.56a.622.622%200%200%201-.653-.317c-.113-.205-.122-.49.16-.764.294-.286.567-.566.791-.835.222-.266.412-.54.523-.815.114-.28.157-.597.026-.908-.127-.303-.39-.524-.72-.69a3.02%203.02%200%200%201-1.672-2.701c0-.905.283-1.59.72-2.088Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}

.comment-rich-text-wrap trix-toolbar .trix-button--icon-code::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.293%2011.293a1%201%200%200%200%200%201.414l4%204a1%201%200%201%200%201.414-1.414L5.414%2012l3.293-3.293a1%201%200%200%200-1.414-1.414l-4%204Zm13.414%205.414%204-4a1%201%200%200%200%200-1.414l-4-4a1%201%200%201%200-1.414%201.414L18.586%2012l-3.293%203.293a1%201%200%200%200%201.414%201.414Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}

.comment-rich-text-wrap trix-toolbar .trix-button--icon-bullet-list::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%207.5a1.5%201.5%200%201%200%200-3%201.5%201.5%200%200%200%200%203ZM8%206a1%201%200%200%201%201-1h11a1%201%200%201%201%200%202H9a1%201%200%200%201-1-1Zm1%205a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm0%206a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm-2.5-5a1.5%201.5%200%201%201-3%200%201.5%201.5%200%200%201%203%200ZM5%2019.5a1.5%201.5%200%201%200%200-3%201.5%201.5%200%200%200%200%203Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}

.comment-rich-text-wrap trix-toolbar .trix-button--icon-number-list::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3%204h2v4H4V5H3V4Zm5%202a1%201%200%200%201%201-1h11a1%201%200%201%201%200%202H9a1%201%200%200%201-1-1Zm1%205a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm0%206a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm-3.5-7H6v1l-1.5%202H6v1H3v-1l1.667-2H3v-1h2.5ZM3%2017v-1h3v4H3v-1h2v-.5H4v-1h1V17H3Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}

.comment-rich-text-wrap trix-toolbar .trix-button--icon-undo::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3%2014a1%201%200%200%200%201%201h6a1%201%200%201%200%200-2H6.257c2.247-2.764%205.151-3.668%207.579-3.264%202.589.432%204.739%202.356%205.174%205.405a1%201%200%200%200%201.98-.283c-.564-3.95-3.415-6.526-6.825-7.095C11.084%207.25%207.63%208.377%205%2011.39V8a1%201%200%200%200-2%200v6Zm2-1Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}

.comment-rich-text-wrap trix-toolbar .trix-button--icon-redo::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21%2014a1%201%200%200%201-1%201h-6a1%201%200%201%201%200-2h3.743c-2.247-2.764-5.151-3.668-7.579-3.264-2.589.432-4.739%202.356-5.174%205.405a1%201%200%200%201-1.98-.283c.564-3.95%203.415-6.526%206.826-7.095%203.08-.513%206.534.614%209.164%203.626V8a1%201%200%201%201%202%200v6Zm-2-1Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E");
}

.comment-rich-text-wrap trix-editor,
.comment-rich-text-wrap .comment-rich-text {
  display: block;
  min-height: 7.5rem;
  border: none;
  border-radius: 0;
  padding: 0.75rem 0.875rem;
  outline: none;
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #111827;
  background: #fff;
}

.comment-rich-text-wrap trix-editor:empty:not(:focus)::before {
  color: #9ca3af;
}

.comment-rich-text-wrap trix-editor:focus {
  outline: none;
}

.comment-trix-content p,
.comment-trix-content div {
  margin: 0 0 0.5em;
}

.comment-trix-content p:last-child,
.comment-trix-content div:last-child {
  margin-bottom: 0;
}

/* Rendered comments + Trix editor — quoted reply blocks */
.comment-trix-content blockquote,
.comment-rich-text-wrap trix-editor blockquote {
  border-left: 3px solid #9ca3af;
  padding: 0.625rem 0.875rem;
  margin: 0.75em 0;
  background: rgba(0, 0, 0, 0.045);
  border-radius: 0 4px 4px 0;
  font-style: normal;
  color: #374151;
}

.comment-trix-content blockquote > :first-child,
.comment-rich-text-wrap trix-editor blockquote > :first-child {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.comment-trix-content blockquote > :first-child strong,
.comment-rich-text-wrap trix-editor blockquote > :first-child strong {
  font-weight: 700;
  color: #111827;
}

/* Quoted attribution links — clickable in rendered comments, inert while composing */
.comment-trix-content blockquote > :first-child a {
  color: #111827;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.comment-trix-content blockquote > :first-child a:hover {
  opacity: 0.7;
}

.comment-rich-text-wrap trix-editor blockquote > :first-child a {
  color: inherit;
  text-decoration: none;
  pointer-events: none;
}

.comment-trix-content blockquote > :last-child:not(:only-child),
.comment-rich-text-wrap trix-editor blockquote > :last-child:not(:only-child) {
  margin: 0;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-style: italic;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #4b5563;
}

.comment-trix-content pre {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.75em 1em;
  overflow-x: auto;
  margin: 0.5em 0;
  border-radius: 6px;
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
}

.comment-trix-content code {
  font-family: ui-monospace, monospace;
  background: rgba(0, 0, 0, 0.06);
  padding: 0.1em 0.3em;
  font-size: 0.9em;
  border-radius: 4px;
}

.comment-trix-content ul,
.comment-trix-content ol {
  padding-left: 1.5em;
  margin: 0.5em 0;
}

.comment-trix-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mh-layout .mh-comment-item__badge {
  margin-left: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

/* Shared comment form — MH parchment theme */
.mh-layout .comment-section__form {
  margin-top: 0;
}

.mh-layout .comment-form {
  gap: 1rem;
}

.mh-layout .comment-form__label {
  font-family: "Work Sans", sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--mhgu-brown);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mh-layout .comment-form__input {
  font-family: "Inter", sans-serif;
  color: var(--mhgu-text);
  background: var(--mhgu-cream);
  border: 2px solid var(--mhgu-border);
  border-radius: 2px;
}

.mh-layout .comment-form__input::placeholder {
  color: var(--mhgu-text-muted);
}

.mh-layout .comment-form__input:focus {
  border-color: var(--mhgu-teal);
  box-shadow: 0 0 0 2px rgba(91, 184, 201, 0.25);
}

.mh-layout .comment-form__identity {
  font-family: "Inter", sans-serif;
  color: var(--mhgu-text);
  background: var(--mhgu-cream);
  border: 2px solid var(--mhgu-border);
  border-left: 3px solid var(--mhgu-teal);
  border-radius: 2px;
}

.mh-layout .comment-form__identity strong {
  color: var(--mhgu-red);
}

.mh-layout .comment-form__submit,
.mh-layout input.comment-form__submit {
  font-family: "Work Sans", sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  color: #fff;
  background: var(--mhgu-teal-dark);
  border: 2px solid var(--mhgu-teal-dark);
  border-radius: 2px;
}

.mh-layout .comment-form__submit:hover,
.mh-layout input.comment-form__submit:hover {
  background: var(--mhgu-gold-dark);
  border-color: var(--mhgu-gold-dark);
}

.mh-layout .comment-rich-text-wrap {
  border: 2px solid var(--mhgu-border);
  border-radius: 2px;
  background: var(--mhgu-cream);
  box-shadow: none;
}

.mh-layout .comment-rich-text-wrap:focus-within {
  border-color: var(--mhgu-teal);
  box-shadow: 0 0 0 2px rgba(91, 184, 201, 0.25);
}

.mh-layout .comment-rich-text-wrap trix-toolbar {
  padding: 0.5rem 0.625rem 0;
  background: linear-gradient(180deg, var(--mhgu-parchment-light) 0%, var(--mhgu-parchment) 100%);
  border-bottom: 1px solid var(--mhgu-border);
}

.mh-layout .comment-rich-text-wrap trix-toolbar .trix-button-group {
  border: 1px solid var(--mhgu-border);
  border-radius: 2px;
  background: var(--mhgu-cream);
}

.mh-layout .comment-rich-text-wrap trix-toolbar .trix-button {
  border-left-color: var(--mhgu-border);
  color: var(--mhgu-brown);
}

.mh-layout .comment-rich-text-wrap trix-toolbar .trix-button:not(:disabled):hover {
  background: var(--mhgu-parchment-light);
}

.mh-layout .comment-rich-text-wrap trix-toolbar .trix-button.trix-active {
  background: rgba(91, 184, 201, 0.25);
  color: var(--mhgu-teal-dark);
}

.mh-layout .comment-rich-text-wrap trix-editor,
.mh-layout .comment-rich-text-wrap .comment-rich-text {
  min-height: 6.5rem;
  padding: 0.75rem 0.875rem;
  font-family: "Inter", sans-serif;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--mhgu-text);
  background: var(--mhgu-cream);
}

.mh-layout .comment-rich-text-wrap trix-editor:empty:not(:focus)::before {
  color: var(--mhgu-text-muted);
}

.mh-layout .comment-trix-content blockquote,
.mh-layout .comment-rich-text-wrap trix-editor blockquote {
  border-left-color: var(--mhgu-teal);
  background: rgba(91, 184, 201, 0.14);
  color: var(--mhgu-text);
}

.mh-layout .comment-trix-content blockquote > :first-child strong,
.mh-layout .comment-rich-text-wrap trix-editor blockquote > :first-child strong {
  color: var(--mhgu-red);
}

.mh-layout .comment-trix-content blockquote > :last-child:not(:only-child),
.mh-layout .comment-rich-text-wrap trix-editor blockquote > :last-child:not(:only-child) {
  border-top-color: rgba(110, 90, 68, 0.15);
  color: var(--mhgu-brown);
}

.mh-layout .comment-trix-content pre,
.mh-layout .comment-trix-content code {
  background: rgba(110, 90, 68, 0.08);
  border-color: var(--mhgu-border);
}
