/* The sidebar folded to a rail of icons - WHEN is the suite's rule
   (GlitchForgeSuite scripts/pabbel-suite/rail/pabbel-rail.css): chosen with
   <html data-rail="1"> on any screen that has a sidebar, or nothing chosen
   yet on a laptop (64-80rem). No script decides it, so the first paint is
   already the right one. The two blocks must stay identical. */
@media (min-width: 64rem) {
  :root[data-rail="1"] {
    --sidebar-w: var(--rail-w, 76px);
    --rail-on: 1;
    --rail-hide: none;
    --rail-pad: 0;
    --rail-justify: center;
  }
}
@media (min-width: 64rem) and (max-width: 79.99rem) {
  :root:not([data-rail]) {
    --sidebar-w: var(--rail-w, 76px);
    --rail-on: 1;
    --rail-hide: none;
    --rail-pad: 0;
    --rail-justify: center;
  }
}

/* What folding does to this sidebar: icons only, centred; the counts and
   the footnote wait for it to open again. */
.nav-row { padding-inline: var(--rail-pad, 16px 12px); justify-content: var(--rail-justify, flex-start); }
.nav-label { display: var(--rail-hide, block); }
.nav-count { display: var(--rail-hide, inline); }
.side-foot { display: var(--rail-hide, block); }
.fold-chevron { transition: transform 200ms var(--ease-out); transform-origin: 14.25px 12px; }
@media (min-width: 64rem) {
  :root[data-rail="1"] .fold-chevron { transform: scaleX(-1); }
}
@media (min-width: 64rem) and (max-width: 79.99rem) {
  :root:not([data-rail]) .fold-chevron { transform: scaleX(-1); }
}

/* A folded item's name beside it on the reading side (rail.js places it).
   Inverted like the suite's tips; grows from its item; instant once one has shown. */
.rail-tip {
  position: fixed; z-index: 140; pointer-events: none;
  padding: 6px 10px; border-radius: 8px;
  background: var(--foreground); color: var(--chrome);
  font-size: 12.5px; font-weight: 500; line-height: 16px; white-space: nowrap;
  box-shadow: var(--shadow-md);
  animation: rail-tip-in 125ms var(--ease-out);
}
.rail-tip[data-instant] { animation: none; }
@keyframes rail-tip-in { from { opacity: 0; scale: 0.96; } }

@media (prefers-reduced-motion: reduce) {
  .rail-tip { animation: none; }
  .app, .lead, .fold-chevron { transition: none; }
}
