@use "../../../themes/mixins/deck";

.main {
  position: relative;

  display: flex;
  justify-content: center;

  @media (max-width: 576px) {
    margin-bottom: 2.75rem;
  }

  max-width: 960px;
}

.container {
  position: relative;

  overflow: hidden;
  display: block;

  width: calc(540px * 16 / 9);
  height: 540px;

  opacity: 0;
  visibility: hidden;

  transition: opacity 0.15s ease-out;

  &:global(.loaded) {
    opacity: 1;
    visibility: visible;
  }

  &:global(.mobile) {
    pointer-events: none;

    a {
      pointer-events: all;
    }
  }

  @include deck.container;

  @media (min-width: 992px) {
    max-width: 960px;
    max-height: calc(960px / 16 * 9);
  }

  margin: 1.75rem auto;

  deckgo-deck {
    @media (min-width: 768px) {
      --slide-padding-end: 5rem;
      --slide-padding-start: 5rem;
      --slide-author-padding-end: 5rem;
      --slide-author-padding-start: 5rem;
      --slide-split-padding-end: 5rem;
      --slide-split-padding-start: 5rem;
    }

    deckgo-slide-split {
      --slide-split-align: center;
      --slide-split-padding-bottom: 0;
      --slide-split-padding-top: 0;

      @media (max-width: 576px) {
        h2 {
          font-size: 1rem;
          line-height: 1.25rem;
        }
      }
    }

    deckgo-highlight-code {
      line-height: 1rem;
    }

    *[slot]:not([slot="background"]) {
      z-index: 2;
    }

    div[slot="background"] {
      width: 100%;
      height: 100%;
      z-index: 1;

      > :global(img.wave) {
        position: absolute;
        bottom: -1px;
        left: 0;
      }

      :global(img.background) {
        height: 100%;
        width: 100%;
        object-fit: cover;
      }
    }
  }
}

.action {
  border: none;
  outline: none;
  font: inherit;
  color: inherit;
  background: none;
  padding: 0;

  display: flex;
  justify-content: center;
  align-items: center;

  cursor: pointer;
  pointer-events: all;

  transition: font-size 300ms;

  height: fit-content;

  &:hover,
  &:active {
    font-size: 4.6rem;
  }

  &:global(.prev) {
    color: red;
  }

  &:global(.next),
  &:global(.prev) {
    position: absolute;
    z-index: 3;

    bottom: -3.45rem;
    transform: translate(0, -50%);

    color: var(--color-dark);

    &:global(.next) {
      left: calc(50% + 16px);
    }

    &:global(.prev) {
      left: calc(50% - 64px);
    }

    svg {
      width: 48px;
      height: 48px;
    }

    &:global(.hide) {
      color: rgba(var(--color-dark-rgb), 0.2);
    }
  }

  @media (min-width: 992px) {
    &:global(.next),
    &:global(.prev) {
      color: var(--deck-nav-color);

      top: 50%;
      transform: translate(0, -50%);

      &:global(.next) {
        left: unset;
        right: 1rem;
      }

      &:global(.prev) {
        left: 1rem;
      }

      svg {
        width: 64px;
        height: 64px;

        opacity: 0.82;
      }

      opacity: 1;
      visibility: visible;
      transition: opacity 0.5s ease-out;

      &:global(.hide) {
        opacity: 0;
        visibility: hidden;
      }
    }
  }
}
