/* ═══════════════════════════════════════════════════════════
   TALK — the dialogue popup (DOM-113, once the plugs')
   What a named character's TALK opens (js/talk.js, js/contacts.js); the
   crew's popup reuses the shell (css/45-crew.css). The plugs it was built
   for are retired (retire-plugs).

   Linked from index.html in this order; the cascade depends on it.
   ═══════════════════════════════════════════════════════════ */

/* ── TALK POPUP ──
   OVERLAYS.md: z 70, centered, max-w 330px, radius 22, --border-gold,
   scale .22s. Same scale-in pattern as the engage modal (DOM-112). */
#talk-overlay { align-items: center; padding: 18px; }
.talk-modal {
  width: 100%;
  max-width: 330px;
  border: 1px solid var(--border-gold);
  border-radius: var(--r-panel);
  background: var(--overlay-fill);
  box-shadow: var(--modal-shadow);
  overflow: hidden;
  transform: scale(0.94);
  transition: transform .22s;
}
/* Any overlay, not just #talk-overlay: .talk-modal is a shared shell now —
   05-crew.md specifies the crew popup as "same geometry as the plug popup" (now the talk popup),
   and DOM-114 reuses it rather than cloning 60 lines of panel. Scoped to one
   id, the open animation only ever played for the screen that got there first. */
.overlay.open .talk-modal { transform: scale(1); }

.talk-modal-portrait-wrap {
  position: relative;
  height: 288px;
  background: var(--surface);
}
.talk-modal-portrait-wrap img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
/* A face with no art is hidden, but `display: block` above outranks the
   attribute, so the empty img drew a broken-image glyph (bugs-7). */
.talk-modal-portrait-wrap img[hidden] { display: none; }
.talk-modal-scrim {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 80px;
  background: var(--portrait-scrim);
  pointer-events: none;
}
/* The name floats over the art in its own pill rather than sitting in the
   body, so the portrait keeps the full 288px. */
.talk-modal-namewrap {
  position: absolute;
  left: 14px; right: 14px; bottom: 13px;
}
.talk-modal-name {
  display: inline-flex;
  align-items: center;
  background: rgba(8,8,10,0.86);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-pill);
  padding: 9px 16px;
  font-family: var(--display);
  font-size: 21px;      /* JS shrinks toward 14px for long names */
  letter-spacing: 1px;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
}

.talk-modal-body { padding: 17px 18px 18px; }
.talk-modal-moniker {
  font-family: var(--ui);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
}
/* min-height holds the footer still while the four lines vary in length. */
.talk-modal-text {
  margin-top: 11px;
  min-height: 84px;
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-bright);
  text-wrap: pretty;
}
.talk-modal-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.talk-modal-spacer { flex: 1; }
.talk-modal-count {
  font-family: var(--ui);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-label);
}
.talk-later-btn {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--text-mid);
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  padding: 12px 20px;
  cursor: pointer;
  transition: color .16s, border-color .16s;
}
.talk-later-btn:hover { color: var(--text); border-color: var(--border-gold); }

/* NEXT just advances the dialogue and stays secondary; the last line is the
   one that commits the recruit, so .is-final takes the region's one primary.
   When the quest under the talk is claimable, COLLECT is that primary instead and
   .is-final is withheld — one primary per region. */
.talk-modal-cta {
  min-width: 104px;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 1px;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--r-pill);
  padding: 12px 22px;
  cursor: pointer;
  transition: filter .16s, border-color .16s;
}
.talk-modal-cta:hover { border-color: var(--border-gold); }
.talk-modal-cta.is-final {
  background: var(--gold-chrome);
  border-color: transparent;
  color: var(--ink);
}
.talk-modal-cta.is-final:hover { filter: brightness(1.08); }
