:host {
  /**
   * @prop --background: Background of the content
   *
   * @prop --color: Color of the content
   *
   * @prop --padding-top: Top padding of the content
   * @prop --padding-end: Right padding if direction is left-to-right, and left padding if direction is right-to-left of the content
   * @prop --padding-bottom: Bottom padding of the content
   * @prop --padding-start: Left padding if direction is left-to-right, and right padding if direction is right-to-left of the content
   *
   * @prop --keyboard-offset: Keyboard offset of the content
   *
   * @prop --offset-top: Offset top of the content
   * @prop --offset-bottom: Offset bottom of the content
   */
  --background: var(--gasco-background-color, #fff);
  --color: var(--gasco-text-color, #000);
  --padding-top: 0px;
  --padding-bottom: 0px;
  --padding-start: 0px;
  --padding-end: 0px;
  --keyboard-offset: 0px;
  --offset-top: 0px;
  --offset-bottom: 0px;
  --overflow: hidden;
  display: block;
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  /* stylelint-disable */
  margin: 0 !important;
  padding: 0 !important;
  /* stylelint-enable */
  font-family: var(--gasco-font-family, inherit);
  contain: size style;
}

:host(.gasco-color) .inner-scroll {
  background: var(--gasco-color-base);
  color: var(--gasco-color-contrast);
}

:host(.outer-content) {
  --background: var(--gasco-color-step-50, #f2f2f2);
}

#background-content {
  left: 0px;
  right: 0px;
  top: calc(var(--offset-top) * -1);
  bottom: calc(var(--offset-bottom) * -1);
  position: absolute;
  background: var(--background);
}

.inner-scroll {
  left: 0px;
  right: 0px;
  top: calc(var(--offset-top) * -1);
  bottom: calc(var(--offset-bottom) * -1);
  padding-left: var(--padding-start);
  padding-right: var(--padding-end);
  padding-top: calc(var(--padding-top) + var(--offset-top));
  padding-bottom: calc(var(--padding-bottom) + var(--keyboard-offset) + var(--offset-bottom));
  position: absolute;
  color: var(--color);
  box-sizing: border-box;
  overflow: hidden;
  /**
   * touch-action: manipulation is an alias
   * for this, but WebKit has an issue
   * where pointercancel events are not fired
   * when scrolling: https://bugs.webkit.org/show_bug.cgi?id=240917
   * Using the long form below avoids the issue.
   */
  touch-action: pan-x pan-y pinch-zoom;
}
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
  .inner-scroll {
    padding-left: unset;
    padding-right: unset;
    -webkit-padding-start: var(--padding-start);
    padding-inline-start: var(--padding-start);
    -webkit-padding-end: var(--padding-end);
    padding-inline-end: var(--padding-end);
  }
}

.scroll-y,
.scroll-x {
  -webkit-overflow-scrolling: touch;
  /**
   * This adds `.inner-scroll` as part of the
   * stacking context in WebKit. Without it,
   * children of gasco-content are treated as
   * siblings rather than descendants. This
   * can result in the children being put
   * into their own layers, degrading
   * scrolling performance.
   *
   * An optimization called "layer backing
   * sharing" usually kicks in to prevent
   * this, but having translate3d defeats
   * this optimization.
   *
   * See: https://bugs.webkit.org/show_bug.cgi?id=216701
   */
  z-index: 0;
  will-change: scroll-position;
}

.scroll-y {
  overflow-y: var(--overflow);
  overscroll-behavior-y: contain;
}

.scroll-x {
  overflow-x: var(--overflow);
  overscroll-behavior-x: contain;
}

.overscroll::before,
.overscroll::after {
  position: absolute;
  width: 1px;
  height: 1px;
  content: "";
}

.overscroll::before {
  bottom: -1px;
}

.overscroll::after {
  top: -1px;
}

:host(.content-sizing) {
  display: flex;
  flex-direction: column;
  /**
   * This resolves a sizing issue in popovers where extra long content
   * would overflow the popover's height, preventing scrolling. It's a
   * quirk of flexbox that forces the content to shrink to fit.
   *
   * overflow: hidden can't be used here because it prevents the visual
   * effect from showing on translucent headers.
   */
  min-height: 0;
  contain: none;
}

:host(.content-sizing) .inner-scroll {
  position: relative;
  /**
   * Because the outer content has display: flex here (to help enable
   * scrolling in a popover), offsetting via `top` (such as when using
   * a translucent header) creates white space under the content. Use
   * a negative margin instead to keep the bottom in place. (A similar
   * thing happens with `bottom` and footers.)
   */
  top: 0;
  bottom: 0;
  margin-top: calc(var(--offset-top) * -1);
  margin-bottom: calc(var(--offset-bottom) * -1);
}

.transition-effect {
  display: none;
  position: absolute;
  width: 100%;
  height: 100vh;
  opacity: 0;
  pointer-events: none;
}

:host(.content-ltr) .transition-effect {
  /* stylelint-disable property-disallowed-list */
  left: -100%;
  /* stylelint-enable property-disallowed-list */
}

:host(.content-rtl) .transition-effect {
  /* stylelint-disable property-disallowed-list */
  right: -100%;
  /* stylelint-enable property-disallowed-list */
}

.transition-cover {
  position: absolute;
  /* stylelint-disable property-disallowed-list */
  right: 0;
  /* stylelint-enable property-disallowed-list */
  width: 100%;
  height: 100%;
  background: black;
  opacity: 0.1;
}

.transition-shadow {
  display: block;
  position: absolute;
  width: 10px;
  height: 100%;
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAgCAYAAAAIXrg4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTE3MDgzRkQ5QTkyMTFFOUEwNzQ5MkJFREE1NUY2MjQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTE3MDgzRkU5QTkyMTFFOUEwNzQ5MkJFREE1NUY2MjQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoxMTcwODNGQjlBOTIxMUU5QTA3NDkyQkVEQTU1RjYyNCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoxMTcwODNGQzlBOTIxMUU5QTA3NDkyQkVEQTU1RjYyNCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PmePEuQAAABNSURBVHjaYvz//z8DIxAwMDAwATGMhmFmPDQuOSZks0AMmoJBaQHjkPfB0Lfg/2gQjVow+HPy/yHvg9GiYjQfjMbBqAWjFgy/4hogwADYqwdzxy5BuwAAAABJRU5ErkJggg==);
  background-repeat: repeat-y;
  background-size: 10px 16px;
}

:host(.content-ltr) .transition-shadow {
  /* stylelint-disable property-disallowed-list */
  right: 0;
  /* stylelint-enable property-disallowed-list */
}

:host(.content-rtl) .transition-shadow {
  /* stylelint-disable property-disallowed-list */
  left: 0;
  /* stylelint-enable property-disallowed-list */
  transform: scaleX(-1);
}

::slotted([slot=fixed]) {
  position: absolute;
  /**
   * When presenting gasco-content inside of an gasco-modal, the .inner-scroll
   * element is composited. In WebKit, the fixed content is not composited
   * causing it to appear under the main scrollable content as a result.
   * The fixed content is correctly composited in other browsers. Adding
   * the translateZ forces the fixed content to be composited so it correctly
   * shows on top of the scrollable content. Setting a negative z-index will
   * still allow the fixed content to appear under the scroll content if specified.
   */
  transform: translateZ(0);
}

.modal-native {
  padding: 1rem;
}