// ============================================================================
// :: Category
// ============================================================================
/**
 * Component used mainly in the table of contents of the brandplatform. It
 * contains a header with a title, info text and a list of all the items
 * belonging to a category.
 */

// ============================================================================
// :: Settings
// ============================================================================
$content-minimum-height: 20rem;

// ============================================================================
// :: Root
// ============================================================================
.bp-category {
  position: relative;

  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2rem;
  overflow: hidden;

  border: 1px solid $bp-border-color-base;

  @include respond-at($bp-breakpoint-tablet-base) {
    padding: 3rem;
  }
}

// ============================================================================
// :: Elements
// ============================================================================
.bp-category__intro {
  margin-bottom: 3.5rem;
  max-width: 100%;
}

.bp-category__header {

  &:not(:only-child) {
    margin-bottom: 1.8rem;
  }
}

.bp-category__title {
  font-weight: $bp-font-weight-bold;
  font-size: $bp-font-size-1x-large;
  line-height: $bp-line-height-1x-large;
  letter-spacing: 0.1rem;
}

.bp-category__text {
  font-size: $bp-font-size-1x-small;
}

.bp-category__content {
  width: 100%;
  height: 100%;
  min-height: $content-minimum-height;
}

.bp-category__items {
  padding: 0;

  list-style-type: none;
}

.bp-category__item {
  border-bottom: 1px solid $bp-border-color-base;

  &:first-child {
    border-top: 1px solid $bp-border-color-base;
  }
}

.bp-category__item-link {
  display: block;
  padding: 2.2rem 0;

  font-size: $bp-font-size-1x-small;
  font-weight: $bp-font-weight-regular;
  line-height: $line-height-normalize;
  text-decoration: none;
  letter-spacing: 0.1rem;

  color: $bp-text-color-base;

  transition:
    color 0.2s ease-in-out,
    transform 0.2s ease-in-out;

  &:hover {
    color: $bp-primary-color;

    transform: translateX(1rem);
  }
}

// ============================================================================
// :: Modifiers
// ============================================================================
.bp-category--list {
  padding: 0;

  .bp-category__header {
    width: 100%;
    margin: 0;

    border-bottom: 1px solid $bp-border-color-base;
  }

  .bp-category__content {
    min-height: auto;
  }

  .bp-category__header,
  .bp-category__content {
    padding: 2rem;

    @include respond-at($bp-breakpoint-tablet-base) {
      padding: 3rem;
    }
  }

  .bp-category__items {
    display: flex;
    flex-wrap: wrap;
  }

  .bp-category__item {
    width: 100%;

    border: none;

    @include respond-at($bp-breakpoint-tablet-base) {
      margin: 0;
      width: 49.9%;
    }

    @include respond-at($bp-breakpoint-desktop-base) {
      width: 25%;
    }
  }

  .bp-category__item-link {

    &:hover {
      transform: translateX(0);
    }
  }
}

// ============================================================================
// :: States
// ============================================================================
.bp-category__item {

  &.is-hidden {
    display: none;
  }
}

.bp-category {

  &.has-not-found {
    display: none;
  }
}
