﻿

:root {
    --rosa: #ff007f;
    --fundo: #f7f7f8;
    --card: #fff;
    --borda: #e8e8ec;
    --texto: #1f1f1f;
    --texto2: #666;
    --chip: #f0f0f2;
    --radius: 14px;
}



.container {
    max-width: 80vw;
    margin: 16px auto 80px;
    padding: 0 12px
}

/* ===== CTAs enxutos com destaque único (foto + posição) ===== */
.strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px
}

@media(max-width:560px) {
    .strip {
        grid-template-columns: 1fr
    }
    .container {
        max-width: 90vw;
        margin: 16px auto 80px;
        padding: 0 12px
    }

}

.cta-card {
    display: flex;
    gap: 12px;
    align-items: center;
    text-decoration: none;
    color: inherit;
    background: var(--card);
    border: 1px solid var(--borda);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,.05);
}

.cta-photo {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0
}

    .cta-photo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block
    }

.pos-badge {
    position: absolute;
    left: -6px;
    top: -6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ffe6f3;
    color: var(--rosa);
    border: 1px solid #ffc7e5;
    font-weight: 800;
    font-size: .8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
}

.cta-info h4 {
    margin: 0;
    font-size: 1rem
}

.cta-info p {
    margin: 2px 0 0 0;
    color: var(--texto2);
    font-size: .9rem
}

.cta-actions {
    margin-left: auto;
    display: flex;
    align-items: center
}

.btn {
    background: var(--rosa);    
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap
}
#btnNovo {
    margin-left: auto;
}
.d-none {
    display: none !important;
}
.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #333;
    border: 1px solid var(--borda);
    border-radius: 999px;
    padding: 8px 12px;
    text-decoration: none;
    font-weight: 600
}
.btn-link:hover {
    color: var(--cor_principal);
}
/* ===== Controles da comunidade ===== */
.controls {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 10px 0 12px
}

.filtros {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.chip {
    background: var(--chip);
    border: 1px solid var(--borda);
    color: #444;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: .9rem;
    cursor: pointer
}

    .chip i {
        margin-right: 6px
    }

    .chip.ativo {
        background: #ffe6f3;
        color: var(--rosa);
        border-color: #ffc7e5
    }

.right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
}
.select {
    border: 1px solid var(--borda);
    border-radius: 10px;
    background: #fff;
    padding: 8px 10px;
    font-size: .95rem
}

.busca {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--borda);
    border-radius: 10px;
    padding: 8px 10px;
    flex: 1;
    min-width: 320px;
    min-width: 200px
}

    .busca input {
        border: none;
        outline: none;
        background: transparent;
        width: 100%
    }

/* ===== Lista de tópicos (capa 16:9 obrigatória) ===== */
.lista {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px
}

.card {
    background: var(--card);
    border: 1px solid var(--borda);
    border-radius: var(--radius);
    box-shadow: 0 10px 28px rgba(0,0,0,.05);
    overflow: hidden;
    cursor: pointer;
    transition: transform .06s ease;
}

    .card:active {
        transform: scale(.997)
    }

.cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #ddd;
    overflow: hidden
}

    .cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block
    }

.badge-tipo {
    position: absolute;
    left: 12px;
    top: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: .75rem;
    border: 1px solid transparent
}

.tag-alerta {
    background: #fff5e6;
    color: #9a6b00;
    border-color: #ffe2b8
}

.tag-evento {
    background: #e9fbef;
    color: #0c6b3c;
    border-color: #bbf1cf
}

.tag-geral {
    background: #eef4ff;
    color: #2447d6;
    border-color: #cfdcff
}

.tag-discussao {
    background: #f1f1f1;
    color: #333;
    border-color: #e4e4e4
}

.card-body {
    padding: 12px 14px
}
.card-link {
    color: inherit;
    text-decoration: none;
    display: block;
}
.titulo {
    margin: 0 0 6px 0;
    font-weight: 900;
    font-size: 1.12rem;
    line-height: 1.25
}

.meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--texto2);
    font-size: .9rem
}

.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    color: var(--texto2)
}

.contadores {
    display: flex;
    gap: 14px;
    font-size: .9rem
}

.autor {
    display: flex;
    align-items: center;
    gap: 8px
}

    .autor img {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        object-fit: cover
    }

/* ===== View switch (lista <-> detalhe) ===== */
.view {
    position: relative;
    min-height: 60vh
}

#view-list {
    display: block
}

#view-topic {
    display: none
}

.topic {
    background: var(--card);
    border: 1px solid var(--borda);
    border-radius: var(--radius);
    box-shadow: 0 10px 28px rgba(0,0,0,.05);
    overflow: hidden;
}

    .topic .topic-cover {
        position: relative;
        width: 100%;
        aspect-ratio: 16/9;
        background: #ddd
    }

        .topic .topic-cover img {
            width: 100%;
            height: 100%;
            object-fit: cover
        }

