/* ================== Forum / community page ================== */
body.forum-page {
  font-family: "Faruma", "MV Boli", Arial, sans-serif;
  background: #ffffff;
  background-attachment: fixed;
  color: #111;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

body.forum-page .content {
  margin-top: var(--site-header-h);
  margin-right: 0 !important;
  margin-left: 0;
  padding: 28px 40px 48px;
  max-width: none !important;
  width: auto;
  box-sizing: border-box;
}

body.forum-page .content > .section:only-child {
  min-height: auto;
  display: block;
}

body.forum-page .forum-intro h2 {
  font-family: "EasaFalaGalan", "Faruma", Arial, sans-serif;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: normal;
  color: #165493;
  margin: 0 0 10px;
  padding-bottom: 0;
  border-bottom: none;
}

body.forum-page .forum-intro h2::after {
  content: none;
  display: none;
}

body.forum-page main.content .forum-thread-view h2,
body.forum-page main.content .forum-thread-view h2::after {
  border-bottom: none;
  padding-bottom: 0;
  text-align: right;
  margin: 0 0 10px;
}

body.forum-page main.content .forum-thread-view h2::after {
  content: none;
  display: none;
}

body.forum-page .forum-replies-title {
  font-family: "EasaFalaGalan", "Faruma", Arial, sans-serif;
  color: #165493;
  font-weight: normal;
  margin: 0 0 12px;
  font-size: 20px;
  text-align: right;
  border-bottom: none;
  padding-bottom: 0;
}

body.forum-page .forum-thread-meta--header {
  margin-bottom: 12px;
}

.forum-wrap {
  max-width: 920px;
  margin: 0 auto;
}

.forum-intro {
  text-align: center;
  margin-bottom: 28px;
}

.forum-intro p {
  margin: 0 auto;
  max-width: 640px;
  color: #627d98;
  font-size: 16px;
  line-height: 1.85;
}

.forum-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  gap: 24px;
  align-items: start;
  direction: ltr;
}

.forum-main,
.forum-side {
  direction: rtl;
  min-width: 0;
}

.forum-side {
  position: sticky;
  top: 84px;
}

.forum-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.forum-cat-btn {
  border: 1px solid rgba(22, 84, 147, 0.18);
  background: #fff;
  color: #486581;
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.forum-cat-btn:hover,
.forum-cat-btn.is-active {
  background: rgba(22, 84, 147, 0.1);
  border-color: rgba(22, 84, 147, 0.35);
  color: #165493;
}

.forum-thread-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.forum-thread-card {
  display: block;
  text-align: right;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid rgba(22, 84, 147, 0.1);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 4px 16px rgba(14, 60, 106, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.forum-thread-card:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 84, 147, 0.22);
  box-shadow: 0 8px 24px rgba(14, 60, 106, 0.1);
}

.forum-thread-card h3 {
  margin: 0 0 8px;
  font-family: "EasaFalaGalan", "Faruma", Arial, sans-serif;
  font-size: 18px;
  font-weight: normal;
  color: #165493;
  line-height: 1.45;
}

.forum-thread-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  font-size: 13px;
  color: #627d98;
}

.forum-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(22, 84, 147, 0.08);
  color: #165493;
  font-size: 12px;
}

.forum-empty,
.forum-loading,
.forum-error {
  text-align: center;
  padding: 40px 16px;
  color: #627d98;
  background: #fff;
  border-radius: 16px;
  border: 1px dashed rgba(22, 84, 147, 0.2);
}

.forum-error {
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.25);
  background: #fff7f7;
}

.forum-compose,
.forum-reply-box {
  background: #fff;
  border: 1px solid rgba(22, 84, 147, 0.1);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 8px 28px rgba(14, 60, 106, 0.07);
}

.forum-compose h3,
.forum-reply-box h3,
.forum-thread-view h3 {
  margin: 0 0 14px;
  font-family: "EasaFalaGalan", "Faruma", Arial, sans-serif;
  font-size: 20px;
  font-weight: normal;
  color: #165493;
}

.forum-field {
  margin-bottom: 12px;
}

.forum-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #486581;
}

.forum-field input,
.forum-field select,
.forum-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(22, 84, 147, 0.18);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  color: #1a2332;
  background: #f8fbff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.forum-field textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.8;
}

.forum-field input:focus,
.forum-field select:focus,
.forum-field textarea:focus {
  outline: none;
  border-color: rgba(22, 84, 147, 0.45);
  box-shadow: 0 0 0 3px rgba(22, 84, 147, 0.1);
  background: #fff;
}

.forum-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.forum-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.forum-btn-primary {
  background: linear-gradient(135deg, #165493 0%, #1e6aab 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(22, 84, 147, 0.24);
}

.forum-btn-primary:hover {
  transform: translateY(-1px);
}

.forum-btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.forum-btn-ghost {
  background: rgba(22, 84, 147, 0.08);
  color: #165493;
}

.forum-status {
  font-size: 13px;
  color: #627d98;
}

.forum-status.is-error {
  color: #b42318;
}

.forum-thread-view {
  background: #fff;
  border: 1px solid rgba(22, 84, 147, 0.1);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 8px 28px rgba(14, 60, 106, 0.07);
  margin-bottom: 18px;
}

.forum-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  color: #165493;
  text-decoration: none;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(22, 84, 147, 0.08);
}

.forum-back:hover {
  background: rgba(22, 84, 147, 0.14);
}

.forum-thread-view h2 {
  margin: 0 0 10px;
  font-family: "EasaFalaGalan", "Faruma", Arial, sans-serif;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: normal;
  color: #165493;
  line-height: 1.4;
}

.forum-thread-body,
.forum-reply-body {
  color: #3a4a5e;
  font-size: 16px;
  line-height: 2;
  white-space: pre-wrap;
  word-break: break-word;
}

.forum-replies {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.forum-reply {
  background: #f8fbff;
  border: 1px solid rgba(22, 84, 147, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
}

.forum-reply-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  color: #627d98;
}

.forum-reply-head strong {
  color: #165493;
  font-weight: normal;
}

.forum-note {
  margin-top: 12px;
  font-size: 12px;
  color: #829ab1;
  line-height: 1.6;
}

.forum-hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .forum-layout {
    grid-template-columns: 1fr;
    direction: rtl;
  }

  .forum-side {
    position: static;
    order: 2;
  }

  .forum-main {
    order: 1;
  }
}

@media (max-width: 768px) {
  body.forum-page .content,
  body.forum-page main.content {
    margin-right: 0;
    margin-left: 0;
    max-width: 100%;
    width: 100%;
    padding: 24px 16px 40px;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .forum-wrap {
    max-width: 100%;
  }
}
