/* Floats at the bottom of the screen, over the page wherever it's scrolled to, and goes after a while to leave the
   photos be. One that can be undone, or says what went wrong, stays longer */
.flash {
  position: fixed;
  right: var(--space-4);
  bottom: calc(var(--space-4) + var(--bottom-inset));
  left: var(--space-4);
  z-index: 2100;

  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2) var(--space-3);
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-3);

  border-radius: var(--radius-m);
  box-shadow: 0 4px 12px var(--drop-shadow-color);
  text-align: center;

  animation: flash-leave 0.4s ease-in 4s forwards;
  /* Taps go through to what's under it, except on its own buttons */
  pointer-events: none;

  &:has(form), &.alert {
    animation-delay: 8s;
  }

  :is(a, button) {
    pointer-events: auto;
  }

  &.notice {
    background-color: var(--notice-bg-color);
    color: var(--notice-text-color);
  }

  &.alert {
    background-color: var(--alert-bg-color);
    color: var(--alert-text-color);
  }

  /* Under the top bar while sorting, clear of the buttons along the bottom */
  :root:has(.sorting) & {
    top: calc(4rem + env(safe-area-inset-top));
    bottom: auto;
  }

  /* Above the bar of a selecting grid, which is at the bottom on phones */
  @media (max-width: 799px) {
    :root:has(.selection-area.selecting) & {
      bottom: calc(5rem + var(--bottom-inset));
    }
  }
}

@keyframes flash-leave {
  to {
    opacity: 0;
    visibility: hidden;
  }
}
