/* ======================================================
   HOLY CIRCLE — COMMUNITY PAGE
   IMPORTANT:
   This file MUST NOT control layout.
   Layout is owned by forum.css + forum-main.css
====================================================== */

/* Page background only */
body[data-page="forum-community"] {
  background: var(--hc-bg);
}

/* ======================================================
   COMMUNITY HERO (TEXT ONLY)
====================================================== */

#communityHeader,
.forum-hero {
  margin-bottom: 2rem;
}

/* ======================================================
   COMMUNITY RIGHT SIDEBAR EXTENSIONS ONLY
   (uses existing forum sidebar blocks)
====================================================== */

#threadCommunityCard .sidebar-list {
  margin-top: 0.5rem;
}

#joinCommunityBtn {
  margin-top: 0.75rem;
  width: 100%;
}

/* ======================================================
   THEME BUTTONS (community page only)
====================================================== */
body[data-page="forum-community"] .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

body[data-page="forum-community"] .btn:focus-visible {
  outline: 3px solid rgba(0, 46, 107, 0.25);
  outline-offset: 2px;
}

body[data-page="forum-community"] .btn.btn-gold,
body[data-page="forum-community"] #joinCommunityBtn,
body[data-page="forum-community"] .add-rule-btn {
  background: var(--hc-gold);
  color: #fff;
  border-color: var(--hc-gold);
  width: 100%;
}

body[data-page="forum-community"] .btn.btn-gold:hover,
body[data-page="forum-community"] #joinCommunityBtn:hover,
body[data-page="forum-community"] .add-rule-btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
}

body[data-page="forum-community"] .btn.is-joined {
  background: #eef0f4;
  border-color: #d7dbe3;
  color: #111;
}

body[data-page="forum-community"] .btn.is-joined:hover {
  background: #e3e6ee;
}

body[data-page="forum-community"] .btn.btn-secondary {
  background: #ffffff;
  color: var(--hc-blue);
  border-color: rgba(0, 46, 107, 0.25);
}

body[data-page="forum-community"] .btn.btn-secondary:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 46, 107, 0.35);
  background: rgba(0, 46, 107, 0.04);
}

body[data-page="forum-community"] .btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Community rules card: keep Add Rule button spacing tidy */
body[data-page="forum-community"] #communityRulesCard .add-rule-btn {
  margin: 0.5rem 0 0.75rem;
}

/* ======================================================
   RULES LIST (no layout overrides)
====================================================== */

#communityRulesList {
  padding-left: 0;
  list-style: none;
}

#communityRulesList li {
  padding: 0.25rem 0;
  color: var(--hc-muted);
}

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 46, 107, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.modal-content {
  background: #ffffff;
  color: #0f172a;
  border-radius: 18px;
  padding: 1.25rem;
  width: 100%;
  max-width: 420px;
  border: 1px solid rgba(191, 151, 69, 0.28);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}

/* Modal title */
#ruleModalTitle {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--hc-blue);
}

/* Inputs */
.modal-content input,
.modal-content textarea {
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 46, 107, 0.18);
  background: #ffffff;
  color: #0f172a;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.modal-content textarea {
  resize: vertical;
  min-height: 110px;
}

.modal-content input::placeholder,
.modal-content textarea::placeholder {
  color: rgba(15, 23, 42, 0.55);
}

.modal-content input:focus,
.modal-content textarea:focus {
  border-color: rgba(191, 151, 69, 0.65);
  box-shadow: 0 0 0 3px rgba(191, 151, 69, 0.22);
}

/* Actions */
.modal-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 0.9rem;
}

.modal-actions .btn {
  width: auto;
  min-width: 92px;
}

/* Keep buttons consistent with theme styles above */
body[data-page="forum-community"] #saveRuleBtn.btn-gold {
  background: var(--hc-gold);
  border-color: var(--hc-gold);
  color: #ffffff;
}

body[data-page="forum-community"] #cancelRuleBtn.btn-secondary {
  background: #ffffff;
  color: var(--hc-blue);
  border: 1px solid rgba(0, 46, 107, 0.25);
}
