:root {
    --black:      #14120f;
    --red:        #5C6C6E;
    --green:      #677677;
    --yellow:     #77817E;
    --blue:       #83847B;
    --magenta:    #c0c1bc;
    --cyan:       #7D8888;
    --white:      #83847B;
    --brblack:    #868783;
    --brred:      #5C6C6E;
    --brgreen:    #677677;
    --bryellow:   #77817E;
    --brblue:     #83847B;
    --brmagenta:  #c0c1bc;
    --brcyan:     #7D8888;
    --brwhite:    #14120f;
    --cursor:     #c0c1bc;
    --revcursor:  #14120f;
    --foreground: #83847B;
    --background: #14120f;
    --bdark:      #14120f;
    --accent:     #c0c1bc;
    color-scheme: only dark;
}

body {
    background: var(--background);
    color: var(--foreground);
    font-family: monospace, serif;
    font-size: 1em;
    max-width: 800px;
    margin: 30px auto;
    padding: 0 15px;
    line-height: 1.5;
}

.topbar {
    text-align: left;
    font-size: 0.9em;
    border-bottom: 1px solid var(--brblack);
    padding-bottom: 5px;
    margin-bottom: 10px;
}

h1, h3 {
    color: var(--white);
    font-weight: normal;
}

h2 {
    color: var(--accent);
    font-weight: normal;
}

h1 a {
    text-decoration: none;
    color: inherit;
}

.title {
    color: var(--accent);
    margin-bottom: 10px;
    font-size: 2rem;
    font-style: italic;
}

.subtitle {
    margin-top: -20px;
    font-style: italic;
    color: var(--cyan);
}

.content-subtitle {
    font-style: italic;
    color: var(--cyan);
    text-align: right;
}

.sidebar {
    float: left;
    width: 160px;
    border-right: 1px solid var(--brblack);
    padding-right: 20px;
    margin-right: 20px;
    will-change: contents;
    contain: layout;
    position: sticky;
    top: 14px;
    background-color: var(--background);
}

.sidebar ul {
    list-style: none;
    padding-left: 0;
    margin-left: 0;
}

.sidebar ul li {
    margin: 0;
    padding: 2px;
    line-height: 1;
    list-style-type: none;
}

.sidebar ul li a {
    text-decoration: none;
}

.sidebar ul li a.active {
    color: var(--accent);
    font-style: italic;
}

.sidebar ul li a::before {
    content: "› ";
}

.sidebar ul li a.active::before {
    content: "» ";
}

.sidebar ul ul {
    margin-left: 16px;
    padding-left: 0;
    list-style: none;
}

.sidebar ul ul li {
    margin: 0;
}

.sidebar ul ul li a.active {
    color: var(--accent);
    font-style: italic;
}

.sidebar ul ul li a::before {
    content: "› ";
}

.sidebar ul ul li a.active::before {
    content: "» ";
}

.sidebar ul li a.active:hover,
.sidebar ul ul li a.active:hover {
    color: var(--background);
    background-color: var(--accent);
}

a {
    color: var(--white);
    text-decoration: none;
}

a:hover {
    color: var(--background);
    background-color: var(--accent);
    font-style: normal !important;
}

pre, code {
    background: var(--brblack);
    color: var(--foreground);
    padding: 2px 4px;
    border: 1px solid var(--brwhite);
}

pre {
    padding: 10px;
    overflow-x: auto;
}

hr {
    border: none;
    border-top: 1px solid var(--brblack);
}

.content {
    overflow: visible;
}

.gallery {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gallery img {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    display: block;
    border: 1px solid var(--brblack);
}

.gallery figure {
    margin: 0;
}

.gallery figcaption {
    margin-top: 5px;
    color: var(--cyan);
    font-size: 0.9em;
    font-style: italic;
}

.comment {
    color: #6e6e6e;
    width: fit-content;
    padding: 2px 1px 2px 1px !important;
    line-height: 1;
}

.log {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.entry {
    border-top: 1px solid var(--brblack);
    padding-bottom: 7px;
    padding-top: 7px;
    margin-bottom: 0px;
}

.entry p {
    margin: 0;
}

.entry a {
    background-color: var(--bdark);
    padding: 0 2px;
}

.entry a:hover {
    line-height: normal;
    color: var(--background);
    background-color: var(--accent);
}

/*.entry:nth-child(even) {
  background-color: #050505;
}*/

.entry:hover .comment {
    color: var(--background);
    background-color: var(--accent);
}

.entry.expanded .comment {
    color: var(--accent);
    background-color: var(--background);
    font-style: italic;
}

.entry.expanded:hover .comment {
    color: var(--background);
    background-color: var(--accent);
    font-style: normal;
}

.entry > *:not(.comment) {
    display: none;
}

.entry.expanded > *:not(.comment) {
    display: block;
}

.entry.expanded p:not(.comment) {
    border-left: 1px solid var(--brblack);
    padding-left: 8px;
}

@media (max-width: 600px) {
    .sidebar {
        float: none;
        width: auto;
        border-right: none;
        border-bottom: 1px solid var(--brblack);
        padding-right: 0;
        padding-bottom: 10px;
        margin-right: 0;
        margin-bottom: 0;
        top: 0;
    }
    
    .content {
        margin-left: 0;
        margin-top: -20px;
    }

    .topbar {
        font-size: 0.7em;
        white-space: nowrap;
        text-align: center;
    }

    h1 {
        display: inline-block;
        margin-bottom: 0;
        white-space: nowrap;
    }

    h1, h2, h3, .comment {
        text-align: center;
    }

    h2 {
        margin-top: 30px;
    }
    
    .subtitle {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .stascii {
        font-size: 3vw;
        overflow-x: auto;
    }

    .comment {
        text-align: center;
        width: 100%;
    }

    .entry p:not(.comment) {
        text-align: left;
    }

    .subdirs {
        text-align: center;
    }

    .content h3:first-child {
        margin-top: 40px;
        margin-bottom: -20px;
    }
}
