/*
 * Heintges partner cards for Web Directory Free 2.x.
 *
 * The former 1.x integration rendered these cards through
 * listing-custom.tpl.php and frontend-custom.css. Version 2.x renders the
 * listing grid client-side, so the supported child-theme CSS hook is used.
 */

.w2dc-dir-cards--grid {
  gap: 20px !important;
}

/* The previous custom template intentionally omitted count/sort/view controls. */
.w2dc-dir-listings-toolbar {
  display: none !important;
}

.w2dc-dir-cards .MuiCard-root {
  background: #fff;
  border: 0 !important;
  border-radius: 10px !important;
  box-shadow: 5px 5px 10px grey !important;
  overflow: hidden;
}

.w2dc-dir-cards .w2dc-listing-content {
  display: block;
  height: 100%;
  padding: 0 !important;
}

.w2dc-dir-cards .w2dc-listing-content__body {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}

.w2dc-dir-cards .w2dc-listing-content__images {
  align-items: center;
  aspect-ratio: 4 / 3;
  background: #fff;
  display: flex;
  justify-content: center;
  margin: 5% auto 0 !important;
  overflow: hidden;
  width: 72%;
}

.w2dc-dir-cards .w2dc-listing-content__images img {
  height: 100% !important;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain !important;
  width: 100% !important;
}

.w2dc-dir-cards .w2dc-listing-content__title {
  font-size: clamp(18px, 1.5vw, 24px);
  line-height: 1.25;
  margin: 9% 0 10%;
  padding: 0 8%;
  text-align: center;
}

body#top .w2dc-dir-cards .w2dc-listing-content__title .w2dc-listing-content__title-link,
body#top .w2dc-dir-cards .w2dc-listing-content__title .w2dc-listing-content__title-link:focus,
body#top .w2dc-dir-cards .w2dc-listing-content__title .w2dc-listing-content__title-link:hover,
body#top .w2dc-dir-cards .w2dc-listing-content__title .w2dc-listing-content__title-link:visited {
  color: #000 !important;
  font-weight: 700;
  text-decoration: none !important;
}

.w2dc-dir-cards .w2dc-listing-content__title-link::after {
  box-sizing: border-box;
  background: #a72c23;
  color: #fff;
  content: "Zur Partnerseite";
  display: block;
  font-size: clamp(14px, 1vw, 17px);
  font-weight: 400;
  margin: 14px auto 0;
  padding: 10px 12px;
  width: min(100%, 220px);
}

.w2dc-dir-cards .w2dc-listing-content__title-link:hover::after,
.w2dc-dir-cards .w2dc-listing-content__title-link:focus::after {
  background: #8f251e;
}

@media (max-width: 768px) {
  .w2dc-dir-cards--grid {
    gap: 12px !important;
  }

  .w2dc-dir-cards .w2dc-listing-content__title {
    font-size: clamp(16px, 3.5vw, 21px);
    margin: 7% 0 8%;
    padding: 0 5%;
  }

  .w2dc-dir-cards .w2dc-listing-content__title-link::after {
    font-size: clamp(12px, 3vw, 16px);
    margin-top: 10px;
    padding: 8px;
  }
}
