:root {
    --line-height: 1.4rem;
    --max-post-width: 30rem;

    --dark-mode-color: #e8e8e8;
    --dark-mode-bg: #1b1b1c;

    --bg: white;
    --color: black;
    --theme-color: #076ad3;
    --alert-color: rgb(208, 92, 14);
    --post-bg: white;
    --post-border: lightgray;
    --normal-button-active-color: lightgray;
    --album-bg: var(--dark-mode-bg);
    --album-bubbles: var(--post-border);
    --dialog-backdrop: rgba(255, 255, 255, .7);
}

body, html {
    margin: 0;
    font-family: sans-serif;
    line-height: var(--line-height);
}

body {
    background: var(--bg);
    color: var(--color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100svh;
    touch-action: none;
}

.scroll-container {
    flex-grow: 1;
    overflow-y: scroll;
}

/* styling */

.grow {
    flex-grow: 1;
}

.hidden {
    display: none;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1em;
}

details summary {
    cursor: pointer;
    text-decoration: dotted underline;
}

dialog {
    border: 1px dotted var(--theme-color);
    color: var(--theme-color);
    padding: 1em;
    max-width: 15em;
    text-align: center;
    background: var(--bg);
}
dialog::backdrop {
    background: var(--dialog-backdrop);
}

input, textarea, button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    line-height: var(--line-height);
    background: var(--bg);
}

a, a:visited {
    color: var(--theme-color);
    text-decoration: underline;
    text-decoration-style: dotted;
    cursor: pointer;

    border: none;
    background: none;
    padding: 0;
}
a:hover, a:active {
    background: var(--theme-color);
    color: var(--bg);
    text-decoration: none;
}

em {
    font-style: normal;
    font-weight: bold;
}

*::selection {
    background: var(--theme-color);
    color: var(--bg);
}

dialog button {
    color: var(--theme-color);
    border-color: var(--theme-color);
}
dialog button:hover {
    background: var(--theme-color);
    color: var(--bg);
}

button, input[type="button"], input[type="submit"], .dialog-close-button {
    border: 1px solid var(--color);
    color: var(--color);
    padding: .5em;
    text-decoration: underline;
    text-decoration-style: dotted;
    cursor: pointer;
    background: transparent;
}
button:hover, button:active,
input[type="submit"]:hover, input[type="submit"]:active,
input[type="button"]:hover, input[type="button"]:active,
.dialog-close-button:hover, .dialog-close-button:active {
    background: var(--normal-button-active-color);
    color: var(--color);
    text-decoration: none;
}

input[type="range"] {
    background: transparent;
    cursor: pointer;
    width: 100%;
}
input[type="range"]:disabled {
    cursor: default;
}

.icon-button {
    border: none;
    padding: 0;
    flex-shrink: 0;
    transition: scale 100ms;
}
.icon-button:hover, .icon-button:active {
    background: transparent;
}
.icon-button img {
    height: 1em;
    vertical-align: middle;
}
.icon-button:active {
    scale: .85;
}

/* layout */

main {
    padding: .75em .75em;
    display: flex;
    flex-direction: column;
    gap: .75em;
}

.posts-list {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: .25em;
    font-family: monospace;
    width: 100%;
    box-sizing: border-box;
}

/*  */

header, footer, nav {
    padding: .5em .75em;
}

header {
    background: var(--post-bg);
    border-bottom: 1px dotted var(--theme-color);

    display: flex;
    gap: .5em 2em;
    flex-wrap: wrap;
    align-items: center;
}
header a {
    text-align: center;
}

header > .grow {
    text-align: left;
}

.index-button::after {
    content: "ndex";
}
.new-post-button::after {
    content: " new post";
}

footer {
    background: var(--post-bg);
    border-top: 1px dotted var(--theme-color);

    display: flex;
    flex-direction: column;
    gap: 1em;
}
nav {
    display: flex;
    gap: 2em;
    padding: 0;
}
nav pre {
    margin: 0;
}
nav a {
    font-family: monospace;
}
footer > div {
    display: flex;
    justify-content: end;
}
footer .flex {
    gap: .25em 2em;
    flex-wrap: wrap;
}