/**
 * Forum Topics
 *
 * Topic listing page shown within a category. Includes the category
 * meta area and individual topic rows with vote count, title, badges,
 * meta, stats, and last-activity info.
 *
 * Template: templates/forum-category.php
 *   .forum-category__meta (topic count + page info)
 *   .forum-category__topics (wrapper)
 *     .forum-topic-row.forum-topic-row--header (column headers)
 *     .forum-topic-row (individual topics)
 *
 * Template: templates/parts/topic-row.php
 *   .forum-topic-row
 *     .forum-topic-row__votes > .forum-topic-row__vote-score
 *     .forum-topic-row__main
 *       .forum-topic-row__title-line
 *         .forum-topic-row__badge (--pinned, --solved, --closed)
 *         a.forum-topic-row__title
 *       .forum-topic-row__meta
 *         img.forum-topic-row__avatar
 *         .forum-topic-row__author
 *         .forum-topic-row__separator
 *         time.forum-topic-row__time
 *     .forum-topic-row__stats
 *       .forum-topic-row__stat (icon + count)
 *     .forum-topic-row__last-activity
 *       time | .forum-topic-row__no-replies
 *
 * @package PC_Kompas_Forum
 */

/* ============================================================================
   CATEGORY META — topic count + page info
   ============================================================================ */

.forum-category__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
    font-size: clamp(0.8125rem, 1vw + 0.2rem, 0.875rem);
    color: var(--text-muted);
}

.forum-category__meta-separator {
    color: var(--text-muted);
}

/* ============================================================================
   TOPIC LIST CONTAINER
   ============================================================================ */

.forum-category__topics {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* ============================================================================
   TOPIC ROW — HEADER (column labels)
   ============================================================================ */

.forum-topic-row--header {
    display: grid;
    grid-template-columns: clamp(48px, 5vw + 0.5rem, 60px) 1fr auto auto;
    align-items: center;
    gap: clamp(0.75rem, 1.5vw, 1rem);
    padding: clamp(0.5rem, 1vw, 0.625rem) clamp(0.75rem, 2vw, 1.25rem);
    background: var(--bg-tertiary);
    font-size: clamp(0.75rem, 0.8vw + 0.2rem, 0.8125rem);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    user-select: none;
}

.forum-topic-row--header:hover {
    background: var(--bg-tertiary);
}

/* ============================================================================
   INDIVIDUAL TOPIC ROW
   4-column grid: votes | main | stats | last-activity
   ============================================================================ */

.forum-topic-row {
    display: grid;
    grid-template-columns: clamp(48px, 5vw + 0.5rem, 60px) 1fr auto auto;
    align-items: center;
    gap: clamp(0.75rem, 1.5vw, 1rem);
    padding: clamp(0.75rem, 2vw, 1rem) clamp(0.75rem, 2vw, 1.25rem);
    background: var(--bg-secondary);
    transition: background-color 0.1s ease;
}

.forum-topic-row:hover {
    background: var(--bg-hover);
}

/* Pinned modifier */
.forum-topic-row--pinned {
    background: var(--accent-light);
}

.forum-topic-row--pinned:hover {
    background: var(--accent-light);
}

/* ============================================================================
   VOTES COLUMN
   ============================================================================ */

.forum-topic-row__votes {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.forum-topic-row__vote-score {
    font-size: clamp(0.9375rem, 1.2vw + 0.2rem, 1.125rem);
    font-weight: 700;
    color: var(--text-secondary);
}

/* ============================================================================
   MAIN — title-line + meta
   ============================================================================ */

.forum-topic-row__main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Title line: badges + title link */
.forum-topic-row__title-line {
    display: flex;
    align-items: center;
    gap: 0.4em;
    min-width: 0;
}

/* The <a> is the title itself */
.forum-topic-row__title {
    font-size: clamp(0.875rem, 1vw + 0.25rem, 1rem);
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.forum-topic-row__title:hover {
    color: var(--accent);
}

/* Badges (pinned, solved, closed) */
.forum-topic-row__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
}

.forum-topic-row__badge svg {
    width: 12px;
    height: 12px;
}

.forum-topic-row__badge--pinned {
    background: var(--warning-bg);
    color: var(--warning);
}

.forum-topic-row__badge--solved {
    background: var(--success-bg);
    color: var(--success);
}

.forum-topic-row__badge--closed {
    background: var(--error-bg);
    color: var(--error);
}

/* Meta line: avatar + author + separator + time */
.forum-topic-row__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs) 0.375rem;
    font-size: clamp(0.75rem, 0.8vw + 0.2rem, 0.8125rem);
    color: var(--text-muted);
}

.forum-topic-row__avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border);
}

.forum-topic-row__author {
    color: var(--text-secondary);
    font-weight: 500;
}

.forum-topic-row__separator {
    color: var(--text-muted);
}

.forum-topic-row__time {
    color: var(--text-muted);
}

/* ============================================================================
   STATS COLUMN — reply count + view count
   ============================================================================ */

.forum-topic-row__stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.forum-topic-row__stat {
    display: flex;
    align-items: center;
    gap: 0.3em;
    font-size: clamp(0.75rem, 0.8vw + 0.2rem, 0.8125rem);
    color: var(--text-muted);
}

.forum-topic-row__stat svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.7;
}

.forum-topic-row__stat span {
    font-weight: 500;
    color: var(--text-secondary);
}

/* ============================================================================
   LAST ACTIVITY COLUMN
   ============================================================================ */

.forum-topic-row__last-activity {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
    font-size: clamp(0.75rem, 0.8vw + 0.2rem, 0.8125rem);
    color: var(--text-muted);
    white-space: nowrap;
    min-width: max(80px, 8vw);
}

.forum-topic-row__last-activity time {
    color: var(--text-muted);
}

.forum-topic-row__no-replies {
    color: var(--text-muted);
    font-style: italic;
}
