/* ========================================
   INFORMACOES.CSS - Estilos para página de publicações
   ======================================== */

/* -------------------- GRID DE PUBLICACOES -------------------- */
.publicacoes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.publicacao-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 1px solid #e5e7eb;
}

.publicacao-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* -------------------- IMAGEM DA PUBLICACAO -------------------- */
.publicacao-imagem {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f3f4f6;
}

.publicacao-imagem-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #059669, #047857);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 42px;
    font-weight: 300;
}

/* -------------------- CONTEUDO DA PUBLICACAO -------------------- */
.publicacao-conteudo {
    padding: 20px;
}

.publicacao-categoria {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Categorias */
.categoria-noticia {
    background: #dbeafe;
    color: #1e40af;
}

.categoria-dica {
    background: #d1fae5;
    color: #047857;
}

.categoria-alerta {
    background: #fee2e2;
    color: #dc2626;
}

.categoria-evento {
    background: #fef3c7;
    color: #d97706;
}

.categoria-campanha {
    background: #e0e7ff;
    color: #4338ca;
}

.categoria-informacao {
    background: #f3e8ff;
    color: #6d28d9;
}

.publicacao-titulo {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.publicacao-resumo {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.publicacao-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f3f4f6;
    font-size: 13px;
    color: #9ca3af;
}

.publicacao-ler-mais {
    color: #059669;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.publicacao-ler-mais:hover {
    text-decoration: underline;
}

/* -------------------- ESTADO VAZIO -------------------- */
.empty-publicacoes {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    grid-column: 1 / -1;
}

.empty-publicacoes .icon {
    font-size: 56px;
    display: block;
    margin-bottom: 16px;
}

.empty-publicacoes h3 {
    color: #1f2937;
    margin-bottom: 8px;
    font-size: 22px;
}

.empty-publicacoes p {
    color: #6b7280;
    font-size: 15px;
}

/* -------------------- LOADER -------------------- */
.loader-publicacoes {
    text-align: center;
    padding: 40px;
    grid-column: 1 / -1;
}

.loader-publicacoes .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #059669;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* -------------------- FILTRO -------------------- */
.filtro-publicacoes {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 20px 0 10px;
    align-items: center;
}

.filtro-publicacoes label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.filtro-publicacoes select {
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 200px;
    transition: all 0.3s;
}

.filtro-publicacoes select:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* ========================================
   MODAL DE DETALHES
   ======================================== */

.modal-publicacao {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    overflow-y: auto;
    padding: 20px;
}

.modal-publicacao.active {
    display: flex !important;
    align-items: flex-start;
    justify-content: center;
}

.modal-publicacao-content {
    background: white;
    max-width: 800px;
    width: 100%;
    border-radius: 16px;
    margin: 40px auto;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUpModal 0.3s ease;
    position: relative;
}

@keyframes slideUpModal {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-publicacao-imagem {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

.modal-publicacao-body {
    padding: 30px;
    background: white;
}

.modal-publicacao-body .categoria {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.modal-publicacao-body h2 {
    font-size: 28px;
    color: #1f2937;
    margin-bottom: 16px;
    line-height: 1.3;
}

.modal-publicacao-body .meta {
    display: flex;
    gap: 20px;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.modal-publicacao-body .conteudo-completo {
    color: #374151;
    font-size: 16px;
    line-height: 1.8;
}

.modal-publicacao-body .conteudo-completo img {
    max-width: 100%;
    border-radius: 8px;
    margin: 16px 0;
}

.modal-publicacao-body .conteudo-completo p {
    margin-bottom: 16px;
}

.modal-publicacao-body .conteudo-completo ul,
.modal-publicacao-body .conteudo-completo ol {
    margin: 16px 0;
    padding-left: 24px;
}

.modal-publicacao-body .conteudo-completo li {
    margin-bottom: 8px;
}

.modal-fechar {
    position: sticky;
    top: 16px;
    float: right;
    background: white;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #1f2937;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: 0.2s;
    z-index: 10;
    margin: 0 16px 0 0;
}

.modal-fechar:hover {
    background: #f3f4f6;
    transform: scale(1.1);
}

/* ========================================
   BOTOES DE COMPARTILHAR NO MODAL
   ======================================== */

.modal-acoes-compartilhar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.btn-compartilhar {
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    color: white;
}

.btn-compartilhar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-compartilhar:active {
    transform: translateY(0);
}

.btn-compartilhar.btn-copiar {
    background: #6b7280;
}

.btn-compartilhar.btn-copiar:hover {
    background: #4b5563;
}

.btn-compartilhar.btn-whatsapp {
    background: #25D366;
}

.btn-compartilhar.btn-whatsapp:hover {
    background: #1da851;
}

.btn-compartilhar.btn-facebook {
    background: #1877F2;
}

.btn-compartilhar.btn-facebook:hover {
    background: #0d65d9;
}

.btn-compartilhar.btn-twitter {
    background: #000000;
}

.btn-compartilhar.btn-twitter:hover {
    background: #1a1a1a;
}

.btn-compartilhar.btn-email {
    background: #ea4335;
}

.btn-compartilhar.btn-email:hover {
    background: #d33426;
}

/* ========================================
   RESPONSIVIDADE
   ======================================== */

@media (max-width: 768px) {
    .publicacoes-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .filtro-publicacoes {
        flex-direction: column;
        align-items: stretch;
    }

    .filtro-publicacoes select {
        min-width: 100%;
    }

    .modal-publicacao-content {
        margin: 20px auto;
        border-radius: 12px;
    }

    .modal-publicacao-body {
        padding: 20px;
    }

    .modal-publicacao-body h2 {
        font-size: 22px;
    }

    .modal-publicacao-body .meta {
        font-size: 13px;
        gap: 12px;
    }

    .modal-fechar {
        width: 36px;
        height: 36px;
        font-size: 22px;
        top: 12px;
        margin: 0 12px 0 0;
    }

    .modal-acoes-compartilhar {
        gap: 8px;
    }

    .btn-compartilhar {
        padding: 8px 14px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .publicacao-imagem {
        height: 150px;
    }

    .publicacao-imagem-placeholder {
        height: 150px;
        font-size: 32px;
    }

    .publicacao-conteudo {
        padding: 16px;
    }

    .publicacao-titulo {
        font-size: 16px;
    }

    .publicacao-resumo {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }

    .modal-publicacao-body {
        padding: 16px;
    }

    .modal-publicacao-body h2 {
        font-size: 18px;
    }

    .modal-publicacao-body .meta {
        font-size: 12px;
        gap: 10px;
        flex-direction: column;
    }

    .modal-publicacao-imagem {
        max-height: 200px;
    }

    .modal-fechar {
        width: 32px;
        height: 32px;
        font-size: 18px;
        top: 10px;
        margin: 0 10px 0 0;
    }

    .modal-acoes-compartilhar {
        flex-direction: column;
        gap: 8px;
    }

    .btn-compartilhar {
        width: 100%;
        text-align: center;
        padding: 10px;
        font-size: 14px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .publicacoes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
