/**
 * AstionComunidades — inicial.css
 * Estilos específicos da página inicial (incial_comunidade.html)
 * Complementa dashboard.css (base) — prefixos: comun-  /  content-
 */

/* ═══════════════════════════════════════════════════
   TABS DE CONTEÚDO
═══════════════════════════════════════════════════ */
.content-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border-radius: 14px;
    padding: 6px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
    overflow-x: auto;
    scrollbar-width: none;
}
.content-tabs::-webkit-scrollbar { display: none; }

.content-tab {
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.content-tab:hover { color: var(--text); background: var(--bg-hover); }
.content-tab.active {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 2px 10px var(--primary-glow);
}

/* Tab "Voltar ao Literário" — estilo discreto */
.content-tab--voltar {
    margin-left: auto;
    font-size: 0.78rem;
    opacity: 0.7;
}
.content-tab--voltar:hover { opacity: 1; }

/* ═══════════════════════════════════════════════════
   SEÇÕES DE CONTEÚDO
═══════════════════════════════════════════════════ */
.content-section { display: none; }
.content-section.active { display: block; }

/* A col-content no inicial deve expandir naturalmente com o conteúdo,
   sem criar scroll interno (diferente do dashboard que usa sticky + overflow-y:auto) */
.col-content {
    overflow-y: visible;
    overflow-x: hidden;
}

/* Feed com mesma largura do comunidade.html */
#section-feed { max-width: 680px; margin: 0 auto; }

/* ═══════════════════════════════════════════════════
   COMPOSITOR DE POST
═══════════════════════════════════════════════════ */
.comun-compose {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 14px;
    transition: box-shadow 0.2s;
}
.comun-compose:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.comun-compose__avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--bg-hover);
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem; font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}
.comun-compose__avatar--user {
    background: var(--gradient);
    color: #fff;
    border-color: transparent;
}

.comun-compose__input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.5;
}
.comun-compose__input::placeholder { color: var(--text-muted); }

.comun-compose__btn {
    padding: 7px 18px;
    border-radius: 20px;
    background: var(--gradient);
    color: #fff;
    font-size: 0.8rem; font-weight: 700;
    border: none; cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
    flex-shrink: 0;
}
.comun-compose__btn:hover { opacity: 0.88; }
.comun-compose__btn:disabled { opacity: 0.5; cursor: not-allowed; }

.comun-compose__input[readonly] {
    cursor: default;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════
   CARD DE POST — ESTRUTURA BASE (.comun-post)
═══════════════════════════════════════════════════ */
.comun-post {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
    transition: box-shadow 0.3s, border-color 0.3s;
}
.comun-post:hover {
    box-shadow: 0 2px 14px rgba(0,0,0,0.07);
    border-color: var(--primary-tint, var(--border));
}

.comun-post__header {
    display: flex; align-items: flex-start;
    gap: 10px; margin-bottom: 12px;
}
.comun-post__avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--bg-hover); border: 2px solid var(--border);
    color: var(--text-muted); font-size: 0.82rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.comun-post__avatar--autor {
    background: var(--gradient); color: #fff; border-color: transparent;
}
.comun-post__author-info { flex: 1; min-width: 0; }
.comun-post__author {
    display: flex; align-items: center; gap: 6px;
    font-weight: 600; font-size: 0.9rem; color: var(--text);
    line-height: 1.3; flex-wrap: wrap;
}
.comun-post__type-badge {
    display: inline-flex; align-items: center;
    font-size: 0.65rem; font-weight: 700;
    padding: 2px 8px; border-radius: 10px;
    text-transform: uppercase; letter-spacing: 0.03em; flex-shrink: 0;
}
.comun-post__type-badge--autor  { background: var(--primary-tint); color: var(--primary); }
.comun-post__type-badge--membro { background: var(--bg-hover);     color: var(--text-muted); }

.comun-post__classif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 18px;
    margin-left: 2px;
    padding: 0 6px;
    border-radius: 5px;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    flex-shrink: 0;
}

