/*
 * ÍL·LUKI branding for vault.illuki.com (Vaultwarden web vault).
 *
 * Vaultwarden renders its identity in THREE different ways. All three need
 * handling — miss one and it reappears on some other screen.
 *
 *  1. <img class="new-logo-themed"> styled with `content: url(images/logo.svg)`
 *     (light) / `logo-white.svg` (dark)   -> loading screen + dashboard/frontend
 *  2. inline <svg viewBox="0 0 290 60">   -> login screen wordmark
 *  3. inline <svg viewBox="0 0 60 60">    -> square mark
 *
 * (1) is the one that bites: the files ARE overridden at nginx, but they are
 * served with a 7-day cache, so any browser that loaded the page before the
 * override keeps showing the stock logo. Overriding the CSS rule with a
 * VERSIONED url sidesteps that entirely — bump ?v= when the art changes.
 *
 * This stylesheet is injected after styles.*.css, so plain source order already
 * wins; !important is belt-and-braces against Angular re-ordering.
 */

/* --- 1. themed <img> : loading screen, dashboard, frontend pages --------- */
img.new-logo-themed,
.theme_light img.new-logo-themed,
.theme_dark img.new-logo-themed {
  content: url("/images/illuki-wordmark.png?v=4") !important;
  width: 200px !important;
  height: auto !important;
}

/* The older wide logo class, same treatment. */
img.logo {
  content: url("/images/illuki-wordmark.png?v=4") !important;
  width: 240px !important;
  height: auto !important;
}

/* --- 2 & 3. inline SVG logos -------------------------------------------- *
 * No file to swap: keep each SVG's layout box (visibility:hidden, NOT
 * display:none, so nothing reflows) and paint ours onto the parent.
 * The parent is <bit-svg>, a CUSTOM ELEMENT — :is(div,span,a) does NOT match
 * it, hence the bare universal :has() with a child combinator.
 * Both viewBoxes are unique in the bundle, so this cannot catch a stray icon.
 * 800x200 / 580x104 / 501x226 are illustrations and are left alone.
 */
*:has(> svg[viewBox="0 0 290 60"]) {
  background-image: url("/images/illuki-wordmark.png?v=4");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

*:has(> svg[viewBox="0 0 60 60"]) {
  background-image: url("/images/illuki-mark.png?v=4");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

svg[viewBox="0 0 290 60"],
svg[viewBox="0 0 60 60"] {
  visibility: hidden !important;
}

/* Tab / PWA icons are real files and are overridden at the proxy. */
