/* ── WIDGET PRÉVIA DE TÓPICOS NA HOME ── */
.st-home-previews {
    margin-bottom: 20px;
}

/* Card principal */
.st-preview-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r2);
    overflow: hidden;
    margin-bottom: 16px;
    transition: box-shadow .2s;
}
.st-preview-card:hover {
    box-shadow: 0 4px 16px var(--c-shadow2);
}

/* Header do card */
.st-preview-header {
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--c-border);
}

/* Breadcrumb mini */
.st-preview-breadcrumb {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--c-muted);
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.st-preview-breadcrumb a {
    color: var(--red);
    font-weight: 500;
    text-decoration: none;
}
.st-preview-breadcrumb a:hover { text-decoration: underline; }
.st-preview-breadcrumb span { color: var(--c-border2); }

/* Titulo */
.st-preview-title {
    display: block;
    font-size: 17px;
    font-weight: 800;
    color: var(--c-text);
    letter-spacing: -.02em;
    line-height: 1.25;
    text-decoration: none;
    margin-bottom: 10px;
    transition: color .15s;
}
.st-preview-title:hover { color: var(--red); }

/* Badges */
.st-preview-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}
.st-preview-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.st-badge-solved { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.st-badge-hot    { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.st-badge-pinned { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.st-badge-cat    { background: rgba(191,8,17,.1); color: var(--red); border: 1px solid rgba(191,8,17,.2); }
.st-badge-tag    { background: var(--c-surface2); color: var(--c-muted); border: 1px solid var(--c-border); font-weight: 500; text-transform: none; letter-spacing: 0; }

/* Stats */
.st-preview-stats {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: var(--c-muted);
    flex-wrap: wrap;
}
.st-preview-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Seção de comentários */
.st-preview-comments {
    border-bottom: 1px solid var(--c-border);
}

/* Comentário individual */
.st-preview-cmt {
    display: flex;
    gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--c-border);
    transition: background .12s;
}
.st-preview-cmt:last-of-type { border-bottom: none; }
.st-preview-cmt:hover { background: var(--c-surface2); }

/* Destaque: comentário mais curtido */
.st-preview-cmt-top {
    background: rgba(191,8,17,.03);
    border-left: 3px solid var(--red);
}
/* Melhor resposta */
.st-preview-cmt-best {
    background: rgba(191,8,17,.05);
    border-left: 3px solid var(--red);
}

/* Avatar coluna */
.st-preview-cmt-ava-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 44px;
    flex-shrink: 0;
}
.st-preview-cmt-ava {
    width: 40px;
    height: 40px;
    border-radius: var(--r);
    object-fit: cover;
    border: 2px solid var(--c-border);
    display: block;
    cursor: pointer;
}
.st-preview-cmt-lvl {
    font-size: 8px;
    font-weight: 700;
    background: rgba(191,8,17,.1);
    border-radius: 3px;
    padding: 1px 3px;
    text-align: center;
    white-space: nowrap;
    color: var(--red);
}

/* Corpo do comentário */
.st-preview-cmt-body { flex: 1; min-width: 0; }

.st-preview-best-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--red);
    background: rgba(191,8,17,.1);
    border-radius: 3px;
    padding: 2px 7px;
    margin-bottom: 6px;
}
.st-preview-cmt-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}
.st-preview-cmt-author {
    font-size: 13px;
    font-weight: 700;
    color: var(--red);
    text-decoration: none;
    cursor: pointer;
}
.st-preview-cmt-author:hover { text-decoration: underline; }
.st-preview-verified {
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
}
.st-preview-mod {
    background: #f59e0b;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
}
.st-preview-cmt-date {
    font-size: 11px;
    color: var(--c-muted);
}
.st-preview-cmt-text {
    font-size: 13px;
    line-height: 1.65;
    color: var(--c-text);
    margin-bottom: 8px;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.st-preview-read-more {
    color: var(--red);
    font-weight: 600;
    margin-left: 4px;
    font-size: 12px;
    text-decoration: none;
}
.st-preview-read-more:hover { text-decoration: underline; }

.st-preview-cmt-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Ver todas */
.st-preview-see-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--red);
    text-decoration: none;
    background: var(--c-surface2);
    border-top: 1px solid var(--c-border);
    transition: background .15s;
}
.st-preview-see-all:hover {
    background: rgba(191,8,17,.06);
}

