/* [cssnext](http://cssnext.io/) syntax */

@keyframes spin {
    from {
        transform: rotate(0deg)
    }
    to {
        transform: rotate(360deg)
    }
}

button.HackerNewsButton {
    background: rgb(246, 246, 239);
    margin: 10px;
    border: 1px solid #d8d8d8;
    color: black;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 0.8em;

    &:hover {
        background: rgb(246, 246, 239) !important;
        color: #f26522 !important;
    }
}

i.HackerNewsSpinner {
    color: #f26522;
    animation: spin 1s infinite;
    margin-top: 20px;
}

.HackerNewsDemo {
    background-color: rgb(246, 246, 239);
    border: 2px solid #d8d8d8;
    padding: 0.5em 1em;
    font-family: Verdana, Geneva, sans-serif;
    line-height: 2em;

    & ng-component {
        display: block;
        width: 100%;
    }

    & .fetchMore {
        cursor: pointer;
        background: transparent;
        width: 100%;
        text-align: center;
        color: #999;
        transition: border .25s;
        border: 1px solid #d8d8d8;
        font-size: 0.8em;

        &:hover {
            border-color: #999;
            color: black;
        }
        & > a:hover { color: inherit; }
    }

    & .commentCount {
        margin-right: 5px;
    }

    & .opener {
        order: 1;
        cursor: pointer;
        font-size: 0.7em;
        &:hover {
            color: #f26522;
        }
        &::after {
           content: '[+]';
           display: block;
           transition: all 0.25s;
       }
    }

    & ul {

        list-style: none;
        padding: 0 1.5em;

        &.depth-0 {
            padding: 0;
            margin: 0;
            & > li {
                &.folded, &:not(.category) { border-bottom: 1px solid #d8d8d8; }
            }
            & > li:last-of-type { border-bottom: none; }

            & > li > span.item {
                & .commentCount, & > ng-component > .commentCount {
                    font-size: 0.8em;
                    margin-right: 15px;
                }
            }
        }
        &:not(.depth-0) {
            border-left: 1px solid #f26522;

            & > li {
                color: #444;
                padding-left: 10px;
            }
        }

        & > li {
            & > span.item {
                display: flex;
                margin: 1em 0px;
                & > .comment, & > ng-component > .comment {
                    font-size: 0.8em;
                    & > .infobar {
                        color: #828282;
                    }
                    & > .text {
                        color: black;
                    }
                }
            }

            &.category > span.item {
                & > .story,
                & > .comment,
                & > ng-component { order: 2 }
            }
            &.category:not(.folded) > span.item > .opener::after {
                content: '[-]'
            }
            &.category.loading > span.item > .opener::after {
                animation: spin 1s infinite;
            }
        }
    }
}
