/**
 * HDR logo in the admin toolbar (replaces the Admin Toolbar "tools/help" icon).
 */

/* Classic (Claro) toolbar. */
.toolbar .toolbar-icon-admin-toolbar-tools-help:before,
.toolbar .toolbar-icon-admin-toolbar-tools-help:active:before {
  box-sizing: content-box;
  background-image: url(/themes/custom/hdr/images/HDR_logo.svg);
  padding-bottom: 0;
  padding-left: 10px;
  padding-right: 2px;
  padding-top: 2px;
  margin-left: 4px;
}

/* Gin toolbar. Gin renders toolbar icons with a CSS mask, so the mask must be
 * cleared for the HDR logo (a background-image) to be visible. */
.gin--horizontal-toolbar #toolbar-administration .toolbar-menu-administration .menu-item > .toolbar-icon-admin-toolbar-tools-help {
  width: 65px !important;
}

body .toolbar .toolbar-bar #toolbar-item-administration-tray .toolbar-icon-admin-toolbar-tools-help.toolbar-icon-default:before {
  background-color: transparent;
  background-image: url(/themes/custom/hdr/images/HDR_logo.svg);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  mask-image: none;
  mask-position: unset;
  width: 36px;
  height: 32px;
  /* Vertically center the logo in the toolbar bar (Gin top-aligns it). */
  inset-block-start: 50%;
  transform: translateY(-50%);
}

/* In Gin dark mode the toolbar bar is dark, so render the HDR logo white.
 * brightness(0) flattens the SVG to black, invert(1) turns it pure white. */
.gin--dark-mode .toolbar .toolbar-icon-admin-toolbar-tools-help:before,
.gin--dark-mode .toolbar .toolbar-icon-admin-toolbar-tools-help:active:before,
.gin--dark-mode .toolbar .toolbar-bar #toolbar-item-administration-tray .toolbar-icon-admin-toolbar-tools-help.toolbar-icon-default:before {
  filter: brightness(0) invert(1);
}
