.d35-brand-logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  /* Marken-/Logo-Ink folgt dem Text-Schwarz (monochrom schwarz), NICHT der
     dunklen Flächenfarbe — sonst nähmen die Logos die Flächenfarbe (z. B.
     Mitternachtsblau) an. Override via color-Attr (z. B. color="#ffffff") auf
     dunklen Flächen. */
  color: var(--d35-color-text, #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;
}

/* --- Linked logos: clearly clickable ---------------------------------- */

/*
  A logo rendered as a link (<a class="d35-brand-logo">) gets an unmistakable
  affordance: pointer cursor plus a gentle hover/focus lift + fade. Non-linked
  logos render as <span> and stay completely inert (no cursor, no hover).
  The lift uses transform on the anchor box, which composes cleanly with the
  per-logo `--d35-brand-logo-scale` applied to the inner SVG.
*/
a.d35-brand-logo {
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

a.d35-brand-logo:hover {
  opacity: 0.7;
  transform: scale(1.06);
}

a.d35-brand-logo:focus-visible {
  opacity: 0.7;
  transform: scale(1.06);
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  a.d35-brand-logo {
    transition: opacity 0.18s ease;
  }

  a.d35-brand-logo:hover,
  a.d35-brand-logo:focus-visible {
    transform: 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;
}

/* Definite 100% statt auto: iOS-Safari rendert inline-SVGs ohne intrinsische
   width/height sonst auf eine winzige Default-Größe (Chrome skaliert sie auf
   die Box hoch) — die Marken waren dadurch auf echtem Safari viel zu klein.
   Die Box hat feste Maße (item-w/item-h); das viewBox-preserveAspectRatio des
   SVG sorgt weiterhin für „contain" (Seitenverhältnis gewahrt, zentriert). */
.d35-brand-logos--uniform .d35-brand-logo svg {
  width: 100%;
  height: 100%;
  /* Optischer Ausgleich für nahezu quadratische Logos (Registry `scale`):
     vergrößert nur die Darstellung innerhalb der Box, ohne die Box-Maße oder
     die Nachbarpositionen zu ändern (transform ist layout-neutral). Default 1. */
  transform: scale(var(--d35-brand-logo-scale, 1));
}

/* 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);
  }
}
