/* GALLERY */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding: 8px;
}

.gallery.centered {
  grid-template-columns: 200px;
  justify-content: center;
  gap: 0;
  padding: 0;
}

.gallery li {
  list-style: none;
  text-align: center;
}

.gallery li a {
  text-decoration: none;
  display: inline-block;
}

.gallery li a img {
  width: 100%;
  height: auto;
  aspect-ratio: 1/1;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery li a img:hover {
  transform: scale(1.05);
}

.title {
  display: block;
  font: var(--font-legend);
  color: var(--fdrx-dark)
  padding: 5px 0;
  max-width: 100%;
}

.title a {
  text-decoration: underline;
}

@media screen and (max-width: 400px) {
  .gallery {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 5px;
  }
  .gallery li a img {
    max-height: 150px;
  }
  .title {
    font: var(--font-small);
  }
}

/* POPUP */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-content {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  background-color: var(--fdrx-white);
  box-sizing: border-box;
}

.popup-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
  vertical-align: bottom;
}

.popup-close {
  position: absolute;
  top: -30px;
  right: -15px;
  font-size: 30px;
  color: white;
  cursor: pointer;
  padding: 0 10px;
  border-radius: 50%;
}

@media screen and (max-width: 600px) {
  .popup-content {
    max-width: 95%;
    max-height: 100%;
    margin: 0 auto;
    padding: 0;
  }

  .popup-content img {
    width: 100%;
    height: auto;
    max-height: 100vh;
    object-fit: contain;
  }

}