/*
 * Papuli branding for Docmost.
 * Served by Caddy from /opt/docmost/branding/override/papuli-branding/ and
 * linked from Docmost's index.html by /opt/docmost/branding/apply-branding.sh.
 * Docmost's own files are not changed: it still renders "Docmost", and these
 * rules hide that and draw the Papuli logo in its place.
 */

/* 1. App header, top left, on every page after login.
      Docmost shows the text "Docmost" (desktop) or its icon (mobile). */
a[href="/home"]:is([aria-label="Docmost"], [data-papuli-brand]) > * {
  display: none !important;
}
a[href="/home"]:is([aria-label="Docmost"], [data-papuli-brand])::before {
  content: "";
  display: block;
  width: 70px;
  height: 38px;
  background: url("/papuli-branding/papuli-wordmark.png") left center / contain no-repeat;
}
[data-mantine-color-scheme="dark"] a[href="/home"]:is([aria-label="Docmost"], [data-papuli-brand])::before {
  background-image: url("/papuli-branding/papuli-wordmark-dark.png");
}

/* 2. Login, sign-up, password-reset and invite pages: the icon + "Docmost" title above the form. */
div:has(> img[alt="Docmost"] + p) > * {
  display: none !important;
}
div:has(> img[alt="Docmost"] + p)::before {
  content: "";
  display: block;
  width: 170px;
  height: 180px;
  background: url("/papuli-branding/papuli-logo.png") center / contain no-repeat;
}
[data-mantine-color-scheme="dark"] div:has(> img[alt="Docmost"] + p)::before {
  background-image: url("/papuli-branding/papuli-logo-dark.png");
}

/* 3. Home page (/home): the full logo above "Spaces you belong to".
      branding.js marks the home page's container with data-papuli-home. */
[data-papuli-home]::before {
  content: "";
  display: block;
  height: 190px;
  margin: 0 auto 28px;
  background: url("/papuli-branding/papuli-logo.png") center / contain no-repeat;
}
[data-mantine-color-scheme="dark"] [data-papuli-home]::before {
  background-image: url("/papuli-branding/papuli-logo-dark.png");
}
@media (max-width: 48em) {
  [data-papuli-home]::before {
    height: 140px;
    margin-bottom: 20px;
  }
}
