.stills-grid .stills-thumb {
  display: block;
  position: relative;
  color: inherit;
}
.stills-grid .stills-thumb .inner {
  position: relative;
  width: 100%;
  padding-top: 100%;
  overflow: hidden;
}
.stills-grid .stills-thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stills-grid .stills-badge {
  position: absolute;
  top: 0.55rem;
  right: 0.7rem;
  z-index: 1;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M8 5v14l11-7z'/%3E%3C/svg%3E") 54% 50% / 0.7rem no-repeat;
  pointer-events: none;
}
.stills-grid .stills-badge-more {
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 3px -3px 0 rgba(0, 0, 0, 0.35);
}

.stills-viewer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  background: rgba(172, 163, 158, 0.78);
  color: #33302f;
  touch-action: none;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.stills-viewer.is-open {
  display: block;
}
.stills-viewer-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: stretch;
  overflow: hidden;
  padding: 3.1rem 0 3.5rem;
}
.stills-viewer-peek {
  flex: 0 0 12vh;
  width: min(52vw, 46vh);
  max-width: 460px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
  opacity: 0.58;
  filter: brightness(0.94);
}
.stills-viewer-peek:hover {
  opacity: 0.78;
}
.stills-viewer-peek.is-empty {
  flex: 0 0 0;
  width: 0;
  height: 0;
  margin: 0;
  visibility: hidden;
  pointer-events: none;
}
.stills-viewer-peek img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.stills-viewer-peek-prev img {
  object-position: bottom;
}
.stills-viewer-peek-next img {
  object-position: top;
}
.stills-viewer-slide {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 4.4rem 0.85rem;
  min-height: 0;
  container-type: size;
  transition: transform 0.32s ease, opacity 0.32s ease;
}
.stills-viewer-frame {
  flex: 0 1 auto;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stills-viewer-slide:has(.stills-viewer-dots:not(:empty)) .stills-viewer-frame {
  max-height: calc(100% - 1.25rem);
}
.stills-viewer-slide img {
  max-width: min(86vw, 78vh);
  max-height: inherit;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  box-shadow: 0 8px 28px rgba(51, 48, 47, 0.28);
}
.stills-viewer-video {
  position: relative;
  flex: 0 0 auto;
  width: auto;
  height: min(72vh, calc(420px * 16 / 9), calc(100cqh - 1.4rem));
  max-width: min(78vw, 420px);
  aspect-ratio: 9 / 16;
  background: #33302f;
}
.stills-viewer-video iframe,
.stills-viewer-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.stills-viewer-poster {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a center / cover no-repeat;
  cursor: pointer;
  border: 0;
  padding: 0;
  color: #fff;
}
.stills-viewer-poster::after {
  content: "";
  width: 4.2rem;
  height: 4.2rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M8 5v14l11-7z'/%3E%3C/svg%3E") 54% 50% / 1.6rem no-repeat;
}
.stills-viewer-poster span {
  position: absolute;
  bottom: 1rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 4px #000;
}

.stills-viewer-close,
.stills-viewer-nav {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  cursor: pointer;
  color: #efeae4;
  background: #33302f;
  box-shadow: 0 2px 12px rgba(51, 48, 47, 0.35);
}
.stills-viewer-close {
  top: 0.85rem;
  right: 0.9rem;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
}
.stills-viewer-close svg {
  width: 1.2rem;
  height: 1.2rem;
  display: block;
}
.stills-viewer-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 50%;
}
.stills-viewer-nav svg {
  width: 1.4rem;
  height: 1.4rem;
  display: block;
}
.stills-viewer-nav:hover {
  background: #1f1d1c;
}
.stills-viewer-nav[disabled] {
  opacity: 0.28;
  cursor: default;
  box-shadow: none;
}
.stills-viewer-prev { left: 0.7rem; }
.stills-viewer-next { right: 0.7rem; }

.stills-viewer-dots {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  z-index: 3;
}
.stills-viewer-dots:empty {
  display: none;
  margin-top: 0;
}
.stills-viewer-dots span {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: rgba(51, 48, 47, 0.45);
}
.stills-viewer-dots span.is-active {
  background: #33302f;
}

.stills-viewer-meta {
  position: absolute;
  left: 1rem;
  right: 4rem;
  bottom: 0.8rem;
  z-index: 3;
  font-size: 0.85rem;
  color: #33302f;
}
.stills-viewer-hint {
  position: absolute;
  left: 0;
  right: 0;
  top: 1.05rem;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: #33302f;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 3;
}
.stills-viewer-hint.is-visible {
  opacity: 0.85;
}

@media (max-width: 700px) {
  .stills-viewer-slide {
    padding: 0.3rem 2.5rem 0.7rem;
  }
  .stills-viewer-close {
    top: 0.65rem;
    right: 0.55rem;
    width: 1.85rem;
    height: 1.85rem;
  }
  .stills-viewer-close svg {
    width: 1.05rem;
    height: 1.05rem;
  }
  .stills-viewer-nav {
    width: 2rem;
    height: 2rem;
  }
  .stills-viewer-nav svg {
    width: 1.15rem;
    height: 1.15rem;
  }
  .stills-viewer-prev { left: 0.25rem; }
  .stills-viewer-next { right: 0.25rem; }
  .stills-viewer-peek {
    flex-basis: 9vh;
    width: min(58vw, 38vh);
  }
}
