/* Layout and reading styles for the posts workspace and public pages. */
:root {
    color: #1f2937;
    background: #f3f5f7;
    font: 16px/1.55 system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: #174b94; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid #2365ba;
    outline-offset: 2px;
}
h1, h2 { line-height: 1.25; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 1rem; }
h2 { font-size: 1.25rem; }
.topbar, .account, .actions, .heading { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.topbar { justify-content: space-between; padding: .75rem max(1rem, calc((100% - 78rem) / 2)); background: white; border-bottom: 1px solid #dbe1e8; }
.brand { color: #172b46; font-weight: 700; text-decoration: none; }
.workspace { max-width: 80rem; margin: 1.5rem auto; padding: 0 1rem; display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1rem; }
.sidebar { display: flex; flex-direction: column; gap: .25rem; align-self: start; }
.sidebar a { padding: .55rem .7rem; border-radius: .4rem; text-decoration: none; }
.sidebar a:hover, .sidebar a[aria-current] { background: #e3ebf6; }
.board, .standalone { background: #fff; border: 1px solid #dbe1e8; border-radius: .65rem; padding: clamp(1rem, 3vw, 2rem); min-width: 0; }
.standalone { max-width: 54rem; margin: 1.5rem auto; width: calc(100% - 2rem); }
.narrow { max-width: 28rem; }
.heading { justify-content: space-between; margin-bottom: 1rem; }
.heading h1 { margin: 0; }
.table-wrap { overflow-x: auto; }
.mobile-label { display: none; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .65rem; border-bottom: 1px solid #e2e8f0; overflow-wrap: anywhere; }
td time, thead th { white-space: nowrap; }
th[scope="row"] { min-width: 9rem; }
.pagination, .discussion, .markdown { margin-top: 1rem; }
.metadata { color: #516174; font-size: .875rem; }
.markdown, .comment-body { overflow-wrap: anywhere; }
.comment-body { white-space: pre-wrap; }
.markdown img { max-width: 100%; height: auto; }
.markdown pre { padding: .75rem; background: #f3f5f7; overflow-x: auto; }
.markdown table { display: block; overflow: auto; width: max-content; max-width: 100%; }
.discussion, .thread { border-top: 1px solid #dbe1e8; }
.comment { padding: .4rem 0; scroll-margin-top: 1rem; }
.replies { margin-left: .75rem; padding-left: .75rem; border-left: 2px solid #e2e8f0; }
.writing-form { display: grid; gap: .75rem; justify-items: start; width: 100%; }
.writing-form > div { width: 100%; min-width: 0; }
.writing-form label, .share-panel label { display: block; font-weight: 600; margin-bottom: .25rem; }
input, textarea { font: inherit; max-width: 100%; }
input:not([type="file"], [type="hidden"]), textarea { width: 100%; padding: .55rem; border: 1px solid #9ba9bb; border-radius: .3rem; }
button, .button { display: inline-block; font: inherit; background: #194f94; color: white; border: 1px solid transparent; border-radius: .35rem; padding: .38rem .7rem; cursor: pointer; text-decoration: none; }
button:disabled { opacity: .55; cursor: wait; }
button.quiet, button.danger { background: white; color: #174b94; border-color: #b5c2d1; }
button.danger, .errorlist { color: #9c2525; }
.errorlist { margin: .25rem 0; }
.share-panel { margin-bottom: 1.5rem; border-bottom: 1px solid #dbe1e8; padding-bottom: 1rem; }
.share-panel label { margin-top: .6rem; }
.link-field input { max-width: 34rem; }
.editor-toolbar button { color: #1f2937; }
.editor-toolbar button:empty::before { color: #1f2937; }
@media (max-width: 720px) {
    .workspace { grid-template-columns: minmax(0, 1fr); margin-top: .6rem; gap: .6rem; }
    .sidebar { flex-direction: row; flex-wrap: wrap; }
    .editor-toolbar { overflow-x: auto; white-space: nowrap; }
    .feed-table, .feed-table tbody { display: block; }
    .feed-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }
    .feed-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem .75rem; padding: .75rem 0; border-bottom: 1px solid #e2e8f0; }
    .feed-table th, .feed-table td { border: 0; padding: 0; }
    .feed-table th { grid-column: 1 / -1; min-width: 0; }
    .feed-table td { font-size: .875rem; }
    .feed-table td time { white-space: normal; }
    .mobile-label { display: block; color: #516174; }
}
