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

@import '../atoms/_text.scss';
@import '../atoms/_headline.scss';
@import '../atoms/_icon.scss';
@import '../atoms/_color.scss';

.#{utility('format-explainer')} {
  overflow: hidden;
  padding-left: 20px;
  padding-right: 20px;
  margin-bottom: 7em;

  @media (min-width: 1024px) {
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 8vw;
  }
}

.#{organism('format-explainer')} {

  .swift {
    & > div {
      transform: translateX(7.5%);

      &.active {
        transform: translateX(0);
        transition-delay: 0.4s;
      }
    }
  }

  &-group {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;

    & > div {
      grid-column: 1 / -1;
      grid-row: 1 / -1;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.4s cubic-bezier(.55,0,.1,1), visibility 0.4s cubic-bezier(.55,0,.1,1), transform 0.4s cubic-bezier(.55,0,.1,1);

      &.active {
        opacity: 1;
        visibility: visible;
      }
    }
  }

  &-visual {
    grid-column: 1 / -1;
    grid-row: 1 / 4;
    order: 2;
    position: relative;
    width: 100%;
    padding: 0 1.5em;

    @media (min-width: 1024px) {
      grid-column: 1 / 14;
      order: inherit;
      padding: 7em 0 0;
    }

    .#{molecule('format-visual')} {
      margin-bottom: 0;
    }
  }

  &-content {
    align-items: end;
  }

  &-content,
  &-navigation {
    grid-column: 1 / -1;
    width: 100%;
    margin-bottom: 0;

    @media (min-width: 1024px) {
      grid-column: 14 / 24;
    }

    @media (min-width: 1280px) {
      grid-column: 14 / 22;
    }
  }

  &-headline {
    margin-top: 0;
  }

  &-copy {
    margin-bottom: 0;
  }

  &-navigation {
    order: 2;
    overflow-y: hidden;
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-wrap: nowrap;
    width: auto;
    padding: 0 20px 15px;
    margin: 0 -20px 15px;

    @media (min-width: 1024px) {
      order: inherit;
      overflow: visible;
      flex-direction: column;
      max-width: 300px;
      padding: 0;
      margin: 0;
    }

    &:after {
      content: '';
      padding-right: 1px;
    }
  }

  &-button {
    @include hl;
    @include hl-h5;
    line-height: 1;
    -webkit-appearance: none;
    min-width: 160px;
    display: flex;
    align-items: center;
    padding: 10px 15px;
    margin: 0 15px 1em 0;
    text-align: left;
    background-color: color('athens-gray');
    border: none;
    border-radius: 4px;
    cursor: pointer;

    @media (min-width: 1024px) {
      margin: 0 0 1em 0;
      background: none transparent;
    }

    &.active {
      color: #fff;
      box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
    }

    &:hover {
      background-color: color('athens-gray');
    }

    &-websites.active { @include gradient-websites; }
    &-stories.active { @include gradient-stories; }
    &-ads.active { @include gradient-ads; }
    &-email.active { @include gradient-e-mails; }

    &-icon {
      width: 30px;
      height: 30px;
      margin-right: 14px;

      &.active {
        fill: #fff;
      }
    }
  }

  &-link {
    grid-column: 1 / -1;
    order: 3;

    @media (min-width: 1024px) {
      grid-column: 14 / 20;
      order: inherit;
    }
  }
}
