// +Imports
// ====================
@import '../base/grid-settings';
@import 'neat/neat'; // lib - Neat

%hide-until-focus {
  @include left(0);
  display: inline-block;
  position: absolute;
  top: -($baseline*30);
  overflow: hidden;
}

.program-card{
  @include span-columns(12);  
  border: 1px solid $border-color-l3;
  border-bottom: none;
  box-sizing: border-box;
  margin-bottom: $baseline;
  position: relative;
  display: inline;

  .card-link{
    @include left(0);
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    border: 0;
    z-index: 1;
    opacity: 0.8;
    &:hover,
    &:focus{
      opacity: 1;
    }

    .banner-image-container{
      position: relative;
      overflow: hidden;
      height: 116px;

      .banner-image{
        @include left(50%);
        position: absolute;
        top: 0;
        z-index: 0;
        transform: translate(-50%, 0);
        min-height: 100%;
      }
    }
  }

  .text-section{
    padding: 40px $baseline $baseline;
    margin-top: 106px;
    position: relative;

    .meta-info{
      @include outer-container;
      font-size: em(12);
      color: $gray;
      position: absolute;
      top: $baseline;
      width: calc(100% - 40px);

      .organization{
        @include span-columns(6);
        white-space: nowrap;
        overflow: hidden;
      }

      .category{
        @include span-columns(6);
        text-align: right;

        .category-text{
            @include float(right);
        }

        .xseries-icon{
          @include float(right);
          @include margin-right($baseline*0.25);
          background: url('#{$static-path}/images/icon-sm-xseries-black.png') no-repeat;
          background-color: transparent;
          background-size: 100%;
          width: ($baseline*0.7);
          height: ($baseline*0.7);
        }
      }
    }
 
    .title{
      @extend %t-title4;
      font-size: em(24);
      color: $gray-d2;
      margin-bottom: 10px;
      line-height: 1.2;
      min-height: ($baseline*3);
    }
  }

  .certificate-status {
    .status-text {
      font-size: em(12);
      color: $gray;
    }
 
    .secondary {
      @extend %hide-until-focus;
    }

    .status-text {
      &:focus,
      &:active {
        position: relative;
        top: auto;
        width: auto;
        height: auto;
        margin: 0;
        text-decoration: none;

        & ~ .status-text {
          @extend %hide-until-focus;
        }
      }
    }
  }

  .progress {
    height: 5px;
    background: $x-light;

    .bar {
      @include float(left);
      height: 100%;
      position: relative;

      &.complete {
        background: $success-dark;
      }

      &.in-progress {
        background: $warning-base;
      }
    }
  }
}

@include media($bp-small) {
  .program-card{
    @include omega(n);
    @include span-columns(4);

    .card-link{
      .banner-image-container{
        height: 166px;
      }
    }

    .text-section{
      margin-top: 156px;
    }
  }
}


@include media($bp-medium) {
  .program-card{
    @include omega(n);
    @include span-columns(8);

    .card-link{
      .banner-image-container{
        height: 242px;
      }
    }

    .text-section{
      margin-top: 232px;
    }
  }
}



@include media($bp-large) {
  .program-card{
    @include omega(2n);
    @include span-columns(6);

    .card-link{
      .banner-image-container{
        height: 116px;
      }
    }

    .text-section{
      margin-top: 106px;
    }
  }
}

@include media($bp-huge) {
  .program-card{
    @include omega(2n);
    @include span-columns(6);

    .card-link{
      .banner-image-container{
        height: 145px;
      }
    }

    .text-section{
      margin-top: 135px;
    }
  }
}