.comun-post__meta {
    font-size: 0.74rem; color: var(--text-muted); margin-top: 2px;
    display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.comun-post__community-tag { color: var(--primary); font-weight: 600; }

.comun-post__text {
    font-size: 0.9rem; line-height: 1.55; color: var(--text); margin-bottom: 12px;
}

.comun-post__title {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    line-height: 1.3;
    letter-spacing: 0.02em;
    margin: 0 0 8px;
}

.comun-post__media {
    margin: 6px 0 12px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-hover);
    aspect-ratio: 9 / 10;
}

.comun-post__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comun-post__media--youtube {
    aspect-ratio: 16 / 9;
}

.comun-post__media--youtube iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}
.comun-post__actions {
    display: flex; gap: 4px; padding-top: 12px;
    border-top: 1px solid var(--border); flex-wrap: wrap;
}
.comun-post__action-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 5px; padding: 7px 10px; border-radius: 8px;
    background: none; border: none;
    color: var(--text-muted); font-size: 0.82rem; font-weight: 500;
    cursor: pointer; text-decoration: none; line-height: 1;
    transition: background 0.18s, color 0.18s;
}
.comun-post__action-btn:hover { background: var(--bg-hover); color: var(--primary); }
.comun-post__action-btn.is-liked { color: #ef4444; }
.comun-post__action-btn.is-liked i { animation: pulse-heart-comun 0.3s ease; }
@keyframes pulse-heart-comun {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.4); }
}

/* Botões de ação interativos (classe nova: .comun-post__action) */
.comun-post__action {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 5px; padding: 7px 10px; border-radius: 8px;
    background: none; border: none;
    color: var(--text-muted); font-size: 0.82rem; font-weight: 500;
    cursor: pointer; text-decoration: none; line-height: 1;
    transition: background 0.18s, color 0.18s;
    flex: 1;
}
.comun-post__action:hover { background: var(--primary-tint); color: var(--primary); }
.comun-post__action.is-active { color: var(--primary); font-weight: 600; }
.comun-post__action.is-active i { color: var(--primary); }
.comun-post__action--ver {
    margin-left: auto;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    flex: initial;
}
.comun-post__action--ver:hover { background: var(--primary-tint); color: var(--primary); }

