/* --------------------------------------------------

  :::  Media Styles

-------------------------------------------------- */

.text figure {
  position: relative; /* Position für die figcaption relative setzen */
  margin-bottom: var(--p-blank-line)
}

.text figure ul {
  line-height: 0;
  display: grid;
  gap: var(--grid-gutter);
  margin: 0;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.text figure ul li {
  list-style: none;
  position: relative;
  overflow: hidden;
  width: 100%;
  padding-top: calc(100% / (var(--aspect-ratio, 1))); /* Erhält das Verhältnis */
}

.text figure ul li img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Für Crop */
}

.text figure ul li figcaption {
  position: absolute; /* Positionierung */
  text-align: center;
  font-size: var(--step--2);
  bottom: 0; /* Am unteren Rand */
  left: 0; /* Linksbündig */
  width: 100%; /* Ganze Breite */
  color: var(--color-text-grey);
  padding: 0.5rem; /* Innenabstand */
  box-sizing: border-box; /* Box-Modell */
}

.text figure[data-crop="true"] ul li img {
  object-fit: cover; /* Bei Crop das Bild zuschneiden */
}

.text figure[data-crop="false"] ul li img {
  object-fit: contain; /* Bilder proportional einpassen */
}

.text figcaption, .video-caption {
  font-size: var(--step--1);
  color: var(--color-text-grey);
  text-align: center;
  /* padding-top: var(--space-2xs); */
  background: transparent;
  position: relative;
top: -30px;
  display: block;
  width: 100%;
  line-height: 1.2em;
  padding: 10px;
}

/* --------------------------------------------------
  :::  Video
-------------------------------------------------- */
video {
  position: relative;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}

.video,
.img {
  position: relative;
  display: block;
  --w: 1;
  --h: 1;
  padding-bottom: calc(100% / var(--w) * var(--h));
  background: var(--color-black);
}

.img img,
.video iframe {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}

.img[data-contain] img {
  object-fit: contain;
}
