/*
  The environment ribbon (Layout/EnvironmentRibbon.razor) and DEMO's sample
  sign-ins (Components/DemoAccounts.razor).

  Not theme colours, on purpose, and the same in every theme, light and dark:
  TEST and DEMO must never look like the real application, and they must not
  look like each other. Striped magenta for TEST, striped violet for DEMO -
  neither appears in any theme (Tools/Theme/build.py), and neither is the
  support session's amber. White text on both passes WCAG AA (better than 6:1
  on the lighter stripe). Fixed values rather than the theme's variables for
  exactly that reason; allow-listed in the colour guard with it.
*/

/*
  Fixed across the top of the window, never scrolled away. Room is made for it
  by adding its height to --osm-safe-top, the inset every frame already leaves
  above its top bar (the phone's notch uses the same one): the top bar grows by
  that much at the top, and everything that sticks below the top bar - the
  navigation, page headers, the drawer - follows --osm-frame-top down with it.
*/
:root:has(.osm-env-ribbon) {
  --osm-env-ribbon-h: 1.75rem;
  --osm-safe-top: calc(env(safe-area-inset-top, 0px) + var(--osm-env-ribbon-h));
}

.osm-env-ribbon {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  height: 1.75rem;
  z-index: 1085; /* above the support-session banner, menus and sticky headers */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 1rem;
  color: #ffffff;
  font-size: .9rem;
  line-height: 1.3;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  border-bottom: 3px solid #2a0019;
  user-select: none;
  /* Never wider than the window: on a 375px phone the words, their tracking
     and the side padding came to 377px, two pixels the page scrolled sideways
     for. Now the box is the window and the words shorten with an ellipsis. */
  box-sizing: border-box;
  max-width: 100vw;
  overflow: hidden;
  white-space: nowrap;
}

.osm-env-ribbon > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 575.98px) {
  .osm-env-ribbon { padding: 0 .5rem; font-size: .8rem; letter-spacing: .03em; }
}

.osm-env-ribbon--test {
  background: repeating-linear-gradient(-45deg, #8a0057 0 16px, #a3006a 16px 32px);
  border-bottom-color: #3d0026;
}

.osm-env-ribbon--demo {
  background: repeating-linear-gradient(-45deg, #44208c 0 16px, #5427a8 16px 32px);
  border-bottom-color: #1e0e40;
}

/* The kiosk has no top bar to grow: it steps down instead. */
.osm-kiosk:has(> .osm-env-ribbon) {
  padding-top: var(--osm-env-ribbon-h);
}

/* DEMO's sample sign-ins, on the sign-in page only. */
.osm-demo-accounts {
  margin-top: 1.5rem;
  padding: .75rem 1rem;
  border: 2px dashed #5427a8;
  border-radius: .5rem;
}

.osm-demo-accounts__title {
  color: #5427a8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .8rem;
}

[data-bs-theme="dark"] .osm-demo-accounts {
  border-color: #b9a2f0;
}

[data-bs-theme="dark"] .osm-demo-accounts__title {
  color: #b9a2f0;
}
