/* ==========================================================================
   RESET & CONFIGURAÇÕES GERAIS
   ========================================================================== */
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html, body {
    background:#f5f1e8;
    font-family: Arial, sans-serif;
    color:#111;
    
    /* TRAVA CRÍTICA ANTI-BALANÇO */
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    position: relative;
}

/* ==========================================================================
   LAYOUT E ESTRUTURA
   ========================================================================== */
.layout{
    display:flex;
    width:100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* ==========================================================================
   SIDEBAR (BARRA LATERAL DESKTOP)
   ========================================================================== */
.sidebar{
    width:88px;
    height:100vh;
    position:fixed;
    left:0;
    top:0;
    border-right:1px solid #e1dbd1;
    background:#f5f1e8;
    display:flex;
    flex-direction:column;
    align-items:center;
    padding-top:12px;
    z-index:1000;
}

.logo-x {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: #e9e3d8;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    box-shadow: inset 0 0 0 1px #e1dbd1;
    user-select: none;
    cursor: default;
    transition: transform 0.2s ease;
}
.logo-x:hover { transform: scale(1.05); }

.sidebar-menu{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.sidebar-menu a{
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #111;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
    text-decoration: none;
}
.sidebar-menu a:hover, .sidebar-menu a.active { background:#e9e3d8; }

#badge-notificacao {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    width: 8px;
    height: 8px;
    background: #1d9bf0;
    border-radius: 50%;
}

/* ==========================================================================
   CAIXA FLUTUANTE DE BUSCA (DESKTOP)
   ========================================================================== */
#busca-flutuante {
    display: none;
    position: fixed;
    left: 104px;
    top: 70px;
    background: #f5f1e8;
    border: 1px solid #e1dbd1;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
    z-index: 99999;
    width: 260px;
    gap: 8px;
    align-items: center;
}
#busca-flutuante input {
    flex: 1; padding: 8px 12px; border: 1px solid #e1dbd1; border-radius: 999px;
    background: #fff; outline: none; font-size: 14px; color: #111;
}
#fechar-busca-flutuante { cursor: pointer; color: #666; font-size: 16px; padding: 4px; }

/* ==========================================================================
   FEED WRAPPER & TOPBAR
   ========================================================================== */
.feed-wrapper{
    width:100%;
    margin-left:88px;
    max-width:720px;
    border-right:1px solid #e1dbd1;
    min-height:100vh;
    background:#f5f1e8;
}

.topbar{
    height:58px;
    display:flex;
    justify-content:space-around;
    align-items:center;
    border-bottom:1px solid #e1dbd1;
    position:sticky;
    top:0;
    background:#f5f1e8;
    z-index:999;
    font-size:18px;
}
.topbar div { cursor: pointer; }

.top-active{
    font-weight:700;
    position:relative;
}
.top-active::after{
    content:""; width:100%; height:4px; border-radius:999px;
    background:#1d9bf0; position:absolute; left:0; bottom:-18px;
}

.feed-update-bar {
    display: block;
    width: calc(100% - 32px);
    margin: 12px 16px;
    padding: 12px;
    background: #1d9bf0;
    color: #ffffff;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    font-family: Arial, sans-serif;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(29, 155, 240, 0.2);
    transition: background 0.2s, transform 0.1s;
    border: none; outline: none;
}
.feed-update-bar:hover { background: #1a8cd8; }
.feed-update-bar:active { transform: scale(0.98); }

/* ==========================================================================
   CAIXA DE PUBLICAÇÃO & TRENDINGS
   ========================================================================== */
.post-box{
    display:flex;
    align-items:center;
    gap:14px;
    padding:16px;
    border-bottom:1px solid #e1dbd1;
    max-width: 100%;
}

.post-avatar{
    width:48px;
    height:48px;
    border-radius:50%;
    border:1px solid #ddd;
    background:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:22px;
    flex-shrink:0;
}

#trending-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-family: Arial, sans-serif;
    align-items: center;
}

/* ==========================================================================
   ESTILIZAÇÃO DOS POSTS DO FEED (NEWS POST)
   ========================================================================== */
