.d35-brand-logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  /* Default to our darkest token ("schwarz"); override via the color attr
     (e.g. color="#ffffff") on dark backgrounds. */
  color: var(--d35-color-dark, #000);
}

.d35-brand-logo svg {
  display: block;
  height: var(--d35-brand-logo-height, 2rem);
  width: var(--d35-brand-logo-width, auto);
  max-width: 100%;
}

/*
  Recolourable (single-colour) logos follow currentColor. This covers both
  logos pre-normalised to currentColor and unfilled ones, so a single `color`
  value drives them on light or dark backgrounds. Multi-colour logos use the
  `--original` modifier and are left untouched.
*/
.d35-brand-logo--mono svg,
.d35-brand-logo--mono svg :where(path, polygon, circle, rect, ellipse, line, g, use) {
  fill: currentColor;
}

.d35-brand-logo--mono svg [fill="none"] {
  fill: none;
}

/* --- Logo strip ------------------------------------------------------- */

.d35-brand-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--d35-brand-logos-gap, 2.5rem);
}

.d35-brand-logos--center {
  justify-content: center;
}

.d35-brand-logos--end {
  justify-content: flex-end;
}

/* Uniform mode: equal box per logo, logo scaled to fit (contain) and centered,
   so wide wordmarks and compact marks share the same footprint. */
.d35-brand-logos--uniform .d35-brand-logo {
  width: var(--d35-brand-logos-item-w, 140px);
  height: var(--d35-brand-logos-item-h, 48px);
  justify-content: center;
}

.d35-brand-logos--uniform .d35-brand-logo svg {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

/* Single-row mode: keep all logos on one line and let them shrink to fit
   (capped at the item width); wraps again on small screens. */
.d35-brand-logos--nowrap {
  flex-wrap: nowrap;
}

.d35-brand-logos--nowrap.d35-brand-logos--uniform .d35-brand-logo {
  /* May shrink to fit but never grow, so the logos stay a centred group
     (via justify-content) instead of stretching across the full width. */
  flex: 0 1 var(--d35-brand-logos-item-w, 140px);
  min-width: 0;
  width: auto;
}

@media (max-width: 640px) {
  .d35-brand-logos--nowrap {
    flex-wrap: wrap;
  }

  .d35-brand-logos--nowrap.d35-brand-logos--uniform .d35-brand-logo {
    flex: 0 0 auto;
    width: var(--d35-brand-logos-item-w, 140px);
  }
}
