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

/* ------------------------------
　　メディア
------------------------------ */
.media-list {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding: 0;
  list-style: none;
}

.media-item {
  margin: 0 0 1.5rem;
}

.media-link {
  display: block;
  padding: 0 0 1.5rem;
  color: global.$color-text;
  text-decoration: none;
  border-bottom: global.$border-width-sm solid global.$color-gray30;

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

  &:hover {
    .media-img {
      transform: scale(1.2);
    }
  }

  &:hover {
    .media-read-more {
      &::before {
        transform: scaleX(1);
      }
    }
  }
}

.media-time {
  display: inline-block;
  margin: 0 0 0.25rem;
  color: global.$color-gray90;
  font-size: map.get(global.$font-scales, body-s);
  line-height: global.$line-height-base;
}

.media-title {
  margin: 0 0 1.25rem;
  font-size: map.get(global.$font-scales, heading-ss);
  line-height: global.$line-height-base;
}

.media-item-img {
  margin: 0 0 1.25rem;
}

.media-img-wrap {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: global.$border-radius-lg;
}

.media-img {
  transition: transform 0.4s ease-in-out;
  will-change: transform;
}

.media-text {
  margin: 0 0 1.25rem;
  color: global.$color-text-side;
  font-size: map.get(global.$font-scales, body-s);
  line-height: global.$line-height-base;
}

.media-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-tag-wrap {
  margin: 1.25rem 0 0;
}

@media screen and (min-width: acms.$breakpoint-sm-min) {
  .media-list {
    display: block;
  }

  .media-link {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr;
    grid-template-columns: 1fr 180px;
    padding: 1.25rem 0;

    &.is-noimage {
      grid-template-columns: auto;
    }
  }

  .media-item {
    margin: 0;
  }

  .media-item-header {
    grid-row: 1;
    grid-column: 1;
    padding: 0 global.$col-gutter 0 0;
  }

  .media-item-body {
    grid-row: 2;
    grid-column: 1;
    padding: 0 global.$col-gutter 0 0;
  }

  .media-item-img {
    grid-row: list.slash(1, 3);
    grid-column: list.slash(2, 3);
    margin: 0;
  }

  .media-time {
    margin: 0 0 0.5rem;
    font-size: map.get(global.$font-scales, body-m);
  }

  .media-title {
    margin: 0 0 1.25rem;
    font-size: map.get(global.$font-scales, heading-ss);

    &::before {
      content: none;
    }
  }

  .media-tag-wrap {
    margin: 2rem 0 0;
  }
}

@media screen and (min-width: acms.$breakpoint-md-min) {
  .media-link {
    grid-template-columns: 1fr 280px;
    padding: 2.5rem 0;
  }

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

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