/* =========================================================
   ZSCAPE — Forum pages
   Builds on styles.css + hiscores.css (table look, panel look) + forms.css.
   ========================================================= */

/* Category list (forum.html) */
.hiscores-table th.col-category { width: auto; }
.forum-category-name { color: var(--gold-2); font-weight: 600; font-size: 1.02rem; transition: color .2s; }
.forum-category-name:hover { color: var(--gold-3); text-decoration: underline; }
.forum-category-desc { color: var(--muted); font-size: .85rem; margin-top: 4px; }

/* Thread list (forum-category.html) */
.hiscores-table th.col-title { width: auto; }
.hiscores-table th.col-author { width: 160px; }
.hiscores-table th.col-activity { width: 200px; text-align: right; }
.hiscores-table td.col-activity { text-align: right; color: var(--muted-2); font-size: .85rem; }
.hiscores-table td.col-author { color: var(--muted); }

.thread-badge {
    display: inline-block; font-family: 'Cinzel', serif; font-size: .68rem; font-weight: 700;
    letter-spacing: .05em; text-transform: uppercase; padding: 2px 7px; border-radius: 3px;
    margin-right: 8px; vertical-align: middle;
}
.thread-badge-pinned { color: #35210a; background: var(--gold-grad); }
.thread-badge-locked { color: var(--muted); background: rgba(255,255,255,.06); border: 1px solid var(--line-2); }

/* Posts (forum-thread.html) */
.forum-posts { display: flex; flex-direction: column; gap: 14px; }
.forum-post {
    display: grid; grid-template-columns: 76px 1fr; gap: 18px;
    padding: 18px 22px; border-radius: 6px; border: 1px solid var(--line);
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    box-shadow: inset 0 1px 0 rgba(255,214,128,.06);
}
.forum-post-side { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.forum-post-main { min-width: 0; }
.forum-post-author { font-family: 'Cinzel', serif; font-weight: 700; color: var(--gold-2); margin-bottom: 10px; }
.forum-post-body { color: var(--text); font-size: .96rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.forum-post-date { color: var(--muted-2); font-size: .78rem; font-family: var(--mono, monospace); }

.forum-post-footer {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
    gap: 12px; margin-top: 14px;
}

/* Avatars */
.forum-avatar {
    width: 64px; height: 64px; border-radius: 8px; overflow: hidden; flex: none;
    border: 1px solid var(--line-2); background: var(--bg-3);
}
.forum-avatar img { width: 100%; height: 100%; object-fit: cover; }
.forum-avatar-fallback {
    display: flex; align-items: center; justify-content: center;
    font-family: 'Cinzel', serif; font-weight: 700; font-size: 1.4rem; color: var(--gold-2);
    background: linear-gradient(180deg, var(--panel-2), var(--bg-3));
}
.forum-avatar-sm {
    display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
    width: 22px; height: 22px; border-radius: 5px; margin-right: 8px; overflow: hidden;
    border: 1px solid var(--line-2); background: var(--bg-3);
    font-family: 'Cinzel', serif; font-weight: 700; font-size: .68rem; color: var(--gold-2);
}
.forum-avatar-sm.forum-avatar-fallback { font-size: .68rem; }
img.forum-avatar-sm { object-fit: cover; }

/* Signature */
.forum-post-signature {
    margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line);
    color: var(--muted); font-size: .85rem; line-height: 1.6;
}

/* Embedded links/images inside rendered post bodies + signatures */
.forum-embed-link { color: var(--gold-2); text-decoration: underline; text-underline-offset: 2px; }
.forum-embed-link:hover { color: var(--gold-3); }
.forum-embed-image {
    display: block; max-width: 100%; max-height: 420px; margin: 10px 0; border-radius: 6px;
    border: 1px solid var(--line);
}

/* Votes */
.forum-vote { display: flex; align-items: center; gap: 8px; }
.forum-vote-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px;
    border: 1px solid var(--line-2); background: var(--bg-3); color: var(--muted);
    font-family: var(--mono, monospace); font-size: .82rem; cursor: pointer;
    transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.forum-vote-btn:hover:not(:disabled) { border-color: var(--gold-deep); color: var(--text); }
.forum-vote-btn:disabled { cursor: not-allowed; opacity: .55; }
.forum-vote-btn .forum-vote-arrow { font-size: .72rem; }
.forum-vote-up.active { border-color: var(--gold); color: var(--gold-2); background: rgba(242,166,58,.12); }
.forum-vote-down.active { border-color: var(--ember); color: var(--ember-2); background: rgba(255,106,31,.12); }

/* Editor toolbar (new thread / reply / signature) */
.forum-editor-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.forum-editor-btn { min-width: 34px; }

.forum-profile-link { margin-bottom: 16px; font-size: .85rem; }
.forum-profile-link a { color: var(--gold-2); text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 460px) {
    .forum-post { grid-template-columns: 1fr; }
    .forum-post-side { flex-direction: row; }
}

/* Moderator controls */
.forum-mod-bar { display: flex; gap: 10px; flex-wrap: wrap; }

/* New thread / reply / profile forms sit inside the shared .panel/.auth-panel look, but
   shouldn't be centered/narrow like the login form. */
#newThreadPanel, #replyPanel, #profilePanel { text-align: left; }
#newThreadPanel .form, #replyPanel .form, #profilePanel .form { max-width: none; }
#profileWrap.auth-wrap { max-width: 640px; }

.forum-avatar-preview { margin-top: 10px; }
.forum-avatar-preview-img {
    width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-2);
}

.form-success {
    color: #b9f2b0; background: rgba(90,220,60,.1); border: 1px solid rgba(90,220,60,.35);
    border-radius: 4px; padding: 10px 14px; font-size: .88rem; margin-bottom: 18px;
}
