/**
 * @license
 * Copyright Endlessjs. All Rights Reserved.
 * Licensed under the MIT License. See License.txt in the project root for license information.
 */

@mixin el-accordion-item-header() {
  border-bottom-width: el-theme(accordion-header-border-width);
  border-bottom-style: el-theme(accordion-header-border-style);
  border-bottom-color: el-theme(accordion-header-border-color);
  color: el-theme(accordion-header-text-color);
  font-family: el-theme(accordion-header-text-font-family);
  font-size: el-theme(accordion-header-text-font-size);
  font-weight: el-theme(accordion-header-text-font-weight);
  line-height: el-theme(accordion-header-text-line-height);
  padding: el-theme(accordion-padding);

  @include el-headings();
}

@mixin el-accordion-theme() {

  el-accordion {
    display: block;
    box-shadow: el-theme(accordion-shadow);
    border-radius: el-theme(accordion-border-radius);

    el-accordion-item-header {
      position: relative;
      @include el-accordion-item-header();

      .expansion-indicator {
        position: absolute;
        @include el-ltr(right, 1rem);
        @include el-rtl(left, 1rem);
      }
    }

    el-accordion-item {
      background-color: el-theme(accordion-item-background-color);
      color: el-theme(accordion-item-text-color);
      font-family: el-theme(accordion-item-text-font-family);
      font-size: el-theme(accordion-item-text-font-size);
      font-weight: el-theme(accordion-item-text-font-weight);
      line-height: el-theme(accordion-item-text-line-height);

      &.disabled el-accordion-item-header {
        color: el-theme(accordion-header-disabled-text-color);
        cursor: default;
      }

      &:first-child {
        border-top-left-radius: el-theme(accordion-border-radius);
        border-top-right-radius: el-theme(accordion-border-radius);
      }
      &:last-child {
        border-bottom-left-radius: el-theme(accordion-border-radius);
        border-bottom-right-radius: el-theme(accordion-border-radius);

        &.collapsed el-accordion-item-header {
          border-bottom: none;
        }
      }
    }
    el-accordion-item:not(.collapsed) + el-accordion-item el-accordion-item-header {
      border-top-color: el-theme(accordion-header-border-color);
      border-top-style: el-theme(accordion-header-border-style);
      border-top-width: el-theme(accordion-header-border-width);
    }

    el-accordion-item-body .item-body {
      flex: 1;
      -ms-flex: 1 1 auto;
      overflow: auto;
      padding: el-theme(accordion-padding);
      position: relative;
    }
  }
}
