/**
 * PhotoEZ Theme — Motion design system
 */

/* =============================================
   EDITOR & ACCESSIBILITY — never hide content
   ============================================= */

.elementor-editor-active .pez-reveal,
.elementor-editor-preview .pez-reveal,
.pez-elementor-edit .pez-reveal,
.elementor-editor-active .pez-hero-enter,
.elementor-editor-preview .pez-hero-enter,
.pez-elementor-edit .pez-hero-enter,
.elementor-editor-active .pez-animate-in,
.elementor-editor-preview .pez-animate-in,
.pez-elementor-edit .pez-animate-in {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  transition: none !important;
  animation: none !important;
}

.pez-reduced-motion .pez-reveal,
.pez-reduced-motion .pez-hero-enter,
.pez-reduced-motion .pez-animate-in,
@media (prefers-reduced-motion: reduce) {
  .pez-reveal,
  .pez-hero-enter,
  .pez-animate-in {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
    animation: none !important;
  }
}

/* =============================================
   SCROLL REVEALS
   ============================================= */

.pez-reveal {
  opacity: 0;
  will-change: opacity, transform;
  transition:
    opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--pez-stagger-index, 0) * 85ms);
}

.pez-reveal.pez-in-view {
  opacity: 1;
  transform: none;
  filter: none;
  will-change: auto;
}

.pez-reveal--up {
  transform: translateY(32px);
}

.pez-reveal--down {
  transform: translateY(-32px);
}

.pez-reveal--left {
  transform: translateX(-36px);
}

.pez-reveal--right {
  transform: translateX(36px);
}

.pez-reveal--scale {
  transform: scale(0.92);
  filter: blur(4px);
}

.pez-reveal--fade {
  transform: none;
}

/* Legacy opt-in class */
.pez-animate-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.pez-animate-in.pez-in-view {
  opacity: 1;
  transform: none;
}

/* =============================================
   HERO — load cascade
   ============================================= */

.pez-hero-enter {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--pez-enter-delay, 0ms);
}

.pez-hero-enter--play .pez-hero-enter {
  opacity: 1;
  transform: none;
}

/* =============================================
   GALLERY — hover & entrance polish
   ============================================= */

.pez-gallery-refined .gallery-item,
.pez-gallery-refined .elementor-image-gallery .gallery-item,
.pez-motion-gallery .gallery-item,
.pez-recent-work-gallery .gallery-item,
.pez-gallery-restored .gallery-item {
  overflow: hidden;
  border-radius: var(--pez-radius-lg);
}

/* Gallery thumbnails must stay visible even while other motion runs */
.pez-gallery-refined .gallery-item,
.pez-recent-work-gallery .gallery-item,
.pez-gallery-restored .gallery-item {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

.pez-gallery-refined .gallery-item.pez-reveal,
.pez-recent-work-gallery .gallery-item.pez-reveal {
  opacity: 0;
  transform: scale(0.94);
  filter: blur(3px);
}

.pez-gallery-refined .gallery-item.pez-reveal.pez-in-view,
.pez-recent-work-gallery .gallery-item.pez-reveal.pez-in-view {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

.pez-gallery-refined .gallery-item img,
.pez-gallery-refined .elementor-image-gallery .gallery-item img,
.pez-motion-gallery .gallery-item img {
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.pez-gallery-refined .gallery-item:hover img,
.pez-gallery-refined .elementor-image-gallery .gallery-item:hover img,
.pez-motion-gallery .gallery-item:hover img {
  transform: scale(1.06);
}

.pez-gallery-refined .gallery-item a,
.pez-motion-gallery .gallery-item a {
  display: block;
  overflow: hidden;
  border-radius: inherit;
}

/* =============================================
   TESTIMONIALS & STEPS
   ============================================= */

.pez-testimonial-card {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
}

.pez-testimonial-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.pez-step-grid > div {
  transition: transform 0.35s ease;
}

.pez-step-grid > div:hover {
  transform: translateY(-4px);
}

.pez-step-num {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.pez-step-grid > div:hover .pez-step-num {
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(232, 49, 91, 0.35);
}

/* =============================================
   BUTTONS & INTERACTIVE ELEMENTS
   ============================================= */

.pez-motion-on .elementor-button,
.pez-motion-on .elementor-button-wrapper .elementor-button {
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease,
    background-color 0.3s ease,
    border-color 0.3s ease;
}

.pez-motion-on .elementor-button:hover,
.pez-motion-on .elementor-button-wrapper .elementor-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(232, 49, 91, 0.28);
}

.pez-motion-on .elementor-button:active,
.pez-motion-on .elementor-button-wrapper .elementor-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(232, 49, 91, 0.2);
}

/* =============================================
   PARALLAX IMAGE SECTIONS
   ============================================= */

.pez-bg-image-section.elementor-section {
  background-position: center calc(50% + var(--pez-parallax-y, 0px)) !important;
  transition: background-position 0.1s linear;
}

/* =============================================
   HEADER SCROLL STATE
   ============================================= */

#site-header {
  transition:
    background-color 0.35s ease,
    box-shadow 0.35s ease,
    backdrop-filter 0.35s ease;
}

#site-header.scrolled {
  box-shadow: 0 4px 24px rgba(17, 17, 24, 0.08);
}

/* =============================================
   SECTION STAGGER GROUPS
   ============================================= */

.pez-motion-section .elementor-widget-wrap > .elementor-element.pez-reveal:nth-child(1) { --pez-stagger-index: 0; }
.pez-motion-section .elementor-widget-wrap > .elementor-element.pez-reveal:nth-child(2) { --pez-stagger-index: 1; }
.pez-motion-section .elementor-widget-wrap > .elementor-element.pez-reveal:nth-child(3) { --pez-stagger-index: 2; }
.pez-motion-section .elementor-widget-wrap > .elementor-element.pez-reveal:nth-child(4) { --pez-stagger-index: 3; }
.pez-motion-section .elementor-widget-wrap > .elementor-element.pez-reveal:nth-child(5) { --pez-stagger-index: 4; }
.pez-motion-section .elementor-widget-wrap > .elementor-element.pez-reveal:nth-child(6) { --pez-stagger-index: 5; }
.pez-motion-section .elementor-widget-wrap > .elementor-element.pez-reveal:nth-child(7) { --pez-stagger-index: 6; }
.pez-motion-section .elementor-widget-wrap > .elementor-element.pez-reveal:nth-child(8) { --pez-stagger-index: 7; }

/* Welcome bar */
.pez-welcome-bar .elementor-heading-title {
  transition: opacity 0.8s ease, transform 0.8s ease;
}
