/* Forum: reuse portal gold and add forum accents */
.forum-page {
  --forum-gold: var(--gold);
  --forum-gold-light: var(--gold-light);
  --forum-gold-dark: var(--gold-dark);
  --forum-warm-bg: 38 40% 94%;
  --forum-header-bg: 36 30% 92%;
  --forum-online: 140 45% 45%;
  --forum-sticky: 36 60% 50%;
}

.forum-categories {
  margin-top: 1.5rem;
}

.forum-category {
  margin-bottom: 1.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}

.forum-category-header {
  background: hsl(var(--forum-header-bg));
  padding: 0.75rem 1.25rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
}

.forum-subforum-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  transition: background 0.15s;
}

.forum-subforum-row:hover {
  background: hsl(var(--forum-warm-bg));
}

.forum-subforum-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: hsl(var(--forum-gold-light) / 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.forum-subforum-body {
  flex: 1;
  min-width: 0;
}

.forum-subforum-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
}

.forum-subforum-title a {
  color: hsl(var(--foreground));
  text-decoration: none;
}

.forum-subforum-title a:hover {
  color: hsl(var(--forum-gold-dark));
}

.forum-subforum-desc {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.25rem;
}

.forum-subforum-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
}

.forum-subforum-last {
  text-align: right;
  min-width: 10rem;
  font-size: 0.875rem;
}

.forum-stats {
  margin-top: 1.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}

.forum-stats-header {
  background: hsl(var(--forum-header-bg));
  padding: 0.75rem 1.25rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
}

.forum-stats-body {
  padding: 1rem 1.25rem;
  background: hsl(var(--card));
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
}

.forum-stats-item {
  text-align: center;
}

.forum-stats-num {
  font-weight: 600;
  color: hsl(var(--forum-gold-dark));
}

.forum-stats-label {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.forum-online-list {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid hsl(var(--border));
  font-size: 0.875rem;
}

.forum-online-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: hsl(var(--forum-online));
  margin-right: 0.35rem;
  vertical-align: middle;
}

.forum-breadcrumb {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.forum-breadcrumb a {
  color: hsl(var(--forum-gold-dark));
  text-decoration: none;
}

.forum-breadcrumb a:hover { text-decoration: underline; }

.forum-breadcrumb-sep {
  margin: 0 0.35rem;
  color: hsl(var(--muted-foreground));
}

.forum-new-topic {
  margin-bottom: 1.25rem;
}

.forum-new-topic-guest {
  padding: 0.75rem 1.25rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--forum-warm-bg) / 0.5);
  font-size: 0.95rem;
}

.forum-new-topic-guest a {
  color: hsl(var(--forum-gold-dark));
  text-decoration: none;
  font-weight: 500;
}

.forum-new-topic-guest a:hover { text-decoration: underline; }

.forum-new-topic-guest .auth-btn {
  display: inline-block;
  padding: 0.4rem 1rem;
  margin-right: 0.5rem;
  border-radius: 0.4rem;
  background: hsl(var(--forum-gold));
  color: hsl(var(--forum-gold-dark));
  font-weight: 600;
  text-decoration: none;
}

.forum-topics {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}

.forum-topics-header {
  background: hsl(var(--forum-header-bg));
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  display: grid;
  grid-template-columns: 2rem 1fr 5rem 5rem 8rem;
  gap: 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
}

.forum-topic-row {
  display: grid;
  grid-template-columns: 2rem 1fr 5rem 5rem 8rem;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  transition: background 0.15s;
}

.forum-topic-row:hover {
  background: hsl(var(--forum-warm-bg));
}

.forum-topic-row.pinned {
  background: hsl(var(--forum-warm-bg) / 0.6);
}

.forum-topic-row a {
  color: hsl(var(--foreground));
  text-decoration: none;
  font-weight: 500;
}

.forum-topic-row a:hover {
  color: hsl(var(--forum-gold-dark));
}

