/* =============================================================================
 * The Sadiq Project — RSVP button + on-site Tally modal (js/rsvp-modal.js)
 * ========================================================================== */

/* Card actions row: RSVP button + "Get Directions" link */
.z-ue-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}
.z-ue-actions .z-ue-link { margin-top: 0; }

.z-ue-rsvp {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-family: var(--z-font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(31, 64, 21, 0.18);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.z-ue-rsvp:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(31, 64, 21, 0.24); }
.z-ue-rsvp:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- Modal ---------------------------------------------------------------- */
html.z-rsvp-open { overflow: hidden; }

.z-rsvp { position: fixed; inset: 0; z-index: 10001; /* above the AI chat widget (9999) */ display: grid; place-items: center; padding: 1rem; }
.z-rsvp[hidden] { display: none; }

.z-rsvp-backdrop {
  position: absolute; inset: 0;
  background: rgba(22, 46, 15, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 0.22s ease;
}
.z-rsvp.is-open .z-rsvp-backdrop { opacity: 1; }

.z-rsvp-dialog {
  position: relative;
  width: min(640px, 100%);
  max-height: min(92vh, 900px);
  display: flex; flex-direction: column;
  background: var(--bg, #F7F4EE);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  opacity: 0; transform: translateY(14px) scale(0.985);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.z-rsvp.is-open .z-rsvp-dialog { opacity: 1; transform: none; }

/* Header: quiet ivory band, serif title, gold eyebrow */
.z-rsvp-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1.15rem 1.5rem 0.95rem;
  background: var(--bg-white, #fff);
  border-bottom: 1px solid rgba(31, 64, 21, 0.1);
}
.z-rsvp .z-rsvp-eyebrow {
  margin: 0 0 0.15rem;
  font-family: var(--z-font-sans);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent);
}
.z-rsvp .z-rsvp-title {
  margin: 0;
  font-family: var(--z-font-serif);
  font-size: 1.55rem; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em;
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
}
.z-rsvp-close {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: var(--primary-100); color: var(--primary);
  font-size: 0.95rem; cursor: pointer; display: grid; place-items: center;
  transition: background 0.2s ease, color 0.2s ease;
}
.z-rsvp-close:hover { background: var(--primary); color: #fff; }
.z-rsvp-close:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.z-rsvp-body { position: relative; flex: 1 1 auto; min-height: 420px; display: flex; padding: 0.5rem 1rem 0; }
.z-rsvp-frame { flex: 1 1 auto; width: 100%; min-height: 420px; border: 0; background: transparent; opacity: 0; transition: opacity 0.25s ease; }
.z-rsvp-frame.is-ready { opacity: 1; }
.z-rsvp-frame[hidden] { display: none; }

.z-rsvp-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem;
  font-family: var(--z-font-sans); color: var(--ink-muted); pointer-events: none;
}
.z-rsvp-loading[hidden] { display: none; }
.z-rsvp-spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--primary-100); border-top-color: var(--primary);
  animation: z-rsvp-spin 0.8s linear infinite;
}
@keyframes z-rsvp-spin { to { transform: rotate(360deg); } }

/* Load failure (offline, blocked frame, Tally down) */
.z-rsvp-error {
  margin: -0.5rem -1rem 0;
  flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 2.5rem 1.5rem; gap: 0.4rem; font-family: var(--z-font-sans); color: var(--ink-muted);
}
.z-rsvp-error[hidden] { display: none; }
.z-rsvp-error > i { font-size: 2.2rem; color: var(--primary-300); margin-bottom: 0.5rem; }
.z-rsvp-error h3 { margin: 0; font-family: var(--z-font-serif); font-size: 1.7rem; color: var(--ink); }
.z-rsvp-error p { margin: 0 0 1.25rem; max-width: 360px; }
.z-rsvp-error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.z-rsvp-btn.z-rsvp-btn-green { background: var(--primary); color: #fff; display: inline-flex; align-items: center; gap: 0.5rem; }
.z-rsvp-btn.z-rsvp-btn-green:hover { background: var(--primary-hover); }
.z-rsvp-btn.z-rsvp-btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary-100); text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; }
.z-rsvp-btn.z-rsvp-btn-outline:hover { border-color: var(--primary); box-shadow: none; }

/* Our own confirmation, shown after Tally reports the submission */
.z-rsvp-done {
  margin: -0.5rem -1rem 0;
  flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 2.5rem 1.5rem; gap: 0.35rem;
  background: linear-gradient(160deg, var(--primary), var(--primary-700));
  color: #fff;
}
.z-rsvp-done[hidden] { display: none; }
.z-rsvp-check {
  flex: none; box-sizing: border-box; padding: 0;
  width: 92px; min-width: 92px; max-width: 92px; height: 92px; min-height: 92px; max-height: 92px;
  border-radius: 50%; margin-bottom: 1rem;
  background: #fff; color: var(--primary); font-size: 2.2rem; line-height: 1;
  display: grid; place-items: center;
  box-shadow: 0 0 0 10px var(--accent-100), 0 0 0 12px var(--accent);
  animation: z-rsvp-pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}
@keyframes z-rsvp-pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.z-rsvp-done h3 { margin: 0; font-family: var(--z-font-serif); font-size: 2.2rem; font-weight: 700; color: #fff; }
.z-rsvp-done-copy { margin: 0.25rem 0 0; max-width: 380px; font-family: var(--z-font-sans); color: rgba(255, 255, 255, 0.8); }
.z-rsvp-card {
  margin: 1.5rem 0 1.75rem; width: min(100%, 420px);
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  padding: 1.1rem 1.25rem; border-radius: 16px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22);
  font-family: var(--z-font-sans);
}
.z-rsvp-card-title { font-family: var(--z-font-serif); font-size: 1.35rem; color: #fff; }
.z-rsvp-card span { display: inline-flex; align-items: center; gap: 0.5rem; color: rgba(255, 255, 255, 0.88); font-size: 0.95rem; }
.z-rsvp-card span[hidden] { display: none; }
.z-rsvp-card i { color: var(--accent); }
.z-rsvp-btn {
  padding: 0.8rem 1.6rem; border: 0; border-radius: 999px;
  background: #fff; color: var(--primary);
  font-family: var(--z-font-sans); font-weight: 700; font-size: 1rem; cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.z-rsvp-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25); }
.z-rsvp-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.z-rsvp.is-done .z-rsvp-foot { display: none; }
.z-rsvp-foot {
  padding: 0.75rem 1.5rem; text-align: center;
  font-family: var(--z-font-sans); font-size: 0.85rem; color: var(--ink-muted);
  border-top: 1px solid rgba(31, 64, 21, 0.08);
}
.z-rsvp-ext { color: var(--primary); font-weight: 600; text-decoration: none; }
.z-rsvp-ext:hover { color: var(--accent-hover); }

@media (max-width: 640px) {
  .z-rsvp { padding: 0; align-items: end; }
  .z-rsvp-dialog { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .z-rsvp .z-rsvp-title { font-size: 1.3rem; }
  .z-rsvp-head { padding: 1rem 1.1rem 0.85rem; }
  .z-rsvp-body { padding: 0.5rem 0.75rem 0; }
  .z-rsvp-done, .z-rsvp-error { margin: -0.5rem -0.75rem 0; }
  .z-rsvp-done h3 { font-size: 1.8rem; }
}
