/* Dark-mode fixes for the parts of site.css that the back office shares with the public site (which stays light).
   site.css writes its colours as fixed values, so they are answered here, once, rather than by editing it. Loaded last.
   Everything is scoped to [data-bs-theme="dark"], which only the console sets (see /js/theme.js). */

[data-bs-theme="dark"] .btn:focus,
[data-bs-theme="dark"] .btn:active:focus,
[data-bs-theme="dark"] .btn-link.nav-link:focus,
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-check-input:focus {
  box-shadow: 0 0 0 .1rem var(--bs-body-bg), 0 0 0 .25rem var(--focus-ring);
}

/* The account menu (top bar) */
[data-bs-theme="dark"] .site-user-toggle {
  border-color: var(--bs-border-color);
  color: var(--bs-body-color);
  background: var(--bs-body-bg);
}

[data-bs-theme="dark"] .site-user-toggle:hover,
[data-bs-theme="dark"] .site-user-toggle[aria-expanded="true"] {
  border-color: var(--console-accent);
  background: var(--bs-tertiary-bg);
  box-shadow: none;
}

[data-bs-theme="dark"] .site-user-toggle:focus-visible,
[data-bs-theme="dark"] .site-user-menu .dropdown-item:focus-visible {
  outline-color: var(--focus-ring);
}

[data-bs-theme="dark"] .site-user-toggle .site-avatar,
[data-bs-theme="dark"] .site-user-menu-head .site-avatar {
  box-shadow: 0 0 0 2px var(--bs-body-bg), 0 0 0 3px var(--bs-border-color);
}

[data-bs-theme="dark"] img.site-avatar {
  background: var(--bs-secondary-bg);
}

[data-bs-theme="dark"] .site-user-chevron,
[data-bs-theme="dark"] .site-user-menu-email,
[data-bs-theme="dark"] .site-user-menu .dropdown-item .bi {
  color: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .site-user-menu {
  border-color: var(--bs-border-color);
  box-shadow: 0 1.25rem 2.5rem -.5rem rgba(0, 0, 0, .6);
}

[data-bs-theme="dark"] .site-user-menu-head {
  background: var(--bs-tertiary-bg);
}

[data-bs-theme="dark"] .site-user-menu-name {
  color: var(--bs-emphasis-color);
}

[data-bs-theme="dark"] .site-user-role {
  color: var(--console-accent-text);
  background: var(--bs-body-bg);
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .site-user-menu .dropdown-divider {
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .site-user-menu .dropdown-item {
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .site-user-menu .dropdown-item:hover,
[data-bs-theme="dark"] .site-user-menu .dropdown-item:focus {
  color: var(--bs-emphasis-color);
  background: var(--bs-secondary-bg);
}

[data-bs-theme="dark"] .site-user-menu .dropdown-item:hover .bi,
[data-bs-theme="dark"] .site-user-menu .dropdown-item:focus .bi {
  color: var(--console-accent-text);
}

[data-bs-theme="dark"] .site-user-menu .dropdown-item:active {
  color: var(--bs-emphasis-color);
  background: var(--bs-secondary-bg);
}

[data-bs-theme="dark"] .site-user-menu .dropdown-item.text-danger,
[data-bs-theme="dark"] .site-user-menu .dropdown-item.text-danger .bi {
  color: #f1948a !important;
}

/* Loading skeletons: a lighter patch on a dark page, and a softer sweep */
[data-bs-theme="dark"] .skeleton {
  background-color: var(--bs-secondary-bg);
}

[data-bs-theme="dark"] .skeleton-faint {
  background-color: var(--bs-tertiary-bg);
}

[data-bs-theme="dark"] .skeleton::after,
[data-bs-theme="dark"] .btn.is-busy::after {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .08), rgba(255, 255, 255, 0));
}

[data-bs-theme="dark"] .btn:not(.btn-primary, .btn-success, .btn-danger, .btn-dark, .btn-secondary, .btn-info, .btn-warning).is-busy::after {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .08), rgba(255, 255, 255, 0));
}

/* The store cards on "Your stores" */
[data-bs-theme="dark"] .store-card,
[data-bs-theme="dark"] .store-empty {
  box-shadow: var(--card-shadow);
}
