/* Preview banner: a quiet bar on the bottom edge while an organizer looks at
   an unpublished shop, linking back to the admin, on a theme's demo shop,
   linking to usetix.io, or on a pitch's, naming who it was made for and
   leading to taking it over */
.preview-banner {
  align-items: center;
  background: var(--color-surface-3);
  color: var(--color-text);
  display: flex;
  font-size: var(--step--1);
  font-weight: var(--weight-semibold);
  gap: var(--space-2xs);
  inset: auto 0 0;
  justify-content: center;
  padding: var(--space-2xs) var(--space-s) max(var(--space-2xs), env(safe-area-inset-bottom));
  position: fixed;
  text-decoration: none;
  z-index: var(--z-raised);

  &:hover {
    background: color-mix(in oklab, var(--color-text) 8%, var(--color-surface-3));
  }
}

/* What the bar leads to, where it says more than where it leads */
.preview-banner__action {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* A theme's demo shop says what it is on the same bar, once the page is
   scrolled: the first screen stays the design's own, whose opening often fills
   the window and would lose its lower edge to the bar. A page too short to
   scroll, and a browser without scroll-driven animations, show the bar from
   the start. */
@supports (animation-timeline: scroll()) {
  .preview-banner[data-variant="demo"] {
    animation: preview-banner-in linear both;
    animation-range: 0 6rem;
    animation-timeline: scroll(root block);
  }
}

@keyframes preview-banner-in {
  from {
    translate: 0 100%;
    visibility: hidden;
  }

  to {
    translate: 0 0;
    visibility: visible;
  }
}
