@import "../variables";

.sz-accordion {
    display: block;
    font-size: $font-size;
}

.sz-accordion-item {
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: $color-grey-100-light;
    box-shadow: 0 2px 1px -1px rgba(0, 0, 0, .2), 0 1px 1px 0 rgba(0, 0, 0, .14), 0 1px 3px 0 rgba(0, 0, 0, .12);
    line-height: 1.25rem;

    &:first-child {
        border-top-left-radius: $border-radius;
        border-top-right-radius: $border-radius;

        .sz-accordion-item-header {
            border-top: none;
        }
    }

    &:last-child {
        border-bottom-left-radius: $border-radius;
        border-bottom-right-radius: $border-radius;
    }
}

.sz-accordion-item-header {
    padding: 1rem 1.25rem;
    border-top: 1px solid lighten($color-grey-100-dark, $color-offset-percent);
    line-height: 1.5rem;
    font-weight: bolder;
    cursor: pointer;

    div {
        display: flex;
        align-items: center;
    }

    span {
        flex: 1;
    }

    sz-icon {
        transform: rotate(0deg);
        transition: transform $transition-speed;
    }
}

.sz-accordion-item-body {
    display: block;
    overflow: hidden;
    //max-height: 0; => from 'sz-accordion-item.component.ts'
    transition: max-height $transition-speed;

    div {
        padding: 1rem 1.25rem;
    }
}

// States:
.sz-accordion-item-header-active {
    border-bottom: 1px solid lighten($color-grey-100-dark, $color-offset-percent);

    sz-icon {
        transform: rotate(180deg);
        transition: transform $transition-speed;
    }
}

.sz-accordion-item-body-active {
    //max-height: variable; => from 'sz-accordion-item.component.ts'
    transition: max-height $transition-speed;
}
