/* Forum: topics, posts, replies, votes and moderation. */

/* Forum */

.forum-categories {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.forum-categories a {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 1rem 0.25rem;
    border-bottom: 1px solid var(--rule);
    color: var(--ink);
    text-decoration: none;
}

.forum-category-name {
    font-family: var(--serif);
    font-size: 1.35rem;
    font-weight: 600;
}

.forum-post {
    padding: 1rem 0;
    border-bottom: 1px solid var(--rule);
    scroll-margin-top: 1rem;
}

.forum-post:target {
    background: var(--paper-deep);
}

.forum-post header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem;
}

/* What others see of a post the admin rejected: it keeps its place in the thread. */
.post-body.post-deleted {
    color: var(--ink-soft);
    font-style: italic;
}

/* Marked by the border and its status note (for the author and admin); not faded, which would make its text and links hard to read. */
.forum-post.is-unpublished {
    border-left: 3px solid var(--gold-soft);
    padding-left: 0.75rem;
}

.post-body {
    overflow-wrap: anywhere;
}

.post-body p {
    margin: 0.5rem 0;
}

.post-body.muted {
    color: var(--ink-soft);
}

.post-status {
    margin: 0.4rem 0;
    padding: 0.4rem 0.6rem;
    background: var(--paper-deep);
    font-size: 0.9rem;
}

.post-status.rejected {
    color: var(--danger);
}

.admin-badge {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}

.post-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.vote-form,
.inline-form {
    display: inline-flex;
    gap: 0.4rem;
    margin: 0;
}

.vote {
    min-height: 36px;
    min-width: 52px;
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: transparent;
    color: var(--ink-soft);
    font: inherit;
    cursor: pointer;
}

.vote.voted {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

.vote-count {
    color: var(--ink-soft);
}

.link-button {
    background: none;
    border: none;
    padding: 0.25rem 0;
    color: var(--gold-ink);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
    min-height: 36px;
}

.forum-thread {
    margin-top: 0.5rem;
}

/* Replies sit under the post they answer, a step in for each level; past the deepest step they stay in line. */
.forum-replies {
    margin-left: clamp(0.25rem, 2vw, 1.25rem);
    padding-left: clamp(0.5rem, 2vw, 0.75rem);
    border-left: 2px solid var(--rule);
}

.forum-replies.flat {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
}

.reply-box {
    margin: 0.25rem 0 0.75rem;
}

.reply-box summary {
    cursor: pointer;
    color: var(--gold-ink);
    font-size: 0.9rem;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}

.forum-form textarea {
    width: 100%;
    font: inherit;
    font-size: 1rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    background: var(--field);
    resize: vertical;
}

.pager {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.moderation-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--rule);
}

.moderation-item blockquote {
    margin: 0.4rem 0;
    padding-left: 0.75rem;
    border-left: 2px solid var(--rule);
}

.moderation-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.reject-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 260px;
}

.reject-form input[type=text] {
    flex: 1 1 200px;
    font: inherit;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
}

.reject-form .check {
    margin: 0;
}

/* Topic lists (the forum's front page and each category): the topic and its latest post, with replies and views beside them. */
.topic-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.topic-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.9rem 0.25rem;
    border-bottom: 1px solid var(--rule);
}

.topic-main {
    flex: 1;
    min-width: 0;
}

.topic-main p {
    margin: 0.2rem 0 0;
}

.topic-title {
    font-family: var(--serif);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
}

.topic-title:hover {
    text-decoration: underline;
}

.topic-latest {
    color: var(--ink-soft);
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.topic-stats {
    display: flex;
    flex: none;
    gap: 0.5rem;
    margin: 0;
}

.topic-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 4.25rem;
    color: var(--ink-soft);
    font-size: 0.8rem;
}

.topic-stat strong {
    color: var(--ink);
    font-size: 1.15rem;
}

@media (max-width: 600px) {
    .topic-row {
        flex-direction: column;
        gap: 0.3rem;
    }

    .topic-stats {
        gap: 1rem;
    }

    .topic-stat {
        flex-direction: row;
        align-items: baseline;
        gap: 0.3rem;
        min-width: 0;
    }

    .topic-stat strong {
        font-size: 1rem;
    }
}
