/**
 * NinjaFSA Redação Automática - Folha de Estilo Editorial dos Artigos
 * Template base exclusivo para o portal NINJAFSA.
 * Compatível com Gutenberg, Elementor e dispositivos móveis.
 */

:root {
    --nfra-cor-texto: #333333;
    --nfra-cor-texto-secundario: #555555;
    --nfra-cor-meta: #777777;
    --nfra-cor-link: #c4170c;
    --nfra-cor-fundo: #ffffff;
    --nfra-cor-borda: #e5e5e5;
    --nfra-fonte-titulo: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --nfra-fonte-texto: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Container do Artigo */
.ninjafsa-article,
.article-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px 16px 36px 16px;
    font-family: var(--nfra-fonte-texto);
    background: var(--nfra-cor-fundo);
    color: var(--nfra-cor-texto);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

.ninjafsa-article *,
.article-container * {
    box-sizing: inherit;
}

/* ==========================================
   TÍTULOS E META INFO
   ========================================== */
.article-container .news-title,
.ninjafsa-article .news-title {
    font-family: var(--nfra-fonte-titulo);
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 15px;
    color: #000000;
    letter-spacing: -0.5px;
}

.article-container .news-subtitle,
.ninjafsa-article .news-subtitle {
    font-family: var(--nfra-fonte-texto);
    font-size: 1.25rem;
    color: var(--nfra-cor-texto-secundario);
    margin-bottom: 20px;
    font-weight: 400;
    line-height: 1.4;
}

.article-container .meta-info,
.ninjafsa-article .meta-info {
    font-size: 0.9rem;
    color: var(--nfra-cor-meta);
    margin-bottom: 20px;
    font-family: var(--nfra-fonte-texto);
    line-height: 1.5;
}

.article-container .meta-info strong,
.ninjafsa-article .meta-info strong {
    color: var(--nfra-cor-link);
    font-weight: 600;
}

/* ==========================================
   BOTÕES SOCIAIS COM TOOLTIP
   ========================================== */
.article-container .social-bar,
.ninjafsa-article .social-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 24px;
    position: relative;
}

.article-container .social-btn,
.ninjafsa-article .social-btn {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5;
    border: none;
    border-radius: 8px;
    height: 44px;
    cursor: pointer;
    text-decoration: none !important;
    transition: background-color 0.2s, transform 0.1s;
    position: relative;
}

.article-container .social-btn:hover,
.ninjafsa-article .social-btn:hover {
    background-color: #e0e0e0;
    transform: translateY(-1px);
}

.article-container .social-btn svg,
.ninjafsa-article .social-btn svg {
    width: 20px;
    height: 20px;
}

.article-container .social-btn.fb svg,
.ninjafsa-article .social-btn.fb svg { fill: #1877F2; }

.article-container .social-btn.wa svg,
.ninjafsa-article .social-btn.wa svg { fill: #25D366; }

.article-container .social-btn.sh svg,
.ninjafsa-article .social-btn.sh svg { fill: #555555; }

.nfra-copy-tooltip {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: #111111;
    color: #ffffff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.nfra-copy-tooltip.show {
    opacity: 1;
}

/* ==========================================
   CARDS DE QUALIDADE EDITORIAL (CONFORME IMAGEM 1)
   ========================================== */
.nfra-quality-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 26px;
}

.nfra-quality-card {
    background: #ffffff;
    border: 1px solid #eef0f3;
    border-radius: 12px;
    padding: 18px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nfra-quality-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.nfra-quality-card .nfra-q-icon-val {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #e11d48;
    font-family: var(--nfra-fonte-titulo);
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 8px;
}

.nfra-quality-card .nfra-q-icon-val svg {
    width: 24px;
    height: 24px;
    fill: #e11d48;
    flex-shrink: 0;
}

.nfra-quality-card .nfra-q-label {
    font-family: var(--nfra-fonte-texto);
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    line-height: 1.25;
}

@media (max-width: 540px) {
    .nfra-quality-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .nfra-quality-card {
        flex-direction: row;
        justify-content: space-between;
        padding: 12px 18px;
    }
    .nfra-quality-card .nfra-q-icon-val {
        margin-bottom: 0;
    }
}

/* ==========================================
   BOX "LEIA TAMBÉM" (CONFORME IMAGEM 2)
   ========================================== */
.nfra-leia-tambem-box {
    margin: 24px 0;
    padding: 12px 18px 14px 18px;
    background: #fafafa;
    border-left: 4px solid #c4170c;
    border-radius: 0 6px 6px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
}

.nfra-leia-tambem-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--nfra-fonte-titulo);
    font-size: 0.85rem;
    font-weight: 800;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    line-height: 1;
}

.nfra-leia-tambem-header svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #111827;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nfra-leia-tambem-link {
    font-family: var(--nfra-fonte-titulo);
    font-size: 1.05rem;
    font-weight: 600;
    color: #c4170c !important;
    text-decoration: underline !important;
    line-height: 1.4;
    transition: opacity 0.2s ease;
    display: inline-block;
}

.nfra-leia-tambem-link:hover {
    opacity: 0.85;
}

/* ==========================================
   ABA DE RESUMO
   ========================================== */
.article-container .resumo-box,
.ninjafsa-article .resumo-box {
    border: 1px solid var(--nfra-cor-borda);
    border-radius: 8px;
    margin-bottom: 25px;
    overflow: hidden;
}

.article-container .resumo-box summary,
.ninjafsa-article .resumo-box summary {
    padding: 14px 20px;
    font-family: var(--nfra-fonte-titulo);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    user-select: none;
}

