/* WOQUE's own "are you sure?" and message boxes (assets/js/woque-dialog.js).
   A sheet from the bottom on a phone, a card in the middle on a computer. Used on member screens and in wp-admin. */
html.woque-ask-open, html.woque-ask-open body { overflow: hidden; }

dialog.woque-ask {
  position: fixed; inset: 0; z-index: 100100; display: flex; align-items: flex-end; justify-content: center;
  width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: transparent;
  color: #24102B; font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 16px; line-height: 1.45;
}
dialog.woque-ask:not([open]) { display: none; }
dialog.woque-ask::backdrop { background: rgba(36, 16, 43, 0.55); animation: woque-ask-fade 0.18s ease; }
dialog.woque-ask *, dialog.woque-ask *::before, dialog.woque-ask *::after { box-sizing: border-box; }

.woque-ask__box {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%;
  max-height: 88vh; max-height: 88svh; overflow-y: auto; overscroll-behavior: contain;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom, 0px)); border-radius: 22px 22px 0 0;
  background: #fff; box-shadow: 0 -12px 40px rgba(36, 16, 43, 0.25); text-align: center;
  animation: woque-ask-rise 0.22s cubic-bezier(.2, .8, .2, 1);
}
.woque-ask__grip { display: block; width: 40px; height: 5px; margin: 0 auto 10px; border-radius: 3px; background: #E6DAEA; }
.woque-ask__icon {
  display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%;
  background: #F1E7F4; color: #2E0F38; font: 700 26px/1 'Bricolage Grotesque', 'Figtree', sans-serif;
}
dialog.woque-ask.is-danger .woque-ask__icon { background: #FBE7E4; color: #9B1C1C; }
dialog.woque-ask[data-kind="alert"] .woque-ask__icon { background: #FFF3D6; color: #8A5A00; }

dialog.woque-ask .woque-ask__title {
  margin: 6px 0 0; padding: 0; font: 700 22px/1.2 'Bricolage Grotesque', 'Figtree', sans-serif; letter-spacing: normal;
  text-transform: none; color: #24102B; overflow-wrap: anywhere;
}
dialog.woque-ask .woque-ask__text { margin: 0; max-width: 34em; font-size: 16px; line-height: 1.5; color: #66546D; overflow-wrap: anywhere; }
dialog.woque-ask .woque-ask__title[hidden], dialog.woque-ask .woque-ask__text[hidden],
dialog.woque-ask .woque-ask__copy[hidden], dialog.woque-ask .woque-ask__btn[hidden] { display: none; }
dialog.woque-ask .woque-ask__copy {
  width: 100%; min-height: 76px; margin: 6px 0 0; padding: 10px 12px; border: 1px solid #E6DAEA; border-radius: 12px;
  background: #FAF6FB; color: #24102B; font: 500 15px/1.4 ui-monospace, Menlo, Consolas, monospace; resize: none;
}

.woque-ask__go { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 14px; }
dialog.woque-ask .woque-ask__btn {
  display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; margin: 0; padding: 0 22px;
  border: 0; border-radius: 14px; font: 700 16px/1.2 'Figtree', system-ui, sans-serif; letter-spacing: normal; text-transform: none;
  cursor: pointer; box-shadow: none; transition: background 0.15s ease;
}
dialog.woque-ask .woque-ask__yes { background: #A3155F; color: #fff; }
dialog.woque-ask .woque-ask__yes:hover { background: #7C0F48; color: #fff; }
dialog.woque-ask.is-danger .woque-ask__yes { background: #9B1C1C; }
dialog.woque-ask.is-danger .woque-ask__yes:hover { background: #7A1414; }
dialog.woque-ask .woque-ask__no { background: #F1E7F4; color: #2E0F38; }
dialog.woque-ask .woque-ask__no:hover { background: #E6DAEA; color: #2E0F38; }
dialog.woque-ask .woque-ask__btn:focus-visible { outline: 3px solid #F2B632; outline-offset: 2px; }

dialog.woque-ask.is-leaving .woque-ask__box { animation: woque-ask-sink 0.16s ease forwards; }
dialog.woque-ask.is-leaving::backdrop { opacity: 0; transition: opacity 0.16s ease; }

/* A computer: a card in the middle, buttons side by side with the main one on the right. */
@media (min-width: 900px) {
  dialog.woque-ask { align-items: center; padding: 24px; }
  .woque-ask__box { max-width: 460px; padding: 30px 30px 26px; border-radius: 22px; box-shadow: 0 24px 60px rgba(36, 16, 43, 0.3); animation-name: woque-ask-pop; }
  .woque-ask__grip { display: none; }
  .woque-ask__go { flex-direction: row-reverse; justify-content: center; }
  dialog.woque-ask .woque-ask__btn { width: auto; min-width: 130px; min-height: 46px; }
  dialog.woque-ask.is-leaving .woque-ask__box { animation-name: woque-ask-shrink; }
}

@keyframes woque-ask-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes woque-ask-rise { from { transform: translateY(100%); } to { transform: none; } }
@keyframes woque-ask-sink { to { transform: translateY(100%); } }
@keyframes woque-ask-pop { from { transform: scale(0.94); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes woque-ask-shrink { to { transform: scale(0.96); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .woque-ask__box, dialog.woque-ask::backdrop { animation: none !important; }
}
