/* MV_PersonPreview (#415) — the small anchored card a person name-pill opens.
   One warm glance — avatar, name, life dates — and a single "Go to <name>"
   action. White elevated surface ("tint the small things, keep heroes calm"),
   floats above panels, reading overlays, and modals (--z-person-preview). */

.person-preview {
  position: fixed;
  z-index: var(--z-person-preview);
  min-width: 220px;
  max-width: min(300px, calc(100vw - 16px));
  padding: var(--space-sm);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  animation: person-preview-in 180ms var(--ease-out-soft);
}

@keyframes person-preview-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .person-preview {
    animation: none;
  }
}

.person-preview__identity {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Same recipe as the panel avatar: sage circle + serif initials while the
   authenticated photo loads (or forever, when there's no photo). */
.person-preview__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--color-accent-soft);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  color: var(--color-accent);
  font-size: var(--font-size-md);
}

.person-preview__text {
  min-width: 0;
}

.person-preview__name {
  font-family: var(--font-serif);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-preview__dates {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-xxs);
}

.person-preview__go {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  background-color: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

/* Focus keeps the app-wide outline ring (reset.css) — the fill is hover-only
   so the card opens calm even though the action takes focus on mount. */
.person-preview__go:hover {
  background-color: var(--color-accent);
  color: var(--color-surface);
}

@media (hover: none) and (pointer: coarse) {
  .person-preview__go {
    min-height: var(--touch-target-min);
  }
}
