/* [cfp_ciencia] — abertura, pesquisas (filtro + paginação + janela), cartões de laboratórios e de dados (com janela: foto, descrição e link). */
.cfpc { --c-titulo: #2a4b7c; --c-cartao: #fff; --c-borda: rgba(14, 42, 63, 0.09); --c-sombra: 0 1px 2px rgba(14, 42, 63, 0.05), 0 8px 24px rgba(14, 42, 63, 0.07);
    --c-agua: var(--cfp-agua, #0d8f84); --c-coral: var(--cfp-coral, #e0705f); --c-suave: var(--cfp-suave, #5f6b75); --c-chip: rgba(13, 143, 132, 0.08);
    --c-bio: #2f9e6e; --c-env: #d9822b; --c-geo: #8a5a3c; --c-tec: #3b6fd8;
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif; color: var(--cfp-tinta, #16222c); }
html.ceclimar-dark-mode .cfpc { --c-titulo: #8fb4e8; --c-cartao: #1b232c; --c-borda: rgba(255, 255, 255, 0.08); --c-sombra: 0 8px 24px rgba(0, 0, 0, 0.3); --c-agua: #3cc7b8; --c-chip: rgba(60, 199, 184, 0.12);
    --c-bio: #5fd19d; --c-env: #f0a85a; --c-geo: #c9967a; --c-tec: #7ea3f2; }
.cfpc *, .cfpc *::before, .cfpc *::after { box-sizing: border-box; }
.cfpc.cfpc h2, .cfpc.cfpc h3, .cfpc.cfpc p, .cfpc.cfpc ul { margin: 0; padding: 0; }
.cfpc.cfpc ul { list-style: none; }
.cfpc.cfpc ul > li { margin: 0; padding: 0; list-style: none; }
.cfpc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* abertura */
.cfpc-abertura { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 32px 44px; align-items: center; margin-bottom: 30px; }
.cfpc.cfpc .cfpc-foto { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 18px; box-shadow: 0 10px 30px rgba(14, 42, 63, 0.16); }
.cfpc-abertura p { font-size: 1rem; line-height: 1.8; }
.cfpc-abertura:not(:has(img)) { grid-template-columns: 1fr; }

.cfpc-indice { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 44px; }
.cfpc.cfpc .cfpc-indice a { padding: 8px 16px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--c-borda); font: 500 0.88rem/1.2 'Inter', sans-serif; color: var(--c-titulo) !important; text-decoration: none !important; transition: background 0.2s ease, color 0.2s ease; }
.cfpc.cfpc .cfpc-indice a:hover { background: var(--c-titulo); color: #fff !important; }
html.ceclimar-dark-mode .cfpc.cfpc .cfpc-indice a:hover { color: #0f1a26 !important; }

.cfpc-secao { margin-bottom: 64px; scroll-margin-top: 110px; }
.cfpc.cfpc .cfpc-h2 { margin-bottom: 20px; font: 700 clamp(1.3rem, 2.2vw, 1.6rem)/1.25 'Inter', sans-serif; color: var(--c-titulo); text-transform: none; letter-spacing: -0.01em; }

/* filtros por área */
.cfpc-filtros { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.cfpc .cfpc-filtros button { min-height: 38px; height: auto !important; margin: 0 !important; padding: 7px 15px !important; border: 0 !important; border-radius: 999px !important; background: var(--c-chip) !important; color: var(--cfp-tinta, #16222c) !important;
    font: 500 0.88rem/1.25 'Inter', sans-serif !important; text-transform: none !important; letter-spacing: 0 !important; cursor: pointer; transition: background 0.2s ease, color 0.2s ease; }
.cfpc .cfpc-filtros button:hover { background: rgba(13, 143, 132, 0.16) !important; }
.cfpc .cfpc-filtros button.is-ativo { background: var(--c-agua) !important; color: #fff !important; }
html.ceclimar-dark-mode .cfpc .cfpc-filtros button.is-ativo { color: #0f1a26 !important; }

/* pesquisas */
.cfpc.cfpc .cfpc-pesquisas { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 20px; }
.cfpc-p-item[hidden] { display: none !important; }
.cfpc .cfpc-pesquisa { --cor: var(--c-bio); position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 20px !important; overflow: hidden;
    background: var(--c-cartao) !important; color: inherit !important; box-shadow: var(--c-sombra), inset 0 0 0 1px var(--c-borda); text-align: left; font: inherit !important; text-transform: none !important; letter-spacing: 0 !important; cursor: pointer; transition: transform 0.25s ease, box-shadow 0.25s ease; white-space: normal !important; overflow-wrap: anywhere; }
.cfpc .cfpc-a-env { --cor: var(--c-env); } .cfpc .cfpc-a-geo { --cor: var(--c-geo); } .cfpc .cfpc-a-tec { --cor: var(--c-tec); }
.cfpc .cfpc-pesquisa::before { content: ''; position: absolute; left: 0; right: 0; top: 0; z-index: 1; height: 4px; background: var(--cor); }
.cfpc .cfpc-pesquisa:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(14, 42, 63, 0.06), 0 18px 40px rgba(14, 42, 63, 0.13); }
.cfpc .cfpc-pesquisa:focus-visible { outline: 3px solid var(--c-agua) !important; outline-offset: 3px; }
.cfpc-p-capa { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: rgba(128, 128, 128, 0.12); }
.cfpc-p-capa img { display: block; width: 100%; height: 100%; margin: 0 !important; object-fit: cover; border-radius: 0 !important; transition: transform 0.6s ease; }
.cfpc-pesquisa:hover .cfpc-p-capa img { transform: scale(1.05); }
.cfpc-p-corpo { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 16px 20px 18px; }
.cfpc-p-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 700 0.7rem/1.3 'Inter', sans-serif; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cor); }
.cfpc-p-meta b { flex: none; padding: 3px 9px; border-radius: 999px; background: rgba(128, 128, 128, 0.12); color: var(--c-suave); font-weight: 700; letter-spacing: 0.02em; }
.cfpc-p-titulo { font: 700 1.05rem/1.35 'Inter', sans-serif; color: var(--c-titulo); }
.cfpc-p-resumo { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.9rem; line-height: 1.55; color: var(--c-suave); }
.cfpc-p-rodape { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--c-borda); }
.cfpc-p-autores { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; font-style: italic; color: var(--c-suave); }
.cfpc-p-mais { flex: none; font: 700 0.88rem 'Inter', sans-serif; color: var(--c-coral); }

/* paginação */
.cfpc-paginas { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 28px; }
.cfpc-paginas[hidden] { display: none; }
.cfpc .cfpc-paginas button { display: grid; place-items: center; min-width: 44px; height: 44px !important; margin: 0 !important; padding: 0 12px !important; border: 0 !important; border-radius: 999px !important;
    background: var(--c-cartao) !important; color: var(--cfp-tinta, #16222c) !important; box-shadow: inset 0 0 0 1.5px var(--c-borda); font: 600 0.95rem 'Inter', sans-serif !important; cursor: pointer; transition: background 0.2s ease, color 0.2s ease; }
.cfpc .cfpc-paginas button:hover:not(:disabled) { background: var(--c-chip) !important; }
.cfpc .cfpc-paginas button.is-atual { background: var(--c-titulo) !important; color: #fff !important; box-shadow: none; }
html.ceclimar-dark-mode .cfpc .cfpc-paginas button.is-atual { color: #0f1a26 !important; }
.cfpc .cfpc-paginas button:disabled { opacity: 0.35; cursor: default; }
.cfpc .cfpc-paginas button:focus-visible { outline: 2px solid var(--c-agua) !important; outline-offset: 2px; }

/* janela da pesquisa */
.cfpc-janela { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 32px); margin: auto; padding: 0; border: 0; border-radius: 24px; overflow: auto; background: var(--c-cartao); color: var(--cfp-tinta, #16222c); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); }
.cfpc-janela::backdrop { background: rgba(6, 14, 22, 0.6); backdrop-filter: blur(5px); }
.cfpc-janela[open] { animation: cfpc-entra 0.25s ease; }
@keyframes cfpc-entra { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
.cfpc .cfpc-fecha { position: absolute; top: 14px; right: 14px; z-index: 2; display: grid; place-items: center; width: 42px; height: 42px; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: rgba(0, 0, 0, 0.45) !important; color: #fff !important; font: 400 1.6rem/1 'Inter', sans-serif !important; cursor: pointer; }
.cfpc-j-capa { aspect-ratio: 16 / 7; background: linear-gradient(135deg, #0d8f84, #2a4b7c); }
.cfpc-j-capa img { display: block; width: 100%; height: 100%; margin: 0 !important; object-fit: cover; border-radius: 0 !important; }
.cfpc-j-capa:has(img:not([src])) { display: none; }   /* sem foto: a janela começa no título */
.cfpc-j-capa:has(img:not([src])) + .cfpc-j-corpo { padding-top: 30px; padding-right: 76px; }
.cfpc-janela:has(.cfpc-j-capa img:not([src])) .cfpc-fecha { background: rgba(128, 128, 128, 0.16) !important; color: inherit !important; }
.cfpc-j-corpo { padding: 24px 28px 28px; }
.cfpc-j-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 10px !important; font: 700 0.74rem 'Inter', sans-serif; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-agua); }
.cfpc-j-ano:not(:empty) { padding: 3px 9px; border-radius: 999px; background: rgba(128, 128, 128, 0.12); color: var(--c-suave); }
.cfpc.cfpc .cfpc-janela h3 { margin-bottom: 8px; font: 700 1.4rem/1.3 'Inter', sans-serif; color: var(--c-titulo); }
.cfpc-j-autores { margin-bottom: 16px !important; font-size: 0.9rem; font-style: italic; color: var(--c-suave); }
.cfpc-j-autores:empty { display: none; }
.cfpc-j-resumo { font-size: 1rem; line-height: 1.75; white-space: pre-line; }
.cfpc-j-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px !important; }
.cfpc.cfpc .cfpc-j-links a { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px; font: 600 0.95rem 'Inter', sans-serif; text-decoration: none !important; transition: filter 0.2s ease, transform 0.2s ease; }
.cfpc.cfpc .cfpc-j-links a:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cfpc.cfpc .cfpc-j-link { background: var(--c-coral); color: #fff !important; }
.cfpc.cfpc .cfpc-j-pdf { background: rgba(128, 128, 128, 0.12); color: inherit !important; }
.cfpc-j-links a[hidden] { display: none !important; }

/* cartões de laboratórios e dados (abrem a janela) */
.cfpc.cfpc .cfpc-cartoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.cfpc .cfpc-cartao { display: flex; flex-direction: column; align-items: stretch; gap: 0; width: 100%; height: 100%; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 18px !important; overflow: hidden;
    background: var(--c-cartao) !important; color: inherit !important; box-shadow: var(--c-sombra), inset 0 0 0 1px var(--c-borda); text-align: left; font: inherit !important; text-transform: none !important; letter-spacing: 0 !important; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; white-space: normal !important; overflow-wrap: anywhere; }
.cfpc .cfpc-cartao:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(14, 42, 63, 0.06), 0 14px 32px rgba(14, 42, 63, 0.12), inset 0 0 0 1px var(--c-borda); }
.cfpc .cfpc-cartao:focus-visible { outline: 3px solid var(--c-agua) !important; outline-offset: 3px; }
.cfpc-cartao-foto { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: rgba(128, 128, 128, 0.12); }
.cfpc-cartao-foto img { display: block; width: 100%; height: 100%; margin: 0 !important; object-fit: cover; border-radius: 0 !important; transition: transform 0.5s ease; }
.cfpc-cartao:hover .cfpc-cartao-foto img { transform: scale(1.05); }
.cfpc-icone { display: grid; place-items: center; flex: none; width: 52px; height: 52px; margin: 20px 20px 0; border-radius: 15px; background: var(--c-chip); color: var(--c-agua); }
.cfpc-dados .cfpc-icone { background: rgba(42, 75, 124, 0.09); color: var(--c-titulo); }
.cfpc-icone svg { width: 28px; height: 28px; }
.cfpc-cartao-txt { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; padding: 14px 20px 18px; }
.cfpc-cartao-nome { font: 700 1rem/1.35 'Inter', sans-serif; color: var(--c-titulo); }
.cfpc-cartao-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.88rem; line-height: 1.5; color: var(--c-suave); }
.cfpc-cartao-mais { margin-top: auto; padding-top: 4px; font: 700 0.88rem 'Inter', sans-serif; color: var(--c-coral); }
.cfpc-j-resumo[hidden] { display: none; }

@media (max-width: 760px) {
    .cfpc-abertura { grid-template-columns: 1fr; }
    .cfpc-indice, .cfpc-filtros { flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
    .cfpc-indice::-webkit-scrollbar, .cfpc-filtros::-webkit-scrollbar { display: none; }
    .cfpc.cfpc .cfpc-indice a, .cfpc .cfpc-filtros button { flex: none; white-space: nowrap; }
    .cfpc-j-corpo { padding: 20px 20px 22px; }
}
@media (prefers-reduced-motion: reduce) { .cfpc *, .cfpc-janela { transition: none !important; animation: none !important; } }
