.gallery {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 72rem;
}

@media (min-width: 1024px) {
  .gallery {
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.gallery button {
  border: 0;
}

button.gallery__teaser {
  aspect-ratio: 1;
  background-color: #000000;
  border-radius: 3px;
  cursor: pointer;
  display: inline;
  height: auto;
  overflow: hidden;
  padding: 0;
  position: relative;
}

button.gallery__teaser:focus-visible {
  z-index: 30;
}

button.gallery__teaser:is(:hover, :focus) {
  background-color: #000000;
}

.gallery__teaser img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.gallery__teaser-overlay {
  align-items: center;
  color: #eee6ee;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  font-size: 1rem;
  inset: 0;
  justify-content: center;
  position: absolute
}

.gallery__modal {
  align-items: center;
  background-color: #000000;
  display: none;
  height: 100%;
  justify-content: center;
  left: 0;
  overflow: auto;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 40;
}

@media (min-width: 768px) {
  .gallery__modal {
    background-color: rgba(0, 0, 0, 0.5);
  }
}

.gallery__image {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: 56rem;
  max-width: 80rem;
  width: 100%;
}

@media (min-width: 768px) {
  .gallery__image {
    background-color: white;
    border-radius: 3px;
    height: calc(100vh - 240px);
    position: relative;
    padding: 1.5rem;
    width: 90%;
  }
}

.gallery__thumbnails {
  display: none;
  flex: 1 1 0;
  gap: 0.75rem;
  order: 1;
}

@media (min-width: 768px) {
  .gallery__thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }
}

button.gallery__thumbnail {
  align-items: center;
  background-color: #cecdc7;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  height: auto;
  justify-content: center;
  opacity: 0.5;
  position: relative;
}

button.gallery__thumbnail:is(:hover, :focus) {
  background-color: #cecdc7;
}

button.gallery__thumbnail.active {
  opacity: 1;
}

button.gallery__thumbnail img {
  position: absolute;
  max-height: 100%;
  width: auto;
}

button.gallery__closer {
  align-self: flex-end;
  background-color: transparent;
  border-radius: 0;
  height: 3rem;
  margin-right: 1rem;
  padding: 0.5rem;
  width: 3rem;
}

button.gallery__closer svg path {
  fill: #eee6ee;
}

button.gallery__closer:is(:hover, :focus) {
  background-color: transparent;
}

button.gallery__closer:active {
  background-color: rgba(255, 255, 255, 0.2);
}

@media (min-width: 768px) {
  button.gallery__closer {
    align-self: auto;
    cursor: pointer;
    margin-right: 0;
    position: absolute;
    right: 1rem;
    top: 1rem;
  }

  button.gallery__closer svg path {
    fill: #5a0e56;;
  }

  button.gallery__closer:active {
    background-color: rgba(172, 134, 170, 0.3);
  }

  button.gallery__closer:hover {
    background-color: rgba(172, 134, 170, 0.2);
  }
}

.gallery__items {
  align-items: center;
  display: flex;
  height: 70%;
  margin-inline: auto;
}

@media (min-width: 768px) {
  .gallery__items {
    justify-content: space-between;
    width: 100%;
  }
}

.gallery__items > .gallery__items-visibility {
  display: none;
}

@media (min-width: 768px) {
  .gallery__items > .gallery__items-visibility {
    display: block;
  }
}

.gallery__items button.gallery__prev {
  align-items: center;
  background-color: transparent;
  border-radius: 0;
  display: flex;
  fill: #5a0e56;
  height: 4rem;
  justify-content: center;
  margin-left: auto;
  margin-right: 1rem;
  width: 4rem;
}

.gallery__items button.gallery__prev:hover {
  background-color: rgba(172, 134, 170, 0.2);
}

.gallery__item {
  flex-direction: column;
  height: 100%;
  position: relative;
}

.gallery__item img {
  max-height: 50vh;
  -webkit-user-drag: none;
}

.gallery__item .media-caption {
  color: #eee6ee;
}

.gallery__item .media-caption a {
  color: #eee6ee;
}

.gallery__item .media-caption p {
  border-bottom: 1px solid #eee6ee;
  margin: 1.5rem;
  padding-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .gallery__item img {
    height: 100%;
    max-height: none;
    object-fit: cover;
  }

  .gallery__item .media-caption {
    background-color: #5a0e56;
    bottom: 0;
    position: absolute;
  }

  .gallery__item .media-caption p {
    border-bottom: 0;
    padding-bottom: 0;
  }
}

.gallery__teaser .media-caption,
.gallery__thumbnail .media-caption {
  display: none;
}

.gallery__items button.gallery__next {
  align-items: center;
  background-color: transparent;
  border-radius: 0;
  display: flex;
  fill: #5a0e56;
  height: 4rem;
  justify-content: center;
  margin-left: 1rem;
  margin-right: auto;
  width: 4rem;
}

.gallery__items button.gallery__next:hover {
  background-color: rgba(172, 134, 170, 0.2);
}

.gallery__actions {
  display: flex;
  justify-content: center;
}

@media (min-width: 768px) {
  .gallery__actions > .gallery__items-visibility {
    display: none;
  }
}

.gallery__actions button.gallery__prev {
  align-items: center;
  background-color: transparent;
  border-radius: 0;
  display: flex;
  height: 3rem;
  justify-content: center;
  margin-left: auto;
  margin-right: 1rem;
  width: 3rem;
}

.gallery__actions button.gallery__prev:active {
  background-color: rgba(255, 255, 255, 0.2);
}

.gallery__info {
  align-items: center;
  color: #eee6ee;
  display: flex;
  justify-content: center;
}

@media (min-width: 768px) {
  .gallery__info {
    color: #5a0e56;;
  }
}

.gallery__actions button.gallery__next {
  align-items: center;
  background-color: transparent;
  border-radius: 0;
  display: flex;
  height: 3rem;
  justify-content: center;
  margin-left: 1rem;
  margin-right: auto;
  width: 3rem;
}

.gallery__actions button.gallery__next:active {
  background-color: rgba(255, 255, 255, 0.2);
}

.gallery__actions button.gallery__prev svg path,
.gallery__actions button.gallery__next svg path {
  fill: #eee6ee;
}
