* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Helvetica Neue, sans-serif;
  vertical-align: top;
}

img {
  max-width: 100%;
}

.gallery_wrapper {
  position: relative;
}

.gallery {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.gallery_item {
  grid-row: 1;
  grid-column: 1;
  opacity: 0;
  margin-bottom: 0.5rem;
  transition: opacity 0.3s ease-in-out;
}

.gallery_img {
  width: 100%;
  aspect-ratio: 15/9;
  height: auto;
  object-fit: cover;
}

.top {
  object-position: top;
}
.bottom {
  object-position: bottom;
}
.left {
  object-position: left;
}
.right {
  object-position: right;
}

.thumbnails {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.thumbnail_item {
  object-fit: cover;
  width: 100%;
  aspect-ratio: 1;
  opacity: 0.5;
  filter: grayscale(1);
  cursor: pointer;
}

.thumbnail_item:hover {
  opacity: 1;
  filter: grayscale(0);
}

figcaption {
  color: #4b4b4e;
  padding-top: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.make_visible {
  display: block;
  visibility: visible;
  opacity: 1;
  filter: grayscale(0);
  z-index: 1;
}

.caption {
  color: #4b4b4e;
}

.source {
  color: #212121;
}

.source a {
  cursor: pointer;
  color: #212121;
  text-decoration: none;
}

.source a:hover {
  cursor: pointer;
  color: #293299;
}

/* Next & previous buttons */
.prev,
.next {
  z-index: 9999;
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -50px;
  color: white;
  font-weight: bold;
  font-size: 20px;
  border-radius: 0 3px 3px 0;
  user-select: none;
  -webkit-user-select: none;
}

/* Position the "next button" to the right */
.next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

/* On hover, add a black background color with a little bit see-through */
.prev:hover,
.next:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

/* Number text (1/3 etc) */
.numbertext {
  color: #f2f2f2;
  font-size: 12px;
  padding: 8px 12px;
  position: absolute;
  top: 0;
}

@media screen and (max-width: 599px) {
  figcaption {
    padding-top: 4px;
    font-size: 12px;
    line-height: 1.2;
  }
}
