@import '../../extends';
@import '../../functions';
@import '../../mixins';
@import '../../variables';

@import '../atoms/_headline.scss';

.#{utility('case-grid')} {
  margin-bottom: 7em;

  @media (min-width: 768px) {
    margin-bottom: calc(16vw + 6em);
  }
}

.#{organism('case-grid')} {
  grid-column: 1 / -1;
  width: 100%;
  height: auto;
  display: grid;
  grid-gap: 0;
  grid-template-columns: 32fr 5fr 4fr 10fr 7fr 10fr 8fr;
  grid-template-rows: 8fr 26fr 6fr 11fr 11fr 12fr 26fr;

  @media (min-width: 768px) {
    grid-template-columns: 32fr 5fr 4fr 10fr 7fr 10fr 8fr 24fr;
  }

  &-headline {
    grid-column: 3 / 16;
    @include hl-xlrg;
    margin-top: 0;
  }

  &-image {
    &:hover {
      z-index: 2;
      transform: translateY(-2%);
      transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    }

    &:hover &-info {
      opacity: 1;
      transform: translateY(0);
    }

    a {
      position: relative;
      display: block;
    }

    amp-img {
      transition: box-shadow 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    }
    
    &-info {
      width: 100%;
      padding: 0 2em;
      position: absolute;
      left: 0;
      bottom: 0;
      opacity: 0;
      background: #fff;
      z-index: 1;
      pointer-events: none;
      transform: translateY(10px);
      transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
      
      @media (max-width: 1023px) {
        display: none;
      }
    }

    &-1 {
      grid-column: 1 / 3;
      grid-row: 2 / 6;

      amp-img {
        box-shadow: 0 6.6vw 7vw 0 rgba(0, 0, 0, 0.5);
        
        &:hover {
          box-shadow: 0 7.6vw 8vw 0 rgba(0, 0, 0, 0.4);
        }
      }
    }

    &-2 {
      grid-column: 4 / 8;
      grid-row: 1 / 4;

      amp-img {
        box-shadow: 0 2.3vw 4.2vw -0.7vw rgba(0, 0, 0, 0.33);
        
        &:hover {
          box-shadow: 0 3.3vw 5.2vw -0.7vw rgba(0, 0, 0, 0.23);
        }
      }
    }

    &-3 {
      grid-column: 5 / 8;
      grid-row: 3 / 7;

      @media (min-width: 768px) {
        grid-column: 7 / 9;
        grid-row: 3 / 7;
      }

      amp-img {
        box-shadow: 0 1.4vw 2.8vw 1.4vw rgba(0, 0, 0, 0.2);
        
        &:hover {
          box-shadow: 0 2.4vw 3.8vw 1.4vw rgba(0, 0, 0, 0.1);
        }
      }
    }

    &-4 {
      grid-column: 2 / 6;
      grid-row: 5 / 8;

      amp-img {
        box-shadow: 0 0.3vw 1vw 0 rgba(0, 0, 0, 0.2);
        
        &:hover {
          box-shadow: 0 1.3vw 2vw 0 rgba(0, 0, 0, 0.1);
        }
      }
    }
  }

  &-link {
    padding: 40px 20px 0;
    grid-column: 1 / -1;
    grid-row: auto;

    @media (min-width: 768px) {
      grid-column: 6 / 9;
      grid-row: 7 / 8;
      padding: 12% 24% 0 12%;
    }
  }
}
