:root {
  --mt-ref-bg: #f4f8f1;
  --mt-ref-surface: #ffffff;
  --mt-ref-ink: #24322d;
  --mt-ref-muted: #68766f;
  --mt-ref-line: rgba(36, 50, 45, 0.11);
  --mt-ref-green: #0f8f43;
  --mt-ref-soft-green: #e6f5eb;
}

body.page-template-template-referenzen {
  background: var(--mt-ref-bg);
}

.mt-references {
  background: var(--mt-ref-bg);
  color: var(--mt-ref-ink);
  min-height: 70vh;
  padding: 46px 0 96px;
}

.mt-ref-container {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.mt-references .mt-breadcrumb {
  margin: 0 0 18px !important;
}

.mt-ref-hero {
  padding: 0 0 34px;
}

.mt-ref-eyebrow {
  margin: 0 0 12px;
  color: var(--mt-ref-green);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mt-ref-hero h1 {
  max-width: 780px;
  margin: 0;
  color: var(--mt-ref-ink);
  font-size: clamp(34px, 4.2vw, 64px);
  font-weight: 700;
  line-height: 1.04;
}

.mt-ref-hero p:not(.mt-ref-eyebrow) {
  max-width: 700px;
  margin: 20px 0 0;
  color: var(--mt-ref-muted);
  font-size: 18px;
  line-height: 1.65;
}

.mt-ref-index {
  padding: 16px 0 34px;
}

.mt-ref-index .mt-ref-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 24px 0;
  border-top: 1px solid var(--mt-ref-line);
  border-bottom: 1px solid var(--mt-ref-line);
}

.mt-ref-index__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 22px;
  border: 1px solid rgba(15, 143, 67, 0.22);
  border-radius: 999px;
  background: var(--mt-ref-soft-green);
  color: #126b39;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
}

.mt-ref-index__button:hover,
.mt-ref-index__button:focus {
  border-color: rgba(15, 143, 67, 0.4);
  background: #d8f0e1;
  color: var(--mt-ref-green);
}

.mt-ref-projects {
  padding-top: 20px;
}

.mt-ref-group {
  display: grid;
  gap: 22px;
  margin-top: 34px;
}

.mt-ref-group > .mt-ref-eyebrow {
  margin-bottom: -4px;
}

.mt-ref-card {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.08fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--mt-ref-line);
  border-radius: 20px;
  background: var(--mt-ref-surface);
  scroll-margin-top: 110px;
  box-shadow: 0 18px 50px rgba(38, 64, 49, 0.07);
}

.mt-ref-card__media {
  display: flex;
  min-height: 360px;
  background: #e8eee7;
}

.mt-ref-gallery {
  display: grid;
  width: 100%;
  gap: 10px;
  align-content: stretch;
  padding: 12px;
}

.mt-ref-gallery__main,
.mt-ref-gallery__thumbs a {
  display: block;
  overflow: hidden;
  border-radius: 14px;
  background: #dfe7df;
}

.mt-ref-gallery__main {
  min-height: 0;
  aspect-ratio: 4 / 3;
}

.mt-ref-gallery__thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 86px;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

.mt-ref-gallery__thumbs a {
  aspect-ratio: 1 / 1;
}

.mt-ref-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.mt-ref-gallery a:hover img,
.mt-ref-gallery a:focus img {
  transform: scale(1.035);
  filter: saturate(1.05) contrast(1.04);
}

.mt-ref-card__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 4vw, 52px);
}

.mt-ref-card__type {
  margin: 0 0 10px;
  color: var(--mt-ref-green);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.mt-ref-card h2 {
  margin: 0;
  color: var(--mt-ref-ink);
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 650;
  line-height: 1.1;
}

.mt-ref-card__summary {
  margin: 18px 0 26px;
  color: #42524b;
  font-size: 17px;
  line-height: 1.65;
}

.mt-ref-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
  margin: 0;
}

.mt-ref-facts div {
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid var(--mt-ref-line);
}

.mt-ref-facts dt {
  display: block;
  float: none !important;
  margin-bottom: 5px;
  color: #6f7d76;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.mt-ref-facts dd {
  display: block;
  float: none !important;
  margin: 0;
  color: var(--mt-ref-ink);
  font-size: 15px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .mt-references {
    padding: 68px 0 72px;
  }

  .mt-ref-container {
    width: min(100% - 28px, 680px);
  }

  .mt-ref-hero h1 {
    font-size: 36px;
  }

  .mt-ref-hero p:not(.mt-ref-eyebrow) {
    font-size: 16px;
  }

  .mt-ref-card {
    grid-template-columns: 1fr;
    border-radius: 18px;
    scroll-margin-top: 88px;
  }

  .mt-ref-card__media {
    min-height: 0;
  }

  .mt-ref-card__body {
    padding: 26px 22px 30px;
  }

  .mt-ref-card h2 {
    font-size: 27px;
  }

  .mt-ref-card__summary {
    font-size: 16px;
  }

  .mt-ref-facts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .mt-ref-index__button {
    width: 100%;
  }
}
