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

/* ------------------------------
　　メディア
------------------------------ */
.media-list-wrap {
  padding: 0 math.div(acms.$grid-space, 2);
}

.media-list {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 30px;
  padding: 0;
  list-style: none;
}

.media-item {
  margin: 0 0 25px;
}

.media-link {
  display: block;
  padding: 0 0 25px;
  color: global.$color-text;
  border-bottom: global.$border-width-sm solid global.$color-gray30;

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

  &:hover {
    text-decoration: none;

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

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

.media-time {
  display: inline-block;
  margin: 0 0 5px;

  @include acms.font-size(13);

  color: global.$color-gray90;
  line-height: 1.5;
}

.media-title {
  margin: 0 0 15px;

  @include acms.font-size(20);

  line-height: 1.5;
}

.media-item-img {
  margin: 0 0 20px;
}

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

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

.media-text {
  margin: 0 0 15px;
  color: global.$color-text-side;

  @include acms.font-size(14);

  line-height: 1.5;
}

.media-read-more {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 10px 0 0;

  @include acms.font-size(16);

  font-weight: bold;

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

  &::after {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin: 0 0 0 10px;
    background: global.$color-secondary no-repeat;
    background-image: url(#{global.$root-theme-img + 'arrow-border-white.svg' });
    background-position: center;
    background-size: 5px 10px;
    border-radius: global.$border-radius-circle;
    content: "";
  }
}

.media-tag-wrap {
  margin: 20px 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;
    margin: 0 (math.div(global.$col-gutter, -2));
    padding: 15px 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 {
    margin: 0;

    @include global.create-grid-row-span(1, 3);
    @include global.create-grid-column-span(2, 3);
  }

  .media-time {
    margin: 0 0 10px;

    @include acms.font-size(16);
  }

  .media-title {
    margin: 0 0 20px;

    @include acms.font-size(20);

    &::before {
      content: none;
    }
  }

  .media-tag-wrap {
    margin: 30px 0 0;
  }
}


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

  .media-title {
    @include acms.font-size(28);
  }

  .media-text {
    @include acms.font-size(16);
  }
}
