#gallery {
  position: relative;
  width: calc(100vw - var(--side-margin) * 2);
  height: 80vh;
  margin: 0 var(--side-margin) 0 var(--side-margin);
  display: flex;
  justify-content: center;
  align-items: center;
}

.rectangle-image {
  position: absolute;
  cursor: zoom-in;
  pointer-events: auto;
  max-width: calc(100vw - var(--side-margin) * 2);
  border-radius: var(--border-radius);
  width: auto;
  height: 80vh;
  top: 0;
  align-self: center;
  object-fit: cover;
  opacity: 0;
}

.portrait-image {
  position: absolute;
  cursor: zoom-in;
  pointer-events: auto;
  border-radius: var(--border-radius);
  max-width: calc(100vw - var(--side-margin) * 2);
  top: 0;
  height: 80vh;
  object-fit: cover;
}

.landscape-image {
  position: absolute;
  cursor: zoom-in;
  pointer-events: auto;
  border-radius: var(--border-radius);
  top: 0;
  width: calc(100vw - var(--side-margin) * 2);
  object-fit: cover;
}

h2 {
  padding-top: 10%;
}

.fade-in {
  animation: fadeIn 3.5s ease-in-out forwards;
}

.fade-out {
  animation: fadeOut 3.5s ease-in-out forwards;
}

@keyframes fadeIn {
  from {
      opacity: 0;
  }
  to {
      opacity: 1;
  }
}

@keyframes fadeOut {
  from {
      opacity: 1;
  }
  to {
      opacity: 0;
  }
}

@media (max-width: 480px) {
  #gallery {
    height: 50vh;
  }

  .rectangle-image {
    height: auto;
    width: calc(100vw - var(--side-margin) * 2);
  }

  .portrait-image {
    position: absolute;
    top: 0;
    max-width: calc(100vw - var(--side-margin) * 2);
    max-height: 50vh;
    height: auto;
  }
}

@media (max-width: 980px) and (min-width: 481px) {
  #gallery {
    height: 80vh;
  }

  .rectangle-image {
    height: auto;
    max-width: calc(100vw - var(--side-margin) * 2);
    max-height: 80vh;
  }

  .portrait-image {
    position: absolute;
    top: 0;
    max-width: calc(100vw - var(--side-margin) * 2);
    max-height: 70vh;
    height: auto;
  }
}