.pile-widget,
.pile-widget * {
  box-sizing: border-box;
}

.pile-card-wrap {
  display: flex;
  width: 100%;
}

.pile-card {
  --pile-speed: 450ms;
  --pile-hover-scale: 1.06;
  position: relative;
  display: block;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  line-height: 0;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--pile-speed) cubic-bezier(.2,.8,.2,1), box-shadow var(--pile-speed) ease, filter var(--pile-speed) ease;
}

.pile-card:focus-visible,
.pile-lightbox button:focus-visible {
  outline: 3px solid rgba(255,255,255,.95);
  outline-offset: 4px;
}

.pile-cover-image {
  display: block;
  width: 100%;
  height: 320px;
  object-fit: cover;
  transition: transform var(--pile-speed) cubic-bezier(.2,.8,.2,1), filter var(--pile-speed) ease;
}

.pile-image-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  transition: background var(--pile-speed) ease;
}

.pile-open-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 50%;
  background: rgba(7,17,11,.35);
  color: #fff;
  opacity: 0;
  transform: translate(-50%, -45%) scale(.88);
  transition: opacity var(--pile-speed) ease, transform var(--pile-speed) cubic-bezier(.2,.8,.2,1), background var(--pile-speed) ease;
  backdrop-filter: blur(8px);
}

.pile-open-icon svg {
  width: 25px;
  height: 25px;
}

.pile-card:hover .pile-open-icon,
.pile-card:focus-visible .pile-open-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.pile-hover-zoom:hover .pile-cover-image { transform: scale(var(--pile-hover-scale)); }
.pile-hover-lift:hover { transform: translateY(-8px); }
.pile-hover-tilt:hover { transform: translateY(-3px) rotate(-.7deg) scale(1.01); }
.pile-hover-bright:hover .pile-cover-image { filter: brightness(1.08) saturate(1.04); }

.pile-badge {
  --pile-badge-x: 18px;
  position: absolute;
  top: 18px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 118px;
  padding: 8px 28px;
  border-radius: 999px;
  background: #0e4c22;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 10px 26px rgba(0,0,0,.16);
}

.pile-badge-right { right: var(--pile-badge-x); }
.pile-badge-left { left: var(--pile-badge-x); }
.pile-badge-center { left: 50%; transform: translateX(-50%); margin-left: var(--pile-badge-x); }

/* The popup gallery must never participate in the normal visitor-page layout.
   It is rendered only after the single cover image is clicked. */
.pile-lightbox,
.pile-lightbox[hidden],
.pile-lightbox:not(.is-rendered) {
  display: none !important;
}

.pile-lightbox.is-rendered {
  display: grid !important;
}

.pile-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  place-items: center;
  overflow: auto;
  padding: clamp(16px, 3vw, 42px);
  background: rgba(5,10,8,.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
  overscroll-behavior: contain;
  backdrop-filter: blur(16px);
}

.pile-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.pile-lightbox-shell {
  display: grid;
  width: 100%;
  min-height: 100%;
  place-items: center;
}

.pile-lightbox-panel {
  position: relative;
  width: min(90vw, 1600px);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 24px;
  background: #0b120e;
  box-shadow: 0 30px 100px rgba(0,0,0,.55);
  transform: translateY(14px) scale(.985);
  transition: transform .32s cubic-bezier(.2,.8,.2,1);
}

.pile-lightbox.is-open .pile-lightbox-panel {
  transform: translateY(0) scale(1);
}

.pile-stage {
  position: relative;
  min-height: min(72vh, 760px);
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.045), transparent 45%),
    #070c09;
}

.pile-slides {
  position: relative;
  width: 100%;
  min-height: inherit;
}

.pile-slide {
  position: absolute;
  inset: 0;
  display: grid;
  margin: 0;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(18px) scale(.99);
  transition: opacity .32s ease, transform .38s cubic-bezier(.2,.8,.2,1);
}

.pile-slide.is-active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.pile-slide-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 78vh;
  margin: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.pile-caption {
  position: absolute;
  right: 20px;
  bottom: 18px;
  left: 20px;
  max-width: 900px;
  margin: 0 auto;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0,0,0,.25);
  color: rgba(255,255,255,.86);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  backdrop-filter: blur(10px);
}

.pile-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 20;
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  background: rgba(255,255,255,.10);
  color: #fff;
  cursor: pointer;
  transition: transform .25s ease, background .25s ease;
  backdrop-filter: blur(10px);
}

.pile-lightbox-close:hover { transform: rotate(90deg); background: rgba(255,255,255,.18); }
.pile-lightbox-close svg { width: 23px; height: 23px; }

.pile-counter {
  position: absolute;
  top: 18px;
  left: 20px;
  z-index: 20;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  background: rgba(0,0,0,.28);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .05em;
  backdrop-filter: blur(10px);
}

.pile-nav {
  position: absolute;
  top: 50%;
  z-index: 18;
  display: grid;
  width: 58px;
  height: 58px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background .22s ease, color .22s ease, transform .22s ease, opacity .22s ease;
  backdrop-filter: blur(12px);
}

.pile-nav:hover { background: #fff; color: #0b120e; transform: translateY(-50%) scale(1.06); }
.pile-prev { left: clamp(12px, 2vw, 28px); }
.pile-next { right: clamp(12px, 2vw, 28px); }
.pile-nav svg { width: 24px; height: 24px; }
.pile-nav:disabled { opacity: .25; cursor: not-allowed; transform: translateY(-50%); }

.pile-dots {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(to top, rgba(0,0,0,.28), rgba(0,0,0,.08));
}

.pile-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  cursor: pointer;
  transition: width .22s ease, border-radius .22s ease, transform .22s ease, background .22s ease;
}

.pile-dot.is-active {
  width: 24px;
  border-radius: 99px;
  background: #fff;
}

body.pile-lock-scroll { overflow: hidden !important; }

@media (max-width: 767px) {
  .pile-lightbox { padding: 10px; }
  .pile-lightbox-panel { width: 100%; border-radius: 18px; }
  .pile-stage { min-height: 70vh; }
  .pile-slide-image { max-height: 72vh; }
  .pile-nav { width: 46px; height: 46px; }
  .pile-nav svg { width: 20px; height: 20px; }
  .pile-prev { left: 8px; }
  .pile-next { right: 8px; }
  .pile-lightbox-close { top: 10px; right: 10px; width: 42px; height: 42px; }
  .pile-counter { top: 12px; left: 12px; }
  .pile-caption { right: 10px; bottom: 10px; left: 10px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .pile-card,
  .pile-cover-image,
  .pile-open-icon,
  .pile-lightbox,
  .pile-lightbox-panel,
  .pile-slide,
  .pile-nav,
  .pile-dot,
  .pile-lightbox-close {
    transition: none !important;
  }
}
