/* =========================
   Community – global layout
   ========================= */

.community-page,
.community-post-page {
  color: inherit;
}

/* =========================
   Links (Yew Router safe)
   ========================= */

.community-post-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

.community-post-link:hover {
  text-decoration: underline;
}

.community-back-link {
  text-decoration: none;
  opacity: 0.8;
}

.community-back-link:hover {
  opacity: 1;
  text-decoration: underline;
}

/* =========================
   Sort tabs
   ========================= */

.community-sort-tab {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font-size: 13px;
  opacity: 0.85;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.community-sort-tab:hover {
  opacity: 1;
}

.community-sort-tab.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  opacity: 1;
}

/* =========================
   Feed cards
   ========================= */

.community-post-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.16);
}

.community-post-score {
  width: 54px;
  text-align: center;
  opacity: 0.95;
}

.community-post-score .label {
  font-size: 12px;
  opacity: 0.65;
}

.community-post-score .value {
  font-size: 18px;
  font-weight: 700;
}

.community-post-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  opacity: 0.75;
}

.community-post-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  word-break: break-word;
}

.community-post-body {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.35;
  opacity: 0.78;
}

/* =========================
   Tags / badges
   ========================= */

.community-tag {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

/* =========================
   Composer
   ========================= */

.community-composer {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.community-composer input,
.community-composer textarea {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  color: inherit;
}

.community-composer textarea {
  resize: vertical;
}

.community-composer button {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.10);
  cursor: pointer;
}

/* =========================
   Community post page
   ========================= */

.community-post-header {
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.16);
}

.community-post-header h1 {
  margin: 0 0 8px 0;
  font-size: 26px;
  line-height: 1.2;
}

.community-post-content {
  white-space: pre-wrap;
  line-height: 1.45;
  opacity: 0.9;
}

/* =========================
   Comments
   ========================= */

.community-comments {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.community-comment {
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.12);
}

.community-comment-meta {
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 6px;
}

.community-comment-body {
  white-space: pre-wrap;
  line-height: 1.4;
}

/* =========================
   Errors / status
   ========================= */

.community-error {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 80, 80, 0.35);
  background: rgba(255, 0, 0, 0.08);
}

.community-loading {
  opacity: 0.8;
  padding: 12px 0;
}
