/* Shared Motion Effect treatment for public invitations and template demos. */
.theme-motioneffect {
  color: #17362b;
  background: #f5f8ef;
}

.theme-motioneffect .cover,
.theme-motioneffect .hero {
  isolation: isolate;
  color: #fff;
  overflow: hidden;
  background: #f8f6ee;
}

.theme-motioneffect .motion-palace-scene {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  border: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.theme-motioneffect .cover::after,
.theme-motioneffect .hero::after {
  content: '';
  position: absolute;
  z-index: 0;
  inset: 0;
  background: linear-gradient(180deg, #fff8eb12, #183e3226);
  pointer-events: none;
}

.theme-motioneffect .hero {
  overflow: hidden;
  position: relative;
  background-attachment: scroll;
}

@media (max-width: 600px) {
  .theme-motioneffect .cover,
  .theme-motioneffect .hero {
    align-content: start;
  }

  .theme-motioneffect .cover {
    overflow-y: auto;
  }

  .theme-motioneffect .motion-palace-scene {
    top: 0;
    transform: translateX(-50%);
  }

  body.theme-motioneffect :is(.cover-box,.cover-card,.hero-content,.hero > .container) {
    width: calc(100% - 32px);
    margin: calc(100vw * 1107 / 1421 + 20px) auto 32px !important;
  }
}

.theme-motioneffect .cover-card,
.theme-motioneffect .cover-box,
.theme-motioneffect .hero > .container,
.theme-motioneffect .hero-content {
  position: relative;
  z-index: 2;
}

body.theme-motioneffect.motion-gate-pending :is(.cover-card,.cover-box,.hero > .container,.hero-content) {
  opacity: 0 !important;
  pointer-events: none;
  transform: translateY(22px);
  animation: none !important;
}

body.theme-motioneffect.motion-gate-open :is(.cover-card,.cover-box,.hero > .container,.hero-content) {
  animation: motionEffectArrive 1.15s cubic-bezier(.2, .7, .25, 1) both;
}

body.theme-motioneffect :is(.hero-content,.cover-box,.cover-card,.hero > .container) {
  color: #173c32 !important;
  background: transparent !important;
  border: 0 !important;
  padding: 32px 24px;
  box-shadow: none !important;
  max-width: min(620px, calc(100% - 32px));
  backdrop-filter: none;
  text-shadow: 0 1px 12px #fff, 0 0 24px #fff !important;
}

body.theme-motioneffect .countdown div,
body.theme-motioneffect .count-item {
  color: #173c32 !important;
  background: #fffdf842 !important;
  border-color: #28604b80 !important;
  backdrop-filter: none;
}

body.theme-motioneffect .hero :is(.script,.names),
body.theme-motioneffect .cover :is(.script,.names) {
  color: #173c32 !important;
  -webkit-text-fill-color: currentColor;
  text-shadow: 0 2px 3px #fff, 0 0 18px #fff, 0 0 32px #fff !important;
  font-size: clamp(2.8rem, 6.5vw, 5rem) !important;
  line-height: 1.1;
  margin: 12px 0 18px;
}

@media (min-width: 601px) {
  body.theme-motioneffect :is(.cover-box,.cover-card,.hero-content,.hero > .container) {
    margin-top: clamp(40px, 9vh, 90px) !important;
  }
}

body.theme-motioneffect .hero :is(.date,.eyebrow),
body.theme-motioneffect .cover .eyebrow {
  color: #204b3b !important;
}

.theme-motioneffect .hero .ornament {
  display: none;
}

.theme-motioneffect .section,
.theme-motioneffect .section.alt {
  color: #17362b;
  background: #f5f8ef;
}

.theme-motioneffect .section.alt {
  background: #e7f0de;
}

.section {
  position: relative;
}

.section > .container {
  position: relative;
  z-index: 1;
}

.theme-motioneffect .section-title {
  color: #204e37;
}

.theme-motioneffect .event-card,
.theme-motioneffect .gift-card,
.theme-motioneffect .wish-card,
.theme-motioneffect .demo-card,
.theme-motioneffect .wish {
  color: #17362b;
  border: 1px solid #c9dcc0;
  background: #fff;
  box-shadow: 0 18px 42px #173e3217;
}

.theme-motioneffect .closing {
  color: #fff;
  background: linear-gradient(135deg, #102e28, #357046);
}

.theme-motioneffect .btn-theme {
  color: #fff;
  background: #22573d;
}

.theme-motioneffect .template-preview,
.preview-motioneffect {
  background: linear-gradient(90deg, #103d30a6, #103d3066), url('../img/motion-effect-castle.png') center / cover;
  color: #fff;
}

.preview-motioneffect::before,
.preview-motioneffect::after {
  display: none;
}

.preview-motioneffect .preview-button {
  background: #b9db89;
  color: #17362b;
}

.motion-effect-text {
  transition: opacity 1s ease, translate 1s cubic-bezier(.2, .7, .25, 1);
  transition-delay: var(--motion-text-delay, 0ms);
}

.motion-effect-text:not(.is-visible) {
  opacity: 0 !important;
  translate: 0 22px;
}

.motion-effect-text.is-visible {
  translate: 0 0;
}

.motion-effect-item {
  transition: opacity .9s ease, translate .9s cubic-bezier(.2, .7, .25, 1);
  transition-delay: var(--motion-item-delay, 0ms);
}

.motion-effect-item:not(.is-visible) {
  opacity: 0 !important;
  translate: 0 36px;
}

.motion-effect-item.is-visible {
  translate: 0 0;
}

.motion-effect-flower {
  position: absolute;
  z-index: 0;
  top: 13%;
  right: 3%;
  width: 125px;
  height: 125px;
  opacity: 0;
  transform: scale(.2) rotate(-35deg);
  transition: opacity 1s ease, transform 1.2s cubic-bezier(.15, .8, .3, 1.25);
  pointer-events: none;
}

.motion-effect-flower-left {
  right: auto;
  left: 3%;
}

.motion-effect-flower.is-visible {
  opacity: .72;
  transform: scale(1) rotate(0);
}

.motion-effect-bloom {
  position: absolute;
  inset: 0;
  transform-origin: center;
}

.motion-effect-flower.is-visible .motion-effect-bloom {
  animation: motionFlowerSpin 14s linear 1.2s infinite;
}

.motion-effect-flower-left.is-visible .motion-effect-bloom {
  animation-direction: reverse;
}

@keyframes motionFlowerSpin {
  to { transform: rotate(360deg); }
}

.motion-effect-petal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 31px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--accent, #68a6db) 70%, #233047);
  border-radius: 70% 70% 70% 8%;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent, #c4b5fd) 48%, white), color-mix(in srgb, var(--primary, #67e8f9) 42%, white));
  transform: translate(-50%, -50%) rotate(var(--petal-angle)) translateY(-13px) scale(.12);
  transform-origin: center;
  transition: transform 1.1s cubic-bezier(.15, .8, .3, 1.25);
  transition-delay: var(--petal-delay, 0ms);
}

.motion-effect-flower.is-visible .motion-effect-petal {
  transform: translate(-50%, -50%) rotate(var(--petal-angle)) translateY(-35px) scale(1);
}

.motion-effect-flower-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #f0bd5c;
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent, #67e8f9) 60%, transparent);
  transform: translate(-50%, -50%);
}

@media (max-width: 767.98px) {
  .motion-effect-flower {
    top: 4%;
    right: 0;
    width: 90px;
    height: 90px;
    transform-origin: right top;
  }

  .motion-effect-flower-left {
    right: auto;
    left: 0;
    transform-origin: left top;
  }
}

@keyframes motionEffectArrive {
  from { opacity: 0; transform: translateY(26px) scale(.98); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-motioneffect .cover-card,
  .theme-motioneffect .cover-box,
  .theme-motioneffect .hero > .container,
  .theme-motioneffect .hero-content,
  .preview-motioneffect::before,
  .preview-motioneffect::after {
    animation: none !important;
  }

  .motion-effect-text {
    opacity: 1 !important;
    translate: none !important;
    transition: none !important;
  }

  .motion-effect-item {
    opacity: 1 !important;
    translate: none !important;
    transition: none !important;
  }

  .motion-effect-flower {
    display: none !important;
  }
}
