/* Forum – dunkelgraues Theme, alles unter .forum gekapselt */
.forum {
  --f-bg: #1b1d21;
  --f-surface: #23262b;
  --f-raised: #2c3036;
  --f-line: #3a3f47;
  --f-text: #d9dce1;
  --f-muted: #9199a3;
  --f-accent: #8fb4d9;
  --f-accent-ink: #14202c;
  --f-danger: #e0908f;

  box-sizing: border-box;
  max-width: 62rem;
  margin: 1.5rem auto;
  padding: 1.5rem;
  background: var(--f-bg);
  color: var(--f-text);
  border: 1px solid var(--f-line);
  border-radius: 8px;
  line-height: 1.55;
}
.forum *, .forum *::before, .forum *::after { box-sizing: inherit; }

.forum a { color: var(--f-accent); text-decoration: none; }
.forum a:hover { text-decoration: underline; }
.forum :focus-visible { outline: 2px solid var(--f-accent); outline-offset: 2px; }

.forum-title { margin: 0 0 1rem; font-size: 1.6rem; font-weight: 600; }
.forum-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.forum-crumbs { margin-bottom: 0.75rem; font-size: 0.9rem; color: var(--f-muted); }

/* Listen */
.forum-list { list-style: none; margin: 0; padding: 0; background: var(--f-surface); border: 1px solid var(--f-line); border-radius: 6px; }
.forum-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--f-line); }
.forum-row:last-child { border-bottom: 0; }
.forum-row:hover { background: var(--f-raised); }
.forum-link { font-weight: 600; font-size: 1.05rem; }
.forum-count { text-align: right; white-space: nowrap; font-size: 0.9rem; }
.forum-meta { margin: 0.15rem 0 0; font-size: 0.85rem; color: var(--f-muted); }
.forum-empty { padding: 1rem; background: var(--f-surface); border: 1px dashed var(--f-line); border-radius: 6px; color: var(--f-muted); }

.forum-badge { display: inline-block; margin-left: 0.4rem; padding: 0 0.45rem; font-size: 0.75rem; color: var(--f-text); background: var(--f-raised); border: 1px solid var(--f-line); border-radius: 999px; vertical-align: middle; }

/* Beiträge */
.forum-post { display: flex; gap: 1rem; margin-bottom: 0.75rem; padding: 1rem; background: var(--f-surface); border: 1px solid var(--f-line); border-radius: 6px; }
.forum-author { flex: 0 0 8rem; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; text-align: center; word-break: break-word; }
.forum-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--f-raised); }
.forum-avatar-fallback { display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 600; color: var(--f-muted); }
.forum-post-body { flex: 1; min-width: 0; }
.forum-content { overflow-wrap: anywhere; }

/* Formulare */
.forum-form { margin-top: 1.25rem; padding: 1rem; background: var(--f-surface); border: 1px solid var(--f-line); border-radius: 6px; }
.forum-form h2 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.forum-form label { display: block; margin: 0.75rem 0 0.25rem; font-size: 0.9rem; color: var(--f-muted); }
.forum-form input[type="text"], .forum-form textarea {
  width: 100%; padding: 0.6rem 0.7rem; font: inherit; color: var(--f-text);
  background: var(--f-bg); border: 1px solid var(--f-line); border-radius: 4px;
}
.forum-form textarea { resize: vertical; }
.forum-actions { display: flex; justify-content: space-between; margin-top: 1rem; }
.forum-form > .forum-btn { margin-top: 0.9rem; }
.forum-error { margin: 0 0 0.5rem; padding: 0.6rem 0.8rem; color: var(--f-danger); background: #2e2224; border: 1px solid #5a3a3d; border-radius: 4px; }
.forum-inline { margin-top: 0.6rem; }

/* Buttons */
.forum-btn { display: inline-block; padding: 0.45rem 0.9rem; font: inherit; font-size: 0.9rem; color: var(--f-text) !important; background: var(--f-raised); border: 1px solid var(--f-line); border-radius: 4px; cursor: pointer; text-decoration: none !important; }
.forum-btn:hover { border-color: var(--f-muted); }
.forum-btn-primary { color: var(--f-accent-ink) !important; background: var(--f-accent); border-color: var(--f-accent); font-weight: 600; }
.forum-btn-primary:hover { filter: brightness(1.08); }
.forum-btn-danger { color: var(--f-danger) !important; background: transparent; }

/* Seitennavigation */
.forum-pagination { display: flex; gap: 0.35rem; flex-wrap: wrap; margin: 1rem 0; }
.forum-pagination a { min-width: 2rem; padding: 0.3rem 0.6rem; text-align: center; background: var(--f-surface); border: 1px solid var(--f-line); border-radius: 4px; }
.forum-pagination a.is-current { color: var(--f-accent-ink); background: var(--f-accent); border-color: var(--f-accent); font-weight: 600; text-decoration: none; }

@media (max-width: 40rem) {
  .forum { margin: 0; padding: 1rem; border-radius: 0; }
  .forum-post { flex-direction: column; }
  .forum-author { flex-direction: row; flex-basis: auto; justify-content: flex-start; text-align: left; }
  .forum-avatar { width: 40px; height: 40px; }
  .forum-row { flex-direction: column; }
  .forum-count { text-align: left; }
}