/* components/brand-logo.css — the admin logo, painted as a CSS mask over the
   site title (partials/brand.hbs, partials/footer.hbs).
   A mask filled with currentColor follows every palette and the inverted
   header; an <img> can't be recoloured (the uploaded SVG is baked to the
   light foreground). The logo becomes single-colour. A painted background
   rect in the artwork would show as a solid block.
   --brand-logo (the URL) is set inline by the template. Height is 1em, so
   it tracks the title's size — capped to the container's width, so home's
   large masthead shrinks on narrow phones instead of overflowing the page.
   --brand-logo-ratio (default 231 / 39) must be updated if the wordmark's
   proportions change. */

/* Gated: without mask support this would paint a solid rectangle, so those
   browsers keep the text title. Both prefixed and unprefixed are tested. */
@supports (mask-image: url("")) or (-webkit-mask-image: url("")) {

  .brand-logo {
    display: block;

    /* Width-driven, so max-inline-size can shrink it and aspect-ratio
       brings the height down with it (a fixed block-size would not). */
    inline-size: calc(1em * var(--brand-logo-ratio, 231 / 39));
    max-inline-size: 100%;
    aspect-ratio: var(--brand-logo-ratio, 231 / 39);

    background-color: currentColor;

    /* contain: a wrong ratio letterboxes rather than stretches. */
    -webkit-mask: var(--brand-logo) no-repeat center / contain;
    mask: var(--brand-logo) no-repeat center / contain;

    /* Keep the title in the a11y tree; push it out of view instead of hiding it.
       nowrap stops a long title from growing the box. */
    text-indent: 100%;
    white-space: nowrap;
    overflow: hidden;
  }

}
