/* ══════════════════════════════════════════════════════════════════
   Reader engagement widget — block at the foot of every post
   ══════════════════════════════════════════════════════════════════ */

#vg-engagement {
  max-width: 780px;
  margin: 56px auto 0;
  padding: 28px 28px 32px;
  background: #fff;
  border: 1px solid rgba(31,58,43,0.12);
  border-radius: 6px;
  font-family: 'Source Sans 3', 'Lato', system-ui, -apple-system, sans-serif;
  color: #1F3A2B;
  box-shadow: 0 2px 18px rgba(0,0,0,0.04);
}

.vg-eng__header { margin-bottom: 18px; }
.vg-eng__title {
  font-family: 'Playfair Display', 'Fraunces', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: #1F3A2B;
  line-height: 1.25;
}
.vg-eng__sub {
  margin: 0;
  font-size: 0.9rem;
  color: #5a6761;
  line-height: 1.5;
}

/* ── Vote row ───────────────────────────────────────────── */
.vg-eng__votes {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 16px 0;
  border-top: 1px solid rgba(31,58,43,0.08);
  border-bottom: 1px solid rgba(31,58,43,0.08);
  margin-bottom: 18px;
}
.vg-eng__vote {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #faf7f2;
  border: 1.5px solid rgba(31,58,43,0.15);
  border-radius: 24px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  color: #1F3A2B;
  transition: all 0.15s ease;
  min-height: 44px;
}
.vg-eng__vote:hover { background: #fff; border-color: rgba(31,58,43,0.35); }
.vg-eng__vote.is-on {
  background: #2a9d8f;
  border-color: #2a9d8f;
  color: #fff;
}
.vg-eng__vote.is-on.is-down {
  background: #cc4030;
  border-color: #cc4030;
}
.vg-eng__count { font-variant-numeric: tabular-nums; font-weight: 700; }

.vg-eng__share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: 1.5px solid rgba(31,58,43,0.15);
  border-radius: 24px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  color: #1F3A2B;
  transition: all 0.15s ease;
  min-height: 44px;
  position: relative;
}
.vg-eng__share:hover { border-color: rgba(31,58,43,0.35); background: #faf7f2; }

.vg-eng__greet {
  margin-left: auto;
  font-size: 0.8rem;
  color: #5a6761;
}

/* ── Comment composer ───────────────────────────────────── */
.vg-eng__composer { margin-bottom: 22px; }
.vg-eng__label {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5a6761;
  margin-bottom: 6px;
  font-weight: 700;
}
.vg-eng__input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid rgba(31,58,43,0.15);
  border-radius: 4px;
  font: inherit;
  font-size: 0.96rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 80px;
  box-sizing: border-box;
  background: #fff;
  color: #1F3A2B;
}
.vg-eng__input:focus {
  outline: none;
  border-color: #2a9d8f;
  box-shadow: 0 0 0 3px rgba(42,157,143,0.15);
}
.vg-eng__composer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  gap: 12px;
}
.vg-eng__char-count {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.74rem;
  color: #8a9690;
}
.vg-eng__post {
  padding: 10px 20px;
  background: #1F3A2B;
  color: #faf7f2;
  border: none;
  border-radius: 3px;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s ease;
}
.vg-eng__post:hover { background: #2a9d8f; }

/* ── Comments list ──────────────────────────────────────── */
.vg-eng__comments { border-top: 1px solid rgba(31,58,43,0.08); padding-top: 18px; }
.vg-eng__comments-head {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5a6761;
  margin-bottom: 12px;
  font-weight: 700;
}
.vg-eng__empty {
  padding: 18px 0;
  color: #8a9690;
  font-style: italic;
  font-size: 0.9rem;
}
.vg-eng__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.vg-eng__comment {
  padding: 14px 0;
  border-bottom: 1px solid rgba(31,58,43,0.06);
}
.vg-eng__comment:last-child { border-bottom: none; }
.vg-eng__comment-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.vg-eng__comment-author {
  font-weight: 700;
  font-size: 0.92rem;
  color: #1F3A2B;
}
.vg-eng__comment-time {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  color: #8a9690;
}
.vg-eng__comment-body {
  font-size: 0.94rem;
  line-height: 1.55;
  color: #2a3a32;
  margin-bottom: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}
.vg-eng__comment-actions {
  display: flex;
  gap: 10px;
}
.vg-eng__like {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid rgba(31,58,43,0.12);
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  color: #5a6761;
  transition: all 0.12s ease;
}
.vg-eng__like:hover { border-color: #b8762a; color: #b8762a; }
.vg-eng__like.is-on {
  border-color: #b8762a;
  color: #b8762a;
  background: rgba(184,118,42,0.08);
}

/* ── Registration modal ─────────────────────────────────── */
.vg-eng-modal {
  position: fixed;
  inset: 0;
  z-index: 9900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.vg-eng-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13,26,19,0.55);
}
.vg-eng-modal__card {
  position: relative;
  max-width: 440px;
  width: 100%;
  background: #faf7f2;
  border-radius: 6px;
  padding: 28px 28px 24px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.25);
  font-family: 'Source Sans 3', 'Lato', system-ui, sans-serif;
  color: #1F3A2B;
}
.vg-eng-modal__card h3 {
  font-family: 'Playfair Display', 'Fraunces', Georgia, serif;
  font-size: 1.35rem;
  margin: 0 0 8px;
  color: #1F3A2B;
  font-weight: 700;
  line-height: 1.25;
}
.vg-eng-modal__lede {
  margin: 0 0 18px;
  font-size: 0.88rem;
  color: #5a6761;
  line-height: 1.55;
}
.vg-eng-modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #8a9690;
  cursor: pointer;
  padding: 4px 8px;
}
.vg-eng-modal__close:hover { color: #1F3A2B; }
.vg-eng-modal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.vg-eng-modal__full { display: block; margin-bottom: 12px; }
.vg-eng-modal__card label {
  display: block;
  font-size: 0.78rem;
  color: #5a6761;
  font-weight: 600;
}
.vg-eng-modal__card input[type="text"],
.vg-eng-modal__card input[type="email"] {
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px;
  border: 1.5px solid rgba(31,58,43,0.15);
  border-radius: 3px;
  font: inherit;
  font-size: 0.94rem;
  box-sizing: border-box;
  background: #fff;
}
.vg-eng-modal__card input[type="text"]:focus,
.vg-eng-modal__card input[type="email"]:focus {
  outline: none;
  border-color: #2a9d8f;
  box-shadow: 0 0 0 3px rgba(42,157,143,0.15);
}
.vg-eng-modal__consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(184,118,42,0.06);
  border-radius: 3px;
  margin-bottom: 16px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #2a3a32;
  font-weight: 400;
}
.vg-eng-modal__consent input { margin-top: 3px; }
.vg-eng-modal__consent a { color: #b8762a; font-weight: 600; }
.vg-eng-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}
.vg-eng-modal__cancel {
  padding: 9px 16px;
  background: transparent;
  border: 1.5px solid rgba(31,58,43,0.15);
  border-radius: 3px;
  font: inherit;
  color: #5a6761;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
}
.vg-eng-modal__submit {
  padding: 9px 18px;
  background: #2a9d8f;
  color: #fff;
  border: none;
  border-radius: 3px;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}
