@use "sass:map";
@use "global/acms-common" as acms;
@use "global/common" as global;

/* ------------------------------
　　メインビジュアル
------------------------------ */
.main-visual {
  position: relative;
  height: var(--mv-height-sp, calc(100svh - 3.5rem));
  min-height: 20rem;
  overflow: hidden;
}

.main-visual-bg {
  width: 100%;
  height: 100%;

  .is-alone {
    animation: zoom 3s 0.3s 1 both;
    animation-duration: ease-out;
  }

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

#main-visual-slider {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding-bottom: 2.5rem;
  overflow: hidden;

  .splide__track,
  .splide__list,
  .splide__slide,
  .splide__slide picture,
  .splide__slide img {
    width: 100%;
    height: 100%;
  }

  .splide__slide picture,
  .splide__slide img {
    object-fit: cover;
  }

  .splide__pagination {
    bottom: 0;
  }
}

.main-visual-box {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 2rem;
  box-sizing: border-box;
  width: calc(100vw - 40px);
  max-width: 480px;
  padding: 2.5rem 2rem;
  color: global.$color-primary;
  background: rgb(255 255 255 / 90%);
  transform: translate(-50%,-50%);
  place-content: center;
}

.main-visual-catch {
  margin: 0;
  font-size: map.get(global.$font-scales, heading-l);
  line-height: global.$line-height-sm;
  animation: fade-in 0.3s 0.8s 1 both;
  will-change: transform, opacity;
}

.main-visual-catch-sub {
  margin: 0;
  font-weight: bold;
  font-size: map.get(global.$font-scales, body-m);
  line-height: global.$line-height-lg;
  animation: fade-in 0.3s 1.3s 1 both;
  will-change: transform, opacity;
}

.main-visual-links {
  display: grid;
  gap: 1rem;

  .button.is-bordered:not(:hover) {
    background: global.$color-white;
  }
}

.main-visual-scroll {
  position: absolute;
  bottom: 1rem;
  width: 100%;
  margin: 0;
  text-align: center;
  animation: fade-in 0.3s 2.8s 1 both;
  will-change: transform, opacity;
}

.main-visual-scroll-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;

  &:link,
  &:visited,
  &:active,
  &:focus {
    color: global.$color-white;
  }

  &:hover {
    opacity: 0.6;
  }

  &::after {
    display: inline-block;
    width: 0.5rem;
    height: 1rem;
    margin: 0.25rem 0 0;
    background-image: url(#{global.$root-theme-img + 'arrow-border-white.svg' });
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transform: rotate(90deg);
    content: "";
  }
}

@media screen and (min-width: acms.$breakpoint-md-min) {
  .main-visual {
    height: var(--mv-height-pc, 48rem);
  }

  .main-visual-box {
    box-sizing: content-box;
    width: auto;
    min-width: 434px;
    max-width: 100%;
    padding: 5.5rem 6.5rem;

    &.is-left {
      left: 0;
      text-align: left;
      transform: translate(0,-50%);
    }

    &.is-center {
      text-align: center;
    }

    &.is-right {
      right: 0;
      left: auto;
      text-align: right;
      transform: translate(0,-50%);
    }
  }

  .main-visual-catch {
    font-size: map.get(global.$font-scales, display-m);
  }

  .main-visual-links {
    grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
    gap: 2rem;
    justify-content: center;
    max-width: 434px;
    margin: 0 auto;

    .main-visual-box.is-left & {
      justify-content: flex-start;
    }

    .main-visual-box.is-right & {
      justify-content: flex-end;
    }
  }

  .main-visual-scroll {
    margin-bottom: 1rem;
  }
}
