/**
 * GPBox Category Gallery styling
 */

/* Structure */
.category-gallery {
  display: grid;
  row-gap: 1.25rem;
  column-gap: 1.25rem;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(2, 195px);
  justify-items: stretch;
  align-items: stretch;
  grid-auto-flow: dense;

  content-visibility: auto;
  contain-intrinsic-size: auto 410px;
}

.category-gallery__item:first-child {
  grid-column-end: span 2;
  justify-self: start;
}

.category-gallery__item:nth-child(2),
.category-gallery__item:nth-child(5),
.category-gallery__item:nth-child(8),
.category-gallery.small .category-gallery__item:not(:first-child) {
  grid-column-end: span 2;
  justify-self: stretch;
}

.category-gallery__item > a {
  height: 100%;
  width: 100%;
}

.category-gallery__item img {
  height: 100%;
  object-fit: cover;
}

/* Titles */
.category-gallery__content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent 50%);
}

.category-gallery__name {
  width: 75%;
  text-align: left;
  padding: 1rem;
  font-weight: 700;
  color: var(--text-white-clr);
  text-shadow: 0px 0px 20px rgba(0, 0, 0, 0);
}
.category-gallery__item:nth-child(2) .category-gallery__name,
.category-gallery__item:nth-child(5) .category-gallery__name,
.category-gallery__item:nth-child(8) .category-gallery__name {
  width: 50%;
}

.category-gallery__subtitle {
  color: var(--light-grey-clr);
  font-weight: 700;
  font-size: var(--small);
}

/* Image */
.category-gallery__thumbnail {
  overflow: hidden;
  border-radius: 8px;
  border: var(--border);
  height: 100%;
  width: 100%;
}
.category-gallery__thumbnail img {
  height: 100%;
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
  transition: transform 295ms var(--bezier-nobounce);
}

@media (hover: hover) and (pointer: fine) {
  .category-gallery__thumbnail:hover img {
    transform: scale(1.15);
  }
}

/* Accent button small */
.category-gallery__first .btn-accent {
  height: 44px;
  width: 168px;
  padding-left: 0.6rem;
  padding-right: 0.25rem;
}
.category-gallery__first .btn-accent .mr-0875 {
  margin-right: 0px !important;
}

@media screen and (max-width: 37.5rem) {
  .category-gallery {
    row-gap: 1rem;
    grid-template-columns: 1fr;
    grid-template-rows: unset;
    contain-intrinsic-size: auto 746px;
  }

  .category-gallery__item {
    grid-column-end: unset !important;
    justify-self: stretch;
    height: 155px;
  }

  .category-gallery__item:first-child {
    height: unset;
  }

  .category-gallery__item:nth-child(n + 6) {
    display: none;
  }
}

@media screen and (min-width: 37.5rem) and (max-width: 62rem) {
  .category-gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: unset;
  }
  .category-gallery__item {
    grid-column-end: span 1 !important;
    justify-self: stretch;
  }
}
