
main {
  background-image: url("../../images/backgrounds/gallery.webp?v=1789505849");
  background-size: auto;
  background-repeat: repeat;
  background-position: center;
  background-color: #000;
}

main > div {
  background-color: rgba(0, 0, 0, 0) !important;
}

#gallery {
  box-sizing: border-box;
  padding: var(--pagePadding) calc(var(--pagePadding) + var(--pageMargin));
  width: 100%;
  align-self: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 50px;
}

#gallery > h2 {
  align-self: flex-start;
}

#galleryNav {
  width: 100%;
  margin: 0 calc(var(--pagePadding) + var(--pageMargin));
}

#galleryNav ul {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  justify-content: center;
  align-items: center;
  gap: 50px;
}

#galleryNav ul li {
  width: 100%;
  height: 100%;
  aspect-ratio: 1.5/1;
}

#galleryNav a {
  display: flex;
  position: relative;
  height: 100%;
  width: 100%;
  cursor: pointer;
  overflow: hidden;
  min-width: 100px;
  min-height: 100px;
}

#galleryNav a span {
  font-size: clamp(1rem, calc(8px + .7vw), 300px);
}

#galleryNav a:focus-visible {
  z-index: 2;
}

#galleryNav a:hover img, #galleryNav a:focus-visible img {
  transform: scale(1.1);
  filter: brightness(1.1);
}

#galleryNav img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s, filter 0.2s;
  background-color: #000;
  will-change: transform;
  position: relative;
  z-index: 0;
  pointer-events: none;
}

#galleryNav a::after {
  content: "";
  background-color: rgba(0, 0, 0, 0.001);
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 1;
}

#galleryNav span {
  position: absolute;
  bottom: 0;
  left: 0;
  line-height: 1;
  width: 100%;
  background-color: var(--elementBackgroundColorTransparent);
  padding: 2%;
  box-sizing: border-box;
  font-size: clamp(.8rem, calc(.5rem + 1vw), 3rem);
  font-family: Arial, Helvetica, sans-serif;
  text-transform: capitalize;
  backdrop-filter: blur(1px);
  color: rgb(212, 212, 212);
  transition: filter 0.2s;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-all;
}

#galleryNav a:hover span, #galleryNav a:focus-visible {
  filter: brightness(1.1)
}

@media (max-width: 720px) and (orientation: portrait) { 
  #gallery {
    padding: 0 0 50px 0;
  }

  #gallery > h2 {
    align-self: center;
  }

  #galleryNav {
    width: 100%;
    margin: 0;
  }

  #galleryNav ul {
    grid-template-columns: auto;
    gap: 50px;
  }

  #galleryNav ul li {
    width: 80vw;
    height: 80vw;
  }
}

@media (max-width: 950px) and (orientation: landscape) { 
  #gallery {
    padding: 0 0 50px 0;
  }

  #gallery > h2 {
    align-self: center;
  }

  #galleryNav {
    width: 100%;
    margin: 0;
  }

  #galleryNav ul {
    grid-template-columns: auto;
    gap: 50px;
  }

  #galleryNav ul li {
    width: 80vh;
    height: 80vh;
  }
}

  @media (prefers-reduced-motion: reduce) {
    #galleryNav img {
      transition: filter 0.2s linear !important;
    }

    #galleryNav a:hover img, #galleryNav a:focus-visible img {
      transform: scale(1) !important;
    }

    #galleryNav span {
      transition: filter 0.2s linear !important;
    }
  }