.topic-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--borda)
}

.topic-title {
    margin: 0;
    font-size: 1.14rem;
    font-weight: 900
}

.topic-meta {
    color: var(--texto2);
    font-size: .9rem;
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

.btn-sec {
    background: #fff;
    color: #333;
    border: 1px solid var(--borda);
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 600;
    cursor: pointer
}

.thread {
    background: var(--fundo)
}

.msg {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid var(--borda);
    background: #fff
}

    .msg:last-child {
        border-bottom: none
    }

    .msg .avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%
    }

.msg-head {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    color: var(--texto2);
    font-size: .9rem
}

.msg-nome {
    font-weight: 800;
    color: #222
}

.msg-texto {
    margin: 6px 0 4px;
    line-height: 1.55;
    font-size: .98rem
}

.reply {
    padding: 12px 14px;
    border-top: 1px solid var(--borda);
    background: #fff;
    display: flex;
    gap: 8px;
    align-items: flex-start
}

    .reply textarea {
        flex: 1;
        border: 1px solid var(--borda);
        border-radius: 10px;
        padding: 10px 12px;
        min-height: 44px;
        resize: vertical;
        font-size: .96rem
    }




/* minimal modal (pode mover para seu CSS) */
#modalNovoTopico {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1030;
}

    #modalNovoTopico[aria-hidden="false"] {
        display: block;
    }

    #modalNovoTopico .novo-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,.5);
    }

    #modalNovoTopico .novo-card {
        position: relative;
        margin: 4rem auto;
        max-width: 640px;
        background: #fff;
        border-radius: 18px;
        box-shadow: 0 10px 30px rgba(0,0,0,.25);
        padding: 1.25rem 1.25rem;
    }

    #modalNovoTopico .novo-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    #modalNovoTopico .novo-close {
        background: none;
        border: 0;
        font-size: 1.5rem;
        cursor: pointer;
        line-height: 1;
    }

    #modalNovoTopico .field {
        margin: .75rem 0;
        display: flex;
        flex-direction: column;
    }

        #modalNovoTopico .field > label {
            font-weight: 600;
            margin-bottom: .25rem;
        }

        #modalNovoTopico .field > input[type="text"],
        #modalNovoTopico .field > select,
        #modalNovoTopico .field > textarea {
            border: 1px solid #ddd;
            border-radius: 10px;
            padding: .6rem .7rem;
        }

    #modalNovoTopico .novo-foot {
        margin-top: 1rem;
        display: flex;
        gap: .5rem;
        justify-content: flex-end;
    }

/* Botão rosa no padrão da página */
.btn-rosa {
    background: var(--rosa);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: .6rem 1rem;
    font-weight: 700;
}

    .btn-rosa[disabled] {
        opacity: .7;
        cursor: not-allowed;
    }

/* Picker de foto custom */
.file-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.file-hidden {
    display: none;
}

.file-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: #fff;
    color: #333;
    border: 1px solid var(--borda);
    border-radius: 999px;
    padding: .45rem .9rem;
    font-weight: 600;
    cursor: pointer;
}

.file-thumb {
    width: 72px;
    height: 54px;
    border-radius: 10px;
    border: 1px solid var(--borda);
    background: #f7f7f8;
    display: inline-block;
    overflow: hidden;
}

    .file-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }


/* --- Desktop (mantém busca grande e botão à direita) --- */
.right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    flex-wrap: nowrap;
}

.busca {
    flex: 1 1 380px; /* grande no desktop */
    min-width: 260px; /* pode ajustar */
}

#btnNovo {
    margin-left: auto;
}

/* --- Mobile: evitar overflow e permitir quebra em 2 linhas --- */
@media (max-width: 640px) {
    .controls {
        gap: 8px;
    }

    .right {
        flex: 1 1 100%;
        flex-wrap: wrap; /* permite quebrar */
    }

    .select {
        flex: 0 0 48%; /* ocupa metade */
    }

    .busca {
        order: 2;
        flex: 1 1 100%; /* 100% de largura */
        min-width: 0; /* <<< remove a restrição que causava overflow */
    }

    #btnNovo {
        order: 3;
        flex: 1 1 100%; /* botão em uma linha inteira */
        margin-left: 0;
        justify-content: center;
    }
}

/* telas muito pequenas: select também quebra */
@media (max-width: 400px) {
    .select {
        flex: 1 1 100%;
    }
}

/* guarda de segurança contra qualquer “pixel fantasma” */
html, body {
    overflow-x: hidden;
}