/* Área de comentários no feed inicial */
.comun-post__comments {
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    background: var(--bg-subtle, var(--bg-card));
    border-radius: 0 0 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.comun-comment {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.comun-comment__avatar {
    width: 32px; height: 32px; min-width: 32px;
    border-radius: 50%;
    background: var(--primary-tint);
    color: var(--primary);
    font-weight: 700; font-size: 0.72rem;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.comun-comment__avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.comun-comment__body {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
}
.comun-comment__author { font-weight: 600; font-size: 0.78rem; color: var(--text-primary); margin-right: 6px; }
.comun-comment__time { font-size: 0.72rem; color: var(--text-muted); }
.comun-comment__text { margin: 4px 0 0; font-size: 0.85rem; color: var(--text-secondary); word-break: break-word; }
.comun-comment-form { display: flex; gap: 10px; align-items: flex-start; padding-top: 4px; }
.comun-comment-input {
    flex: 1; border: 1px solid var(--border); border-radius: 10px;
    padding: 8px 12px; font-size: 0.85rem; resize: vertical;
    min-height: 40px; background: var(--bg-card); color: var(--text-primary);
    font-family: inherit; transition: border-color 0.2s;
}
.comun-comment-input:focus { outline: none; border-color: var(--primary); }
.comun-comment-send {
    background: var(--gradient); color: #fff; border: none; border-radius: 8px;
    width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0; transition: opacity 0.2s;
}
.comun-comment-send:disabled { opacity: 0.5; cursor: default; }
.comun-comment-send:hover:not(:disabled) { opacity: 0.85; }
.comun-comments__loading,
.comun-comments__vazio { font-size: 0.82rem; color: var(--text-muted); padding: 6px 0; text-align: center; }

/* ─── Modal de compartilhar (compartilhado com comunidade) ───────────────── */
#comun-share-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .22s;
}
#comun-share-modal-overlay.aberto { opacity: 1; }
.comun-share-modal__box {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
    padding: 20px 22px; width: min(380px, 92vw); box-shadow: 0 8px 32px rgba(0,0,0,.18);
    display: flex; flex-direction: column; gap: 14px;
}
.comun-share-modal__header { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 1rem; color: var(--text-primary); }
.comun-share-modal__fechar { background: none; border: none; cursor: pointer; font-size: 1.3rem; line-height: 1; color: var(--text-muted); padding: 2px 6px; border-radius: 6px; transition: background .15s; }
.comun-share-modal__fechar:hover { background: var(--bg-hover); }
.comun-share-modal__redes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.comun-share-modal__rede { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px; border: 1px solid var(--border); border-radius: 10px; background: none; cursor: pointer; font-size: 0.72rem; color: var(--text-muted); transition: all .18s; }
.comun-share-modal__rede i { font-size: 1.35rem; color: var(--cor-rede, var(--primary)); }
.comun-share-modal__rede:hover { background: var(--primary-tint); border-color: var(--primary); color: var(--primary); }
.comun-share-modal__link { display: flex; gap: 8px; align-items: center; }
.comun-share-modal__link input { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 0.8rem; background: var(--bg-subtle, var(--bg-input)); color: var(--text-muted); min-width: 0; }
.comun-share-modal__link button { flex-shrink: 0; padding: 7px 14px; background: var(--gradient); color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 0.8rem; font-weight: 600; transition: opacity .18s; white-space: nowrap; }
.comun-share-modal__link button:hover { opacity: .85; }
/* ─── Fim modal de compartilhar ─────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════
   POST ESPECIAL — DEBATE
═══════════════════════════════════════════════════ */
.comun-post--debate {
    border-left: 3px solid var(--primary);
}
.comun-post__special-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.comun-post__special-tag--debate {
    background: var(--primary-tint);
    color: var(--primary);
}
.comun-post__special-tag--live {
    background: #ef4444;
    color: #fff;
}
.comun-post__special-tag--sugestao {
    background: var(--primary-tint);
    color: var(--primary);
}
.comun-post__debate-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}
.comun-post__debate-title {
    font-weight: 700;
    font-size: 0.93rem;
    color: var(--text);
    margin: 6px 0 10px;
    line-height: 1.4;
}
.comun-post__vote-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.71rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.comun-post__vote-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    overflow: hidden;
    margin-bottom: 12px;
}
.comun-post__vote-bar-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ═══════════════════════════════════════════════════
   POST ESPECIAL — SUGESTÃO DE COMUNIDADE
═══════════════════════════════════════════════════ */
.comun-post--sugestao {
    background: linear-gradient(135deg, var(--bg-card) 80%, var(--primary-light) 100%);
}
.comun-post__sugestao-body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0 12px;
}
.comun-post__sugestao-avatar {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--gradient);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.comun-post__sugestao-info { flex: 1; min-width: 0; }
.comun-post__sugestao-nome {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.comun-post__sugestao-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 2px 0;
}
.comun-post__sugestao-motivo {
    font-size: 0.72rem;
    color: var(--primary);
    font-style: italic;
}

/* ═══════════════════════════════════════════════════
   SIDEBAR — LOADING STATE
═══════════════════════════════════════════════════ */
.sidebar-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ═══════════════════════════════════════════════════
   EXPLORAR COMUNIDADES
═══════════════════════════════════════════════════ */
.explorar-filtros {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.explorar-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.explorar-search > i {
    font-size: 1.1rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.explorar-search__input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
}
.explorar-search__input::placeholder { color: var(--text-muted); }

.explorar-generos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.explorar-genero {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.explorar-genero:hover { background: var(--bg-hover); color: var(--text); }
.explorar-genero.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}

/* Card de explorar (variação com botão Entrar) */
.dash-community-card--explorar .dash-community-card__entrar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 7px 16px;
    background: var(--gradient);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    justify-content: center;
    transition: opacity 0.2s;
}
.dash-community-card--explorar .dash-community-card__entrar:hover { opacity: 0.85; }
