/* Styling for block-level content media emitted by the render-image hook
   (layouts/_default/_markup/render-image.html). */

/* In-page anchor jumps must not land under the fixed (affixed) navbar:
   62px navbar min-height plus breathing room. Applies to any element
   targeted by a #fragment link (headings, <a id> anchors, ...). */
[id] {
  scroll-margin-top: 90px;
}

figure.media-figure {
  /* stand in for the <p> wrapper these elements had before */
  margin: 0 0 10px;
}

figure.media-figure > figcaption {
  margin-top: 6px;
  font-size: 0.875em;
  font-style: italic;
  color: #777;
  text-align: center;
}

/* Blog posts size and center images via #post-content img (custom.css);
   move that rule's vertical spacing onto the figure so a caption sits
   directly beneath its image. */
#blog-post #post-content figure.media-figure {
  margin: 24px auto;
}

#blog-post #post-content figure.media-figure > img {
  margin: 0 auto;
}

/* Static pages (layouts/page/single.html wraps content in .page-body) get the
   same uniform width/centering as blog articles (#blog-post #post-content img
   in the theme's custom.css). */
.page-body figure.media-figure {
  margin: 24px auto;
}

.page-body figure.media-figure > img {
  display: block;
  width: calc(100% - (min(var(--article-image-margin, 40px), 15%) * 2));
  max-width: calc(100% - (min(var(--article-image-margin, 40px), 15%) * 2));
  height: auto;
  margin: 0 auto;
}

/* ---- fixed-ratio image crops (carousel, project tiles, banners) ----
   Emitted by partials/crop-img.html: the focal point and zoom of the
   visible crop come per image via --crop-pos / --crop-zoom, where zoom
   is relative to a plain object-fit: cover. The surrounding box must
   clip (overflow: hidden) when zoom > 1. */
img.crop-cover {
  object-fit: cover;
  object-position: var(--crop-pos, 50% 50%);
  transform: scale(var(--crop-zoom, 1));
  transform-origin: var(--crop-pos, 50% 50%);
}

img.crop-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.home-carousel .item {
  overflow: hidden;
}

/* The slide image is now a positioned layer; positioned elements paint
   above static ones, so the text container must be positioned too. */
.home-carousel .item > .container {
  position: relative;
}

/* ---- content info boxes (CMS "info box" button: > [!NOTE] alerts) ---- */
.content-infobox {
  margin: 1.2em 0;
  padding: 14px 16px;
  border-left: 4px solid var(--page-accent, #129b9b);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.045);
}
.content-infobox > :last-child { margin-bottom: 0; }
.content-infobox > :first-child { margin-top: 0; }

/* ---- foerderlogos shortcode: funded-by / joint-project logo box ---- */
.foerderlogos {
  margin: 32px auto;
  padding: 22px 24px;
  border-radius: 10px;
  background: #f4f4f4;
  border: 1px solid #e4e4e4;
}
.foerderlogos-group + .foerderlogos-group {
  margin-top: 20px;
}
.foerderlogos-group h4 {
  margin: 0 0 12px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 15px;
  color: color-mix(in srgb, var(--page-accent, #129b9b) 75%, #000);
}
.foerderlogos-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 14px;
}
.foerderlogos-card {
  background: #fff;
  border-radius: 6px;
  padding: 10px 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.foerderlogos-card img {
  height: 64px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  display: block;
}
@media (max-width: 767px) {
  .foerderlogos-card img {
    height: 52px;
    max-width: 170px;
  }
}