/* Caixa de resposta rápida */
.st-preview-reply {
    padding: 12px 18px;
    background: var(--c-surface2);
}
.st-preview-login-prompt {
    font-size: 13px;
    color: var(--c-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.st-preview-login-prompt a {
    color: var(--red);
    font-weight: 600;
}
.st-preview-reply-wrap {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.st-preview-reply-ava {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--c-border);
    flex-shrink: 0;
}
.st-preview-reply-editor { flex: 1; min-width: 0; }
.st-preview-reply-ta {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--c-border);
    border-radius: var(--r);
    font-family: var(--ff);
    font-size: 13px;
    color: var(--c-text);
    background: var(--c-surface);
    resize: none;
    outline: none;
    transition: border-color .15s, min-height .2s;
    line-height: 1.5;
    min-height: 38px;
}
.st-preview-reply-ta:focus {
    border-color: var(--red);
    min-height: 70px;
}
.st-preview-reply-actions {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
    margin-top: 7px;
}

/* Dark mode */
.st-dark .st-badge-solved { background: #14532d; color: #86efac; border-color: #166534; }
.st-dark .st-badge-hot    { background: #431407; color: #fdba74; border-color: #9a3412; }
.st-dark .st-badge-pinned { background: #1e3a5f; color: #93c5fd; border-color: #1d4ed8; }
.st-dark .st-preview-cmt-top  { background: rgba(191,8,17,.07); }
.st-dark .st-preview-cmt-best { background: rgba(191,8,17,.09); }

/* Responsive */
@media(max-width:480px) {
    .st-preview-header { padding: 13px 14px 10px; }
    .st-preview-title  { font-size: 15px; }
    .st-preview-cmt    { padding: 11px 14px; gap: 9px; }
    .st-preview-cmt-ava-col { width: 36px; }
    .st-preview-cmt-ava     { width: 34px; height: 34px; }
    .st-preview-reply       { padding: 10px 14px; }
}

/* Excerpt / descricao do topico */
.st-preview-excerpt {
    font-size: 13px;
    line-height: 1.65;
    color: var(--c-text2);
    margin-bottom: 10px;
    word-break: break-word;
    overflow-wrap: anywhere;
}




/* ── ACOES DO TOPICO E COMENTARIOS NA PREVIA ── */
/* Garante que nenhum botao estique para direita */
.st-preview-topic-actions,
.st-preview-cmt-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    width: 100%;
}
/* Todos os filhos diretos: tamanho natural, nunca crescem */
.st-preview-topic-actions > *,
.st-preview-cmt-actions > * {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
}
/* Vote group inline */
.st-preview-topic-actions .st-vote-group,
.st-preview-cmt-actions .st-vote-group {
    display: inline-flex !important;
    flex-direction: row !important;
    width: auto !important;
}
/* Botoes individuais */
.st-preview-topic-actions .st-vote-btn,
.st-preview-cmt-actions .st-vote-btn {
    display: inline-flex !important;
    width: auto !important;
    padding: 5px 11px !important;
    font-size: 12px !important;
}
.st-preview-topic-actions .st-meta-btn {
    display: inline-flex !important;
    width: auto !important;
    font-size: 12px !important;
}
.st-preview-cmt-actions .st-cmt-btn {
    display: inline-flex !important;
    width: auto !important;
}
/* Ver topico empurra para direita */
.st-preview-topic-actions .st-preview-ver-link {
    margin-left: auto !important;
}
