html {
    --subtitle-gap: 1em;

    background-color: black;
    color: #ccc;
    font-family: Arial, Helvetica, sans-serif;
    overflow-wrap: anywhere;
}

body {
    width: 100%;
    margin: 0;
    background-color: #111;
}

footer {
    width: 100%;
    background-color: black;

    img {
        width: 32px;
        height: 32px;
        margin: 4px;
    }
}

table, th, td {
    overflow-wrap: initial;
    border: 1px solid #333;
    border-collapse: collapse;
    padding: 0.25em 0.5em;
}

a[href] {
    color: #f99;
}

a.internal[href] {
    color: #99f;
}

h4 {
    margin-bottom: 0;
}

blockquote {
    position: relative;
    margin-left: 40px;
}

blockquote::before {
    content: ' ';
    position: absolute;
    top: -8px;
    left: -24px;
    height: calc(100% + 16px);
    border-left: 4px solid #333;
}

code {
    display: block;
    overflow: auto;
    padding: 0 1em 1em;
    background-color: #222;
}

.post-body {
    width: 100%;
    margin-top: 1em;

    > * {
        border: 1px solid #222;
        border-radius: 4px;
        padding: 0 1em;
    }
}

.maybe-empty:empty {
    display: none;
}

.maybe-unlinked {
    display: block;
    width: auto;
    height: 10em;
    margin-left: auto;
    margin-right: auto;
}

.maybe-unlinked[src=""], .maybe-unlinked[src="https:"] {
    display: none;
}

.content {
    width: auto;
    max-width: 60em;
    margin: 0 auto;
    padding: 1em;
}

.aligned {
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;
    align-items: center;
}

.index {
    display: flex;
    flex-flow: row wrap;
    gap: 1em;

    .other-index {
        display: flex;
        flex-flow: column nowrap;
        gap: 1em;    
    }

    .posts-index {
        flex: 1 1 0;
    }
}

.tree {
    min-width: 10em;
    display: grid;
    grid-template-rows: 1lh;
    grid-template-columns: 1lh 1fr;
    gap: 0.5em 1em;
    
    img {
        justify-self: center;
        height: 1lh;
    }

    a {
        justify-self: left;
        width: 100%;
        white-space: nowrap;
        overflow-x: hidden;
        text-overflow: ellipsis;
    }

    .tree-line-art {
        margin: calc(1px - 0.5lh) 0.25lh 0 0.25lh;
        border-radius: 0 0 0.25lh 0.25lh;
        background-color: #333;
    }

    .tree-children {
        display: flex;
        flex-flow: column nowrap;
        gap: 0.5em;
    }
}

.tree.tree-parent {
    grid-template-rows: 1lh 1fr;
}

.subtitle {
    display: flex;
    flex-flow: row wrap;
    color: #666;

    > *:not(:last-child) {
        position: relative;
        margin-right: var(--subtitle-gap);
    }

    > *:not(:last-child)::after {
        content: '•';
        position: absolute;
        top: 0;
        right: calc(0em - var(--subtitle-gap));
        width: var(--subtitle-gap);
        text-align: center;
    }
}

.upvote::before {
    content: '';
    display: inline-block;
    width: 15px;
    height: 14px;
    background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAcCAMAAADC4sagAAABFFBMVEUjJCQiIiIjIyMkIiIkJCQlJSUlJicmJiYnIyEnJycnKCsoKCgpLC8rIyErKyssMDUvLy8wJCAwMDAxMTEyMjI0NDQ2NjY3JR83Nzc5OTk7Ozs8PDw9PT0+Pj4/Pz9AQEBBQUFCQkJDQ0NGRkZISEhKSkpKV2tLS0tMTExOTk5PT09QYHdSUlJTU1NVVVVWVlZXV1dXaINYWFhaWlpabYlbW1tecpBgYGBhYWFid5dkZGRle5xlfJ1pgKRrhKhshKlshapuLhZwirFyjbV0j7h4lL97mcZ9MBR/nsyCo9OOMxGcNQ+eNg+kNw6sOA2vOAy0OQy7Ogq/OwrBOwrDPAnLPQjPPQfTPgfbPwXjQQTrQgPzQwLKxGgxAAAAAXRSTlMAQObYZgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlJREFUOMu9lF1TwjAQRTcMvmeQOi1QPmxFBQTxW1ERUUFEUVRU/P//w9yGmBTFyZPnpXNmbju76W6IJM8Uw49rLa6Tz4mpq/mCqY3Gvqnj6XQ61lp0mGd8favCwx2tow8wUlpwGWOZrNJKjXO+UVc6fJcMZzV7IswSOU/qej0l0rwyq33wphhAM1kWkcy70GB7mUfUNqG9V02PyPMTMs2Wig5RaTctwzxVXyPqvJh0VkJBIKJ4huncCRAvHOEZyGKegO4a6UDrIdLGCT4C6/QDsE7fA+v0HdAadWqk0SH9D3sgXkm4uJIDYKTFnwwXd3kMrNOnwDp9BmzS5QuTshN1iDRwfkxV9VJTJXLzSWYM+NzEEjWvFE2oGvCE7/2yDeL8riWzM8xmorRazLlNI2rdgNb3ZYLF1Es/t8VE7X6/39Yqlt4tLLwhiLq3XVNLfumP24fo3Opm+wLGCVa252Y8tQAAAABJRU5ErkJggg==);
    background-size: 45px 28px;
}

.tag {
    background-color: #222;
    border-radius: 4px;
    margin: -1px 0;
    padding: 1px 4px;
}

.comment {
    border: 1px solid #222;
    border-radius: 4px;
    background-color: black;
    padding: 0.5em 0.5em 0.5em 1em;
    margin-bottom: 0.5em;

    .comment-deleted {
        color: #666;
    }
}

.comment[id=""] > .subtitle .upvote::before {
    background-position: -30px 0;
}

.comment-body {
    margin-right: 0.5em;
}

.info-text {
    font-style: italic;
    color: #666;
}

.search {
    position: relative;

    input {
        width: calc(100% - 10px);
        padding: 4px;
        border: 1px solid #333;
        border-radius: 4px;
        background-color: #222;
        color: white;
    }

    button {
        position: absolute;
        right: 0;
        width: 2em;
        height: 100%;
        padding: 4px;
        border: none;
        background: transparent;
        cursor: pointer;

        img {
            height: 1.25em;
            vertical-align: middle;
        }
    }
}

:target {
    border-color: white;
}

.tree:not(:has(a.searchable:not(.filtered))) {
    display: none;
}
