/**
** FIGURE
** Figure element, displaying images, embeds, videos etc.
** 1. Figure itself
** 2. Figcaption element w/content
**
** PRINCIPLE:
** <figure class="c-figure">
**   <div class="c-figure__img">
**      <img>
**   </div>
**   <figcaption class="c-figure__caption">
**       <div class="c-figure__info">Caption</div>
**       <div class="c-figure__byline">License, CTA</div>
**   </figcaption>
** </figure>
**/

/* 1. */
.c-figure {
  img {
    width: 100%;
  }
  iframe {
    display: block;
  }

  > * {
    max-width: 100%;
    border: 0;
  }
}
.c-figure {
  margin: $spacing 0 $spacing;

  @include mq($from: desktop) {
    margin: $spacing--large 0 $spacing--large;
    @include grids-expand(4,6,2);
  }
  transition: transform 0.2s, width 0.2s, height 0.2s;

  .c-license-icons__list {
    margin-right: $spacing--small;
  }

  &--full-column {
    left: auto !important;
    right: auto !important;
    width: auto !important;
    overflow: hidden;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: $spacing--large;
    margin-bottom: 0;
  }
}

/* 2. */
.c-figure__caption {
  background-color: $brand-grey--lightest;
  padding-top: $spacing--small;
  display: block;
}
.c-figure__captionbtn {
  background: none;
  border: none;
  cursor: pointer;
  color: $brand-color;
  box-shadow: $link;
  padding: 0;
  @include font-size(14px);
  &:hover {
    box-shadow: $link--hover;
  }
}
.c-figure__licensetag {
  display: none;
}
.c-figure__byline {
  text-align: left;
  display: flex;
  align-items: center;

  .c-license-icons__list {
    flex-direction: row;
    text-align: center;
    justify-content: center;
  }

  .c-figure__captionbtn {
    svg {
      display: none;
    }
  }

  .c-license-icons__licenselabel {
    // remove license descriptions
    display: none;
  }
}

.c-figure__byline-authors {
  @include font-size(14px);
  border-right: 1px solid $brand-grey--light;
  padding-right: $spacing--small;
  margin-right: $spacing--small;
}

.c-figure__info {
  max-width: 650px;
  margin-bottom: $spacing--small;
  @include inuit-font-size(14px, 22px);
  @include mq($from: tablet) {
    flex: 2;
    margin-bottom: $spacing--small;
  }
}

.c-figure__fullscreen-btn {
  cursor: pointer;
  position: absolute;
  bottom: 0;
  right: 0;
  padding: 5px $spacing--small 8px;
  transition: all 0.3s ease-out;
  background: rgba($white, 0.2);

  svg {
    transition: transform 0.4s ease-out;
    width: 26px;
    height: 26px;
    fill: $brand-color;
  }
}

.c-figure:hover {
  .c-figure__fullscreen-btn {
    background: $white;
    svg {
      transform: scale(1.2);
    }
  }
}

.c-figure {
  &__link-wrapper {
    margin-top: $spacing--small;

    .c-icon {
      margin-left: $spacing--small/2;
      width: 18px;
      height: 18px;
    }
  }

  &__link {
    color: $brand-color;
    box-shadow: none;
    display: flex;
    align-items: center;
    @include font-size(14px, 25px);

    &:hover,
    &:active,
    &:focus {
      .c-figure__link-text {
        box-shadow: $link--hover;
      }
    }
  }

  &__link-text {
    box-shadow: $link;
    display: block;
  }

  &__link-description {
    margin-top: $spacing--small/2 !important;
    margin-bottom: 0;
    @include font-size(14px, 25px);
  }
}
