/* Forum pages */

.forum-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.forum-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.forum-header h1 { margin-bottom: 4px; }

/* Category blocks */
.forum-categories { display: flex; flex-direction: column; gap: 8px; }

.forum-category-block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.forum-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  transition: background var(--transition);
  gap: 12px;
}

.forum-category-header:hover { background: var(--bg-hover); }

.forum-category-name {
  font-weight: 600;
  font-size: 14px;
  display: block;
  margin-bottom: 2px;
}

.forum-category-body {
  border-top: 1px solid var(--border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.forum-category-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

/* Thread rows */
.thread-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r);
  transition: all var(--transition);
  color: var(--text);
}

.thread-row:hover { background: var(--bg-hover); }

.thread-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.thread-row-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-row-meta { font-size: 12px; }

/* Thread page */
.thread-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.thread-breadcrumb a { color: var(--text-2); }
.thread-breadcrumb a:hover { color: var(--text); }

.thread-title-row {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.thread-title-row h1 { font-size: 1.4rem; }

/* Posts */
.posts-list { display: flex; flex-direction: column; gap: 0; }

.post-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 8px;
  overflow: hidden;
}

.post-author {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.post-author-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.post-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.post-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-2);
}

.post-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.post-content .mention {
  color: var(--accent-2);
  font-weight: 600;
}

.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.post-actions { display: flex; align-items: center; gap: 12px; }

.post-vote-btn {
  font-size: 12px;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition);
  padding: 3px 6px;
  border-radius: var(--r);
}

.post-vote-btn:hover { color: var(--accent-2); }
.post-vote-btn.active { color: var(--accent-2); }

.post-delete-btn {
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition);
}

.post-delete-btn:hover { color: var(--danger); }

/* Reply box */
.reply-box {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
  .post-item { grid-template-columns: 1fr; }
  .post-author {
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border);
    justify-content: flex-start;
    padding: 10px 12px;
  }
  .post-author-info { align-items: flex-start; }
}

/* ── Thread: OP vs Replies ───────────────────────── */
.post-op {
  border-color: var(--border-2);
  margin-bottom: 24px;
}

.post-op .post-body {
  background: var(--bg-3);
}

.replies-section {
  margin-bottom: 24px;
}

.replies-label {
  margin-bottom: 12px;
}

.replies-thread {
  display: flex;
  gap: 0;
}

.replies-line {
  width: 2px;
  background: var(--border-2);
  border-radius: 2px;
  margin-left: 20px;
  flex-shrink: 0;
  min-height: 100%;
}

.replies-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 16px;
}

.post-reply {
  border-radius: var(--r);
}

.post-reply .post-author {
  padding: 10px 12px;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  width: 140px;
}

.post-reply .post-author-info {
  align-items: flex-start;
}

/* ── Threaded replies ────────────────────────────── */
.op-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-2);
  background: var(--accent-dim);
  padding: 1px 6px;
  border-radius: 20px;
  letter-spacing: 0.05em;
}

.replies-section { margin-top: 8px; margin-bottom: 24px; }
.replies-label { margin-bottom: 10px; }
.replies-list { display: flex; flex-direction: column; gap: 4px; }

.reply-thread { display: flex; flex-direction: column; gap: 4px; }

.post-reply { border-radius: var(--r); }

.post-author-compact {
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 10px 12px !important;
  width: 140px !important;
  background: var(--bg-card) !important;
  border-right: 1px solid var(--border) !important;
}

.post-author-compact .post-author-info {
  align-items: flex-start !important;
}

.nested-replies {
  display: flex;
  margin-left: 24px;
  gap: 0;
}

.thread-line {
  width: 2px;
  background: var(--border-2);
  border-radius: 2px;
  margin: 4px 0;
  flex-shrink: 0;
}

.nested-replies-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 12px;
}

.post-reply-nested {
  border-color: var(--border);
}

.post-reply-btn {
  font-size: 12px;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition);
  padding: 3px 6px;
  border-radius: var(--r);
}
.post-reply-btn:hover { color: var(--accent-2); }

.replying-to-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--accent-dim);
  border-radius: var(--r);
  margin-bottom: 8px;
  border-left: 2px solid var(--accent);
}

.mention {
  color: var(--accent-2);
  font-weight: 600;
}
