/* twf-engagement.css — styles for the public comment widget and contact form.
   Scoped under .twf-comments / .twf-contact so it won't collide with site styles. */

.twf-comments,
.twf-contact {
  --twf-border: #e3e6ec;
  --twf-muted: #6b7280;
  --twf-accent: #2563eb;
  --twf-bg-soft: #f7f8fa;
  margin: 2.5rem 0 1rem;
  font-size: 0.95rem;
  line-height: 1.55;
}

.twf-comments .twf-c-title,
.twf-contact .twf-ct-title {
  font-size: 1.35rem;
  margin: 0 0 1.1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--twf-border);
}

/* ---- comment list ---- */
.twf-c-list { margin-bottom: 2rem; }
.twf-c-empty,
.twf-c-loading { color: var(--twf-muted); font-style: italic; }

.twf-c-thread { margin-bottom: 1.25rem; }

.twf-c-item {
  padding: 0.9rem 1rem;
  background: var(--twf-bg-soft);
  border: 1px solid var(--twf-border);
  border-radius: 10px;
}
.twf-c-reply {
  margin-top: 0.6rem;
  margin-left: 2rem;
  background: #fff;
  border-left: 3px solid var(--twf-accent);
}

.twf-c-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}
.twf-c-author { font-weight: 600; }
.twf-c-date { color: var(--twf-muted); font-size: 0.82rem; }
.twf-c-body { margin: 0; white-space: pre-wrap; word-break: break-word; }

.twf-c-reply-btn {
  margin-top: 0.5rem;
  background: none;
  border: none;
  color: var(--twf-accent);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.twf-c-reply-btn:hover { text-decoration: underline; }

/* ---- forms ---- */
.twf-c-form,
.twf-contact form {
  background: #fff;
  border: 1px solid var(--twf-border);
  border-radius: 12px;
  padding: 1.2rem;
}
.twf-c-formtitle,
.twf-ct-formtitle { margin: 0 0 0.9rem; font-size: 1.05rem; }

.twf-c-row,
.twf-ct-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.twf-c-row > *,
.twf-ct-row > * { flex: 1 1 200px; }

.twf-comments input,
.twf-comments textarea,
.twf-contact input,
.twf-contact textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--twf-border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}
.twf-comments textarea,
.twf-contact textarea { min-height: 110px; resize: vertical; margin-bottom: 0.75rem; }

.twf-comments input:focus,
.twf-comments textarea:focus,
.twf-contact input:focus,
.twf-contact textarea:focus {
  outline: none;
  border-color: var(--twf-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* honeypot — hidden from humans, visible to dumb bots */
.twf-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.twf-c-actions,
.twf-ct-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.twf-comments button[type="submit"],
.twf-contact button[type="submit"] {
  background: var(--twf-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.3rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.twf-comments button[type="submit"]:hover,
.twf-contact button[type="submit"]:hover { background: #1d4ed8; }
.twf-comments button[type="submit"]:disabled,
.twf-contact button[type="submit"]:disabled { opacity: 0.6; cursor: default; }

.twf-c-status,
.twf-ct-status { font-size: 0.88rem; }
.twf-c-status.ok,
.twf-ct-status.ok { color: #15803d; }
.twf-c-status.err,
.twf-ct-status.err { color: #b91c1c; }

.twf-c-replying {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.8rem;
  font-size: 0.88rem;
  color: #1e40af;
}
.twf-c-cancel {
  background: none; border: none; color: var(--twf-accent);
  cursor: pointer; font: inherit; font-weight: 600; padding: 0;
}
.twf-c-cancel:hover { text-decoration: underline; }

@media (prefers-color-scheme: dark) {
  .twf-comments, .twf-contact {
    --twf-border: #2c313a;
    --twf-muted: #9aa3af;
    --twf-bg-soft: #1a1d23;
  }
  .twf-c-reply,
  .twf-c-form, .twf-contact form,
  .twf-comments input, .twf-comments textarea,
  .twf-contact input, .twf-contact textarea { background: #14171c; color: #e6e8eb; }
}
