/*
 * funding-badge.css — the funding emblems fixed bottom left (NA8).
 *
 * The legacy site keeps the LIFE emblem and the Natura 2000 logo on every page in the bottom
 * left corner of the window, fixed, in front of the content: `.fixed-holder .footer .col1
 * .eu-logo` with the 222 x 85 raster `eu.png`. The child theme had the emblems in the footer
 * only; the walk-through of 2026-10-06 reported them missing (protocol #7).
 *
 * The markup comes from inc/funding-badge.php at `wp_footer`, like the back-to-top button: it
 * is no layout slot Divi knows and has to appear where a template carries neither header nor
 * footer. The images are the same attachments the footer shows (Customizer, inc/footer.php),
 * so the editors change them in one place.
 *
 * All values are measured on the rendered snapshot and stand in tokens.css
 * (`--wi-funding-badge-*`); the reasoning is there. Held by bin/check-funding-badge.sh.
 *
 * Two emblems side by side, each at the legacy image height with its own proportions — the
 * raster file squeezed both into one height, which the emblem rules do not allow for the
 * vector originals. The gap is the gap the raster leaves between the two.
 */
.wi-funding-badge {
  position: fixed;
  left: var(--wi-funding-badge-left);
  bottom: var(--wi-funding-badge-bottom);
  z-index: var(--wi-funding-badge-z);

  display: flex;
  align-items: center;
  gap: var(--wi-funding-badge-gap);
  margin: 0;
  padding: 0;
}

/*
 * Height fixed, width derived — the same trap as with the footer emblems: both files are
 * vector files with a `viewBox` only, and with `height: auto` inside a flex container each
 * size would refer to the other and both would come out 0. Two classes in the selector, the
 * rule from AI/architecture/divi-fallstricke.md, section 2: an `img` in the document stands
 * under Divi's `img { max-width: 100%; height: auto }`.
 */
.wi-funding-badge .wi-funding-badge__emblem {
  display: block;
  width: auto;
  height: var(--wi-funding-badge-height);
  max-width: none;
}

/*
 * The map page: the plugin keeps its legend in the lower left corner of a full-window map —
 * exactly where the badge stands. The legacy map had no legend there, so the legacy badge
 * covered nothing. The plugin exposes the legend's distance from the bottom as
 * `--wildisland-legend-bottom` (assets/css/map.css of the plugin), and the theme sets it to the
 * badge's top edge plus a gap. Only on the full-window map: an inline map in an article scrolls
 * with the page, and its legend meets the badge for a moment at most.
 *
 * The value counts from the bottom of the map CANVAS, because the plugin positions the legend
 * against its stage, the canvas's own box (templates/map.php of the plugin, since 0.25.1).
 * Before that it was positioned against the whole container, which also holds the status line
 * and, on a phone, the filter panel — measured on 2026-10-08 at 375px: container 1158px over a
 * 900px canvas, legend over the panel instead of over the map. A full-window canvas ends at the
 * window's bottom edge, which is what the badge is fixed to, so the two values share a
 * reference. In pixels throughout: the property is read on the legend, whose type is smaller
 * than the page's, and an `em` there is not an `em` here.
 */
.wildisland-map.wildisland-map--full {
  --wildisland-legend-bottom: calc(var(--wi-funding-badge-bottom) + var(--wi-funding-badge-height) + var(--wi-funding-badge-gap));
}

/* On paper there is no window to be fixed to; the footer carries the emblems there. */
@media print {
  .wi-funding-badge {
    display: none;
  }
}
