@layer block {
  .cards > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-gap: 16px;
  }

  .cards > ul > li {
    border: 1px solid var(--highlight-background-color);
    background-color: var(--background-color);
  }

  .cards .cards-card-body {
    margin: 16px;
  }

  .cards .cards-card-image {
    line-height: 0;
  }

  .cards .cards-card-body > *:first-child {
    margin-top: 0;
  }

  .cards > ul > li img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }

  /* ======== has-hover-copy ========= */
  .cards.has-hover-copy > ul > li {
    display: grid;
  }

  .cards.has-hover-copy > ul > li > div {
    grid-area: 1/1;
  }

  .cards.has-hover-copy .cards-card-body {
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .cards.has-hover-copy li:is(:hover, :focus-visible) .cards-card-body {
    opacity: 1;
    background: color-mix(in srgb, var(--backdrop-color) 60%, var(--clr-black));
    color: var(--clr-white);
    margin: 0;
    padding: var(--gutter-m);
    transition: opacity 0.3s ease;
  }

  /* =====  End of has-hover-copy  ====== */

  /* ======== has-mobile-scroll ========= */
  .cards.has-mobile-scroll > ul {
    display: flex;
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    padding-inline: var(--gutter-m) 0;
  }

  .cards.has-mobile-scroll > ul > li {
    flex: 1 0 90%;
    scroll-snap-align: center;
  }

  .cards.has-mobile-scroll > ul > li:last-of-type {
    margin-inline-end: var(--gutter-m);
  }

  main .section.cards-container:has(.has-mobile-scroll) {
    padding-inline: 0;
  }

  @media (width >= 600px), (min-width: 600px) {
    .cards.has-mobile-scroll > ul > li {
      flex: 1 0 45%;
    }
  }

  @media (width >= 1024px), (min-width: 1024px) {
    .cards.has-mobile-scroll > ul {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
      padding-inline: 0;
    }

    main .section.cards-container:has(.has-mobile-scroll) {
      padding-inline: var(--gutter-m);
    }

    .cards.has-mobile-scroll > ul > li:last-of-type {
      margin-inline-end: 0;
    }
  }

  /* =====  End of has-mobile-scroll  ====== */
}
