:root {
  --timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  --animation-duration: 250ms;
}

.gallery {
  display: grid;
  max-width: 1140px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  grid-auto-rows: 240px;
  grid-gap: 12px;
  justify-content: center;
  padding: 0;
  list-style: none;
  margin-left: auto;
  margin-right: auto;
}

.gallery__item {
  position: relative;
  box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.2),
    0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 2px 1px -1px rgba(0, 0, 0, 0.12);
}

.gallery__image:hover {
  transform: scale(1.03);
}

.gallery__image {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: transform var(--animation-duration) var(--timing-function);
}

.gallery__link {
  display: block;
  text-decoration: none;
  height: 100%;
}

.gallery__link:hover {
  cursor: zoom-in;
}




/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms linear;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: initial;
}

.lightbox__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
}

.lightbox__content {
  position: absolute;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.9);
  transition: transform 200ms ease-in-out;
}

.lightbox___image {
  width: auto;
  height: auto;
  max-height: 100vh;
  max-width: 100vw;
}

.lightbox.is-open .lightbox__content {
  transform: scale(1);
}

.lightbox__button {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  background-color: transparent;
  color: #fff;
  cursor: pointer;
  transition: background-color 200ms ease-in-out;
  outline: none;
}

.lightbox__button:hover,
.lightbox__button:focus {
  background-color: rgba(0, 0, 0, 0.5);
}

.lightbox__button i {
  font-size: 36px;
}