/* Extracted from blog/partials/comment_thread.html */
/* ── Comments section ─────────────────────────────── */
.comments-section {
  margin-top: 56px;
}

.comments-heading {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.comments-heading-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent);
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ── Empty state ──────────────────────────────────── */
.comments-empty {
  text-align: center;
  padding: 40px 20px;
  background: var(--card-bg);
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--muted);
  margin-bottom: 32px;
}

.comments-empty svg {
  width: 40px;
  height: 40px;
  opacity: 0.3;
  margin-bottom: 12px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* ── Individual comment card ──────────────────────── */
.comment {
  margin-bottom: 12px;
}

.comment-replies {
  margin-left: 20px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
  margin-top: 8px;
}

.comment-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.2s ease;
}

.comment-card:hover {
  border-color: rgba(14, 165, 233, 0.25);
}

.comment-main {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
}

/* ── Avatar ───────────────────────────────────────── */
.comment-avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-avatar-initials {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-strong) 0%, #075985 100%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

/* ── Body ─────────────────────────────────────────── */
.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.comment-author {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.comment-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.comment-badge.mod {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.comment-badge.verified {
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent);
}

.comment-time {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.comment-content {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.65;
}

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

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

/* ── Author response ──────────────────────────────── */
.comment-author-response {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(14, 165, 233, 0.06);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
}

.comment-author-response-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.comment-author-response-text {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
}

.comment-author-response-text p {
  margin: 0 0 0.4em;
}

.comment-author-response-text p:last-child {
  margin: 0;
}

/* ── Edited notice ────────────────────────────────── */
.comment-edited {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

/* ── Action buttons ───────────────────────────────── */
.comment-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 10px;
}

.comment-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, opacity 0.15s ease, filter 0.15s ease;
}

.comment-action-btn:hover {
  background: rgba(14, 165, 233, 0.1);
  color: var(--accent);
}

.comment-action-btn.muted:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

/* ── Reply form ───────────────────────────────────── */
.reply-form-wrap {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.comment-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--hover);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s ease;
}

.comment-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.comment-textarea::placeholder {
  color: var(--muted);
}

.reply-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.comment-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent-strong);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.comment-submit-btn:hover {
  opacity: 0.88;
}

.comment-cancel-btn {
  padding: 8px 14px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, opacity 0.15s ease, filter 0.15s ease;
}

.comment-cancel-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ── New comment form ─────────────────────────────── */
.comment-form-card {
  margin-top: 32px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.comment-form-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.comment-form-body {
  padding: 22px;
}

.comment-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .comment-field-row {
    grid-template-columns: 1fr;
  }
}

.comment-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.comment-field input,
.comment-field textarea,
.comment-field .comment-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--hover);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.comment-field input:focus,
.comment-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.comment-field input::placeholder,
.comment-field textarea::placeholder {
  color: var(--muted);
}

.comment-field-hint {
  margin-top: 5px;
  font-size: 0.78rem;
  color: var(--muted);
}

.comment-form-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.comment-form-notice {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
