/* ============== CGDW Blogpost – Frontend (vollständig) ============== */

/* Grid */
.cgdwbp-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols-d, 3), minmax(0, 1fr));
  gap: var(--gap, 24px);
}
@media (max-width: 1024px) {
  .cgdwbp-grid {
    grid-template-columns: repeat(var(--cols-t, 2), minmax(0, 1fr));
  }
}
@media (max-width: 767px) {
  .cgdwbp-grid {
    grid-template-columns: repeat(var(--cols-m, 1), minmax(0, 1fr));
  }
}

/* Card */
.cgdwbp-card {
  border: 1px solid #e5e7eb;
  border-radius: var(--radius, 12px);
  background: #fff;
  color: #111827;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.08);
  overflow: hidden;
}

/* -------- Media 16:9 robust (img in <picture>/<figure>) -------- */
.cgdwbp-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #f3f4f6;
  line-height: 0; /* entfernt Inline-Gap unter Bildern */
  font-size: 0; /* sichert kein Zeilenraum */
  display: block;
}
.cgdwbp-media figure {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
}
.cgdwbp-media picture {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.cgdwbp-media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
}
.cgdwbp-media img.cgdwbp-fit-contain {
  object-fit: contain !important;
  background: #fff;
}

/* Body + Spacing */
.cgdwbp-body {
  padding: 0 18px;
}

.cgdwbp-badge {
  display: inline-block;
  margin: 20px 0 15px 0; /* Bild→Badge 20, Badge→Titel 15 */
  background: #002233 !important;
  color: #fff !important;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Titel: 3 Zeilen */
.cgdwbp-title {
  margin: 0 0 10px 0; /* Titel→Auszug 10 */
  display: block;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  min-height: calc(3 * 1.7rem);
  max-height: calc(3 * 1.7rem);
  line-height: 1.2rem;
}
.cgdwbp-title a {
  color: #700121;
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
  text-align: justify;
  line-height: 1.6rem;
}

/* Auszug: 6 Zeilen */
.cgdwbp-excerpt {
  color: #444;
  font-size: 14px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow: hidden;
  line-height: 1.5;
  min-height: calc(6 * 1.5em);
  max-height: calc(6 * 1.5em);
  margin: 0 0 25px 0; /* Auszug→Button 25 */
  text-align: justify;
}

/* Button */
.cgdwbp-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: #700121;
  color: #fff !important;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 5px;
  font-weight: 700;
  margin-bottom: 20px;
}

/* Meta */
.cgdwbp-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 14px 0 16px;
  border-top: 1px solid #e5e7eb;
  font-size: 0.92rem;
  color: #111827;
}
.cgdwbp-author {
  position: relative;
  padding-right: 12px;
  color: #444;
  font-size: 12px;
}
.cgdwbp-sep {
  width: 1px;
  height: 16px;
  background: #700121;
  display: inline-block;
}
.cgdwbp-date{
  color: #444;
  font-size: 12px;
}

/* Fallback ohne aspect-ratio */
@supports not (aspect-ratio: 16/9) {
  .cgdwbp-media {
    height: 260px;
  }
  @media (max-width: 640px) {
    .cgdwbp-media {
      height: 220px;
    }
  }
}
