/* Manual project gallery. Values inherit the active page palette. */
.project-gallery {
  position: relative;
  width: 100%;
  overflow: hidden;
  touch-action: pan-y;
}

.gallery-track {
  display: flex;
  width: 100%;
  transition: transform .45s cubic-bezier(.2, .65, .2, 1);
  will-change: transform;
}

.project-gallery.is-previewing .gallery-track,
.project-gallery.is-previewing .gallery-controls,
.proj.is-previewing .gallery-track,
.proj.is-previewing .gallery-controls {
  display: none;
}

.project-gallery.is-previewing .project-preview {
  position: absolute;
  inset: 0;
  z-index: 3;
  height: auto;
  min-height: 0;
}

.gallery-slide {
  flex: 0 0 100%;
  min-width: 0;
  pointer-events: auto;
}

.gallery-slide[aria-hidden="true"] {
  pointer-events: none;
}

.gallery-slide > .shot {
  width: 100%;
  min-height: 260px;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background: var(--bg2, #f3f3f3);
}

.gallery-slide > .shot > .shot-media {
  position: absolute;
  inset: -10% 0;
  width: 100%;
  height: 120%;
}

.gallery-slide .shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  color: var(--fg, #111);
}

.gallery-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line, #dedede);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.gallery-controls button:hover:not(:disabled) {
  background: var(--fg, #111);
  color: var(--bg, #fff);
}

.gallery-controls button:disabled {
  cursor: default;
  opacity: .35;
}

.gallery-status {
  min-width: 42px;
  color: var(--mut, #666);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
  text-align: center;
}

.project-explore {
  display: flex;
  justify-content: flex-end;
  position: absolute;
  z-index: 4;
  right: 16px;
  top: 16px;
}

.project-explore button,
button.project-explore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--line, #dedede);
  border-radius: 999px;
  background: var(--bg, #fff);
  color: var(--fg, #111);
  font: inherit;
  font-size: 12px;
  letter-spacing: .04em;
  cursor: pointer;
}

.project-explore button:hover,
button.project-explore:hover {
  background: var(--fg, #111);
  color: var(--bg, #fff);
}

.project-preview[hidden] {
  display: none;
}

.project-preview {
  width: 100%;
  height: min(72vh, 680px);
  min-height: 280px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  border: 1px solid var(--line, #dedede);
  border-radius: 8px;
  background: var(--bg2, #f3f3f3);
}

.project-preview-image,
.project-preview > img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
}

.project-preview:focus-visible {
  outline: 3px solid var(--acc, #111);
  outline-offset: 3px;
}

@media (max-width: 560px) {
  .gallery-slide > .shot {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .project-preview {
    height: min(70svh, 540px);
    min-height: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-track {
    transition: none;
  }
}
