/* ==========================================================================
   online-staff.css — the colleagues online, left of the global search (online-staff, decision 13 of 17/10)

   Loaded by the OnlineStaff component (HeadContent). Colours come from the --knm-theme-* tokens of knm-theme.css: no
   literal colour, so light/dark and the accent follow. Shown from 992px up (Bootstrap d-none d-lg-flex on the row).
   ========================================================================== */

.knm-os {
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
  padding-inline-start: .5rem;
}

/* A face is a real button: no chrome of its own, the avatar is what shows; the focus ring is the accent. */
.knm-os__face,
.knm-os__more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  line-height: 0;
}

.knm-os__face:focus-visible,
.knm-os__more-btn:focus-visible {
  outline: 2px solid var(--knm-theme-accent);
  outline-offset: 2px;
}

/* «+N»: a small round button the size of a small avatar, with the count in it. */
.knm-os__more-btn {
  width: 2rem;
  height: 2rem;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1;
  color: var(--knm-theme-text-muted);
  background: var(--knm-theme-bg);
  border: 1px solid var(--knm-theme-border);
}

.knm-os__more-btn:hover {
  color: var(--knm-theme-accent-text);
  border-color: var(--knm-theme-accent);
}

/* Faces overlap (CTO 29/10): each one slides half under the next, with a ring the colour of the top bar so the edges
   read. Hovering the row opens it a little; hovering a face lifts it and, less, its two neighbours: a wave. */
.knm-os__face,
.knm-os__more-btn {
  position: relative;
  margin-inline-start: -.5rem;
  transition: transform .18s ease, margin .18s ease;
}

.knm-os__face,
.knm-os__more-btn {
  box-shadow: 0 0 0 2px var(--knm-theme-surface);
}

/* Everybody in the row is online, so the dot says nothing there and would sit on the next face; the «+N» list keeps it. */
.knm-os__face .knm-avatar__status {
  display: none;
}

.knm-os:hover .knm-os__face,
.knm-os:hover .knm-os__more-btn,
.knm-os:focus-within .knm-os__face,
.knm-os:focus-within .knm-os__more-btn {
  margin-inline-start: -.25rem;
}

.knm-os__face:hover,
.knm-os__face:focus-visible {
  z-index: 3;
  transform: translateY(-4px) scale(1.12);
}

.knm-os__face:hover + .knm-os__face,
.knm-os__face:has(+ .knm-os__face:hover),
.knm-os__face:focus-visible + .knm-os__face,
.knm-os__face:has(+ .knm-os__face:focus-visible) {
  z-index: 2;
  transform: translateY(-2px) scale(1.05);
}

@media (prefers-reduced-motion: reduce) {
  .knm-os__face,
  .knm-os__more-btn {
    transition: none;
  }
}

/* «+N» menu: one row per colleague, face and name, the whole row a button; the list scrolls past the screen height. */
.knm-os__list {
  display: flex;
  flex-direction: column;
  min-width: 15rem;
  max-height: min(60vh, 26rem);
  overflow-y: auto;
  padding: .25rem;
}

.knm-os__row {
  display: flex;
  align-items: center;
  gap: .625rem;
  width: 100%;
  padding: .375rem .5rem;
  border: 0;
  border-radius: .5rem;
  background: none;
  color: var(--knm-theme-text);
  text-align: start;
  cursor: pointer;
}

.knm-os__row:hover,
.knm-os__row:focus-visible {
  background: var(--knm-theme-accent-soft);
  outline: none;
}

.knm-os__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knm-os__go {
  color: var(--knm-theme-text-muted);
  opacity: 0;
  transition: opacity .15s ease;
}

.knm-os__row:hover .knm-os__go,
.knm-os__row:focus-visible .knm-os__go {
  opacity: 1;
  color: var(--knm-theme-accent-text);
}
