/* Generic Pearl Doors opening, isolated from Zhibek Gul's native .zg4 scene. */
/* The native Zhibek Gul opening uses this same editorial font, not Playfair. */
@font-face {
  font-family: "ZG Editorial";
  src: url("/assets/fonts/cormorantgaramond.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
.pdg-opening {
  position: fixed;
  inset: 0;
  z-index: 120;
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
  background: #f5ebde;
  color: #574735;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: contain;
}
.pdg-opening.pdg-active { background: transparent; }
.pdg-door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 2;
  overflow: hidden;
  overflow: clip;
  backface-visibility: hidden;
  transform: translate3d(0,0,0);
  pointer-events: none;
}
.pdg-door-left { left: 0; }
.pdg-door-right { right: 0; }
.pdg-door > img {
  position: absolute;
  top: 0;
  width: 200%;
  max-width: none;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  -webkit-user-drag: none;
}
.pdg-door-left > img { left: 0; }
.pdg-door-right > img { right: 0; }
.pdg-door::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(6px,3vw,26px);
  pointer-events: none;
}
.pdg-door-left::after { right: 0; background: linear-gradient(90deg,transparent,#95795b31 72%,#70584448); }
.pdg-door-right::after { left: 0; background: linear-gradient(90deg,#70584448,#95795b31 28%,transparent); }
.pdg-seal-carrier {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  left: 0;
  width: 50%;
  pointer-events: none;
}
.pdg-seal {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 100%;
  width: clamp(86px,23vw,140px);
  aspect-ratio: 2 / 3;
  border: 0;
  margin: 0;
  padding: 0;
  border-radius: 48%;
  appearance: none;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transform: translate3d(-50%,-50%,0);
  transition: transform .24s cubic-bezier(.22,.7,.23,1),filter .24s ease-out;
  animation: pdg-seal-pulse 3.4s ease-in-out infinite;
}
.pdg-seal img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 5px 7px #79604960);
}
.pdg-seal:focus-visible { outline: 3px solid #755e3d; outline-offset: 7px; }
.pdg-opening:not(.pdg-active) .pdg-seal:active {
  animation: none;
  transform: translate3d(-50%,-50%,0) scale(.94);
  filter: brightness(1.13);
}
.pdg-idle {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: rgba(33,27,23,.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .75s ease-in-out;
}
.pdg-idle.is-visible { opacity: 1; }
.pdg-opening .pdg-idle-message {
  position: absolute;
  top: calc(50% - clamp(130px,29vh,190px));
  left: 5%;
  right: 5%;
  margin: 0;
  text-align: center;
  font: 600 clamp(20px,5.4vw,29px)/1.2 "ZG Editorial",Georgia,serif !important;
  letter-spacing: .035em !important;
  color: #fffdf4 !important;
  text-shadow: 0 2px 14px #3c302a,0 0 28px #4a362a !important;
  text-transform: none !important;
  transform: translateY(8px);
  transition: transform .8s cubic-bezier(.18,.7,.2,1);
}
.pdg-opening .pdg-idle.is-visible .pdg-idle-message { transform: translateY(0); }
.pdg-opening .pdg-recipient {
  position: absolute;
  z-index: 4;
  top: calc(50% + clamp(64.5px,17.25vw,105px) + 28px);
  left: 14%;
  right: 14%;
  margin: 0;
  padding: 10px clamp(12px,3vw,22px);
  background: linear-gradient(90deg,rgba(255,253,247,0),rgba(255,253,247,.76) 12%,rgba(255,253,247,.76) 88%,rgba(255,253,247,0)) !important;
  color: #574735 !important;
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 9px #fffef0 !important;
  font: italic 500 clamp(20px,5.4vw,30px)/1.15 "ZG Editorial",Georgia,serif !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  pointer-events: none;
}
.pdg-opening .pdg-recipient[data-pdg-fit='medium'] { font-size: clamp(18px,4.6vw,26px) !important; }
.pdg-opening .pdg-recipient[data-pdg-fit='long'] { font-size: clamp(16px,4vw,23px) !important; }
.pdg-opening .pdg-recipient[data-pdg-fit='xl'] { font-size: clamp(15px,3.4vw,20px) !important; }
.pdg-active .pdg-door-left,
.pdg-active .pdg-seal-carrier {
  animation: pdg-door-left 5.5s cubic-bezier(.4,.02,.16,.99) both;
  will-change: transform;
}
.pdg-active .pdg-door-right {
  animation: pdg-door-right 5.5s cubic-bezier(.4,.02,.16,.99) both;
  will-change: transform;
}
.pdg-active .pdg-seal { animation: none; pointer-events: none; }
.pdg-active .pdg-recipient { animation: pdg-recipient-away .85s ease-in both; }
@keyframes pdg-door-left {
  0%,14% { transform: translate3d(0,0,0); }
  100% { transform: translate3d(calc(-103% - 84px),0,0); }
}
@keyframes pdg-door-right {
  0%,14% { transform: translate3d(0,0,0); }
  100% { transform: translate3d(103%,0,0); }
}
@keyframes pdg-seal-pulse {
  0%,100% { transform: translate3d(-50%,-50%,0) scale(1); }
  50% { transform: translate3d(-50%,-50%,0) scale(1.035); }
}
@keyframes pdg-recipient-away {
  0%,20% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(7px); }
}

/* The first invitation frame is prepared behind the two moving wings. */
.pgx-scope[data-priglo-opening='pearl-doors'] .invite.is-gated.is-opening .invite-body {
  display: block !important;
  height: auto !important;
  min-height: 100dvh !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: none;
}
.pgx-scope[data-priglo-opening='pearl-doors'] .invite.is-gated.is-opening .invite-body > * {
  visibility: visible;
}

/* Admin + editor: portrait art with the same central oval seal. */
.opening-option-pearl-doors {
  position: relative;
  background: #f1e7db url('/frontend/addons/templates/qyz-uzatu-zhibek-gul/v4/assets/pearl-doors.webp') center/cover no-repeat !important;
}
/* The ready-made editor bundle has an Ivory thumbnail fallback for unknown
   styles; display the actual Pearl Doors artwork without rebuilding it. */
.opening-option-pearl-doors > * { visibility: hidden; }
.opening-option-pearl-doors::after {
  content: '';
  position: absolute;
  inset: 25% 31%;
  background: url('/frontend/addons/templates/qyz-uzatu-zhibek-gul/v4/assets/pearl-seal.webp') center/contain no-repeat;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px #79604960);
}
.pdg-thumbnail { position: relative; height: 100%; width: 100%; overflow: hidden; }
.pdg-thumbnail-art { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.pdg-thumbnail-seal { position: absolute; top: 50%; left: 50%; height: 35%; max-height: 96px; width: auto; transform: translate(-50%,-50%); filter: drop-shadow(0 2px 4px #79604960); }

@media (prefers-reduced-motion: reduce) {
  .pdg-seal { animation: none; }
  .pdg-idle,.pdg-idle-message { transition: none; }
  .pdg-active .pdg-door,.pdg-active .pdg-seal-carrier { animation-duration: .01ms !important; }
}
.pdg-fast.pdg-active .pdg-door,.pdg-fast.pdg-active .pdg-seal-carrier { animation-duration: .01ms !important; }
