/*
 * inbox-arrival.css — the animated "Import" screenshot on the landing page.
 *
 * Layout: the main window (inbox open) sits in front; the live-preview
 * window sits BEHIND it, shifted right and down so part of the photo peeks
 * out. inbox-arrival.js steps through three classes on .lp-inbox-stage:
 *   .is-live-on       the "Live preview" switch turns on
 *   .is-arrived       a 4th photo arrives (inbox shows 4 new)
 *   .is-preview-open  the preview window slides out from behind
 * Without JS (or with reduced motion) all three are set, i.e. the final state
 * is shown as a still image.
 *
 * The base screenshot is the final state. The two "before" screenshots lie
 * on top of it and are clipped to the inbox panel, so the rest of the window
 * (patient list, header) never changes during the animation.
 */

/* Wrapper for both windows. Animated graphics do not use the .float hover,
   so the arrival animation stays steady. */
.lp-inbox-stage {
  position: relative;
  z-index: 1;
  /* Room below the main window for the part of the preview that peeks out. */
  padding-bottom: 14%;
}

/* Main window: 80% wide so the preview can stick out on the right. */
.lp-inbox-main {
  width: 80%;
  z-index: 2;
}

/* Screenshot area below the CSS title bar. */
.lp-inbox-screen { position: relative; }

/* Before-states, clipped to the inbox panel (x 810-1170, y 58-730 of the
   1180 x 740 screenshot). */
.lp-inbox-screen .lp-inbox-state {
  position: absolute;
  inset: 0;
  clip-path: inset(7.4% 0.4% 0.9% 68.4%);
}
.lp-inbox-screen .lp-inbox-before { transition: opacity 0.5s ease; }
.lp-inbox-screen .lp-inbox-before-off { transition: opacity 0.25s ease; }
.lp-inbox-stage.is-live-on .lp-inbox-before-off { opacity: 0; }
.lp-inbox-stage.is-arrived .lp-inbox-before { opacity: 0; }

/* Preview window: behind the main window, anchored bottom-right. While
   closed it is tucked fully behind the main window and invisible. */
.lp-inbox-preview {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 56%;
  z-index: 1;
  opacity: 0;
  transform: translate(-30%, -30%) scale(0.94);
  transition: opacity 0.5s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.lp-inbox-stage.is-preview-open .lp-inbox-preview {
  opacity: 1;
  transform: none;
}

/* Camera flash: a bright burst BEHIND both windows on the right side, played
   once per cycle just before the new photo arrives (.is-flash is set by
   inbox-arrival.js). The page background is light, so the white burst gets a
   faint cool-grey rim to stay visible. */
.lp-inbox-flash {
  position: absolute;
  right: -24%;
  top: -8%;
  width: 50%;
  aspect-ratio: 1;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #ffffff 0 26%,
    rgba(248, 251, 255, 1) 34%,
    rgba(224, 236, 255, 0.95) 44%,
    rgba(186, 208, 240, 0.55) 56%,
    rgba(186, 208, 240, 0.18) 64%,
    transparent 72%
  );
  filter: blur(6px) drop-shadow(0 0 18px rgba(255, 255, 255, 1));
  opacity: 0;
  transform: scale(0.4);
  pointer-events: none;
}
.lp-inbox-stage.is-flash .lp-inbox-flash { animation: lpInboxFlash 0.75s ease-out forwards; }
@keyframes lpInboxFlash {
  0% { opacity: 0; transform: scale(0.4); }
  18% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.25); }
}

@media (prefers-reduced-motion: reduce) {
  .lp-inbox-flash { display: none; }
  .lp-inbox-screen .lp-inbox-state,
  .lp-inbox-preview { transition: none; }
}

/* Bigger graphic for this row on wide screens: the row may grow beyond the
   usual content width and gives the screenshots a larger share of it.
   Below 920 px the highlights stack anyway and use the full width. */
@media (min-width: 921px) {
  .lp-highlight.lp-inbox-highlight {
    max-width: calc(var(--lp-max) + 220px);
    grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.5fr);
  }
}
