/* ============================================================
   Polaroid Pile — production styles
   Works with Elementor Basic Gallery widget (or any container
   of <img> tags) carrying the class "polaroid-pile".
   Background is inherited from the theme/section.
   ============================================================ */

.polaroid-pile,
.polaroid-pile .elementor-widget-container {
  overflow: visible; /* lifted cards must not get clipped */
}

.pp-pile {
  position: relative;
  width: 100%;
}

.pp-card {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(var(--x), var(--y));
  will-change: transform;
  transition: transform .5s cubic-bezier(.22, .9, .28, 1);
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y; /* keeps page scroll natural on touch */
}

.pp-card.pp-dragging {
  transition: none;
  cursor: grabbing;
}

.pp-frame {
  background: #fbfaf7;
  padding: 9px 9px 30px; /* thick bottom edge, no caption */
  border-radius: 2px;
  transform: rotate(var(--r));
  transition: transform .35s cubic-bezier(.2, .85, .3, 1), box-shadow .35s;
  box-shadow:
    0 1px 2px rgba(25, 20, 12, .18),
    0 8px 20px rgba(25, 20, 12, .22);
}

.pp-card:hover .pp-frame,
.pp-card:focus-visible .pp-frame {
  transform: rotate(0deg) scale(1.05);
  box-shadow:
    0 2px 4px rgba(25, 20, 12, .2),
    0 18px 42px rgba(25, 20, 12, .32);
}

.pp-card:focus-visible {
  outline: none;
}
.pp-card:focus-visible .pp-frame {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.pp-frame img {
  display: block;
  width: var(--pp-img);
  height: var(--pp-img); /* square crop, classic polaroid */
  object-fit: cover;
  background: #ded9d0;
  filter: saturate(.94) contrast(1.02);
  margin: 0;
}

/* optional shuffle button — rendered only when the container
   also has the class "pp-shuffle". Alignment comes from
   pp-align-left / pp-align-center / pp-align-right on the
   container (set by the widget's Button alignment control). */
.pp-toolbar {
  margin: 0 0 18px;
  text-align: left;
}
.polaroid-pile.pp-align-center .pp-toolbar { text-align: center; }
.polaroid-pile.pp-align-right  .pp-toolbar { text-align: right; }

.pp-shuffle-btn {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 7px 18px;
  margin: 0;
  cursor: pointer;
  opacity: .75;
  transition: opacity .2s;
}
.pp-shuffle-btn:hover { opacity: 1; }

/* ---------- lightbox ---------- */

.pp-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(14, 12, 9, .88);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 4vmin;
  cursor: zoom-out;
}
.pp-lightbox.pp-open { display: flex; }

.pp-frame-lg {
  background: #fbfaf7;
  padding: 14px 14px 44px;
  border-radius: 2px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: pp-pop .35s cubic-bezier(.2, .85, .3, 1);
}

.pp-frame-lg img {
  display: block;
  max-width: 82vw;
  max-height: 74vh;
  width: auto;
  height: auto;
  margin: 0;
}

@keyframes pp-pop {
  from { transform: scale(.92) rotate(-1.5deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);      opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .pp-card,
  .pp-frame { transition: none; }
  .pp-frame-lg { animation: none; }
}
