/* ==========================================================================
   Forum, stembus en nieuws (agent C). Alleen CSS-variabelen voor kleuren.
   ========================================================================== */

/* ---------- Forumindex ---------- */
.forum-online { padding: var(--space-sm) var(--inset-panel); } /* statusstrook: tekst lijnt uit met de forumblokken eronder */
.forum-online .online-dot { vertical-align: 0; }
.forum-here { margin-top: var(--space-xs); line-height: 1.7; }
.forum-name { display: flex; gap: var(--space-sm); align-items: flex-start; min-width: 0; }
.forum-name-text { min-width: 0; }
.forum-name .pill { margin-left: var(--space-2xs); vertical-align: 1px; }
.forum-ico { flex-shrink: 0; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--color-action) 12%, var(--color-surface)); color: var(--color-action); }
.forum-ico .icon { width: 18px; height: 18px; }
.forum-ico-l { width: 52px; height: 52px; }
.forum-ico-l .icon { width: 26px; height: 26px; }
/* Forumindex als contracttabel (views/forum/index.php): naam vet, omschrijving grijs, nieuwste bericht op een vaste breedte */
.forum-name .title { font-weight: 700; }
.forum-desc { max-width: 70ch; }
/* Een breedte op de kop werkt niet naast de fill-kolom (width: 100%); de inhoud houdt de kolom op 15rem, of op 30 % van de
   tabel als die smaller is (anders scrolde het forumoverzicht op 960 px, spec afbreken §1) */
.forum-last > .clamp-1 { width: min(15rem, 30cqi); max-width: 100%; }
@container tbl (width < 34rem) {
  .forum-table .sub.forum-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
  .forum-last > .clamp-1 { width: auto; }
}
.forum-cat-head { display: flex; gap: var(--space-sm); align-items: center; min-width: 0; }
.forum-cat-head p { max-width: 70ch; }
.h-grp { font-size: var(--text-base); margin: var(--space-xs) 0 var(--space-xs); color: var(--muted); }
.forum-tips { margin: 0; padding-left: var(--space-md); }
.forum-tips li { margin-bottom: var(--space-2xs); }

/* Zijbalk */
.forum-menu + .forum-side-search { margin-top: var(--inset-panel); }
.forum-side-search { display: flex; gap: var(--space-xs); margin-top: var(--space-xs); }
.forum-side-search input { flex: 1; min-width: 0; }

/* ---------- Topiclijst (tabelcontract: lijstmodus, zie app.css "Tabel" en views/forum/_topics.php) ---------- */
.forum-list-body > .small { margin-bottom: var(--space-2xs); }
.topic-title { font-weight: 700; }
.topic-table tr.is-locked .topic-title { color: var(--color-text-muted); }
.topic-flags { display: inline-flex; gap: var(--space-3xs); margin-right: var(--space-3xs); vertical-align: -2px; }
.topic-flag { display: inline-flex; color: var(--color-action); }
.topic-flag .icon, .pill .icon, .post-actions .icon, .topic-h1 .pill .icon { width: 14px; height: 14px; vertical-align: -2px; }
.topic-line .pill { margin-left: var(--space-2xs); }
.topic-pages { display: inline-flex; flex-wrap: wrap; gap: var(--space-3xs); margin-left: var(--space-xs); vertical-align: 1px; }
.topic-pages a, .topic-pages span { padding: var(--space-3xs) var(--space-2xs); border: 1px solid var(--color-border); border-radius: var(--radius-xs); background: var(--color-surface); color: var(--color-text-muted); font-size: var(--text-xs); line-height: 1; }
.topic-pages a:hover { border-color: var(--color-action); color: var(--color-action); text-decoration: none; }
.topic-pages span { padding: var(--space-3xs) var(--space-3xs); border: 0; background: none; }
.topic-last > a { font-weight: 600; }

