.type-jinshan #page {
  width: 100%;
  max-width: none;
  margin-top: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Page-level clipping removes transient resize overflow while the photo stage stays visible. */
.type-jinshan {
  overflow-x: clip;
}

.type-jinshan #page .page-title,
.type-jinshan #page-header #page-site-info {
  display: none;
}

.type-jinshan #page-header {
  height: 70px;
  min-height: 70px;
}

.type-jinshan #content-inner {
  width: 100%;
  max-width: none;
  padding-right: 0;
  padding-left: 0;
  padding-top: 0 !important;
}

.jinshan-memory-page {
  --jinshan-page-gutter: var(--site-page-gutter);
  --jinshan-display-leading: var(--site-display-title-leading);
  --jinshan-meta-size: var(--site-eyebrow-size);
  --jinshan-text: rgba(255, 255, 255, 0.95);
  --jinshan-muted: rgba(255, 255, 255, 0.68);
  width: min(1320px, calc(100% - (var(--jinshan-page-gutter) * 2)));
  min-height: calc(100vh - 70px);
  margin: 0 auto;
  padding: 0 0 42px;
  color: var(--jinshan-text);
}

.jinshan-memory-page__hero {
  position: relative;
  z-index: 2;
  /* Keep the photo field origin unchanged while using the shared title leading. */
  padding: var(--page-top-spacing) 0 48.06px;
  text-align: center;
}

.jinshan-memory-page__title {
  --page-enter-distance: 14px;
  margin: 0;
  color: var(--jinshan-text) !important;
  font-size: clamp(36px, 4.8vw, 58px);
  font-weight: 650;
  letter-spacing: -0.06em;
  line-height: var(--jinshan-display-leading);
  text-wrap: balance;
}

.jinshan-memory-page__period {
  --page-enter-distance: 8px;
  margin: 18px 0 0;
  color: var(--jinshan-muted);
  font-size: var(--jinshan-meta-size);
  letter-spacing: 0.16em;
  line-height: 26px;
  white-space: nowrap;
}

.jinshan-memory-field {
  margin-top: 0;
}

/* Runtime placement measures this stage; the title and epilogue remain outside its bounds. */
.jinshan-memory-field__stage {
  position: relative;
  height: clamp(840px, 74vh, 880px);
  min-height: 840px;
}

.jinshan-memory-field__slots {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.jinshan-memory-slot {
  --jinshan-slot-rotation: 0deg;
  box-sizing: border-box;
  position: absolute;
  z-index: 1;
  display: block;
  width: 0;
  height: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0;
  outline: 0;
  transition: z-index 160ms ease;
}

.jinshan-memory-slot[hidden] {
  display: none;
}

.jinshan-memory-slot.is-active {
  opacity: 1;
}

.jinshan-memory-slot.is-entering {
  z-index: 2;
}

.jinshan-memory-slot:hover,
.jinshan-memory-slot:focus-visible {
  z-index: 10;
}

.jinshan-memory-slot:focus-visible .jinshan-memory-card {
  outline: 2px solid rgba(255, 227, 247, 0.78);
  outline-offset: 5px;
}

.jinshan-memory-card {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(var(--jinshan-slot-rotation));
  transform-origin: center;
}

.jinshan-memory-card img {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 233, 249, 0.2);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(8, 4, 17, 0.28);
  object-fit: contain;
}

.jinshan-memory-page__title.page-motion-item-visible {
  animation-duration: 520ms;
}

.jinshan-memory-page__period.page-motion-item-visible {
  animation-delay: 80ms;
  animation-duration: 420ms;
}

.jinshan-memory-lightbox {
  box-sizing: border-box;
  position: fixed;
  z-index: 10050;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 56px 60px 64px;
  background: rgba(12, 7, 18, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.jinshan-memory-lightbox:not([hidden]).is-open {
  opacity: 1;
  pointer-events: auto;
}

.jinshan-memory-lightbox__backdrop {
  position: absolute;
  inset: 0;
}

.jinshan-memory-lightbox__content {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  place-items: center;
}

.jinshan-memory-lightbox__image {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 120px);
  max-height: calc(100vh - 110px);
  max-height: calc(100dvh - 110px);
  border-radius: 10px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
  object-fit: contain;
}

.jinshan-memory-lightbox__counter {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 2;
  color: rgba(255, 250, 255, 0.74);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  line-height: 1;
  transform: translateX(-50%);
}

.jinshan-memory-lightbox__button {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--site-border-subtle);
  border-radius: 50%;
  background: rgba(72, 42, 82, 0.54);
  color: rgba(255, 248, 255, 0.92);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}

.jinshan-memory-lightbox__button:hover,
.jinshan-memory-lightbox__button:focus-visible {
  border-color: rgba(255, 226, 249, 0.66);
  background: rgba(103, 59, 111, 0.7);
}

.jinshan-memory-lightbox__button:focus-visible {
  outline: 2px solid var(--accent-border);
  outline-offset: 3px;
}

.jinshan-memory-lightbox__button--close {
  top: 16px;
  right: 16px;
}

.jinshan-memory-lightbox__button--previous {
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
}

.jinshan-memory-lightbox__button--next {
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
}

body.jinshan-memory-lightbox-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .jinshan-memory-page {
    width: calc(100% - 32px);
  }

  .jinshan-memory-page__hero {
    padding-bottom: 39.22px;
  }

  .jinshan-memory-page__title {
    font-size: clamp(34px, 7.2vw, 46px);
  }

  .jinshan-memory-page__period {
    margin-top: 14px;
  }

  .jinshan-memory-field__stage {
    height: 760px;
    min-height: 760px;
  }
}

@media (max-width: 600px) {
  .jinshan-memory-page {
    width: calc(100% - (var(--site-mobile-gutter) * 2));
    padding-bottom: 28px;
  }

  .jinshan-memory-page__hero {
    padding: 40px 0 34.66px;
  }

  .jinshan-memory-page__title {
    font-size: clamp(30px, 9.4vw, 38px);
    letter-spacing: -0.045em;
  }

  .jinshan-memory-page__period {
    margin-top: 14px;
    letter-spacing: 0.12em;
  }

  .jinshan-memory-field__stage {
    height: 430px;
    min-height: 430px;
  }

  .jinshan-memory-card img {
    border-radius: 10px;
  }

  .jinshan-memory-lightbox {
    padding: 52px 48px 56px;
  }

  .jinshan-memory-lightbox__image {
    max-width: calc(100vw - 72px);
    max-height: calc(100vh - 104px);
    max-height: calc(100dvh - 104px);
  }

  .jinshan-memory-lightbox__button--previous {
    left: 6px;
  }

  .jinshan-memory-lightbox__button--next {
    right: 6px;
  }
}

@media (max-width: 430px) {
  .jinshan-memory-page__hero {
    padding-bottom: 34.57px;
  }

  .jinshan-memory-field__stage {
    height: 410px;
    min-height: 410px;
  }

  .jinshan-memory-lightbox__button {
    width: 38px;
    height: 38px;
  }
}

.jinshan-memory__epilogue {
  max-width: 720px;
  margin: 44px auto 0;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.62);
  font-size: var(--site-reading-size);
  line-height: var(--site-reading-leading);
  text-align: center;
}

@media (max-width: 600px) {
  .jinshan-memory__epilogue {
    margin-top: 36px;
    padding: 0 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jinshan-memory-slot,
  .jinshan-memory-card,
  .jinshan-memory-lightbox,
  .jinshan-memory-lightbox__button {
    transition: none;
  }
}
