/*
 * «Лифт» - кнопки «наверх / вниз» справа снизу на всех страницах (javascripts/lift.js, идея Web-Project2).
 * Табло показывает, где вы на странице (0–100 %); нажатая кнопка горит, пока страница едет;
 * кнопка гаснет, если ехать в её сторону некуда. Подключается последним - перекрывает configurator.css.
 */
.lift {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: .4rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 999px;
  background: color-mix(in srgb, var(--md-default-bg-color) 85%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 .4rem 1.2rem rgba(0, 0, 0, .18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(.5rem) scale(.96);
  transition: opacity .25s, transform .25s cubic-bezier(.16, 1, .3, 1), visibility 0s linear .25s;
}
[data-md-color-scheme=slate] .lift {
  border-color: color-mix(in srgb, #fff 12%, transparent);
  box-shadow: 0 .4rem 1.2rem rgba(0, 0, 0, .6);
}
.lift.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .25s, transform .25s cubic-bezier(.16, 1, .3, 1);
}

.lift-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  box-sizing: border-box;
  width: 2.2rem;
  height: 1.3rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--md-accent-fg-color--transparent, rgba(82, 108, 254, .1));
  box-shadow: none;
  color: var(--md-accent-fg-color);
  text-shadow: none;
  font: 700 .6rem/1.3rem var(--md-code-font-family);
  font-variant-numeric: tabular-nums;
}
.lift-dir { width: auto; font-size: .45rem; line-height: 1.3rem; }
.lift-unit { font-size: .45rem; opacity: .8; }

.lift-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 50%;
  background: var(--md-default-bg-color);
  box-shadow: none;
  color: var(--md-default-fg-color--light);
  font-size: .55rem;
  line-height: 1;
  cursor: pointer;
  transition: color .2s, border-color .2s, background-color .2s, transform .1s, opacity .2s;
}
[data-md-color-scheme=slate] .lift-btn { border-color: color-mix(in srgb, #fff 14%, transparent); }
.lift-btn::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid transparent;
  border-radius: 50%;
  transition: border-color .2s, box-shadow .2s;
}
.lift-btn:hover:not(:disabled) { color: var(--md-accent-fg-color); border-color: var(--md-accent-fg-color); }
.lift-btn:hover:not(:disabled)::after { border-color: transparent; }
.lift-btn:active:not(:disabled) { transform: scale(.92); box-shadow: none; }
.lift-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--md-accent-fg-color--transparent, rgba(82, 108, 254, .25)); }
.lift-btn.is-lit { color: var(--md-accent-fg-color); border-color: var(--md-accent-fg-color); }
.lift-btn.is-lit::after { border-color: var(--md-accent-fg-color); box-shadow: 0 0 .6rem .05rem color-mix(in srgb, var(--md-accent-fg-color) 55%, transparent); }
.lift-btn.is-lit span { text-shadow: none; }
.lift-btn:disabled { cursor: default; color: var(--md-default-fg-color--lighter); opacity: .45; }

@media (max-width: 600px) {
  .lift { right: .5rem; bottom: .5rem; padding: .3rem; gap: .3rem; }
  .lift-btn { width: 1.7rem; height: 1.7rem; }
  .lift-display { width: 1.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .lift, .lift-btn, .lift-btn::after { transition: none; }
}
@media print { .lift { display: none; } }
