body.is-modal {
  overflow: hidden;
}

.pin-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  overflow: auto;
  overflow-anchor: none;
  background: rgba(0, 0, 0, 0.62);
}

.pin-modal[hidden] {
  display: none;
}

.pin-modal-sheet {
  width: min(60rem, 100%);
  max-width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  margin: auto;
  overflow: clip;
  overflow-anchor: none;
  background: #fff;
  border-radius: 16px;
}

.pin-modal-close-hold {
  position: sticky;
  top: 0;
  z-index: 6;
  height: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-right: 0.7rem;
  padding-left: 0.7rem;
  pointer-events: none;
}

.pin-modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  overflow: visible;
  background: #fff;
  color: #211922;
}

.pin-modal-main {
  display: flex;
  flex: 0 0 auto;
  min-height: 0;
}

.pin-modal-close {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin: 0.7rem 0 0;
  padding: 0;
  pointer-events: auto;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: #fff;
  color: #211922;
  font-size: 1.35rem;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.pin-modal-close svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
}

.pin-modal-media {
  position: relative;
  flex: 1.2;
  min-width: 0;
  overflow: hidden;
  background: #f3f3f3;
}

.pin-modal-frame {
  position: relative;
  width: 100%;
}

.pin-modal-media .media-strip {
  touch-action: pan-x pan-y pinch-zoom;
}

.pin-modal-media .media-strip.is-carousel {
  position: relative;
  align-items: flex-start;
  touch-action: pan-x pan-y pinch-zoom;
}

.pin-modal-media .media-strip.is-carousel .media-slide {
  position: relative;
  flex: 0 0 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  min-height: 0;
  overflow: hidden;
}

.pin-modal-media .media-strip.is-carousel .shot-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pin-modal-media > .media-strip:not(.is-carousel) video.shot-media {
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.pin-modal-media .media-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.75rem;
  z-index: 2;
  width: max-content;
  max-width: calc(100% - 0.8rem);
  margin-inline: auto;
  transform: none;
  background: rgba(255, 255, 255, 0.92);
}

.pin-modal-media .media-nub {
  background: #211922;
}

.pin-modal-media .media-dot {
  background: rgba(33, 25, 34, 0.28);
}

.pin-modal-media img,
.pin-modal-media video {
  width: 100%;
  height: auto;
  max-width: none;
  background: #efefef;
}

.pin-modal-copy {
  flex: 0.8;
  min-width: 0;
  overflow: visible;
  padding: 1.35rem 1.2rem 1.5rem;
}

.pin-modal-copy h2 {
  margin: 0 2.2rem 0.45rem 0;
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
}

.pin-modal-byline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  color: #767676;
  font-size: 0.85rem;
}

#pin-modal-byline-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pin-modal-byline > .shot-info {
  position: static;
  flex: 0 0 auto;
  margin-left: auto;
}

.pin-modal-body {
  margin: 0.9rem 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.pin-modal-actions {
  margin: 1.1rem 0 0;
}

.pin-modal-actions a {
  font-weight: 600;
  text-decoration: none;
}

.pin-modal-more {
  background: #fff;
  padding: 0.35rem 0 0.4rem;
}

.pin-modal-more[hidden] {
  display: none;
}

#pin-modal-scroll > .shot.is-ghost .media-slide {
  aspect-ratio: 3 / 4;
  background: #f8e4ec;
}

#pin-modal-scroll > .shot .media-strip:not(.is-carousel) {
  height: auto;
}

#pin-modal-scroll > .shot .media-strip:not(.is-carousel) .media-slide {
  height: auto;
}

#pin-modal-scroll > .shot .media-strip:not(.is-carousel) img.shot-media {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
}

#pin-modal-scroll > .shot .shot-media,
#pin-modal-scroll > .shot .shot-bar,
#pin-modal-scroll > .shot > .shot-info,
#pin-modal-scroll > .shot > .shot-more {
  transition: opacity 0.45s ease;
}

#pin-modal-scroll > .shot:has(.media-strip.is-loading) .shot-bar,
#pin-modal-scroll > .shot:has(.media-strip.is-loading) > .shot-info,
#pin-modal-scroll > .shot:has(.media-strip.is-loading) > .shot-more {
  opacity: 0;
}

#pin-modal-scroll .media-spin {
  display: none;
}

#pin-modal-scroll > .shot.is-ghost .media-slide::after,
#pin-modal-scroll > .shot .media-slide.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    transparent 32%,
    rgba(255, 250, 245, 0.72) 50%,
    transparent 68%
  );
  transform: translate3d(-120%, 0, 0);
  animation: media-sheen 1.8s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  #pin-modal-scroll > .shot.is-ghost .media-slide::after,
  #pin-modal-scroll > .shot .media-slide.is-loading::after,
  #pin-modal-scroll > .shot .shot-media {
    animation: none;
    transition: none;
  }
}

.pin-modal-wait {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 3rem;
  margin: 0 0 0.6rem;
  color: #767676;
  font-size: 0.82rem;
  font-weight: 600;
}

.pin-modal-wait[hidden] {
  display: none;
}

.pin-modal-more > .pin-board {
  margin: 0 0.85rem 1rem;
}

.pin-modal-topic {
  margin: 0;
  padding: 0.85rem 1.15rem 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
}

@media (max-width: 719px) {
  html:has(body.is-modal),
  body.is-modal {
    overflow-x: clip;
  }

  .pin-modal {
    padding: 1.15rem 1rem;
    max-width: 100%;
    overflow-x: clip;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .pin-modal-sheet {
    width: 100%;
    overflow: clip;
  }

  .pin-modal-card,
  .pin-modal-main,
  .pin-modal-media,
  .pin-modal-frame,
  .pin-modal-copy,
  .pin-modal-more {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .pin-modal-topic,
  .pin-modal-byline,
  .pin-modal-body,
  .pin-modal-actions {
    display: none;
  }

  .pin-modal-copy {
    display: block;
    padding: 0.85rem 1.15rem 0.2rem;
  }

  .pin-modal-copy h2 {
    margin: 0;
  }

  .pin-modal-media .media-strip {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .pin-modal-media .media-strip.is-carousel {
    align-items: stretch;
    height: calc(100vh - 12.5rem);
    height: calc(100svh - 12.5rem);
    max-height: calc(100svh - 12.5rem);
  }

  .pin-modal-media .media-strip.is-carousel .media-slide,
  .pin-modal-media .media-strip:not(.is-carousel) .media-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    aspect-ratio: auto;
    min-height: 0;
    overflow: hidden;
  }

  .pin-modal-media .media-strip.is-carousel .media-slide {
    height: 100%;
  }

  .pin-modal-media .media-strip.is-carousel .shot-media,
  .pin-modal-media > .media-strip:not(.is-carousel) video.shot-media,
  .pin-modal-media .shot-media {
    position: static;
    inset: auto;
    display: block;
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    max-width: 100%;
    height: auto;
    max-height: calc(100vh - 12.5rem);
    max-height: calc(100svh - 12.5rem);
    margin-inline: auto;
    aspect-ratio: auto;
    object-fit: contain;
  }
}

#pin-modal .media-slide.is-still::after {
  content: none;
  animation: none;
}

#pin-modal .media-slide.is-still > video.shot-media {
  opacity: 1;
}
