:root {
    --background: #1b191f;
    --foreground: #e5e3e8;
    --card: #25222a;
    --card-foreground: #e5e3e8;
    --primary: #625a71;
    --primary-foreground: #1b191f;
    --accent: #efefef;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: var(--background);
    color: var(--foreground);
}

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

/* ------------
      Header
   ------------ */

stuck {
	position: fixed;
	top: 0px;
	left: 0px;
}

header {
    //position: fixed;
    top: 0px;
    padding-left: 8px;
	width: 100%;
	border-bottom: 2px solid var(--accent);
}

header a:hover {
    text-decoration: underline;
}

header img {
    max-height: 1.5em;
}

/* ------------
       Nav
   ------------ */

nav {
	position: absolute;
    padding-left: 8px;
    width: 14em;
    overflow-y: auto;
    overflow-x: hidden;

    scroll-behavior: smooth;
}

nav::-webkit-scrollbar {
    width: 0.25em;
    background-color: rgba(0,0,0,.05);
}
nav::-webkit-scrollbar-thumb {
    background: #000;
}

nav li {
    white-space: nowrap;
    width: 11.5em;
    overflow-x: hidden;
    text-overflow: ellipsis;
}

nav a.active {
    text-decoration: underline;
}

nav a:hover {
    text-decoration: underline;
}

nav .nav-active {
    text-decoration: underline;
}

nav ul {
    list-style-type: none;
}

nav ul ul {
    margin-left: 0.75em;
}

/* ------------
     Content
   ------------ */

main {
    margin-left: 15.5em;
    width: 50vw;
    margin-bottom: 25vh;
	padding-left: 1em;
	border-left: 2px solid var(--accent);
}

main video, main iframe {
    width: 100%;
}

main > blockquote > p {
    margin-bottom: 0.3em;
    font-style: italic;
}

main > blockquote > p:last-child {
    margin-bottom: 0;
    font-style: normal;
}

main ul, main ol {
    margin-left: 1.2em;
}

main ul.tag-list li {
    display: inline;
    margin-left: 5px;
}

main ul.tag-list li:not(:last-child):after {
    content: ",";
}

main ul.grouped-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    list-style-type: none;
}

main ul.grouped-list > li {
    padding-right: 1em;
    padding-bottom: 0.2em;
    white-space: nowrap;
    text-overflow: ellipsis;
}

main ul.grouped-list li:before {
    content: "/";
}

main ul.grouped-list a {
    text-decoration: none;
}

main ul.grouped-list a:hover {
    text-decoration: underline;
}

main table th {
    text-align: left;
}

main table td, main table th {
    padding: 2px 10px 0px 0px;
}

main a {
    text-decoration: underline;
}

main a:hover {
    text-decoration: none;
}

main a.external:before {
    content: ">>";
}

main table th:nth-child(1), main table td:nth-child(1) {
    word-break: keep-all;
    white-space: nowrap;
}

main code {
    font-family: monospace;
    background-color: var(--card);
    color: var(--card-foreground);
    border: 1px solid #999;
}

main pre {
    font-family: monospace;

    overflow: auto;

    display: block;
    /*
     * background-color: #eee;
     * border: 1px solid #999;
     */
    padding: 5px;
    margin: 2px 2px;
}

/* ------------
      Footer
   ------------ */

footer {
    position: fixed;
    left: 4px;
    bottom: 8px;
    height: 3em;
}

footer span {
    display: block;
}

footer img {
    width: 2em;
    height: 2em;
}

/* ------------
      Phones
   ------------ */

@media only screen and (min-device-width: 320px) and (max-device-width: 480px),
only screen and (min-device-width: 320px) and (max-device-width: 640px) and (orientation: landscape) {
    header {
        position: static;
        font-size: 51pt;
        text-align: center;
    }

    nav {
        position: static;
        width: auto;
        margin: 0 0 0 1em;
        font-size: 40pt;
    }

    nav ul {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        flex: 100%;
    }

    nav ul.notes-index-nav {
        display: none;
    }

    nav li  {
        display: block;
        width: auto;
        padding-right: 1em;
    }

    nav li:before {
        content: "/";
    }

    main {
        width: auto;
        margin: 0 auto 1em auto;
        padding: 0 3em 0 3em;
        font-size: 28pt;
    }

    main ul.grouped-list {
        font-size: 36pt;
    }

    pre {
        font-size: 1.2em;
    }

    main table th:nth-child(1), main table td:nth-child(1) {
        font-size: 1.3em;
    }

    tr {
        display: block;
        margin-bottom: 1em;
    }

    thead {
        display: none;
    }

    td {
        display: block;
    }

    footer {
        position: static;
        text-align: center;
        font-size: 28pt;
    }
}
