/*
 * ScrollContainer: a ScrollArea frame that also anchors two overlays above its viewport, a top Fade (shown once
 * content has scrolled under the edge) and a ScrollDownButton in the end corner (shown while unpinned). The frame
 * isolates their stacking so the overlays never escape it.
 */

@layer dx-components {
  .dx-scroll-container {
    isolation: isolate;
  }

  .dx-scroll-container-fade {
    position: absolute;
    inset-inline: 0;
    top: 0;
    z-index: 1;
    height: calc(2 * var(--dx-block-size));
    background: linear-gradient(to bottom, var(--surface-bg, var(--color-base-surface)), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 200ms ease-out;
  }
  .dx-scroll-container-fade[data-edge='bottom'] {
    top: auto;
    bottom: 0;
    background: linear-gradient(to top, var(--surface-bg, var(--color-base-surface)), transparent);
  }
  .dx-scroll-container-fade[data-state='visible'] {
    opacity: 1;
  }

  .dx-scroll-container-scroll-down {
    position: absolute;
    inset-inline-end: var(--dx-gap-size);
    bottom: var(--dx-gap-size);
    z-index: 1;
    transition: opacity 300ms ease-out;
  }
  .dx-scroll-container-scroll-down[data-state='hidden'] {
    opacity: 0;
    pointer-events: none;
  }

  @media (prefers-reduced-motion: reduce) {
    .dx-scroll-container-fade,
    .dx-scroll-container-scroll-down {
      transition: none;
    }
  }
}
