/* Pastor sticky stack: next card rises into the same top slot (no downward drift) */

/* body_wrap overflow:hidden kills position:sticky — open it on History only */
html:has(body.pnt-page-history),
body.pnt-page-history {
  overflow-x: clip;
}
body.pnt-page-history .body_wrap {
  overflow: visible;
}

/*
  Double-header fix: with overflow visible, .header-area.is-sticky (CSS)
  AND the JS-cloned .xb-header-area-sticky both stick. Keep CSS sticky only.
*/
body.pnt-page-history #xb-header-area .xb-header-area-sticky {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
body.pnt-page-history #xb-header-area.header-area.is-sticky {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
}

.pnt-pastor-sticky-stack {
  position: relative;
  width: min(640px, calc(100vw - 2.5rem));
  max-width: 640px;
  margin: 0 auto 1.25rem;
  padding: 0 0 0.5rem;
  box-sizing: border-box;
  /* do not set overflow or transform here — breaks sticky */
}

/* Stays near bottom of the viewport while the pastor stack is scrolling */
.pnt-pastor-keep-scroll {
  position: sticky;
  top: calc(100dvh - 3.75rem);
  z-index: 50;
  height: 0;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.pnt-pastor-keep-scroll span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(23, 0, 6, 0.86);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(23, 0, 6, 0.22);
  animation: pnt-pastor-keep-bounce 1.6s ease-in-out infinite;
}
.pnt-pastor-keep-scroll span::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.95;
}
@keyframes pnt-pastor-keep-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .pnt-pastor-keep-scroll span {
    animation: none;
  }
}

.pnt-pastor-sticky-card {
  position: sticky;
  /* optically center under the single sticky header */
  top: max(5.5rem, calc(50vh - min(42vh, 340px)));
  z-index: 1;
  width: 100%;
  /* room for the next card to rise fully into this slot */
  margin: 0 auto 58vh;
  padding: 0.65rem 0.65rem 1rem;
  border-radius: 22px;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid rgba(23, 0, 6, 0.06);
  box-shadow: 0 16px 48px rgba(23, 0, 6, 0.14);
}

/* Last card: enough hold to cover the previous pastor, then release into next section */
.pnt-pastor-sticky-card:last-of-type {
  margin-bottom: 22vh;
}

/* keep-scroll is child 1; cards start at child 2 — later cards must sit above earlier ones */
.pnt-pastor-sticky-card:nth-child(2) { z-index: 1; }
.pnt-pastor-sticky-card:nth-child(3) { z-index: 2; }
.pnt-pastor-sticky-card:nth-child(4) { z-index: 3; }
.pnt-pastor-sticky-card:nth-child(5) { z-index: 4; }
.pnt-pastor-sticky-card:nth-child(6) { z-index: 5; }
.pnt-pastor-sticky-card:nth-child(7) { z-index: 6; }
.pnt-pastor-sticky-card:nth-child(8) { z-index: 7; }
.pnt-pastor-sticky-card:nth-child(9) { z-index: 8; }
.pnt-pastor-sticky-card:nth-child(10) { z-index: 9; }
.pnt-pastor-sticky-card:nth-child(11) { z-index: 10; }
.pnt-pastor-sticky-card:nth-child(12) { z-index: 11; }
.pnt-pastor-sticky-card:nth-child(13) { z-index: 12; }
.pnt-pastor-sticky-card:nth-child(14) { z-index: 13; }
.pnt-pastor-sticky-card:nth-child(15) { z-index: 14; }
.pnt-pastor-sticky-card:nth-child(16) { z-index: 15; }
.pnt-pastor-sticky-card:nth-child(17) { z-index: 16; }
.pnt-pastor-sticky-card:nth-child(18) { z-index: 17; }

.pnt-pastor-stack-card__media {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #f3f1ea;
  margin: 0 0 0.85rem;
}

.pnt-pastor-stack-card__media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(58vh, 560px);
  object-fit: contain;
  object-position: center center;
  background: #f3f1ea;
  margin-inline: auto;
}

.pnt-pastor-stack-card__media--portrait img {
  object-position: center top;
  max-height: min(62vh, 600px);
}

.pnt-pastor-sticky-card h4,
.pnt-pastor-sticky-card p {
  padding-left: 0.85rem;
  padding-right: 0.85rem;
  text-align: center;
}

.pnt-pastor-sticky-card h4 {
  color: #781921;
  font-size: 1.45rem;
  margin: 0 0 0.35rem;
}

.pnt-pastor-sticky-card p {
  color: #5c5c54;
  margin: 0;
  padding-bottom: 0.35rem;
  line-height: 1.55;
  font-size: 1.05rem;
}

.pnt-pastor-stack-card__zoom {
  display: block;
  position: relative;
  cursor: zoom-in;
  text-decoration: none;
  color: inherit;
}

.pnt-pastor-stack-card__zoom-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  background: rgba(23, 0, 6, 0.78);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.92;
}

.pnt-pastor-stack-card__zoom:hover .pnt-pastor-stack-card__zoom-hint,
.pnt-pastor-stack-card__zoom:focus-visible .pnt-pastor-stack-card__zoom-hint {
  background: #781921;
}

@media (max-width: 991px) {
  .pnt-pastor-sticky-card {
    top: max(4.75rem, calc(48vh - min(38vh, 280px)));
    margin-bottom: 52vh;
  }
  .pnt-pastor-sticky-card:last-of-type {
    margin-bottom: 18vh;
  }
  .pnt-pastor-stack-card__media img {
    max-height: min(52vh, 440px);
  }
}

@media (max-width: 767px) {
  .pnt-pastor-sticky-stack {
    width: min(100%, calc(100vw - 1.25rem));
    margin-bottom: 0.75rem;
  }
  .pnt-pastor-sticky-card {
    top: max(4.25rem, calc(46vh - min(36vh, 240px)));
    margin-bottom: 48vh;
    padding: 0.45rem 0.45rem 1rem;
    border-radius: 16px;
  }
  .pnt-pastor-sticky-card:last-of-type {
    margin-bottom: 16vh;
  }
  .pnt-pastor-stack-card__media {
    border-radius: 12px;
  }
  .pnt-pastor-stack-card__media img {
    max-height: min(48vh, 360px);
  }
}
