/* ============================================================
   VG Blog Q&A — Reader-submitted public Q&A with admin moderation
   2026-05-30
   ============================================================ */

.qa-section {
  margin: 36px 0;
  font-family: var(--qr-font-sans, "Inter", system-ui, sans-serif);
}

.qa-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.qa-section h2 {
  font-family: var(--vgr-font-serif, "Lora", Georgia, serif);
  font-size: clamp(22px, 3vw, 26px);
  font-weight: 700;
  letter-spacing: -.2px;
  margin: 0;
  color: var(--vgr-ink, #0f172a);
  display: flex;
  align-items: center;
  gap: 10px;
}

.qa-section h2 .count {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  background: rgba(220,107,46,.10);
  color: #dc6b2e;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: .04em;
}

.qa-card {
  background: #fff;
  border: 1px solid #f1eadd;
  border-radius: 14px;
  margin-bottom: 12px;
  padding: 18px 20px;
  transition: box-shadow .15s, border-color .15s;
}

.qa-card:hover {
  box-shadow: 0 4px 18px rgba(15,23,42,.06);
  border-color: rgba(220,107,46,.4);
}

.qa-card.is-pending {
  background: #fffdf5;
  border-color: #fde68a;
  border-style: dashed;
}

.qa-card__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.qa-card__avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff8ee, #fef3c7);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #dc6b2e;
  font-size: 14px;
  font-family: "Inter", sans-serif;
}

.qa-card__meta {
  flex: 1;
  min-width: 0;
}

.qa-card__name {
  font-weight: 700;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.3;
}

.qa-card__sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.qa-card__sub .mine {
  background: rgba(220,107,46,.12);
  color: #b8511f;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-left: 6px;
}

.qa-card__sub .pending {
  background: #fef3c7;
  color: #92400e;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 10px;
  margin-left: 6px;
}

.qa-card__q {
  font-family: var(--vgr-font-serif, "Lora", serif);
  font-size: 16px;
  line-height: 1.5;
  color: #1e293b;
  margin: 6px 0 12px;
  white-space: pre-wrap;
}

.qa-card__answer {
  margin-top: 14px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #fff8ee, #fffefb);
  border-left: 3px solid #dc6b2e;
  border-radius: 0 12px 12px 0;
  font-size: 14.5px;
  line-height: 1.7;
  color: #334155;
}

.qa-card__answer-by {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #dc6b2e;
  margin-bottom: 8px;
}

.qa-card__answer-by::before {
  content: "🪔";
  font-size: 14px;
}

.qa-card__answer p {
  margin: 0 0 8px;
}
.qa-card__answer p:last-child { margin-bottom: 0; }

.qa-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #f1eadd;
}

.qa-upvote {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1.5px solid #e2e8f0;
  border-radius: 999px;
  padding: 6px 12px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
  transition: all .15s;
}

.qa-upvote:hover {
  border-color: #dc6b2e;
  color: #dc6b2e;
}

.qa-upvote.is-upvoted {
  background: rgba(220,107,46,.10);
  border-color: #dc6b2e;
  color: #dc6b2e;
}

.qa-upvote__arrow {
  font-size: 14px;
  line-height: 1;
}

.qa-card__admin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #94a3b8;
}

.qa-admin-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.qa-admin-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 8px;
  padding: 5px 10px;
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  color: #0f172a;
}

.qa-admin-btn:hover {
  background: #f8fafc;
}

