.gallery-zoom {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.gallery-zoom img {
  outline: 2px solid transparent;
  outline-offset: -2px;
}

.gallery-zoom:hover img {
  outline-color: rgb(var(--accent));
}

.pswp {
  --pswp-bg: rgb(var(--bg));
  --pswp-icon-color: rgb(var(--heading));
  --pswp-icon-color-secondary: rgb(var(--bg));
  --pswp-icon-stroke-color: rgb(var(--bg));
}

.pswp__top-bar {
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-s);
  height: var(--nav-height);
  padding-inline: var(--wrap-pad);
  border-bottom: 1px solid rgb(var(--line));
  background: rgb(var(--bg));
}

.pswp__counter {
  height: auto;
  margin: 0;
  color: rgb(var(--heading));
  font-family: var(--font-body);
  font-size: var(--text-button);
  line-height: 1;
  opacity: 1;
  margin-right: auto;
}

.pswp__button--zoom {
  height: 2.75rem;
}

.pswp__button--close {
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  opacity: 1;
}

.gallery-close {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  border-bottom: 1px solid rgb(var(--accent));
  color: rgb(var(--heading));
  font-family: var(--font-body);
  font-size: var(--text-button);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pswp__button--close:hover .gallery-close {
  color: rgb(var(--accent-text));
}

.gallery-caption {
  position: absolute;
  margin: 0;
  color: rgb(var(--heading));
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  pointer-events: none;
}

.gallery-caption[hidden] {
  display: none;
}

.gallery-thumbs {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 5.5rem;
  justify-content: safe center;
  gap: var(--space-s);
  padding: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.gallery-thumbs::-webkit-scrollbar {
  display: none;
}

.gallery-thumb {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.gallery-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  outline: 2px solid transparent;
  outline-offset: -2px;
}

.gallery-thumb:hover img,
.gallery-thumb[aria-pressed="true"] img {
  outline-color: rgb(var(--accent));
}

@media (min-width: 40em) {
  .gallery-thumbs {
    grid-auto-columns: 7rem;
  }
}

@media (min-width: 64em) {
  .gallery-thumbs {
    top: calc(var(--nav-height) + 1rem);
    right: 1.5rem;
    bottom: 1.5rem;
    left: auto;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: 7rem;
    align-content: start;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .pswp__button--arrow--next {
    right: 10rem;
  }
}
