/*
 * Copyright (c) 2025 TechDivision GmbH
 * All rights reserved
 *
 * This product includes proprietary software developed at TechDivision GmbH, Germany
 * For more information see https://www.techdivision.com/
 *
 * To obtain a valid license for using this software please contact us at
 * license@techdivision.com
 */

.cards > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(278px, 1fr));
  grid-gap: var(--spacing-half);
}

.cards > ul > li {
  position: relative;
  border-radius: var(--card-border-radius);
  background-color: var(--color-gray-light);
  overflow: hidden;
}

.cards > ul > li.clickable {
  cursor: pointer;
}

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

.cards .cards-card-image p {
  margin: 0;
}

.cards .cards-card-image > p > a {
  width: 100%;
  display: block;
  padding: 5px 0;
  position: absolute;
  bottom: 0;
  left: 0;
  text-align: center;
  line-height: var(--body-line-height-m);
  color: var(--color-white);
  background-color: var(--color-red);

  &::after {
    bottom: 0.5em;
  }
}

.cards .cards-card-body {
  padding: var(--spacing-simple) var(--spacing-simple) 0;
}

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

.cards .cards-card-body h2 {
  text-align: center;
}

.cards > ul > li .cards-card-body .image-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
}

.cards > ul > li .cards-card-body .image-wrapper p {
  margin-bottom: 0;
}

.cards > ul > li .cards-card-image img {
  width: 100%;
}

.cards > ul > li .cards-card-image:first-child img {
  object-fit: cover;
}

.cards.teaser > ul > li {
  position: relative;
}

.cards.teaser > ul > li .cards-card-image img {
  aspect-ratio: auto;
  object-fit: contain;
}

.cards.teaser > ul > li .cards-card-image:first-child img {
  object-fit: cover;
}

.cards.teaser > ul > li .cards-card-image:nth-of-type(2) {
  position: absolute;
  display: flex;
  justify-content: center;
  width: 100%;
  top: var(--spacing-simple);
}

.cards.teaser > ul > li .cards-card-image:nth-of-type(2) img {
  max-width: 250px;
}

.cards > ul > li > .cards-card-body > .button-container {
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
}

.cards.teaser > ul > li > .cards-card-body > .button-container {
  text-align: center;
}

.cards.third-width > ul,
.cards.half-width > ul {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: var(--spacing-simple);
}

  /* styling half-width cards with brand logo */
.cards.half-width .cards-card-image + .cards-card-image {
  max-width: 80px;
  position: relative;
  padding-right: var(--spacing-simple);
  margin-top: var(--spacing-simple);
  margin-left: auto;
}

@media (width >= 600px) {
  .cards > ul > li > .cards-card-body > .button-container {
    position: absolute;
  }

  .cards > ul > li {
    position: relative;
    padding-bottom: 130px;
  }

  .cards.third-width > ul,
  .cards.half-width > ul {
    grid-template-columns: 1fr 1fr;
  }
}

@media (width >= 900px) {
  .cards.third-width > ul {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .cards.half-width .cards-card-image + .cards-card-image + .cards-card-body {
    padding-right: 110px;
  }

  .cards.half-width .cards-card-image + .cards-card-image {
    position: absolute;
    right: var(--spacing-simple);
    padding-right: 0;
  }
}