.vg-eng-modal__submit:hover { background: #1F3A2B; }
.vg-eng-modal__submit:disabled { opacity: 0.6; cursor: progress; }
.vg-eng-modal__err {
  color: #cc4030;
  font-size: 0.82rem;
  margin-top: 10px;
  min-height: 1em;
}

/* ── Share menu ─────────────────────────────────────────── */
.vg-eng-share {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid rgba(31,58,43,0.15);
  border-radius: 4px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
  padding: 4px;
  z-index: 50;
  display: flex;
  flex-direction: column;
}
.vg-eng-share__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  color: #1F3A2B;
  text-decoration: none;
  text-align: left;
  border-radius: 3px;
  font-weight: 500;
}
.vg-eng-share__item:hover { background: #faf7f2; }
.vg-eng-share__item span {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: rgba(31,58,43,0.06);
  border-radius: 3px;
  font-size: 0.82rem;
}

/* ── Toast ──────────────────────────────────────────────── */
.vg-eng__toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1F3A2B;
  color: #faf7f2;
  padding: 12px 20px;
  border-radius: 4px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.88rem;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  opacity: 0;
  transition: all 0.22s ease;
  z-index: 9950;
  pointer-events: none;
  max-width: 420px;
  text-align: center;
}
.vg-eng__toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 560px) {
  #vg-engagement {
    padding: 22px 18px 24px;
    margin-top: 40px;
    border-radius: 4px;
  }
  .vg-eng__title { font-size: 1.2rem; }
  .vg-eng__votes { gap: 8px; }
  .vg-eng__vote, .vg-eng__share { padding: 9px 14px; font-size: 0.88rem; }
  .vg-eng__greet { margin-left: 0; width: 100%; margin-top: 6px; font-size: 0.76rem; }
  .vg-eng-modal__card { padding: 22px 18px; }
  .vg-eng-modal__row { grid-template-columns: 1fr; }
  .vg-eng-modal__actions { flex-direction: column-reverse; }
  .vg-eng-modal__cancel, .vg-eng-modal__submit { width: 100%; }
}