.news-post {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid #e1dbd1;
    transition: 0.2s;
    max-width: 100%;
}
.news-post:hover { background: #eee8de; }

.news-avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 12px;
    border: 1px solid #e1dbd1;
    background: white;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.news-avatar img {
    width: 28px !important;
    height: 28px !important;
    max-width: 100%; max-height: 100%;
    object-fit: contain !important;
    display: block !important;
    border-radius: 4px !important;
}

.news-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* IMPEDE O VAZAMENTO DE TEXTO EM FLEXBOX */
}

/* Ajuste fino anti-quebra do cabeçalho */
.news-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 4px;
    margin-bottom: 4px;
}

.news-source-name {
    font-weight: 700;
    font-size: 15px;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Corta com ... se for gigante */
}

.news-user {
    color: #666;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-time {
    color: #666;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0; /* Não deixa o tempo esmagar ou quebrar linha */
}

.news-title {
    position: relative;
    z-index: 1;
}
.news-title a {
    text-decoration: none;
    color: #111;
    font-size: 16px;
    line-height: 1.4;
    display: inline-block;
    max-width: 100%;
    word-break: break-word; /* Força quebra de palavras longas */
}
.news-title a:hover { color: #1d9bf0; }

.news-footer-source {
    margin-top: 8px;
    color: #666;
    font-size: 14px;
}

/* Gerenciamento de Layout Desktop da Barra de Ações */
.news-actions {
    display: flex;
    justify-content: flex-start;
    width: max-content;
    gap: 24px;
    margin-top: 12px;
    color: #666;
    position: relative;
    z-index: 10;
}
.news-actions i { font-size: 18px; cursor: pointer !important; padding: 4px; }

/* REGRA DE CORREÇÃO: Esconde o botão de seguir clonado de baixo por padrão no Computador */
.news-actions .btn-seguir-fonte {
    display: none !important;
}

/* Estilo geral do botão seguir */
.btn-seguir-fonte {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #111111;
    color: #ffffff;
    border: 1px solid #111111;
    font-weight: 700;
    font-family: Arial, sans-serif;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0; /* Impede o botão de esmagar */
}
.btn-seguir-fonte:not(.seguindo):hover { background: #2a2a2a; border-color: #2a2a2a; transform: translateY(-1px); }
.btn-seguir-fonte.seguindo { background: transparent; color: #111111; border: 1px solid #d7d2cb; }
.btn-seguir-fonte.seguindo:hover { background: rgba(224, 36, 94, 0.1); color: #e0245e; border-color: #e0245e; }
.btn-seguir-fonte.seguindo:hover span { display: none; }
.btn-seguir-fonte.seguindo:hover::after { content: "Deixar de seguir"; }
.btn-seguir-fonte.seguindo:hover svg { display: none; }
.btn-seguir-fonte:active { transform: scale(0.96); }

mark.tag-highlight {
    background: transparent; color: inherit; text-decoration: underline;
    text-decoration-color: #1d9bf0; text-decoration-thickness: 2px;
    text-underline-offset: 3px; font-weight: inherit;
}

/* ==========================================================================
   NOTIFICAÇÃO DO BOTÃO DE HASHTAG
   ========================================================================== */
#badge-hashtag {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    width: 8px;
    height: 8px;
    background: #1d9bf0;
    border-radius: 50%;
}

#site-footer{
    width: 100%;
    background: #f5f1e8;
    border-top: 1px solid #e1dbd1;
    padding: 20px 12px;
    margin-top: 30px;
    text-align: left;
}

.footer-inner{
    max-width: 720px;
    margin: 0 auto;
}

.footer-title{
    font-weight: 700;
    font-size: 16px;
    color: #111;
    margin-bottom: 4px;
}

.footer-sub{
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

#btn-contato-footer{
    background: #e9e3d8;
    border: 1px solid #e1dbd1;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: #111;
}

#footer-contato-box{
    display: none;
    margin-top: 12px;
    padding: 12px;
    background: #e9e3d8;
    border-radius: 12px;
    border: 1px solid #e1dbd1;
    text-align: left;
}

#footer-contato-box p{
    font-size: 13px;
    margin-bottom: 6px;
    color: #111;
}

