/* =======================================================================
   board.css - styles specific to the /board/ forum section. Loaded
   alongside style.css (topbar/nav/footer/panel/btn/cf-form/cf-alert
   etc. all come from there - this file only adds what's unique to the
   forum: the logged-in user menu, breadcrumbs, rank badges, and the
   category/forum/topic/post layout used by the board's own pages.
   ======================================================================= */

/* --- Top bar user menu (replaces the plain HUD stat block within board/) */
.board-user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.board-user-menu__identity {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-bright);
    font-family: var(--font-heading);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.board-user-menu__identity:hover { color: var(--accent); text-decoration: none; }
.board-user-menu__name { color: inherit; }

/* --- Rank / group badges - small pill using a per-rank accent color set
   via the --rank-color custom property (see board-header.php / wherever
   a rank is rendered). Reused for group badges too. */
.rank-badge {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 7px;
    border-radius: 2px;
    border: 1px solid var(--rank-color, var(--border));
    color: var(--rank-color, var(--text-dim));
    background: color-mix(in srgb, var(--rank-color, var(--text-dim)) 12%, transparent);
    white-space: nowrap;
}

/* --- Breadcrumbs */
.board-breadcrumbs {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin: 18px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.board-breadcrumbs a { color: var(--accent-dim); }
.board-breadcrumbs a:hover { color: var(--accent); }
.board-breadcrumbs__sep { opacity: 0.5; }
.board-breadcrumbs__current { color: var(--text); }

/* --- Category / forum listing (board index) */
.board-category { margin-bottom: 22px; }
.board-category__title {
    font-family: var(--font-heading);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-bright);
    padding: 10px 16px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
}
.board-forum-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 90px 90px 220px;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-top: 0;
    background: var(--panel);
}
.board-forum-row:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.board-forum-row__name { color: var(--accent); font-weight: 700; }
.board-forum-row__name:hover { text-decoration: none; color: var(--text-bright); }
.board-forum-row__desc { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
.board-forum-row__stat { text-align: center; font-family: var(--font-mono); font-size: 12px; }
.board-forum-row__stat-label { display: block; font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.board-forum-row__latest { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.board-forum-row__latest a { color: var(--text); }
.board-forum-row__latest .board-forum-row__latest-title { color: var(--text); display: block; }
@media (max-width: 720px) {
    .board-forum-row { grid-template-columns: 1fr; gap: 6px; }
    .board-forum-row__stat { text-align: left; }
    .board-forum-row__stat-label { display: inline; }
}

/* --- Topic listing (inside a forum) */
.board-topic-row {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 90px 90px 220px;
    gap: 16px;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-top: 0;
    background: var(--panel);
}
.board-topic-row:first-child { border-top: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.board-topic-row:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.board-topic-row__icon { color: var(--text-dim); text-align: center; }
.board-topic-row.is-pinned .board-topic-row__icon { color: var(--accent-amber); }
.board-topic-row.is-locked .board-topic-row__icon { color: var(--accent-danger); }
.board-topic-row__title a { color: var(--accent); font-weight: 700; }
.board-topic-row__title a:hover { text-decoration: none; color: var(--text-bright); }
.board-topic-row__meta { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; }
.board-topic-row__stat { text-align: center; font-family: var(--font-mono); font-size: 12px; }
.board-topic-row__latest { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.board-tag {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1px 6px;
    border-radius: 2px;
    margin-left: 6px;
    border: 1px solid var(--border);
    color: var(--text-dim);
}
.board-tag.is-pinned { color: var(--accent-amber); border-color: var(--accent-amber); }
.board-tag.is-locked { color: var(--accent-danger); border-color: var(--accent-danger); }
@media (max-width: 720px) {
    .board-topic-row { grid-template-columns: 20px 1fr; }
    .board-topic-row__stat, .board-topic-row__latest { display: none; }
}

/* --- Toolbar row above listings (New Topic button, etc.) */
.board-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

/* --- Post view (a single reply/topic-starter within a topic) */
.board-post {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 0;
    border: 1px solid var(--border);
    border-top: 0;
    background: var(--panel);
}
.board-post:first-of-type { border-top: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.board-post:last-of-type { border-radius: 0 0 var(--radius) var(--radius); }
.board-post__author {
    padding: 18px 14px;
    background: var(--panel-alt);
    border-right: 1px solid var(--border);
    text-align: center;
    font-size: 12px;
}
.board-post__avatar {
    width: 64px; height: 64px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-deep);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 8px;
    font-family: var(--font-heading);
    font-size: 22px;
    color: var(--text-dim);
    overflow: hidden;
}
.board-post__avatar img { width: 100%; height: 100%; object-fit: cover; }
.board-post__username { color: var(--text-bright); font-weight: 700; display: block; margin-bottom: 4px; }
.board-post__username:hover { color: var(--accent); }
.board-post__joined { color: var(--text-dim); font-size: 10.5px; margin-top: 6px; }
.board-post__postcount { color: var(--text-dim); font-size: 10.5px; }
.board-post__body { padding: 16px 18px; min-width: 0; }
.board-post__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-dim);
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-soft);
    flex-wrap: wrap;
    gap: 8px;
}
.board-post__content { font-size: 13.5px; line-height: 1.7; word-wrap: break-word; overflow-wrap: break-word; }
.board-post__content p { margin: 0 0 1em; }
.board-post__content img { max-width: 100%; border-radius: var(--radius); }
.board-post__content a { word-break: break-word; }
.board-post__signature {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    font-size: 12px;
    color: var(--text-dim);
}
.board-post__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.board-post__edited { font-size: 10.5px; color: var(--text-dim); font-style: italic; margin-top: 10px; }
@media (max-width: 640px) {
    .board-post { grid-template-columns: 1fr; }
    .board-post__author { display: flex; align-items: center; gap: 10px; text-align: left; border-right: 0; border-bottom: 1px solid var(--border); padding: 10px 14px; }
    .board-post__avatar { margin: 0; width: 40px; height: 40px; font-size: 16px; }
}

/* --- Attachments (image/video/audio, with thumbnails) */
.board-attachments { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.board-attachment {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-deep);
    overflow: hidden;
    width: 160px;
}
.board-attachment img, .board-attachment video { display: block; width: 100%; height: 110px; object-fit: cover; background: #000; }
.board-attachment audio { display: block; width: 100%; margin: 10px 0; padding: 0 8px; }
.board-attachment__file {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 110px; gap: 6px; color: var(--text-dim); font-size: 24px;
}
.board-attachment__name {
    display: block;
    font-size: 10.5px;
    padding: 6px 8px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-top: 1px solid var(--border);
}

/* --- Pagination */
.board-pagination { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 18px 0; font-family: var(--font-mono); font-size: 12px; }
.board-pagination a, .board-pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 30px; height: 30px; padding: 0 8px;
    border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text);
}
.board-pagination a:hover { border-color: var(--accent-dim); color: var(--accent); text-decoration: none; }
.board-pagination .is-current { color: var(--accent); border-color: var(--accent-dim); background: rgba(195, 178, 106,0.08); }
.board-pagination .is-disabled { opacity: 0.35; pointer-events: none; }

/* --- Reply / new-topic editor */
.board-editor-toolbar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.board-editor-toolbar button {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 5px 9px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
}
.board-editor-toolbar button:hover { border-color: var(--accent-dim); color: var(--accent); }
.board-upload-hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* --- Empty state */
.board-empty { padding: 30px; text-align: center; color: var(--text-dim); font-size: 13px; }