.qa-admin-btn.approve { background: #16a34a; color: #fff; border-color: #16a34a; }
.qa-admin-btn.reject  { background: #dc2626; color: #fff; border-color: #dc2626; }
.qa-admin-btn.answer  { background: #dc6b2e; color: #fff; border-color: #dc6b2e; }

/* === Ask form === */
.qa-ask {
  background: linear-gradient(135deg, #fff8ee, #fffefb);
  border: 1.5px solid #f1e0c2;
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 18px;
}

.qa-ask__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.qa-ask__head h3 {
  font-family: var(--vgr-font-serif, "Lora", serif);
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.qa-ask__emoji {
  font-size: 24px;
}

.qa-ask p {
  font-size: 13.5px;
  color: #64748b;
  margin: 0 0 14px;
  line-height: 1.55;
}

.qa-ask textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-family: var(--vgr-font-serif, "Lora", serif);
  font-size: 15px;
  line-height: 1.6;
  color: #0f172a;
  background: #fff;
  resize: vertical;
  min-height: 80px;
  box-sizing: border-box;
}

.qa-ask textarea:focus {
  outline: 0;
  border-color: #dc6b2e;
  box-shadow: 0 0 0 4px rgba(220,107,46,.10);
}

.qa-ask__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.qa-ask__charcount {
  font-size: 11px;
  color: #94a3b8;
  font-family: "Inter", sans-serif;
}

.qa-ask__submit {
  background: linear-gradient(135deg, #dc6b2e, #b8511f);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 11px 22px;
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(220,107,46,.3);
  transition: transform .12s;
}

.qa-ask__submit:hover:not(:disabled) {
  transform: translateY(-1px);
}

.qa-ask__submit:disabled {
  background: #cbd5e1;
  box-shadow: none;
  cursor: wait;
}

.qa-ask__msg {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  min-height: 18px;
}

.qa-ask__msg.is-ok  { color: #15803d; }
.qa-ask__msg.is-bad { color: #dc2626; }

/* Login gate */
.qa-login-gate {
  background: #fff;
  border: 1.5px dashed #dc6b2e;
  border-radius: 14px;
  padding: 20px 22px;
  text-align: center;
  font-family: "Inter", sans-serif;
}

.qa-login-gate__emoji { font-size: 28px; margin-bottom: 6px; }
.qa-login-gate h3 {
  font-family: var(--vgr-font-serif, "Lora", serif);
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px;
}
.qa-login-gate p {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 12px;
}

.qa-login-gate a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #1f1f1f;
  border: 1.5px solid #dadce0;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: border-color .15s;
}
.qa-login-gate a:hover { border-color: #dc6b2e; }

/* Empty state */
.qa-empty {
  padding: 30px 20px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

.qa-empty .emoji {
  display: block;
  font-size: 38px;
  margin-bottom: 6px;
}

/* === Admin answer composer modal === */
.qa-answer-composer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99997;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(11,18,32,.55);
  backdrop-filter: blur(2px);
}
.qa-answer-composer.is-open { display: flex; }

.qa-answer-composer__card {
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 16px 50px rgba(0,0,0,.25);
}

.qa-answer-composer__card h3 {
  font-family: var(--vgr-font-serif, "Lora", serif);
  font-size: 18px;
  margin: 0 0 6px;
  color: #0f172a;
}

.qa-answer-composer__q {
  font-size: 14px;
  color: #475569;
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 12px;
  line-height: 1.5;
}

.qa-answer-composer textarea {
  width: 100%;
  min-height: 140px;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font: 14px var(--vgr-font-serif, "Lora", serif);
  resize: vertical;
  box-sizing: border-box;
}
.qa-answer-composer textarea:focus { outline:0; border-color:#dc6b2e; box-shadow:0 0 0 3px rgba(220,107,46,.12); }

.qa-answer-composer__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.qa-answer-composer .qa-admin-btn.cancel {
  background: transparent;
  color: #64748b;
}

/* === Dark mode overrides === */
body.post-view[data-reading-mode="dark"] .qa-section h2 { color: #f5f0e6; }
body.post-view[data-reading-mode="dark"] .qa-card {
  background: #1a212c !important;
  border-color: #3a4254 !important;
  color: #f5f0e6 !important;
}
body.post-view[data-reading-mode="dark"] .qa-card__name { color: #f5f0e6 !important; }
body.post-view[data-reading-mode="dark"] .qa-card__q { color: #f5f0e6 !important; }
body.post-view[data-reading-mode="dark"] .qa-card__sub { color: #8a93a3 !important; }
body.post-view[data-reading-mode="dark"] .qa-card__answer {
  background: linear-gradient(135deg, #2a1f15, #1c1812) !important;
  border-color: #fbbf24 !important;
  color: #dee2ea !important;
}
body.post-view[data-reading-mode="dark"] .qa-card__avatar {
  background: linear-gradient(135deg, #2a1f15, #4a3826) !important;
  color: #fbbf24 !important;
}
body.post-view[data-reading-mode="dark"] .qa-upvote { color: #8a93a3; border-color: #3a4254; }
body.post-view[data-reading-mode="dark"] .qa-upvote.is-upvoted {
  background: rgba(251,191,36,.15) !important;
  color: #fbbf24 !important;
  border-color: #fbbf24 !important;
}
body.post-view[data-reading-mode="dark"] .qa-ask {
  background: linear-gradient(135deg, #2a1f15, #1c1812) !important;
  border-color: #4a3826 !important;
}
body.post-view[data-reading-mode="dark"] .qa-ask__head h3,
body.post-view[data-reading-mode="dark"] .qa-login-gate h3 { color: #f5f0e6 !important; }
body.post-view[data-reading-mode="dark"] .qa-ask textarea {
  background: #1a212c !important;
  border-color: #3a4254 !important;
  color: #f5f0e6 !important;
}
body.post-view[data-reading-mode="dark"] .qa-empty {
  background: #1a212c !important;
  border-color: #3a4254 !important;
  color: #8a93a3 !important;
}
body.post-view[data-reading-mode="dark"] .qa-login-gate {
  background: #1a212c !important;
  border-color: #fbbf24 !important;
}
body.post-view[data-reading-mode="dark"] .qa-login-gate p { color: #c3c9d3 !important; }
