$page-header-widget-width: 350px;

@use "00-base/configure" as *;

.ma__page-header {

  @include ma-container;

  @include clearfix;

  &__tags {
    clear: both;
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: space-between;
    overflow: hidden;
    margin-bottom: 20px;
    padding-top: 18px;
    border-bottom-width: 1px;
    border-bottom-style: solid;


    .ma__header-tags,
    .ma__social-links {
      border-bottom-width: 1px;
      border-bottom-style: solid;
      min-height: 48px;
      position: relative;
        top: 1px;

      @media ($bp-medium-min) {
        border: 0;
      }
    }

    .ma__header-tags {
      flex-grow: 1;
      margin-bottom: 30px;

      @media ($bp-medium-min) {
        margin-bottom: 10px;
      }
    }

    @media ($bp-medium-max) {
      border: 0;
    }
  }

  &__content {
    padding: 30px 0;

    // With underline decoration

    &--underline {

      &:after {
        content: "";
        position: absolute;
        display: block;
        height: 6px;
        width: 105px;
        background-color: #388557;
        -webkit-transform: skew(-30deg);
        -ms-transform: skew(-30deg);
        transform: skew(-30deg);
        margin-top: 1rem;
      }
    }
  }

  &--has-optional-content &__content {
    padding-bottom: 0
  }

  &__tags ~ &__content {
    padding-top: 30px;

    @media ($bp-medium-min) {
      padding-top: 40px;
    }

    @media ($bp-large-min) {
      padding-top: 50px;
    }

    @media ($bp-x-large-min) {
      padding-top: 60px;
    }
  }

  .ma__page-banner-legacy ~ & &__content {
    padding-top: 20px;
  }

  &__publish-state {
    margin-top: -20px;
    margin-bottom: 35px;
  }

  &__category {
    font-size: $fonts-medium;
    padding-bottom: 1rem;
    line-height: 1.1;
    font-weight: $fonts-bold;
    letter-spacing: $letter-spacing-large;
    text-transform: uppercase;
    color: var(--mf-c-font-detail);

    @media ($bp-small-min) {
      font-size: $fonts-large;
    }
  }

  &__title {
    margin-bottom: .4em;

    &:last-child {
      margin-bottom: 0;

      .ma__page-header--has-optional-content  & {
        margin-bottom: .4em;
      }
    }

    .ma__page-header__sub-title {
      margin-top: .8em;
    }

    & > abbr {
      font-size: $fonts-large;
      border: none;
      text-decoration: none;
    }
  }

  .ma__page-banner-legacy ~ & &__title {
    display: none;
  }

  &__sub-title, &__description {

    &:last-child {
      margin-bottom: 0;
    }
  }

  // Control font size and line height
  // regardless of it's added to page

  &__sub-title,
  &__sub-title * {
    font-size: $fonts-larger;
    line-height: 1.5 !important;
    margin-bottom: 1em;

    .popover {

      &__trigger {
        margin-bottom: 0;
      }
    }

    .ma__page-header--has-optional-content &:last-child {
      margin-bottom: 1em;
    }
  }

  &__sub-title .ma__rich-text__container {
    margin-bottom: 0;
  }

  &__divider {
    clear: both;
    padding-bottom: 30px;

    @media ($bp-medium-min) {
      padding-bottom: 50px;
    }

    @media ($bp-large-min) {
      padding-bottom:60px;
    }

    .ma__divider {
      padding-left: 0;
      padding-right: 0;
    }

  }



// buttons


  &__buttons {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;

    &-wrapper {
      display: flex;
      width: 100%;
      margin-top: 1.5rem;

      @media ($bp-medium-max) {
        flex-direction: column;
        align-items: flex-start;
      }
    }

    &-label {
      font-size: $fonts-small;
      font-weight: $fonts-bold;
      margin-right: 1rem;
      margin-top: 0.75rem;
      letter-spacing: $letter-spacing-large;
      flex: 0 0 fit-content;
    }
  }

  &__button {
    display: inline-block;
    text-shadow: none;
    margin-top: 0.5rem;
    margin-right: 0.5rem;
  }

// links

  &__links {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
  }

  &__link {
    display: inline-block;
    text-shadow: none;
    margin-top: 0.5rem;
    margin-right: 2rem;
    white-space: nowrap;
  }
}

//theme

.ma__page-header {

  &__tags {

    @media ($bp-medium-min) {
      border-color: var(--mf-c-bd-divider);
    }

    .ma__header-tags,
    .ma__social-links {
      border-color: var(--mf-c-bd-divider);
    }
  }

  &__sub-title {
    color: var(--mf-c-font-heading);
    font-weight: $fonts-bold;
  }

}
