/* Dear Letters — reader popup + emoji reactions for the Notes and Diary walls
   (reaction styles match my-letters.html) */

/* ── Reaction Row ── */
.reaction-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-top: 10px;
  padding: 8px 4px 2px;
  border-top: 1px solid rgba(150, 180, 255, 0.15);
}

.rxn-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 5px;
  border-radius: 10px;
  transition: transform 0.18s ease, background 0.18s ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.rxn-btn:hover {
  transform: scale(1.25);
  background: rgba(120, 160, 255, 0.15);
}

.rxn-btn.voted {
  background: rgba(120, 160, 255, 0.22);
  box-shadow: 0 0 8px rgba(120, 160, 255, 0.35);
}

.rxn-emoji {
  font-size: 22px;
  line-height: 1;
}

.rxn-count {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: rgba(180, 200, 255, 0.65);
  font-weight: 500;
  min-width: 14px;
  text-align: center;
}

.rxn-btn.voted .rxn-count {
  color: #a0c4ff;
}

.rxn-btn::after {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  background: rgba(10, 15, 40, 0.92);
  color: #c8d8ff;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(150, 180, 255, 0.25);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.rxn-btn:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.rxn-toast {
  position: fixed;
  bottom: calc(90px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(12, 18, 45, 0.92);
  border: 1px solid rgba(150, 180, 255, 0.3);
  color: #c8d8ff;
  font-family: 'Inter', sans-serif;
  padding: 9px 22px;
  border-radius: 30px;
  font-size: 14px;
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 9999;
  pointer-events: none;
}

.rxn-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Tap-to-open hint on cards ── */
.open-hint {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  opacity: 0.7;
  margin-top: 8px;
}

/* ── Reader popup ── */
.reader-modal[hidden] {
  display: none;
}

.reader-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.reader-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 2, 15, 0.8);
  backdrop-filter: blur(4px);
}

.reader-box {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow: auto;
  border-radius: 16px;
  background: #141838;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  animation: readerIn 0.25s ease;
}

@keyframes readerIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.reader-close {
  position: sticky;
  top: 8px;
  float: right;
  margin: 8px 8px -44px 0;
  z-index: 3;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(10, 10, 30, 0.6);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

/* The full post inside the popup is the card itself, unclamped and not tilted */
.reader-body > * {
  transform: none !important;
  cursor: default !important;
  margin: 0;
}

.reader-body .clamped {
  display: block !important;
  -webkit-line-clamp: unset !important;
  overflow: visible !important;
  max-height: none !important;
}

.reader-body .open-hint {
  display: none;
}
