/* Dreijerink Inc. branding for Gitea.
   Deliberately all CSS: no template override, so a Gitea upgrade cannot leave a
   stale copy of head_navbar.tmpl hiding new menu items. If Gitea ever renames
   these hooks the worst case is the stock logo reappearing - cosmetic only. */

/* --- the wordmark on the start page --------------------------------------
   home.tmpl hardcodes height="220" on a 525x151 image and the stock CSS sets
   only max-width, so without height:auto the wordmark is squashed square. */
.home .logo {
  height: auto;
}

/* --- the square mark in the navbar ---------------------------------------
   The navbar img is hardcoded to logo.svg, which is the wide wordmark. CSS
   cannot swap an <img> source in Firefox (`content: url()` is Chromium-only),
   so the img is removed from the flow and the mark is drawn on a pseudo
   element instead. display:none also takes it out of the accessibility tree,
   which is correct here: the surrounding <a> already carries an aria-label. */
#navbar-logo img {
  display: none;
}

#navbar-logo::before {
  content: "";
  display: inline-block;
  width: 30px;
  height: 30px;
  background: url("/assets/img/logo-mark.svg") center / contain no-repeat;
}

/* --- light backgrounds ----------------------------------------------------
   Both marks are pure white, and the default theme is gitea-auto, which
   follows each visitor's OS. The start page goes white and the navbar goes
   rgb(246,247,250), so without this they vanish for anyone on a light OS.
   The filter sits on the pseudo element rather than the <a> so it inverts the
   mark alone and leaves the navbar's own background untouched. */
html[data-theme="gitea-light"] .home .logo,
html[data-theme="gitea-light"] #navbar-logo::before {
  filter: invert(1);
}

@media (prefers-color-scheme: light) {
  html[data-theme="gitea-auto"] .home .logo,
  html[data-theme="gitea-auto"] #navbar-logo::before {
    filter: invert(1);
  }
}
