.gallery-page {
  max-width: 1824px;
  margin: auto;
  padding: 16px;
  border-radius: 8px;
  background-image: linear-gradient(
    to bottom,
    rgb(0, 0, 0, 0.95) 0%,
    rgb(0, 0, 0, 0.85) 50%,
    rgb(0, 0, 0, 0.65) 100%
  );
  .gallery {
    display: grid;
    grid-template-areas: "gallery-container preview-container";
    grid-template-columns: 1fr 610px;
    gap: 20px;
  }
}

.gallery-title {
  margin-left: 12px;
  font-size: 2rem;
  a {
    font-weight: 900;
  }
}

.gallery-controls {
  margin-left: auto;
  margin-right: 12px;
}

.gallery-container {
  grid-area: gallery-container;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  hr {
    background-color: var(--hr-color-ultra-lite);
  }
}

.gallery-container-title {
  font-style: italic;
  font-size: 1.4rem;
  color: var(--hr-color);
  margin-left: 14px;
}

.gallery-content-container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  row-gap: 12px;
  overflow-y: auto;
  padding-top: 12px;
  margin: auto;
  width: 1745px;
}
.gallery-content-container-user-profile {
  width: 100%;
  margin-left: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  row-gap: 12px;
  padding-top: 12px;
}
.gallery-result {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 12px;
  width: 175px;
  gap: 4px;
  box-sizing: content-box;
  color: var(--hr-color);
}
.checkable-gallery-result {
  cursor: pointer;
  border-radius: 10px;
}
.checkable-gallery-result:hover {
  background-color: var(--hr-color-lite);
}
.gallery-result > div.image {
  grid-area: image;
  position: relative;
  display: flex;
  margin: auto;
  img {
    max-height: 150px;
    max-width: 150px;
    border-radius: 5px;
  }
  .pages-icon {
    position: absolute;
    bottom: -3rem;
    right: -7.4rem;
    height: 12rem;
    width: 30rem;
    scale: 50%;
    background-image: url("../symbols/pages-icon.png");
    background-position: bottom right;
    background-repeat: no-repeat;
  }
  .page-count {
    position: absolute;
    bottom: 20px;
    right: 18px;
    text-align: center;
    color: black;
    width: 19px;
    font-size: 16px;
  }
}
.gallery-result > div.title {
  grid-area: title;
  text-align: center;
  margin: auto;
  width: 150px;
  visibility: visible;
  position: relative;
  display: flex;
  flex-direction: column;
  .submission-title {
    font-size: 1.2rem;
    text-overflow: ellipsis;
    width: 120px;
    margin-left: auto;
    margin-right: auto;
  }
  a {
    color: var(--font-color);
    text-decoration: underline;
  }
  a:hover {
    color: var(--link-color);
  }
}

.gallery-result > div.username {
  grid-area: username;
  text-align: center;
  font-size: 1.1rem;
  a {
    color: var(--link-color);
  }
}

.large-gallery-result {
  display: flex;
  flex-direction: column;
  padding: 12px;
  width: 325px;
  gap: 4px;
}

.large-gallery-result > div.image {
  img {
    margin: auto;
    max-height: 300px;
    max-width: 300px;
    border-radius: 5px;
  }
}

.large-gallery-result > div.title {
  margin: auto;
}

.page-number {
  cursor: pointer;
}

.preview-container {
  grid-area: preview-container;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 650px;
  margin: 10px;

  .image {
    margin-left: auto;
    margin-right: auto;
    img {
      max-height: 600px;
      max-width: 600px;
      border-radius: 5px;
    }
  }
  .title {
    margin-left: auto;
    margin-right: auto;
    font-size: 2.8rem;
    font-family: var(--serif-font);
  }
  .date {
    margin-left: auto;
    margin-right: auto;
    font-size: 1rem;

    font-style: italic;
    margin-top: 2px;
    color: var(--hr-color);
  }
  .username {
    margin-left: auto;
    margin-right: auto;
    font-size: 1.2rem;
  }

  .description {
    color: var(--hr-color-lite);
    font-style: italic;
    font-size: 0.8rem;
    height: 120px;
    -webkit-mask-image: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 1) 75%,
      rgba(0, 0, 0, 0) 100%
    );
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: left;
  }
}

.metadata-icons {
  position: absolute;
  top: -20px;
  left: -20px;
  display: flex;
  flex-direction: row;
}

.rating-icon {
  height: 40px;
  width: 40px;
  scale: 50%;
  background-position: top left;
  background-repeat: no-repeat;
}

.metadata-icon {
  height: 40px;
  width: 40px;
  scale: 50%;
  margin-left: -18px;
  background-position: top left;
  background-repeat: no-repeat;
}

.gallery-column-fade {
  -webkit-mask-image: linear-gradient(
    to top,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 1) 2%,
    rgba(0, 0, 0, 1) 98%,
    rgba(0, 0, 0, 0) 100%
  );
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: left;
}

.submission-checkbox {
  position: absolute;
  right: 2px;
  top: 2px;
  display: none;
}

@media (max-width: 1799px) {
  .gallery-content-container {
    width: 1396px;
  }
}

@media (max-width: 1450px) {
  .gallery-content-container {
    width: 1047px;
  }
}

@media (max-width: 1101px) {
  .gallery-content-container {
    width: 100%;
  }
}
@media (max-width: 992px) {
  .gallery-content-container {
    margin-top: 30px;
    gap: 36px;
    overflow-y: unset;
  }
  .gallery-container {
    overflow-y: unset;
  }
  .gallery-container-title {
    margin-top: 0;
  }
  .gallery-result {
    width: 40%;
    height: auto;
    margin: auto;
  }

  .gallery-result > div.image {
    img {
      max-width: 300px;
      max-height: 300px;
    }
  }
  .rating-icon {
    scale: 75%;
  }
  .metadata-icon {
    scale: 75%;
    margin-left: -9px;
  }

  .gallery-page {
    .gallery {
      grid-template-columns: 100% 0;
    }
  }

  .gallery-column-fade {
    -webkit-mask-image: unset;
    -webkit-mask-repeat: unset;
    -webkit-mask-position: unset;
  }
}

@media (max-width: 768px) {
  .large-gallery-result,
  .gallery-result {
    width: 38vw;
  }
  .gallery-result > div.image {
    width: 100%;
    img {
      max-width: 100%;
      max-height: 100%;
    }
  }
  .gallery-content-container {
    gap: 0;
  }
}
