//
// Copyright IBM Corp. 2016, 2018
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

//-----------------------------
// Footer
//-----------------------------

@import '../../globals/scss/vars';
@import '../../globals/scss/css--reset';
@import '../../globals/scss/css--typography';
@import '../button/button';
@import '../link/link';

@mixin footer {
  @include deprecate(
    'The `footer` component in `carbon-components` has been deprecated. ' +
      'It will be removed in the next major release.'
  ) {
    .#{$prefix}--footer--bottom-fixed {
      position: fixed;
      bottom: 0;
      left: 0;
    }

    .#{$prefix}--footer {
      @include reset;
      @include font-family;
      box-sizing: border-box;
      display: flex;
      align-items: center;
      border-top: 2px solid $brand-01;
      background-color: $ui-01;
      min-height: 3.5rem;
      z-index: z('footer');
      padding: rem(20px) 5%;
      width: 100%;
    }

    .#{$prefix}--footer-info {
      display: flex;

      @media screen and (max-width: 600px) {
        flex-direction: column;
      }
    }

    .#{$prefix}--footer-info__item {
      @include typescale('delta');
      @include line-height('body');
      display: flex;
      flex-direction: column;
      margin: 0;
      margin-right: rem(64px);
    }

    .#{$prefix}--footer-info__item > .#{$prefix}--link {
      font-weight: 600;
    }

    .#{$prefix}--footer-info__item > .#{$prefix}--footer-label {
      @include typescale('zeta');
      @include line-height('body');
      margin: 0;

      @media screen and (max-width: 600px) {
        display: none;
      }
    }

    .#{$prefix}--footer-cta {
      margin-left: auto;
    }
  }
}

@include exports('footer') {
  @if not(feature-flag-enabled('breaking-changes-x')) {
    @include footer;
  }
}
