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

/* ------------------------------
　　メインビジュアル
------------------------------ */
.main-visual {
  position: relative;
  box-sizing: content-box; /* スライダーページネーション用のpaddingを含めない */
  height: var(--mv-height-sp, calc(100svh - var(--header-height-fixed)));
  min-height: 20rem;

  &:has(.splide__controls) {
    /* スライダーページネーションの高さを確保 */
    padding-bottom: 5.125rem;
  }

  @include acms.media-breakpoint-up(md) {
    height: var(--mv-height-pc, 48rem);
  }

  .main-visual-filter {
    position: absolute;
    z-index: 1;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgb(0 0 0 / 0%) 50%, #000 100%);
  }

  .main-visual-bg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;

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

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

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

    @include acms.media-breakpoint-up(md) {
      box-sizing: border-box;
      gap: 2rem;
      width: auto;
      max-width: 40rem;
      padding-block: 4.5rem;
      padding-inline: 5rem;
      overflow: hidden;
      text-align: unset;

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

        .main-visual-links {
          justify-content: flex-start;
        }
      }

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

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

        .main-visual-links {
          justify-content: flex-end;
        }
      }
    }

    @include acms.media-breakpoint-up(lg) {
      padding-block: 5rem;
      padding-inline: 6.5rem;
    }
  }

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

    @include acms.media-breakpoint-up(md) {
      font-size: map.get(global.$font-scales, heading-3xl);
      line-height: var(--line-height-2xs);
    }
  }

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

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

    .button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 200px;
    }

    @include acms.media-breakpoint-up(md) {
      display: flex;
      gap: calc(var(--col-gutter) / 2);
      justify-content: space-between;
      width: 100%;
      margin: 0 auto;

      .button {
        flex: 1;
      }
    }
  }
}
