/*
 * SEMCO theme for the Zammad desktop app.
 * Served by zammad-nginx from public/assets, linked by semco_ticket_info.rb (see ROLLOUT.md).
 * Only overrides Zammad's CSS custom properties (app/assets/stylesheets/zammad.scss,
 * identical in 7.1.1 and 7.2.2). SEMCO colors: light blue #3FA3D7, dark blue #005B9A.
 * Zammad sets data-theme on <html>; the light overrides must not leak into dark mode.
 */

:root:not([data-theme='dark']) {
  /* accent: buttons, links, focus */
  --button-primary-background: #005B9A;
  --button-primary-background-active: #004A7E;
  --button-active: #005B9A;
  --text-link: #005B9A;
  --text-nav: #005B9A;
  --highlight: #3FA3D7;
  --border-highlight: #3FA3D7;
  --shadow-highlight: #CBE6F5;
  --background-highlight: #E3F1FA;
  --text-muted-highlight: #CBE6F5;

  /* navigation, login and other full-screen pages */
  --background-tertiary: #0F3A5F;
  --background-quaternary: #0A2C49;
  --background-active: #0F3A5F;
  --menu-background-active: #005B9A;
  --menu-text: #F2F7FB;
  --menu-text-active: #FFFFFF;
  --menu-icon: #B3CCE2;
  --nav-icon: #B3CCE2;
  --menu-switch-background: #061E33;
  --fullscreen-text-muted: #1C4A72;

  /* customer articles in the ticket view */
  --background-article-customer: #EEF6FC;
  --background-article-customer-meta: #F5FAFD;
  --border-article-customer: #D2E7F5;
  --border-article-customer-selected: #B5D8EF;
}

:root[data-theme='dark'] {
  --button-primary-background: #2F8FC4;
  --button-primary-background-active: #3FA3D7;
  --text-link: #5DB3E2;
  --highlight: #3FA3D7;
  --border-highlight: #3FA3D7;
  --menu-background-active: #2F8FC4;
}

/* navigation: SEMCO symbol instead of the Zammad bird (no setting for it, the
   branding logo is only used on the login page). The icon stays in place but
   invisible, so the click target and the notification counter keep working. */
.search .logo {
  background: url('/assets/semco-nav-logo.png?v=1') no-repeat center / 42px auto;
}

.search .logo .icon-logo {
  visibility: hidden;
}

/* narrow navigation (Zammad's "phone" mixin: collapsed navigation or < 768px):
   the logo box shrinks to the 35x30 icon, so scale the symbol down and keep it
   in the upper left, mostly clear of the notification counter, instead of cropping it */
#app.navigation-collapsed .search .logo {
  background-position: 4px 3px;
  background-size: 28px auto;
}

@media screen and (max-width: 767px) {
  .search .logo {
    background-position: 4px 3px;
    background-size: 28px auto;
  }
}

/* navigation accessibility (WCAG 2.2 AA, contrast against #0A2C49 / #0F3A5F):
   text #F2F7FB 13.3:1 / 10.9:1, icons #B3CCE2 8.6:1 / 7.1:1, white on the active
   item #005B9A 7.1:1. The active item differs little from the navigation
   background (1.65:1), so a light bar marks it (8.5:1, 1.4.11). */
:root:not([data-theme='dark']) .menu-item.is-active,
:root:not([data-theme='dark']) .nav-tab.is-active {
  box-shadow: inset 4px 0 0 #8FD0F5;
}

:root:not([data-theme='dark']) .search input[type='search'] {
  color: #F2F7FB;
  box-shadow: inset 0 0 0 1px #6F93B5;
}

:root:not([data-theme='dark']) .search input[type='search']::placeholder {
  color: #B3CCE2;
}

#navigation a:focus-visible,
#navigation .logo:focus-visible,
#navigation input[type='search']:focus-visible {
  outline: 2px solid #8FD0F5;
  outline-offset: -2px;
}
