.block-cards__card {
  --notch: 92px;
  --curve: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.block-cards__frame {
  position: relative;
  border-radius: var(--curve);
  border-bottom-right-radius: 0;
  overflow: hidden;
  background: var(--ib-bg-soft);
}

.block-cards__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--curve);
}

.block-cards__picture {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 1.1s var(--ib-ease);
}

.block-cards__card:hover .block-cards__picture {
  transform: scale(1.04);
}

.block-cards__blank {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ib-line);
}

.block-cards__blank-glyph {
  width: 42px;
  height: 42px;
}

.block-cards__notch {
  --fill: var(--ib-bg);
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: var(--notch);
  height: var(--notch);
  background: var(--fill);
  border-top-left-radius: 50%;
}

.ib-section--soft .block-cards__notch {
  --fill: var(--ib-bg-soft);
}

.block-cards__notch::before,
.block-cards__notch::after {
  position: absolute;
  content: "";
  width: var(--curve);
  height: var(--curve);
  background: radial-gradient(circle at 0 0, transparent calc(var(--curve) - .5px), var(--fill) var(--curve));
}

.block-cards__notch::before {
  bottom: 6px;
  left: calc(var(--curve) * -1);
  width: calc(var(--curve) + 1px);
}

.block-cards__notch::after {
  top: calc(var(--curve) * -1);
  right: 6px;
  height: calc(var(--curve) + 1px);
}

.block-cards__action {
  position: absolute;
  inset: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--ib-accent);
  color: var(--ib-accent-contrast);
  transition: transform var(--ib-motion) var(--ib-ease), box-shadow var(--ib-motion) var(--ib-ease);
}

.block-cards__card:hover .block-cards__action {
  transform: scale(1.06);
  box-shadow: var(--ib-shadow);
}

.block-cards__arrow {
  width: 22px;
  height: 22px;
  display: block;
  transform: rotate(-45deg);
  transition: transform var(--ib-motion) var(--ib-ease);
}

.block-cards__card:hover .block-cards__arrow,
.block-cards__action:focus-visible .block-cards__arrow {
  transform: rotate(0deg);
}

.block-cards__arrow--glyph,
.block-cards__card:hover .block-cards__arrow--glyph,
.block-cards__action:focus-visible .block-cards__arrow--glyph {
  transform: none;
}

.block-cards__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 8px;
}

.block-cards__title {
  margin: 0;
  font-family: var(--ib-font-display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.25;
}

.block-cards__title a {
  color: inherit;
  text-decoration: none;
}

.block-cards__card--link {
  position: relative;
  cursor: pointer;
}

.block-cards__card--link .block-cards__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.block-cards__card--link .block-cards__title a:focus-visible {
  outline: none;
}

.block-cards__card--link:has(.block-cards__title a:focus-visible) {
  outline: 2px solid var(--ib-accent);
  outline-offset: 4px;
  border-radius: var(--ib-radius);
}

.block-cards__card--link .ib-bookmark--icon {
  z-index: 2;
}

.block-cards__text {
  margin: 0;
  color: var(--ib-muted);
  line-height: 1.6;
}

.block-cards__tags {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.block-cards__tags li {
  padding: 6px 10px;
  border-radius: 3px;
  background: var(--ib-bg-soft);
  font-family: var(--ib-font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ib-fg);
  transition: background var(--ib-motion) var(--ib-ease), color var(--ib-motion) var(--ib-ease);
}

@supports (background: color-mix(in srgb, red 20%, transparent)) {
  .block-cards__tags li {
    background: color-mix(in srgb, var(--ib-accent) 12%, transparent);
    color: var(--ib-accent-ink, color-mix(in srgb, var(--ib-accent) 82%, #000));
  }
}

.block-cards__card:hover .block-cards__tags li {
  color: var(--ib-accent-ink, var(--ib-accent));
}

.block-cards {
  overflow-x: clip;
}

@media (max-width: 640px) {
  .block-cards__notch {
    right: 0;
    bottom: 0;
  }
}

.block-cards--bento .grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.block-cards--bento .grid > * {
  grid-column: span 2;
}

.block-cards--bento .grid > :nth-child(4n + 1),
.block-cards--bento .grid > :nth-child(4n + 4) {
  grid-column: span 4;
}

.block-cards--bento .block-cards__frame {
  flex: 1;
}

.block-cards--bento .block-cards__media {
  height: 100%;
  min-height: 240px;
  aspect-ratio: auto;
}

.block-cards--bento .block-cards__picture {
  position: absolute;
  inset: 0;
}

.block-cards--horizontal .grid > * {
  grid-column: span 6;
}

.block-cards--horizontal .block-cards__card {
  flex-direction: row;
  align-items: stretch;
  gap: 24px;
}

.block-cards--horizontal .block-cards__frame {
  flex: 0 0 42%;
}

.block-cards--horizontal .block-cards__media {
  height: 100%;
  aspect-ratio: 1;
}

.block-cards--horizontal .block-cards__body {
  align-self: center;
}

@media (max-width: 1024px) {
  .block-cards--bento .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .block-cards--bento .grid > *,
  .block-cards--bento .grid > :nth-child(4n + 1),
  .block-cards--bento .grid > :nth-child(4n + 4) {
    grid-column: span 1;
  }

  .block-cards--horizontal .grid > * {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .block-cards--bento .grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .block-cards--bento .block-cards__media {
    aspect-ratio: 4 / 3;
    height: auto;
    min-height: 0;
  }

  .block-cards--bento .block-cards__picture {
    position: static;
  }

  .block-cards--horizontal .block-cards__card {
    flex-direction: column;
    gap: 18px;
  }

  .block-cards--horizontal .block-cards__frame {
    flex: none;
  }

  .block-cards--horizontal .block-cards__media {
    aspect-ratio: 4 / 3;
    height: auto;
  }
}