/* ---------- Topic ---------- */
.topic-h1 { overflow-wrap: anywhere; }
.topic-h1 .prefix { font-size: var(--text-xs); vertical-align: 4px; }
.topic-h1 .pill { font-size: var(--text-xs); vertical-align: 4px; font-family: var(--font-body); }
.topic-head-text { min-width: 0; }
.topic-posts { padding-top: var(--space-xs); padding-bottom: var(--space-xs); }
.topic-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2xs) var(--space-sm); }
.topic-pager .pagination { margin: var(--space-xs) 0; }
.forum-post { scroll-margin-top: var(--space-sm); }
.forum-post:target { background: color-mix(in srgb, var(--primary) 7%, transparent); border-radius: var(--radius-s); }
.forum-post.is-first { border-bottom-width: 2px; }
.forum-post.by-starter .forum-post-av .avatar { box-shadow: 0 0 0 2px var(--primary); }
.forum-post-main { min-width: 0; }
.forum-post .post-head { row-gap: var(--space-3xs); }
.forum-post-meta { color: var(--muted); font-size: var(--text-xs); }
.forum-post-time { margin-left: auto; color: var(--muted); font-size: var(--text-xs); white-space: nowrap; }
.forum-post-time a { color: var(--muted); }
.forum-edited { margin: var(--space-xs) 0 0; font-style: italic; }
.forum-sig { margin-top: var(--space-xs); padding-top: var(--space-xs); border-top: 1px solid var(--line); font-size: var(--text-xs); color: var(--muted); overflow-wrap: anywhere; max-height: 7.5em; overflow: hidden; }
.forum-post .post-actions { flex-wrap: wrap; }
.forum-post .post-actions a:hover, .forum-post .post-actions button:hover { color: var(--primary); }
.forum-crew h2 .icon { vertical-align: -3px; color: var(--primary); }
.forum-crew form { margin: 0; }
.forum-move { max-width: 210px; }
#reageren h2 .chev, #reacties h2 .chev { color: var(--color-live); }
@media (max-width: 600px) {
  .forum-post { grid-template-columns: 40px minmax(0, 1fr); gap: var(--space-xs); }
  .forum-post .avatar { width: 40px; height: 40px; }
  .forum-post-time { margin-left: 0; width: 100%; white-space: normal; }
}

/* ---------- Zoeken ---------- */
.forum-results mark, .forum-result-title mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: var(--radius-xs); padding: 0 var(--space-3xs); }
.forum-result-title { font-weight: 700; overflow-wrap: anywhere; }
.forum-snippet { margin-top: var(--space-2xs); overflow-wrap: anywhere; }

/* ---------- Statistieken ---------- */
.forum-bar-row { grid-template-columns: 70px minmax(0, 1fr) 30px; }
.forum-bar-row > span:first-child { white-space: nowrap; }


/* ---------- Stembus ---------- */
.stembus-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.stembus-poll .poll-q a { color: inherit; }
.stembus-poll .poll-bar em { gap: var(--space-xs); }
.stembus-poll .poll-bar em > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stembus-poll .poll-bar em > span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.stembus-n { color: var(--muted); font-size: .8em; }
.poll-opt.is-mine .poll-bar { box-shadow: inset 0 0 0 1px var(--primary); }
.stembus-main .poll-q { font-size: var(--text-lg); }
.stembus-archive li { overflow-wrap: anywhere; }
.stembus-comment { grid-template-columns: 40px minmax(0, 1fr); padding: var(--space-xs) 0; }
.stembus-comment .avatar { width: 40px; height: 40px; }

/* ---------- Nieuws ---------- */
.nieuws-item { display: flex; gap: var(--space-md); align-items: flex-start; }
.nieuws-thumb { flex-shrink: 0; width: 120px; border-radius: var(--radius-s); overflow: hidden; background: var(--surface-2); }
.nieuws-thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.nieuws-text { min-width: 0; flex: 1; }
.nieuws-title { font-size: var(--text-lg); margin-bottom: var(--space-2xs); overflow-wrap: anywhere; }
.nieuws-title .prefix { vertical-align: 2px; }
.nieuws-item.is-latest .nieuws-title { font-size: var(--text-2xl); }
.nieuws-meta { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-xs); align-items: center; margin-bottom: var(--space-xs); }
.nieuws-excerpt { margin-bottom: var(--space-xs); overflow-wrap: anywhere; }
.nieuws-image { border-radius: var(--radius-s); max-height: 420px; }
.nieuws-intro { font-size: var(--text-lg); }
@media (max-width: 520px) {
  .nieuws-item { flex-direction: column; }
  .nieuws-thumb { width: 100%; }
  .nieuws-thumb img { aspect-ratio: 16 / 9; }
}
.topic-posts article.forum-post:last-of-type { border-bottom: 0; }
/* button.btn in app.css wint van .btn-ghost/.btn-danger; hier lokaal rechtzetten */
.forum-crew button.btn-ghost { background: transparent; color: var(--primary); border-color: var(--line); }
.forum-crew button.btn-ghost:hover { background: var(--surface-2); }
.forum-crew button.btn-danger { background: var(--color-danger); color: var(--color-surface); border-color: transparent; }
.forum-crew button.btn-danger:hover { background: var(--color-danger); filter: brightness(.9); }
