:root {
    color-scheme: dark;
    --primary: #1F150C;
    --second: #412D15;
    --white: #E1DCC9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: var(--white);
    font-family: "Noto Serif KR", serif;
    font-optical-sizing: auto;
    font-size: 1rem;
}

body {
    background-color: var(--primary);
    width: min(960px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
header > a:first-child {
    display: inline-flex;
    flex: 0 1 auto;
    flex-direction: row;
    align-items: flex-end;
    min-width: 0;
    width: fit-content;
    flex-wrap: wrap;
}
header > a:first-child > * {
    margin-right: 1rem;
    max-width: 100%;
}
h1 {
    font-size: 3rem;
    text-decoration: underline;
}

main {
    margin: 30px 50px;
}
@media (max-width: 767px) {
    main {
        margin: 1rem;
    }
    main h1 {
        font-size: 2rem;
    }
    li, li > a {
        display: flex;
        flex-direction: column;
    }
}

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

article {
    margin-bottom: 5rem;
}
p#post-content {
    white-space: pre-wrap;
}

ul {
    list-style: none;
}
li {
    padding: 1rem 0;
}
ul li + li {
    border-top: 1px solid var(--second);
}

.button {
    appearance: none;
    display: inline-block;
    text-align: center;
    padding: 2px 10px;
    margin: 0 2px;
    border-radius: 5px;
    border: none;
    background-color: var(--white);
    color: var(--primary);
    cursor: pointer;
    white-space: nowrap;
}
.danger {
    appearance: none;
    display: inline-block;
    text-align: center;
    padding: 2px 10px;
    margin: 0 2px;
    border-radius: 5px;
    border: 1px solid var(--white);
    background-color: var(--primary);
    color: var(--white);
    cursor: pointer;
    white-space: nowrap;
}
.disabled {
    appearance: none;
    display: inline-block;
    text-align: center;
    padding: 2px 10px;
    margin: 0 2px;
    border-radius: 5px;
    border: none;
    background-color: var(--second);
    color: var(--primary);
    cursor: not-allowed;
    white-space: nowrap;
}

.strong {
    font-size: 1.5rem;
    margin-right: 1rem;
}
.quiet {
    color: var(--second);
}
span {
    margin-right: 1rem;
}

input {
    background: none;
    border: none;
    border-bottom: 1px solid var(--white);
}
textarea {
    border: none;
    border-left: 5px solid var(--white);
    height: max(100px, 40vh);
    padding-left: 1rem;
    background: none;
    resize: vertical;
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
textarea::-webkit-scrollbar {
    display: none;
}

.stack-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.stack-form * {
    margin: 1rem 0;
}

.comment-form {
    width: 100%;
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-top: 1rem;
}
.comment-form .comment-content {
    flex: 1 1 auto;
    min-width: 0;
}
.comment-form .comment-password {
    flex: 0 0 auto;
}
.comment-form button {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 640px) {

    .topbar,
    .section-heading,
    .post-header,
    .inline-form {
        align-items: stretch;
        flex-direction: column;
    }

    .inline-form input {
        max-width: none;
    }

    .comment-form {
        flex-direction: column;
    }

    .comment-form #comment-password {
        flex-basis: auto;
    }
}
