/* The role proposal card (components/proposal.js). */

/* ---------- ROLE PROPOSAL MODAL ----------
   The proposal art is transparent with cream-outlined olive, gold and
   sienna lettering, so the card is painted the same cream as the
   outline (#f7f3eb) and the lettering stays crisp against it. */
.proposal-card {
  background: #f7f3eb;
  max-width: 520px;
}
.proposal-card .close-modal {
  z-index: 2;
  background: rgba(75, 81, 36, 0.12);
  color: var(--olive-deep);
}
.proposal-card .close-modal:hover { background: rgba(75, 81, 36, 0.24); }
.proposal-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.5rem clamp(1rem, 5vw, 1.75rem) calc(1.75rem + env(safe-area-inset-bottom));
}
/* Size the art to the height the card has left so the unanswered card
   fits without scrolling. --proposal-chrome is everything else in the
   card (padding, answer buttons, Send); 1.2844 is the art's height-to-
   width ratio once the cropped bands below are taken off (1123/794 - 0.13). */
.proposal-card {
  --proposal-max-h: calc(var(--vvh) * 0.92);
  --proposal-chrome: calc(11rem + env(safe-area-inset-bottom));
}
.proposal-art-frame {
  width: min(100%, calc((var(--proposal-max-h) - var(--proposal-chrome)) / 1.2844));
  margin: 0 auto;
}
/* The art has an empty band above the first line; crop it so the
   message starts near the top of the card. The % margins resolve
   against the frame, which is the art's width. */
.proposal-art {
  display: block;
  width: 100%;
  height: auto;
  margin-top: -9%;
  margin-bottom: -4%;
  pointer-events: none;
  user-select: none;
}
@media (min-width: 640px) {
  .proposal-card { --proposal-max-h: 88vh; }
}
/* Once answered, the card is just the art: no answer buttons, reply or Send,
   so it doesn't need to leave room for them. */
.proposal-card.is-view-only { --proposal-chrome: calc(3.5rem + env(safe-area-inset-bottom)); }
.proposal-card.is-view-only .proposal-choices,
.proposal-card.is-view-only .proposal-reply,
.proposal-card.is-view-only .submit-btn,
.proposal-card.is-view-only #proposalStatus {
  display: none;
}

.proposal-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  position: relative;
}
.proposal-choice {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.3;
  padding: 0.8em 0.6em;
  border-radius: 50px;
  border: 1px solid var(--olive);
  background: transparent;
  color: var(--olive-deep);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}
.proposal-choice.is-no { border-color: var(--sienna); color: var(--sienna); }
.proposal-choice:hover { background: rgba(99, 107, 47, 0.08); }
.proposal-choice.is-no:hover { background: rgba(166, 63, 0, 0.08); }
.proposal-choice.is-yes.is-selected {
  background: var(--olive);
  color: var(--cream);
}
.proposal-choice.is-no.is-selected {
  background: var(--sienna);
  color: var(--cream);
}
.proposal-reply {
  margin: 1.25rem 0 0;
  text-align: center;
  animation: rsvp-thankyou-in 0.4s ease;
}
.proposal-reply[hidden] { display: none; }

/* Same note style as the RSVP form's decline / joyful messages. */
.proposal-reply p {
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--sienna);
  text-align: left;
  background: rgba(166, 63, 0, 0.07);
  border-radius: 12px;
  padding: 0.75em 1em;
  margin: 0 0 1rem;
}
#proposalYes p {
  color: #8A6500;
  background: rgba(219, 164, 0, 0.14);
}
.proposal-reply .form-group { margin-bottom: 0.5rem; }
.proposal-reply textarea { min-height: 96px; }
.proposal-card .submit-btn { margin-top: 1.25rem; }
.proposal-card .submit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.proposal-card .submit-btn:disabled:hover { background: linear-gradient(135deg, var(--olive), var(--olive-mid)); }
.proposal-card .submit-btn:disabled:hover svg { transform: none; }
@media (max-width: 380px) {
  .proposal-choices { grid-template-columns: 1fr; }
  /* Stacked answer buttons take one more row. */
  .proposal-card { --proposal-chrome: calc(14.25rem + env(safe-area-inset-bottom)); }
}
