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

/* ------------------------------
　　横組みカード
------------------------------ */
.visual-card-wrap {
  position: relative;
  padding: 2.5rem 0.75rem;

  .splide__track {
    overflow: unset;
  }

  .splide__pagination {
    position: static;
    margin-top: 1.25rem;
    padding: 0;

    li + li {
      margin-left: 1rem;
    }
  }

  .splide__pagination__page {
    display: block;
    width: 0.625rem;
    height: 0.625rem;
    padding: 0;
    background: global.$color-gray40;
    border: 0;
    border-radius: 50%;
    opacity: 1;

    &.is-active {
      background: global.$color-primary;
      transform: unset;
    }
  }

  .splide__arrow {
    position: absolute;
    top: 33.233vw;
    z-index: 1;
    display: block;
    width: 3rem;
    height: 3rem;
    padding: 0;
    background: none;
    border: none;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgb(0 0 0 / 20%);
    transform: translateY(-50%);

    .arrow {
      @include global.arrow-circle($size: l,$color-bg:global.$color-white,$color-line:gray);
    }

    .label {
      visibility: hidden;
    }
  }

  .splide__arrow--prev {
    left: -0.75rem;

    .arrow {
      transform: rotate(180deg);
    }
  }

  .splide__arrow--next {
    right: -0.75rem;
  }
}

.visual-card {
  height: 100%;
}

.visual-card-link {
  display: block;
  height: 100%;
  min-height: 28rem;
  overflow: hidden;
  color: global.$color-text;
  text-decoration: none;
  background: global.$color-gray20;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgb(0 0 0 / 20%);
}

.visual-card-img-wrap {
  position: relative;
  flex: 0 0 60%;
  overflow: hidden;
  aspect-ratio: 3/2;
}

.visual-card-img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  transition: transform 0.4s ease-in-out;
  will-change: transform;
}

.visual-card-body {
  padding: 1.5rem;
}

.visual-card-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  color: global.$color-gray90;
  font-size: map.get(global.$font-scales, body-s);

  & > * {
    margin: 0 1rem 0 0;
  }
}

.visual-card-title {
  font-size: map.get(global.$font-scales, body-m);
}

.visual-card-text {
  font-size: map.get(global.$font-scales, body-s);
}

.visual-card-category {
  position: relative;
  padding-left: 1rem;

  &::before {
    position: absolute;
    top: 0.35em;
    left: 0;
    display: block;
    width: 1px;
    height: 1rem;
    background: global.$color-gray60;
    content: "";
  }
}

.visual-card-title {
  margin: 1rem 0;
}

.visual-card-read-more {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0.5rem 0 0;
  font-weight: bold;
  font-size: map.get(global.$font-scales, body-m);

  &::before {
    position: absolute;
    right: 0;
    bottom: -0.5rem;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: global.$color-secondary;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    content: "";
  }

  &::after {
    margin: 0 0 0 0.5rem;

    @include global.arrow-circle($size: ss,$color-bg:global.$color-secondary,$color-line:white);

    content: "";
  }
}

@media (hover: hover) {
  .visual-card-link:hover {
    .visual-card-img {
      transform: scale(1.1);
    }

    .visual-card-read-more::before {
      transform: scaleX(1);
    }
  }
}

@media (min-width: acms.$breakpoint-md-min) {
  .visual-card-wrap {
    padding: 3rem 0 4rem;

    .splide__track {
      padding: 0 calc(50vw - 35.5rem) !important;
    }

    .splide__arrow {
      top: 50%;
      margin: 0;
      transform: translateY(-50%);
    }

    .splide__arrow--prev {
      left: 0;
    }

    .splide__arrow--next {
      right: 0;
    }
  }

  .visual-card-link {
    display: flex;
  }

  .visual-card-img-wrap {
    aspect-ratio: unset;
  }

  .visual-card-body {
    align-self: center;
    padding: 3rem;
  }

  .visual-card-title {
    font-size: map.get(global.$font-scales, heading-s);
  }

  .visual-card-text {
    font-size: map.get(global.$font-scales, body-m);
  }
}

@media (min-width: 75rem) {
  .visual-card-wrap {
    .splide__arrow--prev {
      left: calc(50vw - 37rem);
    }

    .splide__arrow--next {
      right: calc(50vw - 37rem);
    }
  }
}
