// LIST
.list-wrapper{
    padding-top: 3rem;
}

.list-title{
    position: relative;
    display: inline-flex;
    margin-top: 0;
    margin-right: 4.5rem; // for reset
    padding: 0.75rem;
    font-weight: 700;
    color: white;
    background: $main;
    @include transition(background);

    span{
        display: inline-block;
        line-height: $font-leading;
    }

    @include mobile{
        margin-bottom: 1.5rem;
    }
    @include desktop{
        position: sticky;
        top: 0;
    }
}
.list-title--selected{
    background: $secondary;

    .list-title__location{
        color: $secondary;
    }
    .list-title__reset{
        // show
        visibility: visible;
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}
.list-title__location{
    // reset list style
    margin: 0;
    padding: 0;
    list-style: none;

    margin-left: 0.5rem;
    padding: 0 0.75rem;
    color: $main;
    background: white;
    border-radius: 0.75rem;
}
.list-title__reset{
    @include block-selection;
    cursor: pointer;
    position: absolute;
    top: 0;
    left: 100%;
    bottom: 0;
    padding: 0.75rem;
    background: $error;
    // hide
    visibility: hidden;
    opacity: 0;
    transform: translate3d(-0.75rem, 0, 0);
    @include transition;
}

.list {
    margin-top: 0;
    width: 100%;
    color: $grey--dark;

    // tbody tr:nth-of-type(odd) {
    //     background: $grey--light;
    // }
    // tbody tr:nth-of-type(even) {
    //     background: darken($grey--light, 5%);
    // }
    th {
        padding: 0.75rem;
        text-align: left;
        word-wrap: break-word;
    }
    td {
        padding: 0.75rem;
        text-align: left;
        word-wrap: break-word;
    }
    tbody td{
        padding-bottom: calc(0.75rem - 1px);
        border-bottom: 1px solid $grey--light;
    }
    a{
        color: currentColor;
        text-decoration: underline;
    }

    @include mobile{
        // force table to not be like tables anymore
    	display: block;

        thead, tbody, th, tr, td {
    		display: block;
    	}

        // hide table headers (but not display: none, for accessibility)
    	thead tr {
    		position: absolute;
    		top: -9999px;
    		left: -9999px;
    	}

        tbody tr{
            margin-bottom: 1.5rem;
            background: $grey--light;
        }
    	tbody td {
            overflow: hidden;
    		position: relative;
    		padding-left: 25%;
            border-color: darken($grey--light, 5%);

            // now like a table header
            &:before{
                content: attr(data-text);
        		position: absolute;
        		top: 0;
        		left: 0;
        		width: 25%;
        		padding: 0.75rem;
                font-size: 0.75rem;
                text-align: right;
                color: $main;

                // add ellipsis
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;
            }
    	}
    }

    @include desktop{
        table-layout: fixed; // same column widths
        border-collapse: collapse;

        th{
            font-family: $font-family--heading;
            font-weight: 700;
            // color: white;
            background: $grey--light;
        }
        th:nth-of-type(even){
            background: darken($grey--light, 5%);
        }
        tbody tr{
            @include transition(background);

            &:hover{
                // color: $main;
                background: $grey--light;
            }
        }
    }
}
