/* Forum screens share the site's typography; conversations have their own rhythm. */
.view-forum .page-heading { padding-block: 2rem 1rem; margin-top: 0; }
.view-forum .page-heading h1 { font-size: clamp(2rem, 3vw, 2.75rem); }
.view-forum .page-heading .lead { margin-bottom: 0; font-size: 1rem; }
.forum-overview { padding-block: 1.25rem 3rem; }
.forum-overview .forum-toolbar { margin-bottom: 1.4rem; align-items: end; justify-content: space-between; gap: 1rem 2rem; }
.forum-search { flex: 1; max-width: 34rem; margin: 0; padding: 0; }
.forum-search label { margin: 0 0 .35rem; font-size: .85rem; }
.forum-search-fields { display: flex; gap: .5rem; }
.forum-search-fields input { min-width: 0; flex: 1; margin: 0; }
.forum-search-fields button { flex: 0 0 auto; }
.forum-overview .forum-category-nav { display: flex; flex-wrap: wrap; gap: .45rem; padding: 0 0 1.25rem; background: none; border-radius: 0; }
.forum-overview .forum-category-nav > a { display: inline-flex; gap: .75rem; justify-content: start; padding: .5rem .85rem; border: 1px solid var(--line); border-radius: .5rem; background: #fff; font-size: .85rem; }
.forum-overview .forum-category-nav > a[aria-current] { background: var(--navy); border-color: var(--navy); color: #fff; }
.category-count { opacity: .85; font-size: .78rem; }
.forum-list-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0 1.5rem; border-bottom: 1px solid var(--line); }
.forum-list-toolbar .forum-tabs { border: 0; margin: 0; }
.forum-my-link { display: inline-flex; align-items: center; min-height: 44px; font-size: .85rem; }
.forum-overview .forum-thread { grid-template-columns: minmax(0, 1fr) 15rem; gap: 1rem 3rem; padding: 1.5rem 1rem; background: #fff; border-radius: 0; border-bottom: 1px solid var(--line); }
.forum-overview .forum-thread:first-child { border-radius: .5rem .5rem 0 0; }
.forum-overview .forum-thread:last-child { border-radius: 0 0 .5rem .5rem; }
.forum-overview .forum-thread h2 { font-size: 1.2rem; margin: .4rem 0; line-height: 1.4; }
.forum-overview .thread-category { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; }
.forum-overview .thread-category a { padding: .1rem .55rem; }
.thread-excerpt { margin: .35rem 0 .65rem; color: var(--muted); font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; }
.thread-activity { display: flex; flex-direction: column; align-items: start; gap: .25rem; font-size: .8rem; min-width: 0; }
.thread-reply-count { display: inline-flex; align-items: baseline; gap: .4rem; min-height: 44px; padding-block: .45rem; text-decoration: none; }
.thread-reply-count strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.thread-activity .thread-latest { display: block; font-size: .75rem; color: var(--muted); overflow-wrap: anywhere; }
.thread-activity a.thread-latest { min-height: 44px; text-decoration: none; }
.thread-latest time { color: var(--ink); margin-top: .2rem; }
.thread-activity a:hover { text-decoration: underline; }
.forum-footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.5rem; margin-top: 1.75rem; font-size: .85rem; }
.forum-footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
.forum-empty { padding: 2rem 1rem; }
.forum-empty h2 { font-size: 1.35rem; }

.forum-topic-page { max-width: 62rem; padding-block: 1.6rem 3rem; }
.forum-topic-page .breadcrumbs { margin: 0 0 1rem; flex-wrap: wrap; }
.topic-heading h1 { font-size: clamp(1.8rem, 3.5vw, 2.65rem); line-height: 1.2; margin: 0; max-width: 100%; overflow-wrap: anywhere; }
.topic-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: .3rem 1rem; margin: .65rem 0 1rem; }
.topic-jumps { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.topic-jumps a, .topic-manage summary { display: inline-flex; min-height: 44px; align-items: center; font-size: .85rem; }
.topic-toolbar .topic-manage { position: relative; margin: 0; border: 0; padding: 0; }
.topic-manage summary { cursor: pointer; gap: .5rem; padding: 0; list-style: none; }
.topic-manage summary::after { content: "+"; }
.topic-manage[open] summary::after { content: "−"; }
.topic-manage > div { position: absolute; right: 0; z-index: 2; min-width: 14rem; background: #fff; border: 1px solid var(--line); border-radius: .5rem; padding: .4rem; box-shadow: 0 .5rem 1rem #173e4c12; }
.topic-manage a { display: flex; align-items: center; min-height: 44px; padding: .4rem .6rem; font-size: .85rem; }
.forum-topic-page .forum-post { padding: 1.3rem 1.5rem; background: #fff; border: 1px solid var(--line); border-radius: .65rem; margin: 0 0 1rem; scroll-margin-top: 1.2rem; }
.forum-post:target { border-color: var(--sea); outline: 2px solid var(--sea); outline-offset: 2px; }
.post-header { display: flex; align-items: start; gap: .8rem; }
.post-avatar { width: 2.6rem; height: 2.6rem; flex: 0 0 2.6rem; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--sky); color: var(--navy); font-size: .85rem; font-weight: 650; }
.post-identity { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .7rem; flex: 1; min-width: 0; }
.post-identity strong, .post-identity h3 { font-size: .95rem; font-weight: 650; margin: 0; line-height: 1.45; overflow-wrap: anywhere; letter-spacing: 0; }
.post-identity time { display: block; width: 100%; color: var(--muted); font-size: .75rem; }
.post-badge { display: inline-flex; font-size: .7rem; padding: .1rem .45rem; background: var(--mist); color: var(--ink); border-radius: .3rem; }
.post-number { flex: 0 0 auto; font-size: .8rem; color: var(--muted); text-decoration: none; min-width: 44px; min-height: 44px; text-align: right; padding-top: .3rem; }
.post-number:hover { text-decoration: underline; }
.post-body { padding-top: 1rem; }
.post-body .prose { max-width: none; font-size: 1rem; overflow-wrap: anywhere; }
.post-body .prose > :first-child { margin-top: 0; }
.post-body .prose > :last-child { margin-bottom: 0; }
.post-body .attachments { margin-top: 1rem; }
.post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding-top: 1rem; margin-top: 1rem; border-top: 1px solid var(--line); background: transparent; }
.post-actions .reaction { margin: 0; }
.post-actions .reaction-button { border-color: transparent; background: none; padding-inline: .35rem; }
.post-actions .reaction-button:hover, .post-actions .reaction-button[aria-pressed=true] { background: var(--sky); border-color: var(--line); }
.post-actions .reply-link { font-weight: 600; }
.post-actions form { margin: 0; padding: 0; }
.post-actions button { margin-top: 0; }
.post-actions .reply-moderation { margin-left: auto; }
.reply-moderation button { font-size: .75rem; color: var(--muted); }
.topic-follow { margin-left: auto; }
.topic-follow form { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; }
.topic-follow button { font-size: .8rem; padding: .4rem .7rem; }
.following-status { font-size: .75rem; color: var(--muted); }
.topic-replies { margin-top: 2rem; scroll-margin-top: 1rem; }
.topic-replies-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.topic-replies-heading h2 { margin: 0; font-size: 1.35rem; }
.topic-replies-heading h2 span { font-size: 1rem; margin-left: .35rem; color: var(--muted); }
.topic-replies-heading > span { font-size: .75rem; color: var(--muted); }
.reply-context { border: 0; border-left: 3px solid var(--sea); border-radius: 0 .35rem .35rem 0; margin: 0 0 1rem; padding: .7rem 1rem; background: var(--mist); font-size: .85rem; }
.reply-context a { font-size: .8rem; font-weight: 600; }
.reply-context p { margin: .3rem 0 0; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.reply-context-unavailable { color: var(--muted); font-size: .8rem; font-style: italic; }
.reply-title { font-size: 1.1rem; margin-bottom: .8rem; }
.forum-topic-page .post-hidden { border-style: dashed; background: var(--mist); }
.post-hidden-label { font-size: .75rem; color: var(--ink); }
.topic-empty { color: var(--muted); font-size: .95rem; margin: 0 0 1rem; }
.forum-topic-page #skriv-svar { margin-top: 1.5rem; padding: 1.5rem; background: #fff; border: 1px solid var(--line); border-radius: .65rem; scroll-margin-top: 1rem; }
.forum-reply-form h2, .topic-closed h2, .topic-join h2 { font-size: 1.35rem; margin: 0 0 .4rem; }
.forum-reply-form > .meta { font-size: .8rem; margin: 0 0 1.25rem; }
.forum-reply-form label { font-size: .9rem; }
.forum-reply-form textarea { resize: vertical; margin-bottom: 0; }
.reply-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1rem; }
.reply-submit a { font-size: .8rem; min-height: 44px; display: inline-flex; align-items: center; }
.reply-compose-context { background: var(--mist); border-left: 3px solid var(--sea); border-radius: 0 .35rem .35rem 0; padding: .8rem 1rem; margin-bottom: 1.2rem; font-size: .85rem; }
.reply-compose-context[hidden] { display: none; }
.reply-compose-context p { margin: .3rem 0; color: var(--muted); overflow-wrap: anywhere; }
.reply-cancel { display: inline-flex; align-items: center; min-height: 44px; font-size: .8rem; }
.topic-closed, .topic-join { padding: 1.5rem; background: var(--sky); border-radius: .65rem; margin-top: 1.5rem; }
.topic-closed p { font-size: .95rem; margin: .7rem 0; }
.topic-join .button { margin-top: .75rem; }

@media (max-width: 48rem) {
  .view-forum .page-heading { padding-block: 1.25rem .5rem; }
  .forum-overview .forum-toolbar { align-items: stretch; }
  .forum-overview .forum-search { flex-basis: 100%; max-width: none; }
  .forum-overview .forum-toolbar > .button { width: auto; }
  .forum-overview .forum-thread { grid-template-columns: minmax(0, 1fr); gap: .5rem; padding: 1.2rem 1rem; }
  .thread-activity { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .3rem 1.25rem; }
  .thread-activity .thread-latest { font-size: .7rem; }
  .forum-topic-page { padding-top: 1rem; }
  .forum-topic-page .forum-post, .forum-topic-page #skriv-svar { padding: 1rem; }
  .topic-heading h1 { font-size: 1.9rem; }
  .topic-manage > div { position: static; min-width: 0; width: 100%; box-shadow: none; }
  .topic-follow { margin-left: 0; flex-basis: 100%; }
  .post-actions .reply-moderation { margin-left: 0; }
  .post-identity h3, .post-identity strong { font-size: .9rem; }
  .post-badge { font-size: .65rem; }
  .post-avatar { width: 2.25rem; height: 2.25rem; flex-basis: 2.25rem; }
  .post-header { gap: .6rem; }
  .topic-replies { margin-top: 1.5rem; }
}