.forum-topic-meta {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.2rem;
}

.forum-topic-stats {
  text-align: center;
  font-size: 0.875rem;
}

.forum-topic-pin,
.forum-topic-lock {
  color: hsl(var(--forum-sticky));
}

.forum-pagination {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.forum-pagination a,
.forum-pagination span {
  padding: 0.4rem 0.75rem;
  border-radius: 0.4rem;
  border: 1px solid hsl(var(--border));
  font-size: 0.9rem;
  text-decoration: none;
  color: hsl(var(--foreground));
  background: hsl(var(--card));
}

.forum-pagination a:hover {
  background: hsl(var(--forum-gold-light) / 0.3);
  border-color: hsl(var(--forum-gold));
}

.forum-pagination .current {
  background: hsl(var(--forum-gold) / 0.2);
  border-color: hsl(var(--forum-gold));
}

.forum-topic-header {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  background: hsl(var(--forum-header-bg));
}

.forum-topic-header h1 {
  margin: 0;
  font-size: 1.35rem;
}

.forum-topic-header-meta {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.forum-posts {
  margin-bottom: 1rem;
}

.forum-post {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
  background: hsl(var(--card));
}

.forum-post-header {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: hsl(var(--forum-warm-bg));
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}

.forum-post-body {
  display: flex;
  flex-wrap: wrap;
}

.forum-post-author {
  width: 100%;
  max-width: 12rem;
  padding: 1rem;
  background: hsl(var(--forum-warm-bg) / 0.5);
  border-right: 1px solid hsl(var(--border));
  text-align: center;
}

.forum-post-author-name {
  font-weight: 600;
  color: hsl(var(--foreground));
}

.forum-post-author-meta {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.35rem;
}

.forum-post-online {
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: hsl(var(--forum-online));
  margin-right: 0.25rem;
}

.forum-post-content {
  flex: 1;
  min-width: 0;
  padding: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.95rem;
  line-height: 1.5;
}

.forum-post-actions {
  padding: 0.5rem 1rem;
  border-top: 1px solid hsl(var(--border));
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.forum-post-actions button {
  background: none;
  border: none;
  cursor: pointer;
  color: hsl(var(--muted-foreground));
  padding: 0.25rem 0;
}

.forum-post-actions button:hover {
  color: hsl(var(--forum-gold-dark));
}

.forum-reply-form {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
  background: hsl(var(--card));
}

.forum-reply-form h3 {
  margin: 0;
  padding: 0.75rem 1.25rem;
  background: hsl(var(--forum-header-bg));
  font-size: 1rem;
}

.forum-reply-form textarea {
  width: 100%;
  min-height: 120px;
  padding: 1rem;
  border: none;
  border-top: 1px solid hsl(var(--border));
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}

.forum-reply-form .forum-reply-guest {
  padding: 0.75rem 1rem;
  border-top: 1px solid hsl(var(--border));
  font-size: 0.875rem;
}

.forum-reply-form .forum-reply-guest input {
  padding: 0.4rem 0.5rem;
  margin-left: 0.5rem;
  width: 12rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.35rem;
}

.forum-reply-form .forum-reply-actions {
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.forum-reply-form .auth-btn {
  min-height: 38px;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  border: none;
  background: hsl(var(--forum-gold));
  color: hsl(var(--forum-gold-dark));
  font-weight: 600;
  cursor: pointer;
}

.forum-reply-form .auth-btn:hover {
  background: hsl(var(--forum-gold-dark));
  color: hsl(var(--ivory));
}

.forum-reply-form .auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.forum-locked-msg {
  text-align: center;
  padding: 1.5rem;
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}

.forum-loading {
  text-align: center;
  padding: 2rem;
  color: hsl(var(--muted-foreground));
}

.forum-error {
  padding: 1rem;
  background: hsl(0 60% 96%);
  color: hsl(0 50% 30%);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
