.gallery-grid {
  --artwork-height: 280px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 52px 42px;
}

.page-galerie {
  padding-left: 70px;
}

.artwork {
  min-width: 0;
  margin: 0;
}

.artwork-open {
  display: flex;
  width: 100%;
  height: var(--artwork-height);
  padding: 0;
  border: 0;
  background: #fff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.artwork-open img {
  display: block;
  width: auto;
  height: var(--artwork-height);
  max-width: 100%;
  object-fit: contain;
  box-shadow: 0 8px 18px rgb(0 0 0 / 30%);
  transition: transform 0.2s ease;
}

.artwork-open:hover img,
.artwork-open:focus-visible img {
  transform: scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
  .artwork-open img {
    transition: none;
  }
}

.artwork figcaption {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin-top: 8px;
  color: #222;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
}

.artwork-dimensions {
  color: #777;
  font-size: 12px;
}

.empty-gallery {
  grid-column: 1 / -1;
}

.lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: #fff;
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox::backdrop {
  /* background: rgb(67 72 76 / 76%); */
  background: rgb(0 0 0 / 80%);
}

.lightbox-frame {
  display: flex;
  flex-direction: column;
  width: fit-content;
  max-width: calc(100vw - 140px);
}

.lightbox-frame > img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 170px);
  object-fit: contain;
  border: 0;
  box-shadow: none;
}

.lightbox-close,
.lightbox-nav {
  display: grid;
  width: 48px;
  height: 48px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: #5c5c5c;
  cursor: pointer;
  outline: none;
}

.lightbox-close:hover,
.lightbox-close:focus-visible,
.lightbox-nav:hover,
.lightbox-nav:focus-visible {
  color: #c4c6c8;
}

.lightbox-close {
  align-self: flex-end;
  font-size: 55px;
  line-height: 1;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  font-size: 54px;
  line-height: 1;
  transform: translateY(-50%);
}

.lightbox-previous {
  left: 12px;
}

.lightbox-next {
  right: 12px;
}

.lightbox-caption {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  width: 0;
  min-width: 100%;
  margin-top: 10px;
}

.lightbox-caption p {
  margin: 0;
}

.lightbox-caption small {
  display: block;
  color: rgb(255 255 255 / 78%);
}

.lightbox-count {
  flex: 0 0 auto;
}

@media (max-width: 850px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 38px 24px;
  }
}

@media (max-width: 700px) {
  .gallery-grid {
    --artwork-height: 200px;
    gap: 28px 18px;
  }

  .lightbox-frame {
    max-width: calc(100vw - 96px);
  }

  .lightbox-frame > img {
    max-height: calc(100dvh - 150px);
  }

  .lightbox-previous {
    left: 0;
  }

  .lightbox-next {
    right: 0;
  }
}