// ============================================================================
// :: Metadata
// ============================================================================
/**
 * A list of data displayed in a horizontal direction. Every item has a name
 * and value representing something important in the brandplatform.
 */

// ============================================================================
// :: Settings
// ============================================================================
$item-spacing: 1rem;
$item-spacing-sides: $item-spacing * 2;

// ============================================================================
// :: Root
// ============================================================================
.bp-metadata {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  /**
   * Every item has some margin, add an offset to the width so it is aligned
   * correctly on the sides of the grid.
  */
  width: calc(100% + #{$item-spacing-sides});
  margin: -$item-spacing;
  padding: 0;

  list-style-type: none;
}

// ============================================================================
// :: Elements
// ============================================================================
.bp-metadata__item {
  position: relative;

  // create a grid of 2 elements above tablet
  width: calc(49.9% - #{$item-spacing-sides});
  margin: $item-spacing;

  text-align: center;

  // create a grid of 4 elements above tablet
  @include respond-at($bp-breakpoint-tablet-base) {
    width: calc(25% - #{$item-spacing-sides});
    margin: $item-spacing;
  }
}

.bp-metadata__amount {
  display: block;

  font-size: $bp-font-size-5x-large;
  line-height: $line-height-normalize;
  font-weight: $bp-font-weight-bold;

  color: $bp-text-color-medium;
}

.bp-metadata__name {
  position: absolute;
  bottom: 0;
  left: 50%;
  padding: 0.3rem 0.5rem;

  font-size: $bp-font-size-base;
  font-weight: $bp-font-weight-bold;
  letter-spacing: 0.1rem;

  background-color: $bp-primary-color;
  color: $bp-text-color-light;

  transform: translateX(-50%);

  @include respond-at($bp-breakpoint-tablet-base) {
    bottom: 0;
    left: 50%;

    transform: translateX(0);
  }
}
