/*
 * Cards Block (Maß & Moritz)
 * Look taken 1:1 from the old Customizer rules for .cust-imgbox-row.
 * "body" prefix + !important on li/p: the theme sets
 * `.entry-content ul li { font-weight: 200 !important }` plus a li:before bullet.
 */

body .mm-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}

body .mm-cards .mm-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  background: #fff;
  box-shadow: rgba(99, 99, 99, 0.2) 0 2px 8px 0;
}

body .mm-cards .mm-card::before {
  content: none !important;
  display: none !important;
}

/* The actual fix: always square, cropped from the centre, no max-height. */
body .mm-cards .mm-card__img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
}

body .mm-cards .mm-card__body {
  padding: 20px;
}

body .mm-cards .mm-card__title {
  /* 20px below = old h4 margin + the 10px flex gap of the old group */
  margin: 10px 0 20px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: #1e3c50;
  hyphens: auto;
}

body .mm-cards .mm-card__text {
  margin: 0;
  font-size: 15px;
  font-weight: 200 !important;
  line-height: 1.4;
  color: #000;
}

/* Whole card clickable, focus ring on the card. */
body .mm-cards .mm-card__link {
  color: inherit;
  text-decoration: none;
}

body .mm-cards .mm-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
}

body .mm-cards .mm-card__link:focus {
  outline: none;
}

body .mm-cards .mm-card--link:hover .mm-card__title {
  text-decoration: underline;
}

body .mm-cards .mm-card--link:has(.mm-card__link:focus-visible) {
  outline: 3px solid #1e3c50;
  outline-offset: 3px;
}

.mm-cards-empty {
  padding: 20px;
  border: 1px dashed #999;
  text-align: center;
}

@media (max-width: 991px) {
  body .mm-cards {
    gap: 15px;
  }

  body .mm-cards .mm-card__body {
    padding: 10px 15px 15px;
  }
}

@media (max-width: 767px) {
  body .mm-cards {
    grid-template-columns: 1fr;
    gap: 25px;
  }
}
