// ACCORDION
.accordion{
    overflow: hidden;
    position: relative;
}
.accordion__input{
    z-index: -1;
    position: absolute;
    opacity: 0;
}
.accordion__label{
    @include block-selection;
    cursor: pointer;
    position: relative;
    display: block;
    margin: 0;
    padding: 1.5rem;
    padding-right: 4.5rem; // for plus
    padding-bottom: calc(1.5rem - 1px);
    border-bottom: 1px solid rgba(black, 0.1);
    font-family: $font-family--heading;
    font-weight: 700;
    line-height: $font-leading;
    background: $grey--light;
    @include transition;

    // plus
    &:before,
    &:after{
        content: '';
        position: absolute;
        top: 50%;
        right: 1.5rem;
        width: 0.75rem;
        height: 2px;
        margin-top: -1px;
        background: $main;
        @include transition(all, 0.45s, $easing--medium);
    }

    @include desktop{

        &:hover{
            background: darken($grey--light, 5%);
        }
        &:hover:after{
            transform: rotate(90deg);
        }
        &:hover:before{
            transform: rotate(90deg*2);
        }
    }
}
.accordion__content{
    // max-height: 0; // set in js
    color: $grey--dark;
    background: $grey--light;
    @include transition(max-height, 0.45s, $easing--medium);

    .the-content{
        padding: 3rem;
        border-bottom: 1px solid $grey--dark;

        // reset first paragraph lead
        & > p:first-of-type {
            font-size: inherit;
        }
        a{
            color: currentColor;
            text-decoration: underline;
        }

        a[href*="linkedin.com"],
        a[href$='.pdf'] {
            padding-left: 1.5rem;
            background-size: 1rem 1rem;
            background-position: center left;
            background-repeat: no-repeat;
        }

        // contains "linkedin.com"
        a[href*="linkedin.com"] {
            background-image: url('../icons/icon-href__linkedin.svg');
        }
        // ends with ".pdf"
        a[href$='.pdf'] {
            background-image: url('../icons/icon-href__pdf.svg');
        }
    }

    @include mobile{

        .the-content{
            padding: 3rem 1.5rem;
        }
    }
    @include desktop{

        .the-content a:hover{
            color: $main;
        }
    }
}
.accordion__content.hidden{
    max-height: 0;
}

// checked
.accordion__input:checked ~ .accordion__label{
    color: white;
    background: $main;

    &:after{
        background: white;
        transform: rotate(90deg);
    }
    &:before{
        background: white;
        transform: rotate(90deg*2);
    }
}
.accordion__input:checked ~ .accordion__content{
    // --height var set in js
    max-height: 9999px !important; // for browsers that don't support css vars
    max-height: var(--height) !important;
}
