// ============================================================================
// :: Menu item
// ============================================================================
/**
* This component is made of an icon with a text label. This is only used in the
* menu to represent the navigation. It has an active state which is used to
* indicate the active page.
 */

// ============================================================================
// :: Root
// ============================================================================
.a-menu-item {
  position: relative;

  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  @include respond-at($breakpoint-tablet-default) {
    width: 100%;
    padding: 1.6rem 0;

    transition: background-color 0.3s ease-in-out;
  }
}

// ============================================================================
// :: Elements
// ============================================================================
.a-menu-item__link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: $z-index-roof;

  width: 100%;
  height: 100%;

  font-weight: $font-weight-regular;
  text-decoration: none;
}

button.a-menu-item__link {
  padding: 0;

  border: none;
  background: transparent;

  cursor: pointer;
}

.a-menu-item__visual {
  position: relative;
}

.a-menu-item__icon {
  display: block;

  font-size: $font-size-2x-large;

  color: $text-color-base;

  @include respond-at($breakpoint-tablet-default) {
    font-size: $font-size-4x-large;
  }
}

.a-menu-item__text {
  font-size: $font-size-3x-small;

  @include respond-at($breakpoint-tablet-default) {
    font-size: $font-size-2x-small;

    margin-top: 0.6rem;
  }
}

.a-menu-item__badge {
  position: absolute;
  top: 0.5rem;
  left: 50%;
}

// When text is large, adjust readability for menu item labels
html[data-text-zoom="large"],
html[data-text-zoom="xlarge"] {
  .a-menu-item__text {
    word-break: break-word;
    text-align: center;
    line-height: 1.25;
  }
}

// ============================================================================
// :: Modifiers
// ============================================================================
.a-menu-item__icon--active {
  position: absolute;
  top: 0;
  left: 0;

  opacity: 0;

  transition: opacity 0.3s ease-in-out;
}

// ============================================================================
// :: States
// ============================================================================
.a-menu-item {
  &.is-active,
  &:hover {
    @include respond-at($breakpoint-tablet-default) {
      background-color: $background-color-base;
    }

    .a-menu-item__icon--active {
      opacity: 1;
    }
  }
}
