/*
Components of ours: rules that carry a decision about one specific thing.

What belongs here:
The max-width of the tip form — sizes and behaviors that are design
decisions about that component, not knowledge any other page could reuse.

What does not:
Rules that change what a Bootstrap class does (bootstrap_overrides.css),
and generic reusable utilities (bootstrap_additions.css).

NOT a manifest. Propshaft has no directive processor,
so `*= require` and friends would sit here as inert comments doing nothing.
The load order (manifest) is defined in `_head.html.erb`.
*/

/*
Tip form: a full-width row of its own below lg,
which is .input-group's default and needs no help.
From lg up it goes inline, filling the gap between follow
and the negative actions (flex-lg-fill in the markup),
and is capped so it cannot sprawl across a wide profile.
28rem is a decision about this form rather than a reusable one.
*/
@media (min-width: 992px) {
  .input-group.tip-form {
    max-width: 28rem;
    width: auto;
  }
}

/*
The tip slider's handle (tips/_form, stacked): the page's emphasis color
rather than Bootstrap's blue, which belongs to links and the one primary
button. Each engine has its own pseudo-element and will not share a rule.
*/
.tip-form .form-range::-webkit-slider-thumb {
  background-color: var(--bs-emphasis-color);
}

.tip-form .form-range::-moz-range-thumb {
  background-color: var(--bs-emphasis-color);
}

.tip-form .form-range::-webkit-slider-thumb:active {
  background-color: var(--bs-secondary);
}

.tip-form .form-range::-moz-range-thumb:active {
  background-color: var(--bs-secondary);
}

/*
The site nav's right side (layouts/_navbar): two signals with a count riding
on them, and the avatar menu. The count is the room chat toggle's pill, the
same shape for "something arrived" everywhere.
*/
.nav-signal {
  position: relative;
}

.nav-count {
  background: var(--bs-danger);
  border-radius: var(--bs-border-radius-pill);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1;
  min-width: 1rem;
  padding: 0.125rem 0.25rem;
  text-align: center;
}

.nav-signal .nav-count,
.nav-menu-summary .nav-count {
  position: absolute;
  right: -0.125rem;
  top: 0.125rem;
}

/*
The avatar menu: a <details> whose summary is the avatar, dropping a panel
from the nav's right edge on the page colors, like the room's drop-downs.
*/
.nav-menu {
  position: relative;
}

.nav-menu-summary {
  cursor: pointer;
  display: block;
  line-height: 1;
  list-style: none;
  padding: 0.25rem 0.5rem;
  position: relative;
}

.nav-menu-summary::-webkit-details-marker {
  display: none;
}

.nav-menu-panel {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  box-shadow: var(--bs-box-shadow);
  display: flex;
  flex-direction: column;
  min-width: 12rem;
  padding: 0.5rem 0;
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  z-index: 1030;
}

.nav-menu-item {
  align-items: center;
  color: var(--bs-body-color);
  display: flex;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  text-decoration: none;
  white-space: nowrap;
}

.nav-menu-item:hover,
.nav-menu-item:focus-visible {
  background: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
}

.nav-menu-rule {
  margin: 0.375rem 0;
}

/*
A gift's uploaded face (gifts/_face) wherever the gift is listed: the room's
menu, Admin → Gifts. Sized by the text around it, like the emoji it stands in
for, so the same partial works at every size.
*/
.gift-face {
  height: 1em;
  vertical-align: -0.15em;
  width: auto;
}

/*
An icon-only clipboard button: the copy icon and the tick share one cell, so
swapping them moves nothing around them. The tick lands at once when the
copy succeeds (clipboard_controller marks the button data-copied for a
moment) and the copy icon fades back over it when the moment passes.
*/
.clipboard-icon {
  align-items: center;
  display: inline-grid;
  justify-items: center;
}

.clipboard-icon > span {
  grid-area: 1 / 1;
  transition: opacity 0.4s ease;
}

.clipboard-icon > [data-clipboard-target="done"] {
  opacity: 0;
}

.clipboard-icon[data-copied] > span {
  transition: none;
}

.clipboard-icon[data-copied] > [data-clipboard-target="label"] {
  opacity: 0;
}

.clipboard-icon[data-copied] > [data-clipboard-target="done"] {
  opacity: 1;
}

