@use "sass:math";
@use "../base/var";
@use "../base/const";
@use "../base/color";
@use "../base/breakpoints";

[part~="wy-preview"] {
  --wy-component-background-color: #{color.token(--wy-background)};
  --wy-component-color: #{color.token(--wy-on-surface)};
  background-color: var(--wy-component-background-color);
  color: var(--wy-component-color);

  display: flex;
  flex-direction: column;
  box-sizing: border-box;

  align-items: stretch;
  justify-content: stretch;
  position: relative;
  flex: 1 1 100%;

  min-width: var.wy-rem(16);
  min-height: var.wy-rem(16);
  max-height: 100%;
  max-width: 100%;
}

[part~="wy-preview-layout"] {
  width: 100%;
  height: 100%;
  container-type: inline-size;
}

[part~="wy-preview-main"] {
  display: flex;
  height: calc(100% - #{var.default(--wy-titlebar-height)});
  min-height: 0;
  flex-direction: row;

  @include breakpoints.container-size-down(md) {
    flex-direction: column;
  }
}

[part~="wy-preview-swiper"] {
  display: flex;
  flex-direction: row;
  flex: 1 1 100%;
  align-items: center;
  justify-content: start;

  min-width: var.wy-rem(16);
  min-height: var.wy-rem(16);
  max-height: 100%;
  max-width: 100%;

  overflow-x: scroll;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: auto;
  overscroll-behavior-x: none;
  scrollbar-width: none;

  &::-webkit-scrollbar {
    display: none;
  }
}

[part~="wy-preview-swiper-disabled"] {
  overflow-x: hidden;
}

[part~="wy-preview-area"] {
  position: relative;
  min-width: 100%;
  min-height: 100%;
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  scroll-snap-stop: always;
  scroll-snap-align: center;
  container-type: size;
}

[part~="wy-nav-prev"],
[part~="wy-nav-next"] {
  --wy-component-background-color: #{color.token(--wy-surface-variant)};
  --wy-component-color: #{color.token(--wy-on-surface-variant)};

  background-color: var(--wy-component-background-color);

  position: absolute;
  top: 50%;
  z-index: const.$zindex-dropdown;
  border-radius: 50%;
}

[part~="wy-nav-prev"] {
  left: var.wy-rem(0.5);
}

[part~="wy-nav-next"] {
  right: var.wy-rem(0.5);
}

