/* ══════════════════════════════════════
   SNR Community — Forum
   ══════════════════════════════════════ */

/* ── Page Layout ── */
.forum-page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}
.forum-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.8rem;
    align-items: start;
}
.forum-main {
    min-width: 0;
}

/* ── Breadcrumb ── */
.forum-breadcrumb {
    font-family: var(--ui);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
}
.forum-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
}
.forum-breadcrumb a:hover { color: var(--crimson); }
.breadcrumb-sep {
    margin: 0 0.4rem;
    color: var(--border);
}
.breadcrumb-current {
    color: var(--text);
    font-weight: 600;
}

/* ── Header ── */
.forum-header {
    margin-bottom: 1.5rem;
}
.forum-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.forum-title {
    font-family: var(--display);
    font-size: 1.8rem;
    font-weight: 500;
    margin: 0;
}
.new-thread-btn {
    font-family: var(--ui);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    background: var(--crimson);
    color: #fff;
    border: none;
    padding: 0.5rem 1.2rem;
    text-decoration: none;
    border-radius: 2px;
    transition: opacity 0.2s;
}
.new-thread-btn:hover { opacity: 0.85; }

/* ── Category Filter ── */
.category-filter {
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.category-filter::-webkit-scrollbar { display: none; }
.cat-tab {
    font-family: var(--ui);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.cat-tab:first-child { border-radius: 2px 0 0 2px; }
.cat-tab:last-child { border-radius: 0 2px 2px 0; }
.cat-tab + .cat-tab { border-left: none; }
.cat-tab:hover { color: var(--text); }
.cat-tab.active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

/* ── Thread List ── */
.thread-list {
    display: flex;
    flex-direction: column;
}
.thread-card {
    display: grid;
    grid-template-columns: 48px 1fr 100px;
    gap: 0;
    align-items: start;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: background 0.15s;
}
.thread-card:first-child { border-top: 1px solid var(--border); }
.thread-card:hover { background: var(--bg-card); }
.thread-card.pinned { background: var(--bg-card); }

/* Vote column in list */
.vote-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    padding-top: 0.2rem;
}
.vote-arrow {
    font-size: 0.55rem;
    color: var(--text-secondary);
    line-height: 1;
}
.vote-count {
    font-family: var(--ui);
    font-size: 0.72rem;
    font-weight: 700;
}

/* Thread content */
.thread-content {
    padding: 0 0.6rem;
    min-width: 0;
}
.thread-badges {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}
.thread-pin-badge {
    font-family: var(--ui);
    font-size: 0.42rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    background: var(--gold);
    color: #fff;
    padding: 0.1em 0.4em;
    border-radius: 2px;
}
.thread-locked-badge {
    font-family: var(--ui);
    font-size: 0.42rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    background: var(--text-secondary);
    color: #fff;
    padding: 0.1em 0.4em;
    border-radius: 2px;
}
.thread-cat-badge {
    font-family: var(--ui);
    font-size: 0.42rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.1em 0.4em;
    border-radius: 2px;
}
.thread-title {
    font-family: var(--display);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.35;
    margin-bottom: 0.3rem;
}
.thread-author {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.thread-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ui);
    font-size: 0.48rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.thread-username {
    font-family: var(--ui);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text);
}
.thread-role-badge {
    font-family: var(--ui);
    font-size: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    padding: 0.1em 0.4em;
    border-radius: 2px;
}
.thread-role-moderator { color: #fff; background: #2c3e50; }
.thread-role-analyst { color: #fff; background: var(--gold); }
.thread-role-premium { color: #fff; background: var(--crimson); }
.thread-role-admin { color: #fff; background: var(--crimson); }
.thread-time {
    font-family: var(--ui);
    font-size: 0.58rem;
    color: var(--text-secondary);
}
.thread-preview {
    font-family: var(--body);
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-top: 0.3rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Stats column */
.thread-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    padding-top: 0.3rem;
}
.thread-stat-item {
    font-family: var(--ui);
    font-size: 0.58rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ── Thread Detail ── */
.thread-detail {
    margin-bottom: 0;
}
.thread-detail-header {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.thread-detail-title {
    font-family: var(--display);
    font-size: 1.4rem;
    font-weight: 500;
    line-height: 1.3;
    margin: 0.3rem 0 0.5rem;
}
.thread-detail-body {
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--border);
}
.thread-detail-body p {
    font-family: var(--body);
    font-size: 0.9rem;
    line-height: 1.65;
    margin: 0 0 0.8rem;
}
.thread-detail-body p:last-child { margin-bottom: 0; }

/* ── Reply Compose ── */
.thread-reply-compose {
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--border);
}

/* ── Replies Header ── */
.thread-replies-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0 0.5rem;
}

/* ── Sidebar ── */
.forum-sidebar {
    position: sticky;
    top: 1.5rem;
}
.sidebar-card {
    border: 1px solid var(--border);
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
}
.sec-title {
    font-family: var(--ui);
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 0.6rem;
}
.sidebar-text {
    font-family: var(--body);
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}
.sidebar-rules {
    font-family: var(--body);
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 1.2rem;
    margin: 0;
}
.sidebar-rules li { margin-bottom: 0.2rem; }

/* ── Pagination ── */
.thread-pagination {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    padding: 1.5rem 0;
}
.page-btn {
    font-family: var(--ui);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--border);
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.15s;
}
.page-btn:hover { border-color: var(--text); color: var(--text); }
.page-btn.active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

/* ── New Thread Form ── */
.new-thread-card {
    border: 1px solid var(--border);
    padding: 2rem;
}
.new-thread-title {
    font-family: var(--display);
    font-size: 1.4rem;
    font-weight: 500;
    margin: 0 0 0.3rem;
}
.new-thread-subtitle {
    font-family: var(--body);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 1.5rem;
}
.new-thread-card .comment-textarea {
    min-height: 160px;
}
.new-thread-card select {
    font-family: var(--body);
    font-size: 0.88rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    outline: none;
    border-radius: 2px;
    transition: border-color 0.2s;
}
.new-thread-card select:focus { border-color: var(--crimson); }
.new-thread-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}
.new-thread-cancel {
    font-family: var(--ui);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
}
.new-thread-cancel:hover { color: var(--text); }
.form-hint {
    font-family: var(--ui);
    font-size: 0.58rem;
    color: var(--text-secondary);
    text-align: right;
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 768px) {
    .forum-layout {
        grid-template-columns: 1fr;
    }
    .forum-sidebar {
        position: static;
        order: -1;
    }
    .forum-sidebar .sidebar-card:not(:first-child) {
        display: none;
    }
    .thread-card {
        grid-template-columns: 40px 1fr;
    }
    .thread-stats {
        display: none;
    }
    .thread-detail-title {
        font-size: 1.15rem;
    }
    .new-thread-card {
        padding: 1.2rem;
    }
}

@media (max-width: 480px) {
    .forum-page { padding: 1rem 0.6rem 2rem; }
    .category-filter { gap: 0; }
    .thread-card { grid-template-columns: 36px 1fr; padding: 0.8rem 0; }
    .vote-col { min-width: 36px; }
    .thread-title { font-size: 0.88rem; }
    .thread-preview { display: none; }
    .thread-detail-header { flex-direction: column; }
}
