/* Discussion reading surfaces use the same palette as the forum index. */
.thread-page { padding-block: 20px 36px; }
.thread-page .breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 0 0 14px; }
.discussion-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 24px; padding: 6px 0 18px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.discussion-intro { flex: 1 1 420px; min-width: 0; }
.discussion-heading h1 { margin: 0; color: var(--ink); font-size: clamp(1.45rem, 2.5vw, 2.15rem); line-height: 1.15; letter-spacing: -.035em; overflow-wrap: anywhere; }
.discussion-flags, .discussion-meta, .discussion-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.discussion-flags { margin-bottom: 7px; }
.discussion-meta { margin-top: 8px; font-size: .8rem; color: var(--muted); }
.discussion-meta > * + * { padding-inline-start: 10px; border-inline-start: 1px solid var(--line); }
.discussion-meta strong { color: var(--ink); overflow-wrap: anywhere; }
.discussion-controls:empty { display: none; }
.discussion-controls .button { padding: 8px 15px; }
.discussion-tools summary { cursor: pointer; font-size: .85rem; color: var(--blue); }
.discussion-tools[open] .moderation-actions { margin: 10px 0 0; }
.thread-page .post {
    --message-accent: var(--blue-strong);
    grid-template-columns: clamp(162px, 18%, 204px) minmax(0, 1fr);
    border-radius: 10px; margin-bottom: 14px; box-shadow: none; scroll-margin-top: 16px;
}
.thread-page .opening-post { --message-accent: var(--blue); }
.thread-page .post:target { border-color: var(--blue); }
.message-strip {
    grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 7px 14px; border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--page) 44%, var(--surface-raised)); color: var(--muted); font-size: .75rem;
}
.message-strip time { border-inline-start: 3px solid var(--message-accent); padding-inline-start: 9px; }
.message-strip a { color: var(--blue); font: 600 .77rem ui-monospace, monospace; }
.thread-page .post > aside {
    display: grid; grid-template-columns: minmax(0,1fr); align-content: start; justify-items: center;
    gap: 8px; padding: 14px; text-align: center;
    background: color-mix(in srgb, var(--page) 68%, var(--surface));
}
.thread-page .post-avatar, .thread-page .avatar.large {
    width: 116px; height: 116px; margin: 0; border-radius: 12px; object-fit: cover;
    border: 2px solid var(--surface); outline: 1px solid color-mix(in srgb, var(--message-accent) 60%, var(--line));
}
.thread-page .avatar.large {
    display: grid; place-items: center; background: var(--surface-raised); color: var(--blue);
    font-size: 3rem; font-weight: 700;
}
.thread-page .post-author-meta { justify-items: center; max-width: 100%; gap: 5px; }
.thread-page .post-author-meta strong { color: var(--ink); font-size: 1rem; line-height: 1.25; }
.thread-page .author-badges { justify-content: center; }
.author-facts {
    width: 100%; margin: 3px 0 0; padding: 2px 9px; border: 1px solid var(--line); border-radius: 7px;
    background: var(--surface); font-size: .73rem; line-height: 1.5; color: var(--muted);
}
.author-facts div { display: flex; justify-content: space-between; gap: 6px; padding-block: 3px; }
.author-facts div + div { border-top: 1px solid color-mix(in srgb, var(--line) 66%, transparent); }
.author-facts dd { margin: 0; font-variant-numeric: tabular-nums; color: var(--ink); }
.thread-page .post-main { display: flex; flex-direction: column; background: var(--surface); }
.thread-page .discussion-reply .post-main { background: color-mix(in srgb, var(--surface-raised) 23%, var(--surface)); }
.thread-page .post-body { flex: 1; min-height: 0; min-width: 0; padding: 15px 18px; line-height: 1.6; }
.thread-page .post-body > :first-child { margin-top: 0; }
.thread-page .post-body > :last-child { margin-bottom: 0; }
.thread-page .post-quote { margin: 9px 0; padding: 9px 13px; border-left: 3px solid var(--blue); border-radius: 0 6px 6px 0; background: color-mix(in srgb, var(--page) 60%, var(--surface)); }
.thread-page .post-quote .post-quote { border-left-color: var(--blue-strong); background: var(--page); }
.thread-page .quote-author { display: block; color: var(--blue); margin-bottom: 3px; font-size: .82rem; }
.thread-page .post-code { max-width: 100%; padding: 12px 14px; background: var(--page); line-height: 1.55; tab-size: 4; }
.thread-page .post-code code { white-space: pre; overflow-wrap: normal; }
.thread-page .post-attachments { min-width: 0; margin: 0 18px 12px; }
.thread-page .post-attachments strong { min-width: 0; overflow-wrap: anywhere; }
.thread-page .post-actions { padding: 7px 14px; gap: 3px 6px; background: color-mix(in srgb, var(--surface) 89%, var(--surface-raised)); font-size: .8rem; }
.thread-page .post-actions :is(button, summary, .post-reply) { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 32px; padding: 5px 9px; border: 1px solid transparent; border-radius: 6px; color: var(--muted); background: transparent; font: inherit; text-decoration: none; cursor: pointer; }
.thread-page .post-actions :is(button, summary, .post-reply):hover,
.thread-page .post-actions .reacted, .thread-page .post-actions .selected { color: var(--blue); background: var(--surface-hover); border-color: var(--line); }
.thread-page .post-actions .reaction-form { margin-right: auto; }
.thread-page .post-actions .reaction-trigger { min-width: 38px; border-color: var(--line); }
.thread-page .post-actions .reaction-choice { min-width: 30px; }
.thread-page :focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.thread-page .pagination { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-block: 12px; }
.thread-page .reply-box { box-shadow: none; padding: 16px; }
.thread-page .reply-box .button { justify-self: end; }
@media (max-width: 740px) {
    .thread-page .post { grid-template-columns: minmax(0,1fr); }
    .thread-page .post > aside { grid-template-columns: auto minmax(0,1fr); justify-items: start; text-align: left; align-items: center; gap: 5px 10px; padding: 10px 13px; border-right: 0; border-bottom: 1px solid var(--line); }
    .thread-page .post-author :is(.post-avatar, .avatar.large) { width: 72px; height: 72px; border-radius: 9px; font-size: 2rem; }
    .thread-page .post-author-meta { justify-items: start; }
    .thread-page .author-badges { justify-content: flex-start; }
    .author-facts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 3px 0 0; padding: 3px 8px; }
    .author-facts div { gap: 4px; }
    .author-facts div + div { border-top: 0; }
    .thread-page .post-body { padding-inline: 13px; }
    .thread-page .post-actions { padding: 4px 8px; }
    .thread-page .post-actions :is(button, summary, .post-reply) { min-height: 42px; }
    .thread-page .post-attachments a { flex-wrap: wrap; }
    .discussion-heading { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .thread-page *, .thread-page *::before { transition: none !important; scroll-behavior: auto; }
}
