.rnw-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  max-width: 1240px;
  margin: 24px auto 40px;
}

.rnw-category-grid .rnw-category-card {
  position: relative;
  display: block;
  min-width: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  isolation: isolate;
  background: #151515;
  color: #fff;
  text-decoration: none;
  border-radius: 2px;
}

.rnw-category-grid .rnw-category-card img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: cover;
  transition: transform 650ms cubic-bezier(.2, .65, .3, 1);
}

.rnw-category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    transparent 30%,
    rgba(0, 0, 0, .35) 60%,
    rgba(0, 0, 0, .9) 100%
  );
}

.rnw-category-caption {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 28px;
  z-index: 2;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .6);
  transition: transform 350ms ease;
}

.rnw-category-title {
  display: block;
  font-family: inherit;
  font-size: clamp(23px, 2.5vw, 34px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.rnw-category-cta {
  display: inline-block;
  margin-top: 12px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, .75);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.rnw-category-card:focus-visible {
  outline: 3px solid #b91c36;
  outline-offset: 4px;
}

.rnw-category-card:focus-visible img {
  transform: scale(1.06);
}

@media (hover: hover) and (pointer: fine) {
  .rnw-category-card:hover img {
    transform: scale(1.06);
  }

  .rnw-category-card:hover .rnw-category-caption {
    transform: translateY(-6px);
  }
}

@media (max-width: 767px) {
  .rnw-category-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rnw-category-grid .rnw-category-card img,
  .rnw-category-caption {
    transition: none;
    transform: none !important;
  }
}
/* Prevent added paragraphs from affecting the layout */
.rnw-category-grid > div {
  min-width: 0;
}

.rnw-category-grid > div > p {
  margin: 0;
  padding: 0;
}

.rnw-category-grid > p:empty,
.rnw-category-grid > br {
  display: none;
}

/* Keep each photo inside its card */
.rnw-category-grid .rnw-category-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--rnw-photo);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 650ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .rnw-category-grid .rnw-category-card:hover::before {
    transform: scale(1.06);
  }
}

.rnw-category-grid .rnw-category-card:focus-visible::before {
  transform: scale(1.06);
}

@media (prefers-reduced-motion: reduce) {
  .rnw-category-grid .rnw-category-card::before {
    transition: none;
    transform: none !important;
  }
}