/* Ported from 2.1's custom-blocks. The plain row is the base; the overlap look (rotation, offsets,
   stacking order, 4:3 cards) only switches on from 1000px, as in 2.1. */

.note-cards {
  background-color: rgb(var(--color-background));
}

.note-cards__title {
  margin: 0 0 1.5rem;
}

.note-cards__list {
  --note-cards-gap: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--note-cards-gap);
  overflow: visible;
  position: relative;
}

/* Each card is wrapped in its own block <div>, so the row's sizing goes on the wrapper. */
.note-cards__list > *:has(> .note-cards__card) {
  flex: 1 0 calc(
    100% / var(--note-cards-per-row, 3) -
      var(--note-cards-gap, 0px) * (var(--note-cards-per-row, 3) - 1) / var(--note-cards-per-row, 3)
  );
  min-width: 0;
}

.note-cards__card {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  gap: 1rem;
  height: 100%;
  padding: 1rem 1.5rem;
  background: rgb(var(--note-card-bg, 138 138 58));
  color: var(--note-card-text, #f7e9cf);
  text-decoration: none;
}

.note-cards__card-top {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: flex-start;
}

.note-cards__image {
  width: calc(var(--note-cards-image-width, 50%) - 16px);
  margin-inline: auto;
}

.note-cards__image img {
  width: 100%;
  height: auto;
}

.note-cards__mark,
.note-cards__number {
  flex: none;
}

.note-cards__card-title {
  margin: 0 0 0.5rem;
}

.note-cards__content {
  margin: 0;
}

@media screen and (min-width: 1000px) {
  .note-cards__inner--overlap .note-cards__list {
    --note-cards-gap: 0px;
    flex-wrap: nowrap;
    padding-block: 7.5rem;
  }

  .note-cards__inner--overlap .note-cards__card {
    position: relative;
    aspect-ratio: 4 / 3;
    grid-auto-rows: max-content;
    align-content: start;
    justify-items: center;
    transform: translate(var(--note-card-offset-x, 0px), var(--note-card-offset-y, 0px))
      rotate(var(--note-card-rotate, 0deg));
    z-index: var(--note-card-z, 1);
  }
}
