/**
 * The flick: top and end on a fast scroll.
 * Redline Next RN-54 SPEC B15 and J20 (D-ST-229, D-ST-231, D-ST-232,
 * D-ST-242, D-ST-244), carried to the live site. Built by js/flick.js.
 * Colours are the Redline Next light tokens: ink #1b1a17, ink-muted #585650,
 * ink-subtle #6e6b64, surface-raised #ffffff, border-strong #b3b0a8,
 * brand #ba3127.
 */

.rl-flick {
  --rl-flick-ink: #6e6b64;        /* at rest: ink-subtle */
  --rl-flick-ink-partner: #585650; /* the other chevron while one is hovered: ink-muted */
  --rl-flick-ink-hover: #1b1a17;  /* the hovered chevron: ink */
  --rl-flick-pad: #ffffff;        /* surface-raised */
  --rl-flick-lift: 0 1px 0 #b3b0a8; /* the hairline lift (design system W3.10) */
  --rl-flick-ease: cubic-bezier(.2, .7, .2, 1);

  position: fixed;
  left: var(--rl-flick-x, calc(100% - 76px));
  bottom: var(--rl-flick-bottom, 42px);
  z-index: 998; /* under the header and the feedback popup (999) */
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  visibility: hidden; /* hidden chevrons take no focus */
  pointer-events: none;
  transform: translateX(8px);
  transition: opacity .2s var(--rl-flick-ease), transform .25s var(--rl-flick-ease), visibility 0s linear .25s;
}

.rl-flick.is-shown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition-delay: 0s;
}

.rl-flick button {
  -webkit-appearance: none;
  appearance: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--rl-flick-ink);
  cursor: pointer;
  transition: color .15s var(--rl-flick-ease), background-color .15s var(--rl-flick-ease), box-shadow .15s var(--rl-flick-ease), transform .15s var(--rl-flick-ease);
}

.rl-flick svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* One chevron hovered: it goes ink on a raised pad, a twelfth bigger; its
   partner darkens so the pair reads as one control (B15.9). */
.rl-flick:hover button,
.rl-flick:focus-within button {
  color: var(--rl-flick-ink-partner);
}

.rl-flick button:hover {
  color: var(--rl-flick-ink-hover);
  background: var(--rl-flick-pad);
  box-shadow: var(--rl-flick-lift);
  transform: scale(1.083);
}

.rl-flick button:focus {
  outline: none;
}

.rl-flick button:focus-visible {
  outline: 2px solid #ba3127;
  outline-offset: 2px;
}

/* Nowhere to go: dimmed, inert, no hover (B15.5). */
.rl-flick button[disabled],
.rl-flick:hover button[disabled] {
  opacity: .28;
  color: var(--rl-flick-ink);
  background: transparent;
  box-shadow: none;
  transform: none;
  cursor: default;
}

/* Wallpaper and coloured grounds: the gutter shows the member's photo or
   colour, so the chevrons go white with a soft shadow. The hover pad stays
   white with the ink chevron. */
body:not(.theme-solid-03) .rl-flick {
  --rl-flick-ink: rgba(255, 255, 255, .82);
  --rl-flick-ink-partner: #ffffff;
}

body:not(.theme-solid-03) .rl-flick button:not(:hover) svg,
body:not(.theme-solid-03) .rl-flick button[disabled] svg {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45));
}

/* Visitors who are not signed in never saw the arrows; nor do they see these. */
.node-anon-users .rl-flick {
  display: none !important;
}

/* Reduced motion keeps the pair and drops the slide (B15.11). */
@media (prefers-reduced-motion: reduce) {
  .rl-flick,
  .rl-flick.is-shown {
    transform: none;
    transition: opacity .15s linear, visibility 0s linear .15s;
  }
  .rl-flick.is-shown {
    transition-delay: 0s;
  }
  .rl-flick button,
  .rl-flick button:hover {
    transform: none;
    transition: none;
  }
}

/* The Back To Top module's own button sits on top of the flick. Hide it until
   the module is uninstalled on live and removed from composer. */
#backtotop {
  display: none !important;
}