.article-container .resumo-box summary::-webkit-details-marker,
.ninjafsa-article .resumo-box summary::-webkit-details-marker {
    display: none;
}

.article-container .resumo-box summary::after,
.ninjafsa-article .resumo-box summary::after {
    content: "▼";
    font-size: 0.8rem;
    color: #777;
    transition: transform 0.2s ease;
}

.article-container .resumo-box[open] summary::after,
.ninjafsa-article .resumo-box[open] summary::after {
    transform: rotate(180deg);
}

.article-container .resumo-content,
.ninjafsa-article .resumo-content {
    padding: 15px 20px 20px 40px;
    background-color: #fafafa;
    border-top: 1px solid var(--nfra-cor-borda);
    margin: 0;
}

.article-container .resumo-content li,
.ninjafsa-article .resumo-content li {
    margin-bottom: 10px;
    font-size: 1.05rem;
    color: #444;
    padding-left: 5px;
}

.article-container .resumo-content li:last-child,
.ninjafsa-article .resumo-content li:last-child {
    margin-bottom: 0;
}

/* ==========================================
   IMAGEM E CONTEÚDO
   ========================================== */
.article-container .news-image-container,
.ninjafsa-article .news-image-container {
    margin-bottom: 25px;
}

.article-container .news-image,
.ninjafsa-article .news-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.article-container .image-caption,
.ninjafsa-article .image-caption {
    font-size: 0.85rem;
    color: var(--nfra-cor-meta);
    margin-top: 8px;
    line-height: 1.3;
}

.article-container .news-content,
.ninjafsa-article .news-content {
    font-size: 1.15rem;
    color: #222222;
    line-height: 1.8;
}

.article-container .news-content p,
.ninjafsa-article .news-content p {
    margin-bottom: 24px;
}

.article-container .news-content h2,
.ninjafsa-article .news-content h2 {
    font-family: var(--nfra-fonte-titulo);
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 35px;
    margin-bottom: 15px;
    color: #000;
}

.article-container .news-content p:first-of-type::first-letter,
.ninjafsa-article .news-content p:first-of-type::first-letter {
    font-weight: bold;
    font-size: 1.15em;
}

/* ==========================================
   COMPONENTES VISUAIS EM MODO CANVAS / RANKING
   ========================================== */
.nfra-visual-component {
    margin: 32px 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.nfra-visual-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.nfra-visual-tag {
    background: #fee2e2;
    color: #b91c1c;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
}

.nfra-visual-title {
    font-family: var(--nfra-fonte-titulo);
    font-size: 1.15rem;
    font-weight: 800;
    color: #111827;
}

/* Gráfico de Barras em Canvas */
.nfra-canvas-wrapper {
    position: relative;
    width: 100%;
    margin: 10px 0;
}

.nfra-canvas-wrapper canvas {
    width: 100% !important;
    height: auto !important;
    display: block;
}

/* Card de Ranking Personalizado */
.nfra-ranking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nfra-ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #c4170c;
}

.nfra-ranking-position {
    width: 28px;
    height: 28px;
    background: #c4170c;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    flex-shrink: 0;
}

.nfra-ranking-info {
    flex: 1;
}

.nfra-ranking-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
}

.nfra-ranking-val {
    font-size: 0.85rem;
    color: #6b7280;
}

/* Box Didático de Impacto Prático */
.nfra-impact-box {
    margin: 28px 0;
    padding: 18px 20px;
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    border-radius: 6px;
}

.nfra-impact-title {
    font-family: var(--nfra-fonte-titulo);
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1d4ed8;
    margin-bottom: 6px;
}

.nfra-impact-desc {
    font-size: 1.05rem;
    line-height: 1.5;
    color: #1e3a8a;
    margin: 0;
}

/* ==========================================
   PUBLICIDADE
   ========================================== */
.article-container .pub-container,
.ninjafsa-article .pub-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 35px 0;
    padding: 20px 0;
}

.article-container .pub-label,
.ninjafsa-article .pub-label {
    font-size: 0.65rem;
    color: var(--nfra-cor-meta);
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 1px;
    font-family: var(--nfra-fonte-texto);
}

.article-container .pub-banner,
.ninjafsa-article .pub-banner {
    display: inline-block;
    max-width: 100%;
}

.article-container .pub-banner img,
.ninjafsa-article .pub-banner img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* ==========================================
   RECOMENDAÇÕES LEIA MAIS (4 POSTS REAIS NINJAFSA)
   Design editorial sofisticado (não como anexo 2)
   ========================================== */
.nfra-recommendations-block {
    margin: 35px 0;
    padding: 22px;
    background: #fcfcfc;
    border: 1px solid #eef0f2;
    border-radius: 10px;
}

.nfra-rec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #c4170c;
}

.nfra-rec-title {
    font-family: var(--nfra-fonte-titulo);
    font-size: 1.05rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #111111;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nfra-rec-title svg {
    width: 18px;
    height: 18px;
    fill: #c4170c;
}

.nfra-rec-badge {
    font-size: 0.75rem;
    color: #666;
    font-weight: 600;
}

.nfra-rec-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.nfra-rec-item {
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    text-decoration: none !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.nfra-rec-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-color: #fca5a5;
}

.nfra-rec-cat {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #c4170c;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.nfra-rec-item-title {
    font-family: var(--nfra-fonte-titulo);
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.35;
    margin: 0;
    flex: 1;
}

.nfra-rec-item:hover .nfra-rec-item-title {
    color: #c4170c;
}

.nfra-rec-meta {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 8px;
}

@media (max-width: 600px) {
    .nfra-rec-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

