/**
 * ページパーツで読み込むとSmoooothの設定画面で動作しなくなってしまうスタイルをまとめたCSS
 * フッターなどで読み込みます
 */

/**
 * header
 */
.header-nav__content {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-80px);

  &.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0px);
  }
}
.header-nav__trigger.active {
  & .header-nav__trigger-toggle {
    background-color: var(--ink);
    &::before, &::after {
      background-color: var(--ink);
    }
  }
}

/**
 * Dialog
 */
.dialog {
  & .dialog__content-wrapper {
    position: fixed;
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
  }

  & .dialog__content {
    position: fixed;
    top: 10vh;
    left: 50%;
    transform: translateX(-50%);
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 101;

    & img {
      display: none !important;
    }
  }

  & .dialog__layer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0 0 0 / 50%);
    z-index: 100;
  }

  &.open {
    & .dialog__content-wrapper {
      opacity: 1;
      pointer-events: auto;
    }

    & .dialog__content {
      & img {
        display: block !important;
      }
    }
  }
}

@keyframes pulse {
  0% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  
  &::before, &::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition-property: transform;
    transition-duration: 450ms;
    transition-timing-function: linear;
    transform-origin: top;
    
    @media (min-width: 1024px) {
      transform-origin: left;
    }
  }
  &::before {
    background-color: var(--logo-sky);
    z-index: 1;
    transition-delay: 450ms;
  }
  &::after {
    background-color: var(--snow);
    z-index: 2;
  }

  & img {
    animation: pulse 3s ease-in-out infinite;
    width: 320px;
    max-width: 80vw;
    z-index: 3;
    transition: visibility 450ms linear;
  }

  & .spinner {
    animation: spin 3s linear infinite;
    width: 4rem;
    height: 4rem;
    border-radius: 9999px;
    border: 1px solid rgba(0 0 0 / 20%);
    border-top-color: var(--ink);
  }

  &.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition-delay: 900ms;
    
    &::before {
      transform: scaleY(0%);
    }
    &::after {
      transform: scaleY(0%);
    }
    @media (min-width: 1024px) {
      &::before {
        transform: scaleX(0%);
      }
      &::after {
        transform: scaleX(0%);
      }
    }
    
    & img {
      visibility: hidden;
    }
  }
}