.footer-copy{
    margin-top: 14px;
    font-size: 12px;
    color: #666;
}
/* ==========================================================================
   MEDIA QUERY: ADAPTAÇÃO TOTAL PARA DISPOSITIVOS MÓVEIS (CELULARES)
   ========================================================================== */
@media (max-width: 768px) {
    .layout {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Menu Inferior Fixo */
    .sidebar {
        width: 100% !important;
        height: 60px !important;
        top: auto !important; 
        bottom: 0 !important; 
        left: 0 !important;
        border-right: none !important;
        border-top: 1px solid #e1dbd1 !important;
        flex-direction: row !important;
        justify-content: space-around !important;
        padding-top: 0 !important;
        padding-bottom: env(safe-area-inset-bottom) !important;
    }

    .logo-x { display: none !important; }

    .sidebar-menu {
        flex-direction: row !important;
        width: 100% !important;
        justify-content: space-around !important;
        gap: 0 !important;
    }
    .sidebar-menu a { width: 50px !important; height: 50px !important; }

    /* Container do Feed */
    .feed-wrapper {
        margin-left: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        border-right: none !important;
        padding-bottom: 80px !important;
        padding-left: 8px !important;  
        padding-right: 8px !important; 
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    /* Abas superiores deslizantes */
    .topbar {
        font-size: 15px !important;
        justify-content: flex-start !important;
        gap: 20px !important;
        padding: 0 8px !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        scrollbar-width: none !important;
        width: 100% !important;
    }
    .topbar::-webkit-scrollbar { display: none !important; }

    /* Caixa de hashtags */
    .post-box {
        flex-wrap: wrap !important;
        gap: 10px !important;
        padding: 16px 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    #trending-topics {
        flex: 1 !important;
        width: 100% !important;
        max-width: calc(100vw - 80px) !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        padding-bottom: 4px !important;
        scrollbar-width: none !important;
    }
    #trending-topics::-webkit-scrollbar { display: none !important; }

    .news-post {
        padding: 14px 8px !important; 
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* ... regras anteriores dentro do @media (max-width: 768px) ... */

    .news-content {
        min-width: 0 !important;
        width: 100% !important;
    }

    /* AUMENTA A FONTE DO TÍTULO APENAS NO MOBILE */
    .news-title a {
        font-size: 19px !important; /* Aumentado de 16px para 19px */
        line-height: 1.35 !important; /* Ajusta o espaçamento entre as linhas para títulos grandes */
    }

    /* INVERSÃO MOBILE: Esconde o botão original do topo do cabeçalho */
    .news-header .btn-seguir-fonte {
        display: none !important;
    }

    /* ... resto das regras do @media ... */


    .news-header {
        width: 100% !important;
        justify-content: flex-start !important;
        gap: 6px !important;
    }
    .news-source-name {
        max-width: 160px !important; 
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .news-user {
        max-width: 110px !important; 
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* INVERSÃO MOBILE: Força o botão clonado de baixo a aparecer na mesma linha do copiar */
    .news-actions {
        display: flex !important;
        justify-content: space-between !important; /* Espalha copiar pra esquerda e seguir pra direita */
        align-items: center !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 12px !important;
        padding-right: 4px !important;
    }

    .news-actions .btn-seguir-fonte {
        display: inline-flex !important; /* Faz o botão de baixo brotar no celular */
        padding: 4px 12px !important;
        font-size: 11px !important;
        border-radius: 999px !important;
        height: auto !important;
    }

    /* Barra de busca superior responsiva */
    #busca-flutuante {
        left: 0 !important; top: 0 !important;
        width: 100vw !important; max-width: 100vw !important;
        border-radius: 0 !important; border: none !important;
        border-bottom: 1px solid #e1dbd1 !important;
        padding: 12px 16px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
        box-sizing: border-box !important;
    }
}

