/* ============================
   Cases – Grid (light)
   Fuld opdateret version
   ============================ */

.jb-cases {
  color: #5a5a5a;
  align-self: flex-start;
}

/* Grid: 4 kolonner desktop, 2 på tablet/mobil */
.jb-cases .grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .jb-cases .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .jb-cases .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Card – basis */
.jb-cases .card {
  position: relative;
  background: #fff;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.jb-cases .card__link {
  position: absolute;
  inset: 0;
  z-index: 2;
}

/* ===== Billeder ===== */

/* Sørg for at picture-wrapper holder proportionen */
.jb-cases picture {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2; /* fast højde uanset billedtype */
  overflow: hidden;
  position: relative;
  background: #f5f5f5;
}

/* Selve billedet */
.jb-cases .card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(100%);
  transition: transform 0.35s ease, filter 0.35s ease;
  position: absolute;
  inset: 0;
}

/* Hovereffekt */
.jb-cases .card:hover .card__img,
.jb-cases .card:focus-within .card__img {
  transform: scale(1.04);
  filter: none;
}

/* ===== Indhold ===== */
.jb-cases .card__body {
  padding: 16px;
}

/* Badge */
.jb-cases .badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #338c7e;
  color: #fff;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
}

/* Dato */
.jb-cases .card__date {
  display: block;
  font-size: 14px;
  color: #338c7e;
  margin: 0 0 6px;
}

/* Titel */
.jb-cases .card__title {
  margin: 0 0 6px;
  font-weight: 800;
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.25;
  color: #5a5a5a;
}

/* Uddrag */
.jb-cases .card__excerpt {
  margin: 0 0 12px;
  overflow: hidden;
  line-height: 1.5;
  max-height: calc(1.5em * 4); /* fallback */
}

@supports (-webkit-line-clamp: 4) {
  .jb-cases .card__excerpt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    max-height: none;
  }
}

/* CTA */
.jb-cases .card__cta {
  color: #338c7e;
  font-weight: 700;
  text-decoration: none;
}

/* Hjælpetekst */
.jb-cases .note {
  margin: 8px 0;
}
