/*
Theme Name: NUPEP Tema
Author: Yann Dezedias
Description: Tema personalizado para o Núcleo de Pesquisa
Version: 7.8.2.36
*/

/* =========================================================
   CHANGELOG — ver arquivo CHANGELOG.md no root do tema
   7.8.1: DB Builder completo (28 builds de dev consolidadas)
   7.8.2: Livros Organizados — hierarquia de produções (pai/capítulos),
          modal de capítulos, DOI/PDF/autores por capítulo, busca ok
   =========================================================
*/

/* =========================================================
   VIEW TRANSITIONS API — versão 2 (single morph, gated by sessionStorage)
   - Só morpha quando navega ENTRE hero da home e a notícia destaque
   - Título faz parte do conteúdo do squircle (não morpha separado)
   - Cross-fade escalonado: texto antigo some rápido, novo aparece tarde
   ========================================================= */
@view-transition {
    navigation: auto;
}

/* Cross-fade geral da página inteira — rápido */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.3s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== MORPH DO SQUIRCLE (único morph, título vai junto dentro) ===== */
::view-transition-group(hero-squircle) {
    animation-duration: 0.55s;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); /* ease-out-expo */
}

/* Conteúdo ANTIGO (squircle da home OU título da single): some RÁPIDO */
::view-transition-old(hero-squircle) {
    animation-duration: 0.15s;
    animation-timing-function: ease-out;
    overflow: clip;
}

/* Conteúdo NOVO: só aparece no FINAL do morph (quando a caixa já chegou) */
::view-transition-new(hero-squircle) {
    animation-duration: 0.2s;
    animation-delay: 0.35s;  /* aparece após 0.35s, quando a caixa está 80% no lugar */
    animation-timing-function: ease-in;
    overflow: clip;
}

/* ===== MORPH TARGET NA SINGLE =====
   Só seta o nome se a classe vt-morph estiver no <html>.
   A classe é adicionada pelo script inline no <head>, ANTES do snapshot.
   Se não veio do hero (sem classe), o nome não é setado → sem morph. */
html.vt-morph .single-title-wrapper {
    view-transition-name: hero-squircle;
}

/* Respeita prefers-reduced-motion (acessibilidade) */
@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root),
    ::view-transition-old(hero-squircle),
    ::view-transition-new(hero-squircle),
    ::view-transition-group(hero-squircle) {
        animation: none !important;
    }
}

/* --- 1. RESET E BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background-color: #3e1e09; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #3e1e09; /* envelope universal — pinta o safe-area-inset-top no iOS/Android */
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
}

/* IMPORTANTE: NUNCA pintar o <body> com creme/claro, porque ele se estende
   até o topo da tela no iOS (viewport-fit=cover) e mostraria o creme na
   faixa do notch. As páginas de notícia usam .news-feed-section, .search-section
   e .archive-header com backgrounds próprios para criar a área creme, SEM
   tocar no body. */

/* --- 2. TIPOGRAFIA GERAL E TEXTOS --- */
.user-content-style { font-size: 18px; line-height: 1.8; color: #333; }
.user-content-style p { margin-bottom: 25px; text-align: justify; }
.user-content-style h2 { color: #5a2800; font-size: 28px; margin-top: 40px; margin-bottom: 20px; text-transform: uppercase; border-left: 5px solid #d35400; padding-left: 15px; }
.user-content-style h3 { color: #8B4513; font-size: 22px; margin-top: 30px; margin-bottom: 15px; font-weight: bold; }
.user-content-style ul { margin-bottom: 25px; padding-left: 40px; }
.user-content-style ul li { margin-bottom: 10px; list-style-type: disc; }
.user-content-style blockquote { background: #f9f9f9; border-left: 5px solid #5a2800; margin: 30px 0; padding: 20px; font-style: italic; color: #555; }

@media (max-width: 768px) {
    .entry-content, .user-content-style, .user-content-style p { font-size: 16px !important; line-height: 1.6 !important; }
    .user-content-style h2 { font-size: 22px !important; margin-top: 30px !important; margin-bottom: 15px !important; }
    .user-content-style h3 { font-size: 18px !important; margin-top: 25px !important; }
}

/* --- 3. CABEÇALHO E LOGO --- */
header { display: flex; align-items: center; justify-content: space-between; padding: 30px 50px; position: absolute; width: 100%; z-index: 100; color: white; }
.header-logo-img { height: 60px; width: auto; display: block; filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0,0,0,0.9)); }
.footer-logo-img { height: 40px; width: auto; max-width: 200px; display: block; filter: brightness(0) invert(1); }

/* --- 4. NAVEGAÇÃO DESKTOP --- */
@keyframes dynamicIslandPop {
    0% { transform: translateX(-50%) scale(0); opacity: 0; }
    60% { transform: translateX(-50%) scale(1.1); }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

.desktop-pilula { position: absolute; top: 30px; left: 50%; transform: translateX(-50%); z-index: 100; animation: dynamicIslandPop 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) both; }
.desktop-links { list-style: none; display: flex; gap: 5px; margin: 0; padding: 8px 10px; background: rgba(60, 30, 0, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 15px 35px rgba(0,0,0,0.3); border-radius: 100px; white-space: nowrap; }
.desktop-links a { color: rgba(255, 255, 255, 0.9); text-decoration: none; font-weight: 700; font-size: 13px; text-transform: uppercase; padding: 8px 18px; border-radius: 50px; transition: all 0.3s ease; display: block; }
.desktop-links a:hover { background-color: rgba(255, 255, 255, 0.2); color: #fff; transform: scale(1.05); }

/* Dropdown Desktop */
.menu-item-has-children > a::after { content: ' ▾'; font-size: 10px; margin-left: 5px; position: relative; top: -1px; transition: transform 0.3s; display: inline-block; }

@media (min-width: 951px) {
    .desktop-links li { position: relative !important; }
    .desktop-links .sub-menu { position: absolute !important; top: calc(100% + 15px) !important; left: 0 !important; min-width: 220px !important; background: rgba(60, 30, 0, 0.95) !important; backdrop-filter: blur(15px) !important; -webkit-backdrop-filter: blur(15px) !important; border: 1px solid rgba(255, 255, 255, 0.2) !important; box-shadow: 0 15px 40px rgba(0,0,0,0.4) !important; border-radius: 15px !important; display: flex !important; flex-direction: column !important; padding: 15px !important; margin-top: 0 !important; gap: 5px !important; opacity: 0 !important; visibility: hidden !important; transform: translateY(10px) !important; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important; pointer-events: none !important; list-style: none !important; }
    .desktop-links .sub-menu::before { content: ''; position: absolute; top: -20px; left: 0; width: 100%; height: 20px; background: transparent; }
    .desktop-links li:hover > .sub-menu { opacity: 1 !important; visibility: visible !important; transform: translateY(0) !important; pointer-events: auto !important; }
    .desktop-links .sub-menu a { text-align: left !important; font-size: 13px !important; padding: 10px 15px !important; border-radius: 8px !important; white-space: normal !important; line-height: 1.4 !important; display: block !important; }
    .desktop-links .sub-menu a:hover { background-color: rgba(255, 255, 255, 0.1) !important; transform: translateX(5px) !important; }
    .desktop-links .sub-menu .menu-item-has-children > a::after { content: ' ›' !important; }
}

/* --- 5. NAVEGAÇÃO MOBILE --- */
.mobile-menu-wrapper { display: none; }

@media (max-width: 950px) {
    .desktop-pilula { display: none; }
    .mobile-menu-wrapper { display: block; position: fixed; top: calc(25px + env(safe-area-inset-top)) !important; right: 20px !important; z-index: 10000; }

    /* BUG FIX v7.3.6: offset da admin bar do WordPress.
       O WP adiciona body.admin-bar quando a barra de admin está visível.
       A barra tem 32px de altura em telas > 782px e 46px em telas ≤ 782px.
       Sem este offset, o sanduíche ficava ATRÁS da barra no topo da página.
       Padrão oficial: https://developer.wordpress.org/reference/functions/wp_admin_bar_render/ */
    body.admin-bar .mobile-menu-wrapper {
        top: calc(25px + 32px + env(safe-area-inset-top)) !important;
    }
    .mobile-toggle { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; width: 70px; height: 50px; border-radius: 50px; background: rgba(60, 30, 0, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 4px 10px rgba(0,0,0,0.3); cursor: pointer; position: relative; z-index: 10002; transition: all 0.3s ease; }
    .mobile-toggle span { display: block; width: 28px; height: 3px; background-color: white; border-radius: 2px; transition: 0.3s; }
    .mobile-toggle:hover { background: rgba(80, 40, 0, 0.95); border-color: rgba(255, 255, 255, 0.4); }
    .mobile-menu-wrapper.menu-open .mobile-toggle { background: #d35400e6; transform: scale(1.05); }
    .mobile-menu-wrapper.menu-open .mobile-toggle span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
    .mobile-menu-wrapper.menu-open .mobile-toggle span:nth-child(2) { opacity: 0; }
    .mobile-menu-wrapper.menu-open .mobile-toggle span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }
    
    /* Dropdown container — padding generoso e largura maior (era 220px, agora 260px) para os itens respirarem */
    .mobile-dropdown { position: absolute; top: 60px; right: 0; width: 260px; background: rgba(60, 30, 0, 0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 30px; padding: 18px 20px; box-shadow: 0 15px 35px rgba(0,0,0,0.3); opacity: 0; visibility: hidden; transform: translateY(-10px) scale(0.95); transform-origin: top right; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); pointer-events: none; }
    .mobile-menu-wrapper.menu-open .mobile-dropdown { opacity: 1; visibility: visible; transform: translateY(0) scale(1); pointer-events: auto; }
    
    /* ITENS DO MENU — área tocável mínima de 44px (WCAG 2.5.5 Target Size para acessibilidade) */
    .mobile-links { list-style: none; padding: 0; margin: 0; }
    .mobile-links li { text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 6px; padding: 12px 6px 10px 6px; }
    .mobile-links li:last-child { border: none; margin-bottom: 18px; padding-bottom: 14px; }
    .mobile-links a { color: white; text-decoration: none; font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: center; min-height: 22px; text-transform: uppercase; line-height: 1.3; padding: 4px 0; transition: color 0.2s ease; }
    .mobile-links a:active { color: #ffd9a8; }
    
    /* Dropdown Mobile (submenu do "mais" expansivo) — padding maior e font-size 13px (era 12px) para legibilidade */
    .mobile-links .sub-menu { display: none; background: rgba(0, 0, 0, 0.22) !important; box-shadow: inset 0 3px 10px rgba(0,0,0,0.1) !important; padding: 8px 0 !important; margin: 8px 0 4px 0 !important; border-radius: 14px !important; list-style: none !important; }
    .mobile-links .sub-menu li { border-bottom: 1px solid rgba(255,255,255,0.05) !important; padding: 0 !important; margin: 0 !important; min-height: 0; }
    .mobile-links .sub-menu li:last-child { border: none !important; margin: 0 !important; padding: 0 !important; }
    .mobile-links .sub-menu li::before { display: none !important; }
    .mobile-links .sub-menu a { padding: 12px 25px 12px 15px !important; font-size: 13px !important; opacity: 0.92 !important; color: #ddd !important; text-transform: capitalize !important; margin-top: 0 !important; min-height: 20px; }
    .mobile-links .sub-menu a:active { color: #ffd9a8 !important; }
    .mobile-links .menu-item-has-children.open-submenu > .sub-menu { display: block !important; animation: fadeInDown 0.3s ease; }
    .mobile-links .menu-item-has-children.open-submenu > a::after { transform: rotate(180deg); }
    @keyframes fadeInDown { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
}

/* BUG FIX v7.3.6: admin bar no mobile (≤782px) tem 46px de altura
   em vez de 32px. Sobrescreve a regra de 32px acima.
   Padrão WordPress: a barra é 32px em >782px e 46px em ≤782px. */
@media screen and (max-width: 782px) {
    body.admin-bar .mobile-menu-wrapper {
        top: calc(25px + 46px + env(safe-area-inset-top)) !important;
    }
}

/* --- 6. PAGINAÇÃO E TAGS GERAIS --- */
.pagination { margin-top: 50px; display: flex; justify-content: center; gap: 10px; }
.pagination a, .pagination span { display: inline-block; padding: 10px 18px; background: white; border: 1px solid #ddd; color: #333; text-decoration: none; font-weight: bold; border-radius: 5px; transition: all 0.3s; }
.pagination a:hover { background-color: #f0f0f0; border-color: #ccc; }
.pagination .current { background-color: #5a2800; color: white; border-color: #5a2800; }
.tags-list { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-btn { padding: 8px 16px; border: 1px solid #a05000; color: #a05000; text-decoration: none; font-size: 12px; text-transform: uppercase; transition: all 0.3s; }
.tag-btn:hover { background-color: #a05000; color: white; }

/* --- 7. HOME: HERO E SLIDER (v6.5 — versão final consolidada) --- */

/* (Regras legadas do .hero simples mantidas para compatibilidade) */
.hero { height: 80vh; height: 80dvh; width: 100%; background-color: #1a1a1a; background-size: cover; background-position: center; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 80px; padding-left: 50px; color: white; }
.hero h1 { font-size: 36px; max-width: 900px; line-height: 1.2; margin-bottom: 15px; text-transform: uppercase; text-shadow: 2px 2px 10px rgba(0,0,0,0.8); }
.hero p { font-size: 18px; max-width: 800px; opacity: 0.95; text-shadow: 1px 1px 5px rgba(0,0,0,0.8); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }

/* =========================================================
   HERO SLIDER v6.5
   · Imagem full-bleed cobrindo o slide
   · Spotlight radial centrado atrás do squircle
   · Squircle branco vazando 50% pra baixo, flutuando ENTRE
     a seção do hero e a seção de notícias (sobre as duas)
   Paleta: cinza #1a1a1a  ·  marrom NUPEP #5a2800  ·  laranja #d35400
   ========================================================= */

.hero-slider-container {
    width: 100%;
    position: relative;
    background-color: #1a1a1a;
    height: 78vh;
    height: 78dvh;  /* ADICIONAR esta linha — fallback vh para navegadores antigos */
    min-height: 560px;
    max-height: 760px;
    z-index: 50 !important;
    isolation: isolate; /* contexto de empilhamento limpo */
}

.swiper.heroSwiper { width: 100%; height: 100%; overflow: visible !important; }

.swiper-slide.hero-slide {
    position: relative;
    height: 100%;
    background-color: #1a1a1a;
    box-sizing: border-box;
}

/* ---------- IMAGEM FULL-BLEED (cobre tudo, é um <a>) ---------- */
.hero-image-pane {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* contém a imagem, NÃO o squircle */
    background-color: #1a1a1a;
    z-index: 1;
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 6s ease;
}

.swiper-slide-active .hero-image { transform: scale(1.03); }
.hero-image-pane:hover .hero-image { transform: scale(1.05); }

/* ---------- SPOTLIGHT RADIAL + leve vinheta topo/rodapé ---------- */
.hero-image-pane::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.28) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 55%, rgba(0,0,0,0.50) 100%),
        radial-gradient(ellipse 50% 60% at 50% 78%, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.65) 25%, rgba(0,0,0,0.35) 50%, rgba(0,0,0,0.10) 70%, rgba(0,0,0,0) 85%);
    pointer-events: none;
    z-index: 2;
}

/* Selo de data sobre a imagem (canto inferior esquerdo) */
.hero-image-credit {
    position: absolute;
    bottom: 20px;
    left: 24px;
    z-index: 3;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ---------- PAINEL CONTEÚDO — centralizado, deixa cliques passarem ---------- */
.hero-content-pane {
    position: relative;
    z-index: 4;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    /* MECANISMO INTELIGENTE: 75px de padding na base cria uma "prateleira" 
       para o squircle ficar em pé, exatamente em cima da paginação */
    padding: 110px 30px 75px 30px; 
    box-sizing: border-box;
    pointer-events: none; 
}

/* ---------- SQUIRCLE — branco, totalmente visível na tela ---------- */
.hero-squircle {
    position: relative;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 22px;
    padding: 26px 32px 22px 32px;
    max-width: 720px;            /* ALONGADO mas mais estreito (era 920px) */
    width: 100%;
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.45);
    
    /* ANTI-CARTAS EMPILHADAS: Esconde os inativos por padrão */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease, visibility 0.4s ease, box-shadow 0.35s ease, border-color 0.35s ease;
    
    pointer-events: auto;
    z-index: 999 !important;
}

/* Revela de forma elegante apenas o squircle do slide que está na tela */
.swiper-slide-active .hero-squircle {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* A barra laranja agora é renderizada pelo .hero-tag::before (acompanha a tag no header) */
.hero-squircle::before { content: none; }

/* Hover faz ele flutuar para cima suavemente */
.swiper-slide-active .hero-squircle:hover {
    transform: translateY(-8px) scale(1);
    box-shadow: 0 30px 65px rgba(0, 0, 0, 0.55);
    border-color: #d35400;
}

.hero-squircle:hover {
    transform: translateY(55%);
    box-shadow: 0 26px 65px rgba(0, 0, 0, 0.52);
    border-color: #d35400;
}

.hero-squircle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: #d35400;
    margin-bottom: 0;
}

/* Barra laranja vertical antes da tag (estilo mockup) */
.hero-tag::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 14px;
    background-color: #d35400;
    border-radius: 2px;
    flex-shrink: 0;
}

.hero-title {
    font-size: 24px;             /* menor: era 32px */
    line-height: 1.25;
    color: #5a2800;
    margin: 0 0 14px 0;
    font-weight: 800;
    letter-spacing: -0.3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-title a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
.hero-title a:hover { color: #d35400; }

/* CORPO: preview + CTA lado a lado (flex row) — CTA vira "quebra de linha" do preview */
.hero-squircle-body {
    display: flex;
    align-items: flex-end;
    gap: 20px;
}

.hero-preview {
    flex: 1;
    font-size: 14px;            /* menor: era 15px */
    line-height: 1.55;
    color: #555;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-date {
    font-size: 12px;
    color: #8a6f5c;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;            /* menor: era 13px */
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #5a2800;
    text-decoration: none;
    padding: 8px 16px;          /* menor: era 9px 20px */
    border: 2px solid #5a2800;
    border-radius: 999px;
    white-space: nowrap;        /* não quebra em 2 linhas */
    flex-shrink: 0;             /* não encolhe dentro do flex row */
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.hero-cta:hover {
    background: #d35400;
    border-color: #d35400;
    color: #fff;
    transform: translateX(3px);
}

/* ---------- Navegação e paginação Swiper ---------- */
.hero-slider-container .swiper-button-next,
.hero-slider-container .swiper-button-prev {
    color: #ffffff !important;
    background: rgba(0, 0, 0, 0.45);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.30);
    transition: background 0.25s ease, transform 0.25s ease;
}

.hero-slider-container .swiper-button-next:hover,
.hero-slider-container .swiper-button-prev:hover {
    background: #d35400;
    transform: scale(1.05);
}

.hero-slider-container .swiper-button-next:after,
.hero-slider-container .swiper-button-prev:after {
    font-size: 16px !important;
    font-weight: 800;
}

.hero-slider-container .swiper-button-prev { left: 22px; }
.hero-slider-container .swiper-button-next { right: 22px; }

.hero-slider-container .swiper-pagination {
    bottom: 25px !important; /* Coloca os pontinhos estrategicamente ABAIXO do squircle */
    left: 50% !important;
    transform: translateX(-50%);
    width: auto !important;
    display: flex;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 999px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000; /* Garante que ninguém os sobreponha */
}

.hero-slider-container .swiper-pagination-bullet {
    background: #ffffff !important;
    opacity: 0.55;
    width: 8px;
    height: 8px;
    margin: 0 !important;
    transition: all 0.25s ease;
    border-radius: 50%;
}

.hero-slider-container .swiper-pagination-bullet-active {
    opacity: 1;
    background: #d35400 !important;
    width: 22px;
    border-radius: 4px;
}

/* ---------- RESPONSIVO ---------- */
@media (max-width: 1100px) {
    .hero-content-pane { padding: 110px 24px 75px 24px; }
    .hero-squircle { padding: 24px 28px 20px 28px; max-width: 620px; }
    .hero-title { font-size: 22px; }
}

@media (max-width: 900px) {
    .hero-content-pane { padding: 90px 16px 65px 16px; }
    .hero-squircle {
        padding: 22px 24px 20px 24px;
        max-width: 100%;
        width: 100%;
        border-radius: 22px;
        box-shadow: 0 14px 35px rgba(0, 0, 0, 0.40);
    }
    .swiper-slide-active .hero-squircle:hover { transform: translateY(-5px) scale(1); }
    .hero-title { font-size: 20px; margin-bottom: 10px; -webkit-line-clamp: 3; line-clamp: 3; }
    .hero-preview { font-size: 13px; }
    .hero-slider-container .swiper-button-prev,
    .hero-slider-container .swiper-button-next { display: none; }
}

@media (max-width: 768px) {
    .hero-slider-container {
        height: 78vh;
        height: 78dvh;
        min-height: 480px;
    }
    .hero-image-pane::after {
        background:
            linear-gradient(180deg, rgba(0,0,0,0.20) 0%, rgba(0,0,0,0) 18%, rgba(0,0,0,0) 45%, rgba(0,0,0,0.65) 100%),
            radial-gradient(ellipse 90% 50% at 50% 85%, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.45) 40%, rgba(0,0,0,0) 80%);
    }
    .hero-image-credit { bottom: 14px; left: 16px; }

    /* Header do squircle: tag e data empilham verticalmente no celular */
    .hero-squircle-header { flex-direction: column; align-items: flex-start; gap: 4px; margin-bottom: 12px; }

    /* Body: preview e CTA empilham verticalmente no celular */
    .hero-squircle-body { flex-direction: column; align-items: stretch; gap: 14px; }

    /* CTA ocupa largura total, centralizado */
    .hero-cta { width: 100%; justify-content: center; }

    .hero-title { font-size: 19px; }
    .hero-preview { font-size: 13px; -webkit-line-clamp: 3; line-clamp: 3; }
    .hero-tag { font-size: 10px; }
    .hero-squircle { padding: 18px 20px 16px 20px; border-radius: 18px; }
}

/* --- 8. NOTÍCIAS (HOME, GRID E SINGLE) --- */
.news-section {
    background-color: #faf6f0;
    padding: 80px 50px 60px 50px;
    position: relative;
    z-index: 1 !important;
}
.news-section h2, .section-title { color: #5a2800; margin-bottom: 30px; text-transform: uppercase; font-size: 24px; padding-bottom: 10px; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.card { background: #fff; border: 1px solid #eee; border-radius: 8px; overflow: hidden; transition: transform 0.2s; }
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.card img { width: 100%; height: 220px; object-fit: cover; display: block; }
.card-content { padding: 20px; }
.card h3 { font-size: 18px; margin-bottom: 10px; color: #333; }
.card .date { display: block; font-size: 12px; color: #999; margin-bottom: 10px; font-weight: bold; }

.container-flex-news { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; gap: 50px; align-items: flex-start; }
.main-news-column { flex: 2.5; width: 100%; }
.news-sidebar { flex: 1; background-color: #fff; padding: 30px; border-radius: 8px; border: 1px solid #eee; box-shadow: 0 5px 20px rgba(0,0,0,0.05); position: sticky; top: 120px; }
.sidebar-widget { margin-bottom: 40px; }
.sidebar-widget h3 { color: #5a2800; font-size: 18px; text-transform: uppercase; border-bottom: 2px solid #5a2800; padding-bottom: 10px; margin-bottom: 20px; }
.search-field, .sidebar-widget select { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; background: white; transition: border-color 0.2s ease; }
.search-field:focus, .sidebar-widget select:focus { border-color: #d35400; }
.categories-list { list-style: none; padding: 0; margin: 0; }
.categories-list li { border-bottom: 1px solid #eee; padding: 10px 0; display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: #777; }
.categories-list li a { text-decoration: none; color: #333; font-weight: 500; transition: color 0.2s; }
.categories-list li a:hover { color: #d35400; }

/* Wrapper que recebe o morph do squircle na single */
.single-title-wrapper {
    display: block;
    /* transparente: só existe pra receber o view-transition-name */
}

.single-hero { height: 60vh; height: 60dvh; width: 100%; background-color: #3e1e09; background-size: cover !important; background-position: center !important; margin-bottom: 0; /* era 50px — causava gap marrom entre hero e wrapper creme */ }
@media (max-width: 768px) {
    .single-hero { height: 40vh; height: 40dvh; margin-bottom: 0; }
}

/* WRAPPER DA SINGLE — envelopa o card branco (.single-content-container) e a
   seção de posts relacionados (.recent-articles-section) com fundo creme
   #faf6f0. Sem este wrapper, o body marrom #3e1e09 apareceria atrás do card
   branco nas laterais e nos gaps. O padding-top preserva o espaçamento visual
   que antes era um margin-bottom do .single-hero — mas DENTRO do wrapper creme,
   então não vaza marrom. */
.single-page-wrapper {
    background-color: #faf6f0;
    position: relative;
    z-index: 1;
    padding-top: 50px; /* espaçamento que antes era margin-bottom do .single-hero */
    padding-bottom: 20px;
    margin-top: 0;
}
@media (max-width: 768px) {
    .single-page-wrapper { padding-top: 30px; }
}

.single-content-container { max-width: 800px; margin: 0 auto; padding: 0 20px; }
.single-title { font-size: 36px; color: #5a2800; text-transform: uppercase; margin-bottom: 10px; }
.single-subtitle { font-size: 14px; color: #d35400; font-weight: bold; text-transform: uppercase; margin-bottom: 30px; }
.post-meta { display: flex !important; align-items: center !important; gap: 15px !important; margin-bottom: 30px !important; }
.author-avatar img { border-radius: 50% !important; width: 60px !important; height: 60px !important; border: 2px solid #eee !important; display: block !important; margin: 0 !important; }
.meta-info { display: flex !important; flex-direction: column !important; justify-content: center !important; }
.author-name { font-weight: bold !important; color: #333 !important; font-size: 16px !important; margin: 0 0 2px 0 !important; line-height: 1.2 !important; display: block !important; }
.post-date { font-size: 13px !important; color: #777 !important; margin: 0 !important; line-height: 1.2 !important; display: block !important; }
.entry-content { font-size: 18px; line-height: 1.8; color: #333; margin-bottom: 50px; }
.entry-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 20px 0; }
.related-themes-box { background-color: #eee; padding: 30px; border-radius: 5px; margin-top: 48px; margin-bottom: 80px; }
.related-themes-box h3 { color: #d35400; font-size: 16px; text-transform: uppercase; margin-bottom: 15px; }
.recent-articles-section { background-color: #faf6f0; padding: 50px 0; border-top: 1px solid #eee; }
.container-recent { max-width: 1000px; margin: 0 auto; padding: 0 20px; }

@media (max-width: 900px) {
    .container-flex-news { flex-direction: column; }
    .news-sidebar { width: 100%; position: static; margin-top: 40px; }
}
@media (max-width: 768px) {
    .related-themes-box { margin-top: 32px; margin-bottom: 60px; padding: 24px; }
    .single-title { font-size: 24px !important; line-height: 1.3 !important; margin-bottom: 15px !important; }
    .single-subtitle { font-size: 13px !important; margin-bottom: 20px !important; }
    .author-name { margin-bottom: 2px; }
}

/* --- 9. PRODUÇÕES ACADÊMICAS --- */
.home-producoes { background-color: #faf6f0; padding: 60px 50px; border-top: 1px solid #eee; }
.container-producoes { max-width: 1200px; margin: 0 auto; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 2px solid #5a2800;
    padding-bottom: 10px;
    position: relative;
    z-index: 5; /* acima do squircle caso esborem, mas com 150px de padding-top não deveria */
}
.section-header h2 { color: #5a2800; font-size: 24px; text-transform: uppercase; margin: 0; }
.btn-ver-todas { color: #d35400; font-weight: bold; font-size: 14px; text-transform: uppercase; text-decoration: none; }
.producoes-home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; justify-content: center; }
.mini-book-card { transition: transform 0.3s; }
.mini-book-card:hover { transform: translateY(-10px); }
.mini-book-card a { text-decoration: none; color: inherit; }
.book-cover-wrapper { position: relative; box-shadow: 0 5px 15px rgba(0,0,0,0.15); border-radius: 4px; overflow: hidden; margin-bottom: 15px; width: 100%; aspect-ratio: 2 / 3; background: #ddd; }
.book-cover-wrapper img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-book-card h3 { font-size: 16px; color: #333; margin-bottom: 5px; font-weight: bold; }
.book-author { font-size: 13px; color: #777; margin: 0; }
.badge-free { position: absolute; top: 10px; right: 10px; background-color: #27ae60; color: white; font-size: 10px; font-weight: bold; padding: 3px 8px; border-radius: 3px; text-transform: uppercase; }

.productions-header, .database-header { background-color: #3e1e09; background-image: linear-gradient(180deg, #3e1e09 0%, #3e1e09 100%); padding: calc(120px + env(safe-area-inset-top)) 0 60px 0; text-align: center; color: white; border-bottom-left-radius: 50% 20px; border-bottom-right-radius: 50% 20px; margin-bottom: 50px; }
.productions-header h1, .database-header h1 { font-size: 32px; text-transform: uppercase; letter-spacing: 1px; text-shadow: 2px 2px 4px rgba(0,0,0,0.3); }

.book-page-container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.book-details-wrapper { display: flex; gap: 50px; margin-bottom: 50px; align-items: flex-start; }
.book-cover-col { flex: 1; max-width: 400px; }
.book-cover-img { width: 100%; box-shadow: 0 10px 25px rgba(0,0,0,0.2); border-radius: 5px; }
.book-info-col { flex: 1.5; }
.book-title { font-size: 32px; color: #5a2800; text-transform: uppercase; margin-bottom: 10px; line-height: 1.2; }
.book-type { color: #d35400; font-weight: bold; text-transform: uppercase; margin-bottom: 20px; font-size: 18px; }
.book-meta p { font-size: 16px; color: #444; margin-bottom: 8px; line-height: 1.5; }
.book-action { margin-top: 30px; }
.btn-book { display: inline-block; background-color: #8B4513; color: white; padding: 15px 40px; text-decoration: none; font-weight: bold; font-size: 18px; border-radius: 8px; box-shadow: 0 4px 0 #5a2800; transition: transform 0.1s, box-shadow 0.1s; }
.btn-book:hover { background-color: #a05015; transform: translateY(2px); box-shadow: 0 2px 0 #5a2800; color: white; }
.book-description { font-size: 18px; line-height: 1.8; color: #333; margin-bottom: 80px; max-width: 900px; }

.books-archive-section { padding: 50px 20px; background-color: #faf6f0; min-height: 500px; }
.container-books { max-width: 1200px; margin: 0 auto; }
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 40px; justify-content: center; }
.book-card-item { background: transparent; transition: transform 0.3s; }
.book-card-item:hover { transform: translateY(-10px); }
.book-card-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; }
.book-card-info { text-align: center; }
.book-card-info h3 { font-size: 16px; color: #5a2800; margin-bottom: 5px; line-height: 1.3; text-transform: uppercase; }
.book-year { display: block; font-size: 14px; color: #777; margin-bottom: 10px; }
.btn-details { display: inline-block; font-size: 12px; color: #d35400; font-weight: bold; text-transform: uppercase; border: 1px solid #d35400; padding: 5px 15px; border-radius: 20px; transition: all 0.2s; }
.book-card-item:hover .btn-details { background-color: #d35400; color: white; }

@media (max-width: 768px) {
    .book-details-wrapper { flex-direction: column; }
    .book-cover-col { max-width: 100%; margin: 0 auto; }
}

/* --- 10. EQUIPE E PERFIL --- */
.team-category-header { text-align: center; margin-top: 60px; margin-bottom: 40px; }
.team-cat-title { color: #5a2800; font-size: 28px; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 15px; position: relative; display: inline-block; }
.team-cat-divider { border: 0; height: 3px; width: 80px; background-color: #d35400; margin: 0 auto; border-radius: 2px; }

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 40px; justify-content: center; margin-bottom: 60px; }
.team-card { background: #fff; border: 1px solid #f0f0f0; border-radius: 10px; padding: 30px 20px; text-align: center; transition: transform 0.3s ease, box-shadow 0.3s ease; display: flex; flex-direction: column; justify-content: space-between; height: 100%; }
.team-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.08); border-color: transparent; }
.team-card a { transition: color 0.2s; }
.team-card h3 a:hover { color: #d35400; }

.team-photo-wrapper { width: 140px; height: 140px; margin: 0 auto 20px auto; border-radius: 50%; overflow: hidden; border: 3px solid #f9f9f9; box-shadow: 0 5px 15px rgba(0,0,0,0.1); transition: transform 0.3s ease, border-color 0.3s; }
.team-card:hover .team-photo-wrapper { border-color: #d35400; transform: scale(1.05); }
.team-photo-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.team-info h3 { font-size: 18px; color: #5a2800; margin-bottom: 10px; font-weight: 700; }
.team-meta-text { margin-bottom: 25px; min-height: 50px; }
.team-role { display: block; font-size: 14px; color: #555; font-weight: 600; margin-bottom: 4px; }
.team-uni { display: block; font-size: 13px; color: #888; font-style: italic; }

.team-actions { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: auto; }
.btn-lattes { display: inline-block; padding: 8px 16px; border: 1px solid #d35400; color: #d35400; text-decoration: none; font-size: 12px; font-weight: bold; border-radius: 20px; text-transform: uppercase; transition: all 0.3s; }
.btn-lattes:hover { background-color: #d35400; color: white; }
.btn-email { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid #ccc; border-radius: 50%; color: #555; text-decoration: none; font-size: 16px; transition: all 0.3s; }
.btn-email:hover { background-color: #555; color: white; border-color: #555; }

.profile-layout { display: flex; gap: 60px; }
.profile-sidebar { flex: 1; min-width: 250px; }
.profile-photo-wrapper { width: 200px; height: 200px; border-radius: 50%; overflow: hidden; border: 5px solid white; box-shadow: 0 10px 30px rgba(0,0,0,0.15); margin: 0 auto 30px auto; background: white; }
.profile-photo-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.profile-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.btn-lattes-profile { display: block; width: 100%; max-width: 200px; padding: 10px; background: #d35400; color: white; text-decoration: none; font-weight: bold; border-radius: 30px; text-transform: uppercase; font-size: 14px; transition: background 0.3s; }
.btn-lattes-profile:hover { background: #a05000; }
.btn-email-profile { display: block; color: #555; text-decoration: none; font-size: 14px; }
.btn-email-profile:hover { color: #d35400; text-decoration: underline; }
.profile-bio { flex: 2.5; padding-top: 40px; }

.bio-collapsed { max-height: 300px; overflow: hidden; position: relative; transition: max-height 0.8s ease-in-out; }
.bio-expanded { max-height: 5000px; transition: max-height 1s ease-in-out; }
.bio-fade-overlay { position: absolute; bottom: 0; left: 0; width: 100%; height: 100px; background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1) 90%); pointer-events: none; transition: opacity 0.5s; }
.bio-expanded .bio-fade-overlay { opacity: 0; }

@media (max-width: 768px) {
    .profile-layout { flex-direction: column; gap: 20px; }
    .profile-sidebar { margin-top: -80px !important; }
    .profile-bio { padding-top: 0; }
}

/* --- 11. PROJETOS DE PESQUISA --- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 30px; }
.project-card { background: white; border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.05); overflow: hidden; position: relative; border-left: 5px solid #5a2800; transition: transform 0.3s; padding: 25px; display: flex; flex-direction: column; }
.project-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.project-status { position: absolute; top: 20px; right: 20px; font-size: 11px; font-weight: bold; text-transform: uppercase; padding: 4px 10px; border-radius: 20px; }
.status-green { background-color: #e6f9ed; color: #27ae60; }
.status-gray { background-color: #eee; color: #777; }
.project-type { display: block; font-size: 12px; color: #d35400; font-weight: bold; text-transform: uppercase; margin-bottom: 5px; }
.project-card h3 { font-size: 20px; margin: 5px 0 15px 0; line-height: 1.3; }
.project-card h3 a { text-decoration: none; color: #333; }
.project-author { font-size: 14px; color: #555; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.project-excerpt { font-size: 14px; color: #666; margin-bottom: 20px; flex-grow: 1; }
.btn-project-details { text-decoration: none; color: #5a2800; font-weight: bold; font-size: 14px; }
.project-year { position: absolute; bottom: 20px; right: 20px; font-size: 30px; font-weight: 800; color: #f0f0f0; z-index: 0; pointer-events: none; }
.project-status-pill { padding: 6px 12px; border-radius: 4px; font-weight: bold; font-size: 12px; text-transform: uppercase; background: white; }
.project-status-pill.status-green { color: #27ae60; }
.project-status-pill.status-gray { color: #777; }

/* --- 12. PLUGINS E EXTRAS (DataTables) --- */
.wpDataTablesWrapper table { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important; }
.wpDataTablesWrapper table thead th { background-color: #5a2800 !important; color: white !important; text-transform: uppercase; padding: 15px !important; border: none !important; }
.wpDataTablesWrapper table tbody td { padding: 12px !important; border-bottom: 1px solid #eee !important; color: #333; }
.wpDataTablesWrapper table tbody tr:nth-child(odd) td { background-color: #fcfcfc; }
.wpDataTablesWrapper table tbody tr:hover td { background-color: #ffe6d5; }
.wpDataTableFilterSection input, .wpDataTableFilterSection select { padding: 8px; border: 1px solid #ccc; border-radius: 4px; width: 100%; }

/* --- 13. ALINHAMENTOS GERAIS PARA CELULAR (Evitar Vazamentos) --- */
@media (max-width: 768px) {
    .news-section, .home-producoes, .projects-section { padding: 40px 16px !important; }

    /* Notícias: 2 cards por linha no celular (antes era 1), aproveitando melhor o espaço */
    .news-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
    .projects-grid, .team-grid, .producoes-home-grid { grid-template-columns: 1fr !important; }

    /* Cards de notícia compactos para caberem 2 por linha */
    .news-grid .card img { height: 110px !important; }
    .news-grid .card-content { padding: 10px !important; }
    .news-grid .card h3 { font-size: 13px !important; line-height: 1.3 !important; margin-bottom: 6px !important; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
    .news-grid .card .date { font-size: 10px !important; margin-bottom: 6px !important; }
    .news-grid .card p,
    .news-grid .card .entry-summary,
    .news-grid .card .post-excerpt,
    .news-grid .card .card-text,
    .news-grid .card .resumo-noticia { font-size: 12px !important; line-height: 1.4 !important; }

    /* Cards v2 (.news-v2-card) compactos para 2 por linha no mobile */
    .news-grid .news-v2-card__body { padding: 14px 16px 12px 16px; }
    .news-grid .news-v2-card__title { font-size: 14px; -webkit-line-clamp: 3; line-clamp: 3; }
    .news-grid .news-v2-card__excerpt { font-size: 12px; -webkit-line-clamp: 2; line-clamp: 2; margin-bottom: 12px; }
    .news-grid .news-v2-card__meta { font-size: 11px; gap: 6px; }
    .news-grid .news-v2-card__avatar { width: 24px; height: 24px; }
    .news-grid .news-v2-card__cat { font-size: 9px; padding: 4px 10px; }
    .news-grid .news-v2-card__time { font-size: 9px; padding: 4px 8px; }
    .news-grid .news-v2-card__time svg { width: 9px; height: 9px; }
}

/* --- 14. RODAPÉ --- */
.nupep-footer { background-color: #3e1e09; color: white; padding: 60px 0 calc(40px + env(safe-area-inset-bottom)) 0; position: relative; overflow: hidden; margin-top: 0; }
.footer-container { max-width: 1200px; margin: 0 auto; padding: 0 40px; position: relative; z-index: 2; }
.footer-top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 50px; }
.footer-socials { display: flex; gap: 20px; }
.footer-socials a { color: white; transition: transform 0.2s, color 0.2s; }
.footer-socials a:hover { color: #d35400; transform: scale(1.1); }
.footer-nav-row { margin-bottom: 40px; }
.footer-menu-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 40px; }
.footer-menu-list li a { color: white; text-decoration: none; font-weight: 700; font-size: 16px; text-transform: capitalize; display: block; padding-top: 15px; border-top: 3px solid white; transition: border-color 0.3s, color 0.3s; }
.footer-menu-list li a:hover { color: #ddd; border-color: #d35400; }
.footer-bottom-row { margin-top: 20px; }
.footer-divider { border: 0; border-top: 1px solid rgba(255,255,255,0.2); margin-bottom: 20px; }
.footer-bottom-row p { font-size: 12px; opacity: 0.7; }
.footer-curve-top-right { position: absolute; top: -50px; right: -50px; width: 150px; height: 150px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3); z-index: 1; }
.footer-curve-bottom-left { position: absolute; bottom: -50px; left: -50px; width: 200px; height: 200px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3); z-index: 1; }

@media (max-width: 768px) {
    .footer-top-row { flex-direction: column; align-items: flex-start; gap: 30px; }
    .footer-menu-list { flex-direction: column; gap: 20px; }
    .footer-menu-list li a { display: inline-block; }
}

/* =========================================
   PÍLULA BRANCA 10 ANOS (MOCKUP PERFEITO)
   ========================================= */

/* --- 1. DESKTOP (PC) --- */
.desktop-links .menu-item-destaque {
    position: relative !important;
    width: 155px !important; 
    height: 30px !important; 
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

.desktop-links .menu-item-destaque a {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important; 
    background-color: #ffffff !important;
    
    /* Esconde o texto do WordPress */
    color: transparent !important;
    font-size: 0 !important;
    text-indent: -9999px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    
    width: 165px !important; 
    height: 56px !important; 
    border-radius: 50px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
    border: none !important;
    padding: 0 !important;
    transition: all 0.3s ease !important;
}

.desktop-links .menu-item-destaque a:hover {
    transform: translate(-50%, -50%) scale(1.08) !important; 
    box-shadow: 0 8px 25px rgba(0,0,0,0.3) !important;
}

.desktop-links .menu-item-destaque a::after {
    content: "" !important;
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    background-image: url('./assets/img/10-anos-logo.png') !important;
    background-size: 70% auto !important; 
    background-position: center !important;
    background-repeat: no-repeat !important;
    filter: brightness(0.2) sepia(1) hue-rotate(330deg) saturate(3) !important; 
}


/* --- 2. MOBILE (TELEMÓVEL) --- */
@media (max-width: 950px) {
    /* Transforma o <ul> do menu em flexbox para podermos reordenar os itens */
    .mobile-links {
        display: flex;
        flex-direction: column;
    }

    .mobile-links .menu-item-destaque {
        order: -1 !important; /* JOGA A PÍLULA PARA O TOPO DA LISTA */
        display: flex !important;
        justify-content: center !important; /* Centraliza a pílula no telemóvel */
        padding: 5px 0 25px 0 !important; /* Mais espaço por baixo dela */
        border-bottom: 1px solid rgba(255,255,255,0.1); /* Linha divisória após o destaque */
        margin-bottom: 15px;
    }
    
    .mobile-links .menu-item-destaque a {
        position: relative !important;
        display: block !important;
        background-color: #ffffff !important;
        width: 170px !important; /* Um pouco mais larga para ficar bonita no centro */
        height: 55px !important;
        border-radius: 30px !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important;
        
        color: transparent !important;
        font-size: 0 !important;
        line-height: 0 !important;
        text-indent: -9999px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
    }

    .mobile-links .menu-item-destaque a::after {
        content: "" !important;
        position: absolute !important;
        top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
        background-image: url('./assets/img/10-anos-logo.png') !important;
        background-size: 65% auto !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        filter: brightness(0.2) sepia(1) hue-rotate(330deg) saturate(3) !important;
    }
}

/* =========================================
   ÍCONE DE CASA (HOME) NO MENU PRINCIPAL
   ========================================= */

/* Classe específica para transformar qualquer item do menu num ícone de casa */
.desktop-links .menu-item-home a {
    font-size: 0 !important; /* Esconde a palavra "Início" */
    color: transparent !important;
    
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important; /* Botão redondo */
    margin-right: 5px; /* Dá um respiro para o botão seguinte */
    
    /* Injeta um ícone SVG de Casa diretamente pelo CSS */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.85)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E") !important;
    background-size: 18px auto !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    transition: background-color 0.3s ease !important;
}

/* Efeito ao passar o rato (Fica mais branco) */
.desktop-links .menu-item-home a:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E") !important;
}

/* Evita que o ícone de casa apareça quebrado no menu mobile.
   No mobile, o texto "Início" volta a aparecer normalmente. */
@media (max-width: 950px) {
    .mobile-links .menu-item-home a {
        font-size: 14px !important;
        color: white !important;
        background-image: none !important;
        width: auto !important;
        height: auto !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
}

/* =========================================
   CENTRALIZAR TEXTOS DO MENU MOBILE
   ========================================= */
@media (max-width: 950px) {
    /* Centraliza os links principais (Início, Notícias, etc) */
    .mobile-links li {
        text-align: center !important;
    }
    
    /* Centraliza os links de dentro do submenu (dropdown "Mais") e corrige o espaçamento torto */
    .mobile-links .sub-menu a {
        text-align: center !important;
        padding: 10px !important; 
    }
}

/* =========================================
    CAIXA DAS LOGOS (E O TRUQUE DO SAFARI)
========================================= */
    .logo-animada-wrapper {
        display: flex;
        align-items: center !important;
        height: 50px; 
        width: 180px; /* Fundamental para segurar as imagens que vão flutuar */
        position: relative; /* Permite colocar uma imagem em cima da outra */
        margin: 0 !important;
        padding: 0 !important;
        
        /* O TRUQUE: O filtro de cor fica na caixa pai, não nas imagens. 
            Isso mata o bug da sombra preta no iPhone na hora! */
        -webkit-filter: brightness(0) invert(1);
        filter: brightness(0) invert(1);
        
        /* Força a renderização por hardware na Apple */
        -webkit-transform: translate3d(0,0,0);
        transform: translate3d(0,0,0);
    }

    .logo-padrao, .logo-comemorativa {
        position: absolute; /* Coloca uma por cima da outra */
        left: 0; /* Trava as duas no mesmo ponto de partida */
        margin: 0 !important; 
        padding: 0 !important;
        height: auto;
        max-height: 50px; 
        display: block;
        
        /* As imagens já não têm filter aqui! 
            Transição estrita apenas na opacidade para não bugar o Safari */
        -webkit-transition: opacity 1s ease-in-out;
        transition: opacity 1s ease-in-out;
        will-change: opacity;
    }

    /* --- Lógica da Animação (Esconde/Mostra) --- */
    .logo-padrao {
        opacity: 1;
    }
    .logo-comemorativa {
        opacity: 0;
    }

    /* Quando o JavaScript adiciona a classe "efeito-10-anos" */
    .logo-animada-wrapper.efeito-10-anos .logo-padrao {
        opacity: 0;
    }
    .logo-animada-wrapper.efeito-10-anos .logo-comemorativa {
        opacity: 1;
    }

/* Responsivo */
@media (max-width: 900px) {
    .logo-animada-wrapper { height: 45px; width: 170px; }
}

/* =========================================
       MODAL DE METODOLOGIA
       ========================================= */
    .btn-metodologia {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background: transparent;
        color: rgba(255, 255, 255, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.4);
        padding: 8px 16px;
        border-radius: 20px;
        font-size: 13px;
        text-transform: uppercase;
        cursor: pointer;
        margin-top: 20px;
        transition: 0.3s;
    }
    .btn-metodologia:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
        border-color: #fff;
    }
    .nupep-modal-overlay {
        position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.7); z-index: 9999;
        display: flex; justify-content: center; align-items: center;
        opacity: 0; visibility: hidden; transition: 0.3s ease;
    }
    .nupep-modal-overlay.active {
        opacity: 1; visibility: visible;
    }
    .nupep-modal-content {
        background: #fff; width: 90%; max-width: 650px;
        border-radius: 15px; padding: 40px; position: relative;
        max-height: 85vh; overflow-y: auto; text-align: left;
        transform: translateY(20px); transition: 0.3s ease;
        box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    }
    .nupep-modal-overlay.active .nupep-modal-content {
        transform: translateY(0);
    }
    .nupep-modal-close {
        position: absolute; top: 20px; right: 20px;
        background: #eee; border: none; width: 30px; height: 30px;
        border-radius: 50%; cursor: pointer; font-weight: bold;
        color: #555; transition: 0.3s; display: flex; align-items: center; justify-content: center;
    }
    .nupep-modal-close:hover { background: #d35400; color: #fff; }
    .nupep-modal-title { color: #5a2800; margin-bottom: 20px; font-size: 24px; text-transform: uppercase; font-weight: 800;}
    .nupep-modal-text { color: #444; line-height: 1.7; font-size: 15px; text-align: justify; }
    .nupep-modal-text h4 { color: #d35400; margin-top: 25px; margin-bottom: 10px; font-size: 17px; text-transform: uppercase;}

    /* =========================================
       FONTES CUSTOMIZADAS E LOGOS DE APOIO
       ========================================= */
    @font-face {
        font-family: 'Mexcellent';
        src: url('/wp-content/themes/nupep_tema/assets/fonts/mexcellent-regular.woff2') format('woff2');
        font-weight: normal;
        font-style: normal;
        font-display: swap;
    }

    .header-titles-wrapper {
        display: flex;
        justify-content: center;
        align-items: center;
        margin-bottom: 25px;
    }

    .title-inventiva {
        font-family: 'Mexcellent', sans-serif !important;
        font-size: 58px; /* Fonte significativamente aumentada */
        line-height: 1.1;
        letter-spacing: 2px;
        color: #fff;
        display: block;
        text-align: center;
    }

    /* Barra lateral direita para os logos */
    .database-logos {
        width: 140px;
        flex-shrink: 0;
        text-align: center;
        padding-top: 30px; /* Alinha com o topo da tabela */
    }
    
    .database-logos h4 {
        color: #5a2800;
        font-size: 15px;
        text-transform: uppercase;
        font-weight: 800;
        margin-top: 0;
        margin-bottom: 25px;
    }
    
    .logos-grid {
        display: flex;
        flex-direction: column;
        gap: 25px;
        align-items: center;
    }
    
    .logos-grid img {
        max-width: 100%;
        height: auto;
        /* Dá um tom mais suave aos logos para não competirem muito com a tabela */
        opacity: 0.85; 
        transition: opacity 0.3s;
    }
    
    .logos-grid img:hover {
        opacity: 1;
    }

    /* Comportamento responsivo (Telemóvel e Tablets) */
    @media (max-width: 900px) {
        .header-titles-wrapper {
            flex-direction: column;
            text-align: center;
            gap: 15px;
        }
        .left-titles, .right-titles { text-align: center; }
        
        .database-logos {
            width: 100%;
            padding-top: 20px;
            padding-bottom: 20px;
        }
        .logos-grid {
            flex-direction: row;
            flex-wrap: wrap;
            justify-content: center;
            gap: 20px;
        }
        .logos-grid img { max-width: 80px; }
    }

/* =========================================
   BOTÃO DE BUSCA — "DYNAMIC ISLAND" SEPARADO
   =========================================
   Conceito: a pílula marrom central (desktop-pilula) é a "Dynamic Island"
   principal. O botão de busca é um segundo "pedaço" que se separou dela
   e foi parar no canto direito do header — círculo branco, com sombra,
   visualmente destacado mas mantendo a mesma linguagem (blur, borda, peso).
   ========================================= */

/* --- 1. O BOTÃO (DESKTOP) --- */
.nupep-search-trigger {
    /* Posicionamento: canto direito do header, alinhado com a pílula */
    position: relative;
    z-index: 100;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 0;

    /* Tamanho do círculo */
    width: 52px;
    height: 52px;

    /* Forma circular */
    border-radius: 50%;

    /* Visual "Dynamic Island" branco destacado */
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.28),
        0 2px 6px rgba(90, 40, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);

    /* Ícone */
    color: #5a2800; /* marrom do tema */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;

    /* Animação de entrada (igual à pílula principal) */
    animation: nupepSearchIslandPop 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    animation-delay: 0.15s;

    /* Transições suaves de hover/focus */
    transition:
        transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        box-shadow 0.35s ease,
        background-color 0.3s ease,
        color 0.3s ease;
}

/* Tamanho do SVG da lupa */
.nupep-search-trigger svg {
    width: 22px;
    height: 22px;
    display: block;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Hover — cresce e fica laranja (cor de destaque do tema) */
.nupep-search-trigger:hover {
    transform: scale(1.1);
    background: #d35400;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow:
        0 14px 32px rgba(211, 84, 0, 0.45),
        0 4px 10px rgba(0, 0, 0, 0.25);
}
.nupep-search-trigger:hover svg {
    transform: rotate(-8deg) scale(1.08);
}

/* Focus do botão de busca — tratado pela regra global */
.nupep-search-trigger:focus-visible {
    outline: none;
}

/* Animação de "pop" igual à da pílula principal */
@keyframes nupepSearchIslandPop {
    0%   { transform: scale(0);     opacity: 0; }
    60%  { transform: scale(1.12); }
    100% { transform: scale(1);     opacity: 1; }
}

/* Esconde no mobile — no mobile a busca entra pelo hambúrguer */
@media (max-width: 950px) {
    .nupep-search-trigger { display: none !important; }
}

/* --- 2. ITEM DE BUSCA DENTRO DO HAMBÚRGUER (MOBILE) --- */
.nupep-search-trigger-mobile {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #ffffff;
    color: #5a2800;
    border: none;
    border-radius: 30px;
    padding: 16px 20px; /* era 12px 18px — aumentado para área tocável mínima 44px (WCAG 2.5.5) */
    margin: 4px 0 0 0; /* gap visual extra acima do botão para separar do último item do menu */
    font-family: inherit;
    font-weight: 700;
    font-size: 15px; /* era 14px */
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
    min-height: 44px; /* WCAG 2.5.5 Target Size — mínimo recomendado para toque mobile */
}
.nupep-search-trigger-mobile svg {
    width: 18px;
    height: 18px;
    display: block;
}
.nupep-search-trigger-mobile:hover,
.nupep-search-trigger-mobile:active {
    transform: scale(1.02);
    background: #d35400;
    color: #ffffff;
}
@media (min-width: 951px) {
    .nupep-search-trigger-mobile { display: none !important; }
}

/* =========================================
   MODAL DE BUSCA — OVERLAY COM FADE
   ========================================= */

/* --- 1. Overlay (fundo escurecido + blur do site) --- */
.nupep-search-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;

    /* Fade do site inteiro por trás */
    display: flex;
    align-items: flex-start;
    justify-content: center;

    padding: 8vh 20px 20px;
    box-sizing: border-box;

    /* Estado hidden inicial (vira block pelo JS) */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.35s ease,
        visibility 0.35s ease;
}
.nupep-search-modal[hidden] { display: none; }
.nupep-search-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Quando o modal abre, escurece e desfoca o site inteiro */
body.nupep-search-open {
    overflow: hidden; /* trava o scroll do site */
}
body.nupep-search-open #page,
body.nupep-search-open > header,
body.nupep-search-open > .mobile-menu-wrapper,
body.nupep-search-open > main,
body.nupep-search-open > footer,
body.nupep-search-open .site-content,
body.nupep-search-open #content {
    filter: blur(6px) brightness(0.55);
    transition: filter 0.35s ease;
}

/* Camada de fundo escura (click para fechar) */
.nupep-search-modal__backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at 50% 0%,
        rgba(45, 22, 0, 0.85) 0%,
        rgba(15, 8, 0, 0.92) 70%,
        rgba(0, 0, 0, 0.95) 100%
    );
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    cursor: pointer;
}

/* --- 2. Card do modal --- */
.nupep-search-modal__card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 720px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.55),
        0 8px 24px rgba(0, 0, 0, 0.25);
    overflow: hidden;

    /* Animação de entrada do card */
    transform: translateY(-30px) scale(0.96);
    opacity: 0;
    transition:
        transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        opacity 0.35s ease;
}
.nupep-search-modal.is-open .nupep-search-modal__card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* --- 3. Botão de fechar --- */
.nupep-search-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f3ece4;
    border: none;
    color: #5a2800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.nupep-search-modal__close svg {
    width: 18px;
    height: 18px;
    display: block;
}
.nupep-search-modal__close:hover {
    background: #d35400;
    color: #ffffff;
    transform: rotate(90deg);
}
.nupep-search-modal__close:focus-visible {
    outline: none;
}

/* --- 4. Formulário de busca (input grande) --- */
.nupep-search-modal__form {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 56px 22px 26px;
    border-bottom: 2px solid #efe3d6;
    background: linear-gradient(180deg, #fffaf3 0%, #ffffff 100%);
}
.nupep-search-modal__icon {
    color: #d35400;
    display: inline-flex;
    flex-shrink: 0;
}
.nupep-search-modal__icon svg {
    width: 24px;
    height: 24px;
    display: block;
}
.nupep-search-modal__input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 22px;
    font-weight: 600;
    color: #2c1a0a;
    letter-spacing: 0.2px;
    padding: 6px 0;
    min-width: 0;
}
.nupep-search-modal__input::placeholder {
    color: #b89c80;
    font-weight: 500;
}
.nupep-search-modal__input::-webkit-search-cancel-button { display: none; }

.nupep-search-modal__kbd {
    position: absolute;
    right: 64px;
    top: 50%;
    transform: translateY(-50%);
    background: #f3ece4;
    color: #8a6b52;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #e3d3bf;
    box-shadow: 0 1px 0 #e3d3bf;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.nupep-search-modal__input:focus ~ .nupep-search-modal__kbd,
.nupep-search-modal.is-open .nupep-search-modal__input:not(:placeholder-shown) ~ .nupep-search-modal__kbd {
    opacity: 0;
}

/* --- 5. Sugestões iniciais (chips) --- */
.nupep-search-modal__suggestions {
    padding: 22px 26px 6px 26px;
}
.nupep-search-modal__hint-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #a08566;
    margin: 0 0 12px 0;
}
.nupep-search-modal__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.nupep-search-chip {
    display: inline-block;
    text-decoration: none;
    background: #faf2e9;
    color: #5a2800;
    border: 1px solid #ecd9bf;
    padding: 8px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.nupep-search-chip:hover {
    background: #d35400;
    color: #ffffff;
    border-color: #d35400;
    transform: translateY(-2px);
}

/* Quando há resultados ao vivo, esconde as sugestões iniciais */
.nupep-search-modal.is-searching .nupep-search-modal__suggestions,
.nupep-search-modal.has-results .nupep-search-modal__suggestions {
    display: none;
}

/* --- 6. Resultados ao vivo (AJAX) --- */
.nupep-search-modal__results {
    padding: 4px 26px 22px 26px;
    max-height: 50vh;
    overflow-y: auto;
    /* Scrollbar discreta */
    scrollbar-width: thin;
    scrollbar-color: #d35400 #faf2e9;
}
.nupep-search-modal__results::-webkit-scrollbar { width: 8px; }
.nupep-search-modal__results::-webkit-scrollbar-track { background: #faf2e9; }
.nupep-search-modal__results::-webkit-scrollbar-thumb { background: #d35400; border-radius: 4px; }

.nupep-search-modal__status {
    text-align: center;
    color: #8a6b52;
    font-size: 13px;
    padding: 18px 0 8px 0;
    font-weight: 600;
    min-height: 20px;
}
/* Estado "carregando" com spin */
.nupep-search-modal__status.is-loading::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border: 2px solid #ecd9bf;
    border-top-color: #d35400;
    border-radius: 50%;
    animation: nupepSearchSpin 0.7s linear infinite;
    vertical-align: -2px;
}
@keyframes nupepSearchSpin {
    to { transform: rotate(360deg); }
}

.nupep-search-modal__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.nupep-search-result {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: #2c1a0a;
    transition: background-color 0.18s ease, transform 0.18s ease;
    border: 1px solid transparent;
}
.nupep-search-result:hover,
.nupep-search-result.is-active {
    background: #faf2e9;
    border-color: #ecd9bf;
    transform: translateX(4px);
}
/* Thumbnail do resultado de busca */
.nupep-search-result__thumb {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: #f3ece4;
}
/* Container do conteúdo (badge + título + excerpt) */
.nupep-search-result__content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.nupep-search-result__row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nupep-search-result__type {
    display: inline-block;
    background: #5a2800;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 100px;
    line-height: 1;
}
.nupep-search-result__type--post         { background: #5a2800; }
.nupep-search-result__type--page         { background: #8B4513; }
.nupep-search-result__type--producoes    { background: #d35400; }
.nupep-search-result__type--projetos     { background: #6b3a00; }
.nupep-search-result__type--equipe       { background: #4a7857; }
.nupep-search-result__title {
    font-size: 15px;
    font-weight: 700;
    color: #2c1a0a;
    margin: 0;
    line-height: 1.35;
}
.nupep-search-result__excerpt {
    font-size: 13px;
    color: #6b5640;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Sem resultados */
.nupep-search-modal__empty {
    text-align: center;
    color: #8a6b52;
    font-size: 14px;
    padding: 22px 10px;
    font-weight: 600;
}
.nupep-search-modal__empty strong { color: #5a2800; }

/* "Ver todos os resultados" — link para /?s=... */
.nupep-search-modal__all-results {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 18px;
    background: #5a2800;
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 100px;
    font-weight: 700;
    font-size: 14px;
    transition: background-color 0.2s ease, transform 0.2s ease;
    width: max-content;
    max-width: 100%;
}
.nupep-search-modal__all-results:hover {
    background: #d35400;
    transform: translateX(4px);
}
.nupep-search-modal__all-results svg {
    width: 16px;
    height: 16px;
}
.nupep-search-modal__all-results[hidden] { display: none !important; }

/* Esconde listas vazias */
.nupep-search-modal__list:empty { display: none; }

/* Marca o termo encontrado dentro dos resultados */
.nupep-search-result__title mark,
.nupep-search-result__excerpt mark {
    background: #ffe7c2;
    color: #5a2800;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 800;
}

/* --- 7. Responsivo do modal --- */
@media (max-width: 600px) {
    .nupep-search-modal { padding: 4vh 12px 12px; }
    .nupep-search-modal__form { padding: 18px 50px 18px 20px; }
    .nupep-search-modal__input { font-size: 18px; }
    .nupep-search-modal__icon svg { width: 20px; height: 20px; }
    .nupep-search-modal__suggestions,
    .nupep-search-modal__results { padding-left: 20px; padding-right: 20px; }
    .nupep-search-modal__kbd { display: none; }
    .nupep-search-modal__close { top: 10px; right: 10px; width: 34px; height: 34px; }
}

/* Prefers-reduced-motion: desliga animações */
@media (prefers-reduced-motion: reduce) {
    .nupep-search-trigger,
    .nupep-search-modal,
    .nupep-search-modal__card,
    .nupep-search-result,
    .nupep-search-chip,
    .nupep-search-modal__close {
        animation: none !important;
        transition: none !important;
    }
}

/* =========================================================
   v5.1 — ACESSIBILIDADE (a11y)
   ========================================================= */

/* Screen-reader-only: visível só para leitores de tela */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

/* Skip-link: fica invisível até receber foco do teclado */
.nupep-skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    z-index: 10000;
    background: #d35400;
    color: white !important;
    padding: 12px 22px;
    border-radius: 0 0 10px 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.30);
    transition: top 0.2s ease;
}
.nupep-skip-link:focus,
.nupep-skip-link:focus-visible {
    top: 0;
    clip: auto;
    clip-path: none;
    height: auto;
    width: auto;
    margin: 0;
    overflow: visible;
}

/* =========================================================
   FOCUS / OUTLINE — RECONFIGURADO SITE-WIDE
   =========================================================
   Filosofia: inputs NUNCA têm outline. O container pai
   (.news-v2-search, form, etc.) indica foco via :focus-within
   mudando border-color. Links e botões usam box-shadow ring
   sutil (apenas teclado, :focus-visible).
   ========================================================= */

/* RESET: nenhum elemento tem outline nativo */
*:focus { outline: none !important; }
*:focus-visible { outline: none !important; }

/* Links e botões: ring sutil via box-shadow (só teclado) */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(211, 84, 0, 0.5);
    border-radius: 4px;
}

/* Inputs: NUNCA outline, NUNCA box-shadow.
   O container pai cuida do foco via :focus-within. */
input:focus,
input:focus-visible,
textarea:focus,
textarea:focus-visible,
select:focus,
select:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* =========================================================
   v5.1 — BANNER DE COOKIES LGPD
   ========================================================= */
.nupep-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: #2a1500;
    color: white;
    box-shadow: 0 -8px 28px rgba(0,0,0,0.25);
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.45s ease;
    pointer-events: none;
}
.nupep-cookie-banner.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.nupep-cookie-banner__content {
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px 24px calc(18px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 18px;
    align-items: center;
}

.nupep-cookie-banner__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(211, 84, 0, 0.20);
    color: #ffb877;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nupep-cookie-banner__icon svg { width: 20px; height: 20px; }

.nupep-cookie-banner__text strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: white;
    margin-bottom: 3px;
}
.nupep-cookie-banner__text p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: rgba(255,255,255,0.82);
}
.nupep-cookie-banner__text a {
    color: #ffb877;
    text-decoration: underline;
    text-decoration-color: rgba(255,184,119,0.45);
}
.nupep-cookie-banner__text a:hover { color: #ffd9a8; }

.nupep-cookie-banner__actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.nupep-cookie-banner__btn {
    border: none;
    padding: 11px 18px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.nupep-cookie-banner__btn--accept {
    background: #d35400;
    color: white;
    box-shadow: 0 4px 12px rgba(211, 84, 0, 0.35);
}
.nupep-cookie-banner__btn--accept:hover {
    background: #b04600;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(211, 84, 0, 0.45);
}
.nupep-cookie-banner__btn--essential {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.35);
}
.nupep-cookie-banner__btn--essential:hover {
    background: rgba(255,255,255,0.10);
    border-color: rgba(255,255,255,0.55);
}

/* Mobile: banner empilha verticalmente */
@media (max-width: 720px) {
    .nupep-cookie-banner__content {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px 18px;
    }
    .nupep-cookie-banner__icon { display: none; }
    .nupep-cookie-banner__actions {
        justify-content: stretch;
    }
    .nupep-cookie-banner__btn {
        flex: 1;
        padding: 12px 10px;
    }
}

/* =========================================================
   v5.1 — RODAPÉ: LINK DE POLÍTICA DE PRIVACIDADE
   ========================================================= */
.footer-legal-links {
    margin-top: 8px;
    font-size: 13px;
}
.footer-legal-links a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-legal-links a:hover {
    color: #ffb877;
    text-decoration: underline;
}

/* =========================================================
   v5.1 — REDUZ MOTION NO BANNER (usuários sensíveis)
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    .nupep-cookie-banner,
    .nupep-cookie-banner__btn {
        transition: none !important;
    }
}


/* =========================================================
   v5.2 — DATA "ATUALIZADO EM"
   ========================================================= */
.post-updated {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    color: #888;
    font-size: 12px;
    font-style: italic;
}
.post-updated svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}


/* =========================================================
   v5.2 — TOC (SUMÁRIO AUTOMÁTICO)
   ========================================================= */
.nupep-toc {
    background: #fff8eb;
    border: 1px solid #f0e0c0;
    border-left: 4px solid #d35400;
    border-radius: 10px;
    padding: 18px 22px;
    margin: 25px 0 35px;
    font-size: 15px;
}
.nupep-toc__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #d9c5a0;
}
.nupep-toc__title {
    font-weight: 800;
    color: #5a2800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-size: 13px;
}
.nupep-toc__toggle {
    background: transparent;
    border: 1px solid #d35400;
    color: #d35400;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}
.nupep-toc__toggle:hover {
    background: #d35400;
    color: #fff;
}
.nupep-toc__list {
    margin: 0;
    padding-left: 22px;
    counter-reset: toc-counter;
    list-style: none;
}
.nupep-toc__list li {
    margin-bottom: 6px;
    position: relative;
    line-height: 1.5;
}
.nupep-toc__list li::before {
    counter-increment: toc-counter;
    content: counter(toc-counter) ".";
    position: absolute;
    left: -22px;
    color: #d35400;
    font-weight: 700;
    font-size: 13px;
}
.nupep-toc__item--sub {
    padding-left: 18px;
    font-size: 14px;
}
.nupep-toc__item--sub::before {
    content: "›";
    counter-increment: none;
    font-size: 18px;
    line-height: 1;
    top: 0;
}
.nupep-toc__list a {
    color: #5a2800;
    text-decoration: none;
    transition: color 0.15s;
}
.nupep-toc__list a:hover {
    color: #d35400;
    text-decoration: underline;
}
@media (max-width: 600px) {
    .nupep-toc { padding: 14px 16px; font-size: 14px; }
}


/* =========================================================
   v5.2 — BIO DO AUTOR
   ========================================================= */
.nupep-bio {
    margin: 40px 0 20px;
    padding: 24px 28px;
    background: linear-gradient(135deg, #fff8eb 0%, #fff 100%);
    border: 1px solid #f0e0c0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(90, 40, 0, 0.04);
}
.nupep-bio__inner {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.nupep-bio__avatar {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #d35400;
    box-shadow: 0 4px 12px rgba(211, 84, 0, 0.18);
    transition: transform 0.2s, box-shadow 0.2s;
}
.nupep-bio__avatar-link {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    outline: none;
}
.nupep-bio__avatar-link:hover,
.nupep-bio__avatar-link:focus-visible {
    transform: scale(1.05);
}
.nupep-bio__avatar-link:hover ~ .nupep-bio__content .nupep-bio__name,
.nupep-bio__avatar:hover {
    border-color: #b04600;
}
.nupep-bio__avatar-img,
.nupep-bio__avatar img {
    width: 100% !important;
    height: 100% !important;
    display: block;
    object-fit: cover;
}
.nupep-bio__content {
    flex: 1;
}
.nupep-bio__label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #999;
    margin-bottom: 2px;
}
.nupep-bio__name {
    display: inline-block;
    font-size: 18px;
    font-weight: 800;
    color: #5a2800;
    margin-bottom: 6px;
    text-decoration: none;
}
a.nupep-bio__name:hover {
    color: #d35400;
    text-decoration: underline;
}
.nupep-bio__desc {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 10px;
}
.nupep-bio__link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #d35400;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: gap 0.2s, color 0.2s;
}
.nupep-bio__link svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
}
.nupep-bio__link:hover,
.nupep-bio__link:focus-visible {
    color: #b04600;
    gap: 8px;
    text-decoration: underline;
}
.nupep-bio__link:hover svg {
    transform: translateX(2px);
}
@media (max-width: 480px) {
    .nupep-bio__inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .nupep-bio__avatar { margin: 0 auto; }
}


/* =========================================================
   v5.2 — BOTÃO FLUTUANTE WHATSAPP
   ========================================================= */
.nupep-wa-float {
    position: fixed;
    bottom: calc(22px + env(safe-area-inset-bottom));
    right: 22px;
    width: 60px;
    height: 60px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45);
    z-index: 998;
    transition: transform 0.2s, box-shadow 0.2s;
}
.nupep-wa-float:hover,
.nupep-wa-float:focus-visible {
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 10px 26px rgba(37, 211, 102, 0.6);
}
.nupep-wa-float svg {
    width: 34px;
    height: 34px;
}
.nupep-wa-float__pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #25d366;
    animation: nupep-wa-pulse 2.4s ease-out infinite;
    pointer-events: none;
}
@keyframes nupep-wa-pulse {
    0%   { transform: scale(1); opacity: 0.7; }
    70%  { transform: scale(1.6); opacity: 0; }
    100% { transform: scale(1.6); opacity: 0; }
}
@media (max-width: 600px) {
    .nupep-wa-float {
        width: 54px;
        height: 54px;
        bottom: calc(16px + env(safe-area-inset-bottom));
        right: 16px;
    }
    .nupep-wa-float svg {
        width: 30px;
        height: 30px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .nupep-wa-float__pulse { animation: none; }
    .nupep-wa-float:hover { transform: none; }
}

/* =========================================================
   NEWS v2 — Template Moderno de Notícias
   =========================================================
   Bloco NÃO-DESTRUTIVO — não modifica nenhuma regra existente.
   Reusa os padrões visuais .archive-header, .hero-slider-container,
   .hero-squircle (já definidos no style.css) e adiciona novos:
     · .news-v2-wrapper         — envelope creme
     · .news-v2-hero-secondary  — secondary title abaixo do título do hero
     · .news-v2-hero-meta       — autor + reading time no squircle
     · .news-v2-filters         — barra de filtros sticky
     · .news-v2-chip            — botão de filtro (pill)
     · .news-v2-search          — busca inline
     · .news-v2-grid            — grid de 6 cards
     · .news-v2-card            — card v2 (com categoria + autor + reading time)
     · .news-v2-loadmore        — botão "carregar mais"
     · .news-v2-skeleton        — placeholder de carregamento
     · .news-v2-bottomsheet     — sheet mobile de filtros
     · .news-v2-empty           — empty state
   Paleta: envelope #3e1e09, conteúdo #faf6f0, cards #fff, acento #d35400.
   Acessibilidade: WCAG 2.5.5 (44px touch), aria-live, focus-visible.
   ========================================================= */

/* --- WRAPPER CREME --- */
.news-v2-wrapper {
    background-color: #faf6f0;
    position: relative;
    z-index: 1;
    padding-bottom: 80px;
    /* padding-top padrão: cobre o header flutuante (position: absolute,
       height: 100px, z-index: 999). Sem isso, o conteúdo fica ATRÁS do header.
       QUANDO HÁ HERO: o wrapper ganha a classe .has-hero (via PHP) e o
       padding-top é zerado — o hero começa no topo da viewport, full-bleed,
       com o header transparente flutuando sobre ele (igual à home). */
    padding-top: calc(100px + env(safe-area-inset-top));
}
/* QUANDO HÁ HERO DESTAQUE: padding-top = 0 (hero full-bleed, header flutua sobre) */
.news-v2-wrapper.has-hero {
    padding-top: 0;
}
@media (max-width: 900px) {
    .news-v2-wrapper {
        padding-top: calc(80px + env(safe-area-inset-top));
    }
    .news-v2-wrapper.has-hero {
        padding-top: 0;
    }
}

/* --- HERO DESTAQUE ESTÁTICO (sem Swiper) --- */
/* Hero moderno: imagem full-bleed de fundo + squircle branco flutuante
   com o conteúdo (tag, título, preview, CTA, autor + reading time).
   Não depende de .hero-slider-container nem de Swiper.js.
   A imagem cobre toda a área do hero via object-fit: cover — sem gap cinza. */
.news-v2-hero {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 520px;
    max-height: 720px;
    overflow: hidden;
    background-color: #3e1e09; /* fallback enquanto a imagem carrega — sem cinza escuro */
    z-index: 2;
}
@media (max-width: 768px) {
    .news-v2-hero {
        height: 60vh;
        min-height: 440px;
    }
}

/* Imagem full-bleed (link clicável) */
.news-v2-hero__bg {
    position: absolute;
    inset: 0;
    display: block;
    text-decoration: none;
    z-index: 1;
}
.news-v2-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 8s ease;
}
.news-v2-hero__bg:hover .news-v2-hero__img {
    transform: scale(1.03);
}

/* Overlay gradiente para legibilidade do squircle */
.news-v2-hero__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 60%, rgba(0,0,0,0.55) 100%),
        radial-gradient(ellipse 60% 70% at 50% 80%, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 35%, rgba(0,0,0,0) 75%);
    pointer-events: none;
}

/* Pílula de data no canto inferior esquerdo */
.news-v2-hero__date {
    position: absolute;
    bottom: 20px;
    left: 24px;
    z-index: 3;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Squircle branco flutuante com o conteúdo */
.news-v2-hero__squircle {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(50%);
    z-index: 4;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 22px;
    padding: 26px 32px 22px 32px;
    max-width: 720px;
    width: calc(100% - 60px);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
}
@media (max-width: 768px) {
    .news-v2-hero__squircle {
        padding: 18px 20px 16px 20px;
        border-radius: 18px;
        width: calc(100% - 32px);
        transform: translateX(-50%) translateY(40%);
    }
}

/* Tag (categoria) — barra laranja + label uppercase */
.news-v2-hero__tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: #d35400;
    margin-bottom: 14px;
}
.news-v2-hero__tag::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 14px;
    background-color: #d35400;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Título do hero */
.news-v2-hero__title {
    font-size: 24px;
    line-height: 1.25;
    color: #5a2800;
    margin: 0 0 14px 0;
    font-weight: 800;
    letter-spacing: -0.3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.news-v2-hero__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}
.news-v2-hero__title a:hover {
    color: #d35400;
}
@media (max-width: 768px) {
    .news-v2-hero__title {
        font-size: 19px;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        margin-bottom: 10px;
    }
}

/* Secondary title (subtítulo via Secondary Title plugin) */
.news-v2-hero__secondary {
    font-size: 15px;
    color: #d35400;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px 0;
}

/* Preview (subtítulo ACF ou excerpt aparado) */
.news-v2-hero__preview {
    font-size: 14px;
    line-height: 1.55;
    color: #555;
    margin: 0 0 18px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 768px) {
    .news-v2-hero__preview {
        font-size: 13px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
}

/* CTA "Ler matéria" */
.news-v2-hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #5a2800;
    text-decoration: none;
    padding: 8px 16px;
    border: 2px solid #5a2800;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}
.news-v2-hero__cta:hover {
    background: #d35400;
    border-color: #d35400;
    color: #fff;
    transform: translateX(3px);
}

/* Meta (autor + avatar + reading time) — no rodapé do squircle */
.news-v2-hero__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #f0e6d8;
    font-size: 13px;
    color: #8a7866;
    flex-wrap: wrap;
}
.news-v2-hero__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.news-v2-hero__author {
    color: #5a2800;
    font-weight: 600;
}
.news-v2-hero__reading {
    color: #8a7866;
}

/* --- BARRA DE FILTROS (sticky desktop) --- */
.news-v2-filters {
    background-color: #faf6f0;
    border-bottom: 1px solid #ecd9bf;
    position: sticky;
    /* top: 0 faria o filter bar grudar no topo da viewport, ATRÁS do header
       (z-index 999 > 50). Como o header é position:absolute (scrolla junto
       com a página), o filter bar precisa grudar numa posição que NÃO
       coincida com a do header. top: 0 é seguro APENAS quando o header já
       scrollou para fora. Para garantir que NUNCA fique atrás do header,
       mantemos top: 0 (quando o header scrolla, o filter bar gruda no topo
       vazio). O padding-top do wrapper já garante a posição inicial correta. */
    top: 0;
    z-index: 50;
    padding: 16px 0;
}
.news-v2-filters-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.news-v2-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}
.news-v2-chip {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    min-height: 36px;
    border-radius: 100px;
    background: #ffffff;
    color: #5a2800;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid #ecd9bf;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
}
.news-v2-chip:hover,
.news-v2-chip:focus-visible {
    background: #fff3e0;
    border-color: #d35400;
    color: #d35400;
    outline: none;
}
.news-v2-chip.is-active {
    background: #3e1e09;
    color: #ffffff;
    border-color: #3e1e09;
}
.news-v2-chip.is-active:hover,
.news-v2-chip.is-active:focus-visible {
    background: #5a2800;
    color: #ffffff;
}

/* --- AÇÕES: ORDENAÇÃO + BUSCA --- */
.news-v2-filters-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.news-v2-sort {
    display: flex;
    align-items: center;
    gap: 6px;
}
.news-v2-sort-label {
    font-size: 12px;
    color: #8a7866;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.news-v2-sort-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: #ffffff;
    color: #5a2800;
    border: 1px solid #ecd9bf;
    border-radius: 100px;
    padding: 10px 32px 10px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    min-height: 36px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a2800' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    transition: border-color 0.2s ease;
}
.news-v2-sort-select:focus-visible {
    outline: none;
    border-color: #d35400;
}

/* --- BUSCA INLINE --- */
.news-v2-search {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #ecd9bf;
    border-radius: 100px;
    padding: 0 16px;
    min-height: 36px;
    transition: border-color 0.2s ease;
}
.news-v2-search:focus-within {
    border-color: #d35400;
}
.news-v2-search svg {
    width: 16px;
    height: 16px;
    color: #8a7866;
    flex-shrink: 0;
    margin-right: 8px;
}
.news-v2-search-input {
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: #5a2800;
    width: 200px;
    outline: none;
}
.news-v2-search-input::placeholder {
    color: #8a7866;
    font-weight: 500;
}

/* --- BOTÃO MOBILE: ABRIR FILTROS --- */
.news-v2-mobile-filter-btn {
    display: none;
    align-items: center;
    gap: 8px;
    background: #3e1e09;
    color: #ffffff;
    border: none;
    border-radius: 100px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer;
    min-height: 36px;
    position: relative;
}
.news-v2-mobile-filter-btn svg {
    width: 16px;
    height: 16px;
}
.news-v2-mobile-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #d35400;
    color: #ffffff;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
}

/* --- GRID DE CARDS --- */
.news-v2-grid-section {
    padding-top: 40px;
}
.news-v2-grid-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.news-v2-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    transition: opacity 0.2s ease;
}
.news-v2-grid[aria-busy="true"] {
    opacity: 0.6;
}

/* --- CARD v2 --- */
.news-v2-card {
    background: #ffffff;
    border: 1px solid #ecd9bf;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(62, 30, 9, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.news-v2-card:hover,
.news-v2-card:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(62, 30, 9, 0.12);
    border-color: #d35400;
}
.news-v2-card__link {
    display: block;
    color: inherit;
    text-decoration: none;
}
.news-v2-card__link:focus-visible {
    outline: none;
}
.news-v2-card__media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #f3ece4;
    overflow: hidden;
}
.news-v2-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}
.news-v2-card:hover .news-v2-card__img,
.news-v2-card:focus-within .news-v2-card__img {
    transform: scale(1.05);
}
.news-v2-card__cat {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #d35400;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 5px 12px;
    border-radius: 100px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(211, 84, 0, 0.92);
    max-width: calc(100% - 90px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.news-v2-card__time {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(62, 30, 9, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 100px;
}
.news-v2-card__time svg {
    width: 11px;
    height: 11px;
}
.news-v2-card__body {
    padding: 22px 24px 20px 24px;
}
.news-v2-card__title {
    font-size: 18px;
    line-height: 1.3;
    color: #2a1a0a;
    font-weight: 800;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}
.news-v2-card:hover .news-v2-card__title,
.news-v2-card:focus-within .news-v2-card__title {
    color: #d35400;
}
.news-v2-card__excerpt {
    font-size: 14px;
    line-height: 1.55;
    color: #6b5640;
    margin: 0 0 18px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.news-v2-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #8a7866;
    flex-wrap: wrap;
}
.news-v2-card__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.news-v2-card__author {
    font-weight: 700;
    color: #5a2800;
}
.news-v2-card__dot {
    opacity: 0.5;
}
.news-v2-card__date {
    font-weight: 500;
}

/* --- PAGINAÇÃO HÍBRIDA --- */
.news-v2-pagination {
    margin-top: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}
.news-v2-loadmore {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    color: #5a2800;
    border: 2px solid #5a2800;
    border-radius: 100px;
    padding: 14px 32px;
    min-height: 44px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
}
.news-v2-loadmore:hover,
.news-v2-loadmore:focus-visible {
    background: #d35400;
    color: #ffffff;
    border-color: #d35400;
    outline: none;
    transform: translateY(-2px);
}
.news-v2-loadmore:active {
    transform: translateY(0);
}
.news-v2-loadmore[hidden] {
    display: none;
}
.news-v2-loadmore svg {
    width: 16px;
    height: 16px;
    transition: transform 0.25s ease;
}
.news-v2-loadmore:hover svg {
    transform: translateY(2px);
}

/* --- SKELETON LOADERS --- */
.news-v2-skeletons {
    display: contents;
}
.news-v2-card--skeleton {
    pointer-events: none;
}
.news-v2-skeleton-img,
.news-v2-skeleton-line {
    background: linear-gradient(90deg, #f3ece4 25%, #faf6f0 50%, #f3ece4 75%);
    background-size: 200% 100%;
    animation: news-v2-skeleton-shimmer 1.4s ease-in-out infinite;
}
.news-v2-skeleton-img {
    width: 100%;
    aspect-ratio: 16 / 9;
}
.news-v2-skeleton-line {
    height: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
}
.news-v2-skeleton-line--title {
    height: 22px;
    width: 80%;
    margin-bottom: 16px;
}
.news-v2-skeleton-line--meta {
    width: 50%;
    margin-bottom: 0;
}
@keyframes news-v2-skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .news-v2-skeleton-img,
    .news-v2-skeleton-line {
        animation: none;
        background: #f3ece4;
    }
}

/* --- NUMERIC PAGER (fallback) --- */
.news-v2-pager {
    text-align: center;
}
.news-v2-pager .page-numbers {
    display: inline-block;
    padding: 10px 16px;
    min-height: 44px;
    min-width: 44px;
    line-height: 24px;
    background: #ffffff;
    color: #5a2800;
    border: 1px solid #ecd9bf;
    border-radius: 8px;
    margin: 0 3px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.news-v2-pager .page-numbers:hover,
.news-v2-pager .page-numbers:focus-visible {
    background: #fff3e0;
    border-color: #d35400;
    color: #d35400;
    outline: none;
}
.news-v2-pager .page-numbers.current {
    background: #5a2800;
    color: #ffffff;
    border-color: #5a2800;
}
.news-v2-pager .page-numbers.dots {
    background: transparent;
    border: none;
    color: #8a7866;
}

/* --- EMPTY STATE --- */
.news-v2-empty {
    text-align: center;
    padding: 80px 20px;
    max-width: 600px;
    margin: 0 auto;
}
/* Variante inline — quando o empty state é injetado dentro do grid via AJAX */
.news-v2-empty--inline {
    padding: 60px 20px;
    max-width: 100%;
}
.news-v2-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: #fff3e0;
    color: #d35400;
    border-radius: 50%;
    margin-bottom: 24px;
}
.news-v2-empty__icon svg {
    width: 36px;
    height: 36px;
}
.news-v2-empty__title {
    font-size: 24px;
    color: #5a2800;
    margin: 0 0 12px 0;
    font-weight: 800;
}
.news-v2-empty__text {
    font-size: 15px;
    color: #6b5640;
    line-height: 1.6;
    margin: 0 0 28px 0;
}
.news-v2-empty__suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.news-v2-empty__chip {
    display: inline-block;
    padding: 10px 18px;
    background: #ffffff;
    color: #5a2800;
    border: 1px solid #ecd9bf;
    border-radius: 100px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    min-height: 36px;
    line-height: 16px;
}
.news-v2-empty__chip:hover,
.news-v2-empty__chip:focus-visible {
    background: #fff3e0;
    border-color: #d35400;
    color: #d35400;
    outline: none;
}

/* --- BOTTOM SHEET MOBILE --- */
.news-v2-bottomsheet {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.news-v2-bottomsheet[hidden] {
    display: none;
}
.news-v2-bottomsheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}
.news-v2-bottomsheet.is-open .news-v2-bottomsheet__backdrop {
    background: rgba(0, 0, 0, 0.5);
}
.news-v2-bottomsheet__panel {
    position: relative;
    background: #faf6f0;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
.news-v2-bottomsheet.is-open .news-v2-bottomsheet__panel {
    transform: translateY(0);
}
.news-v2-bottomsheet__handle {
    width: 40px;
    height: 4px;
    background: #d35400;
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
}
.news-v2-bottomsheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #ecd9bf;
    flex-shrink: 0;
}
.news-v2-bottomsheet__title {
    font-size: 20px;
    color: #5a2800;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.news-v2-bottomsheet__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: #5a2800;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s ease;
}
.news-v2-bottomsheet__close:hover,
.news-v2-bottomsheet__close:focus-visible {
    background: rgba(211, 84, 0, 0.12);
    color: #d35400;
    outline: none;
}
.news-v2-bottomsheet__close svg {
    width: 22px;
    height: 22px;
}
.news-v2-bottomsheet__body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}
.news-v2-filter-group {
    margin-bottom: 28px;
}
.news-v2-filter-group:last-child {
    margin-bottom: 0;
}
.news-v2-filter-group__title {
    font-size: 14px;
    color: #8a7866;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 14px 0;
}
.news-v2-filter-group__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.news-v2-filter-group__chips .news-v2-chip {
    min-height: 44px;
    padding: 12px 20px;
    font-size: 14px;
}
.news-v2-bottomsheet__footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #ecd9bf;
    background: #ffffff;
    flex-shrink: 0;
}
.news-v2-bottomsheet__reset {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #5a2800;
    border: 2px solid #ecd9bf;
    border-radius: 100px;
    padding: 14px 20px;
    min-height: 44px;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.news-v2-bottomsheet__reset:hover,
.news-v2-bottomsheet__reset:focus-visible {
    background: #fff3e0;
    border-color: #d35400;
    color: #d35400;
    outline: none;
}
.news-v2-bottomsheet__apply {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #5a2800;
    color: #ffffff;
    border: none;
    border-radius: 100px;
    padding: 14px 20px;
    min-height: 44px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.news-v2-bottomsheet__apply:hover,
.news-v2-bottomsheet__apply:focus-visible {
    background: #d35400;
    outline: none;
}

/* =========================================================
   RESPONSIVO — NEWS v2
   ========================================================= */

@media (max-width: 900px) {
    .news-v2-filters-inner {
        gap: 12px;
    }
    .news-v2-chips {
        display: none; /* esconde chips inline no mobile — usam bottom sheet */
    }
    .news-v2-mobile-filter-btn {
        display: inline-flex;
        flex: 1;
        justify-content: center;
    }
    .news-v2-sort {
        display: none; /* mobile usa bottom sheet para tudo */
    }
    .news-v2-search {
        flex: 1;
    }
    .news-v2-search-input {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .news-v2-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .news-v2-card__body {
        padding: 18px 20px 16px 20px;
    }
    .news-v2-card__title {
        font-size: 17px;
    }
    .news-v2-card__excerpt {
        font-size: 13px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
    .news-v2-empty {
        padding: 60px 20px;
    }
    .news-v2-empty__title {
        font-size: 20px;
    }
    /* Hero squircle vira full-width no mobile */
    .news-v2-hero .hero-content-pane {
        padding: 90px 16px 65px 16px;
    }
}

@media (max-width: 480px) {
    .news-v2-grid-container {
        padding: 0 16px;
    }
    .news-v2-filters-inner {
        padding: 0 16px;
    }
    .news-v2-mobile-filter-btn {
        font-size: 12px;
        padding: 10px 14px;
    }
}

/* --- ACESSIBILIDADE: focus tratado pela regra global --- */
.news-v2-chip:focus-visible,
.news-v2-sort-select:focus-visible,
.news-v2-loadmore:focus-visible,
.news-v2-mobile-filter-btn:focus-visible,
.news-v2-bottomsheet__close:focus-visible,
.news-v2-bottomsheet__apply:focus-visible,
.news-v2-empty__chip:focus-visible {
    outline: none;
}

/* --- REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
    .news-v2-card,
    .news-v2-card__img,
    .news-v2-loadmore,
    .news-v2-loadmore svg,
    .news-v2-bottomsheet__panel,
    .news-v2-bottomsheet__backdrop,
    .news-v2-skeleton-img,
    .news-v2-skeleton-line {
        transition: none !important;
        animation: none !important;
    }
    .news-v2-card:hover .news-v2-card__img {
        transform: none;
    }
}

/* --- SCREEN READER TEXT (fallback se não houver classe global) --- */
.news-v2-pager .screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}



/* =========================================================
   DB BUILDER — Estilos do programa de banco de dados
   ========================================================= */

/* === Mobile blocker (telefones) ===
   Em telas < 768px mostra um aviso fullscreen e esconde o app.
   Tablets (>= 768px) e desktops funcionam normalmente. */
.db-mobile-blocker {
    display: none; /* escondido por padrão */
}
@media (max-width: 767px) {
    body.page-template-page-db-builder {
        overflow: hidden;
        height: 100vh;
    }
    .db-mobile-blocker {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 99999;
        background: linear-gradient(135deg, #3e1e09 0%, #5a2800 100%);
        align-items: center;
        justify-content: center;
        padding: 24px;
    }
    .db-mobile-blocker-card {
        background: #fff;
        border-radius: 20px;
        padding: 40px 28px;
        max-width: 360px;
        width: 100%;
        text-align: center;
        box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    }
    .db-mobile-blocker-card svg {
        width: 64px;
        height: 64px;
        color: #d35400;
        margin: 0 auto 20px;
        display: block;
    }
    .db-mobile-blocker-card h2 {
        font-size: 22px;
        font-weight: 800;
        color: #2c1a0a;
        margin: 0 0 16px;
    }
    .db-mobile-blocker-card p {
        font-size: 14px;
        line-height: 1.6;
        color: #5a2800;
        margin: 0 0 14px;
    }
    .db-mobile-blocker-card p strong {
        color: #2c1a0a;
    }
    .db-mobile-blocker-btn {
        display: inline-block;
        margin-top: 16px;
        padding: 12px 28px;
        background: #d35400;
        color: #fff !important;
        text-decoration: none;
        border-radius: 10px;
        font-weight: 700;
        font-size: 15px;
        transition: background 0.2s;
    }
    .db-mobile-blocker-btn:hover {
        background: #b04600;
    }
    /* Esconde o app inteiro em telefones */
    .db-builder-app {
        display: none !important;
    }
}

/* === Reset para a página do DB Builder === */
body.page-template-page-db-builder {
    background: #f5f3f0;
    overflow-x: hidden;
}

/* === Container do app === */
.db-builder-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f5f3f0;
}

/* === Reset: esconde o header do tema nesta página (mas mantém o footer visível) ===
   Importante: esconde TODOS os elementos do header do tema — header principal,
   nav desktop, mobile menu wrapper, search modal, cookie banner. Caso contrário,
   em tablets (<= 950px) o mobile-menu-wrapper com position:fixed e z-index:10000
   aparecia por cima do header do DB Builder. */
body.page-template-page-db-builder header[role="banner"],
body.page-template-page-db-builder header[role="banner"] *,
body.page-template-page-db-builder .desktop-pilula,
body.page-template-page-db-builder .mobile-menu-wrapper,
body.page-template-page-db-builder .nupep-search-modal,
body.page-template-page-db-builder .nupep-cookie-banner,
body.page-template-page-db-builder .nupep-skip-link {
    display: none !important;
}

/* === Header do app (substitui o header do tema) === */
:root { --db-header-h: 100px; }
.db-builder-header {
    background: #3e1e09 !important;
    background-color: #3e1e09 !important;
    color: #fff;
    padding: 0;
    position: sticky !important;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 18px rgba(0,0,0,0.22);
    height: var(--db-header-h);
    flex-shrink: 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
/* Admin bar do WP: 32px em telas > 782px, 46px em ≤ 782px.
   Sem este offset, o header sticky ficaria escondido atrás da barra. */
body.admin-bar .db-builder-header { top: 32px; }
@media screen and (max-width: 782px) {
    body.admin-bar .db-builder-header { top: 46px; }
}
.db-builder-header-inner {
    max-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
}
.db-builder-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
}
.db-builder-logo svg {
    width: 26px;
    height: 26px;
    color: #d35400;
    flex-shrink: 0;
}
.db-builder-logo-text {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.3px;
    color: #fff;
}
.db-builder-logo:hover .db-builder-logo-text { color: #f5b27a; }
.db-builder-logo:hover svg { color: #f5b27a; }

.db-builder-nav {
    display: flex;
    gap: 4px;
}
.db-builder-nav a {
    color: rgba(255,255,255,0.72);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    transition: color 0.18s, background 0.18s;
}
.db-builder-nav a:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}
.db-builder-nav a:focus-visible {
    outline: 2px solid #d35400;
    outline-offset: 2px;
}

/* === Menu do usuário (avatar + dropdown) === */
.db-user-menu {
    position: relative;
    flex-shrink: 0;
    margin-left: auto; /* empurra o avatar para a extrema direita */
}
.db-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d35400 0%, #b04600 100%);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.18);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    font-family: inherit;
}
.db-user-avatar:hover {
    transform: scale(1.06);
    border-color: rgba(255,255,255,0.5);
    box-shadow: 0 4px 12px rgba(211,84,0,0.45);
}
.db-user-avatar:focus-visible {
    outline: 2px solid #f5b27a;
    outline-offset: 2px;
}
.db-user-avatar[aria-expanded="true"] {
    border-color: #f5b27a;
    box-shadow: 0 4px 12px rgba(245,178,122,0.5);
}
.db-user-initials {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    user-select: none;
}

.db-user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 240px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    z-index: 1100;
    border: 1px solid rgba(0,0,0,0.04);
}
.db-user-dropdown[hidden] { display: none; }
.db-user-info {
    padding: 16px 18px 14px;
    border-bottom: 1px solid #f0ebe0;
    background: linear-gradient(180deg, #fff7ef 0%, #fff 100%);
}
.db-user-name {
    font-size: 14px;
    font-weight: 700;
    color: #2c1a0a;
    line-height: 1.3;
    word-break: break-word;
}
.db-user-email {
    font-size: 12px;
    color: #8a7866;
    margin-top: 3px;
    word-break: break-all;
}
.db-user-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    color: #c0392b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}
.db-user-logout svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.db-user-logout:hover {
    background: #fdf2f0;
    color: #a5281b;
}
.db-user-logout:focus-visible {
    outline: 2px solid #d35400;
    outline-offset: -2px;
}

/* === Layout === */
.db-builder-layout {
    flex: 1;
    display: flex;
    align-items: flex-start;
    padding-left: 280px; /* espaço para a sidebar fixa */
}

/* === Sidebar ===
   position: fixed em vez de sticky: a sidebar fica fixa na lateral
   da viewport, com seu próprio scroll vertical independente do
   body. Assim ela nunca desliza para baixo do header. */
.db-builder-sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid #e0dad0;
    padding: 16px;
    position: fixed;
    top: var(--db-header-h);
    left: 0;
    height: calc(100vh - var(--db-header-h));
    overflow-y: auto;
    z-index: 900; /* abaixo do header (1000) */
}
body.admin-bar .db-builder-sidebar {
    top: calc(32px + var(--db-header-h));
    height: calc(100vh - 32px - var(--db-header-h));
}
@media screen and (max-width: 782px) {
    body.admin-bar .db-builder-sidebar {
        top: calc(46px + var(--db-header-h));
        height: calc(100vh - 46px - var(--db-header-h));
    }
}
.db-builder-new-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #d35400;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 16px;
}
.db-builder-new-btn:hover { background: #b04600; }
.db-builder-new-btn svg { width: 18px; height: 18px; }

.db-builder-trabalhos-list { display: flex; flex-direction: column; gap: 8px; }
.db-builder-loading-list, .db-builder-empty-list {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}
.db-trabalho-item {
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
}
.db-trabalho-item:hover { background: #faf6f0; }
.db-trabalho-item.is-active { background: #fff3e0; border-color: #d35400; }
.db-trabalho-item-title {
    font-size: 14px;
    font-weight: 700;
    color: #2c1a0a;
    margin-bottom: 4px;
}
.db-trabalho-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #8a7866;
    flex-wrap: wrap;
}
.db-trabalho-badge-finalized {
    background: #4a7857;
    color: #fff;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
}
.db-trabalho-author {
    font-size: 11px;
    color: #8a7866;
    font-style: italic;
}
.db-trabalho-author::before {
    content: 'por ';
}

/* === Main === */
.db-builder-main {
    flex: 1;
    padding: 24px;
    min-width: 0; /* evita overflow horizontal do filho (tabela larga) */
}

/* === Empty state === */
.db-builder-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #999;
}
.db-builder-empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; }
.db-builder-empty-state h2 { font-size: 22px; color: #5a2800; margin: 0 0 8px; }
.db-builder-empty-state p { font-size: 15px; max-width: 400px; }

/* === Workspace === */
.db-builder-workspace { display: flex; flex-direction: column; gap: 0; }
.db-workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.db-workspace-title {
    flex: 1;
    font-size: 24px;
    font-weight: 800;
    color: #2c1a0a;
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    padding: 4px 0;
    min-width: 200px;
    transition: border-color 0.2s;
}
.db-workspace-title:focus { border-bottom-color: #d35400; }
.db-workspace-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.db-save-status { font-size: 12px; color: #8a7866; min-width: 60px; }

/* === Buttons === */
.db-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
    font-family: inherit;
}
.db-btn svg { width: 16px; height: 16px; }
.db-btn-sm { padding: 6px 12px; font-size: 12px; }
.db-btn-primary { background: #d35400; color: #fff; }
.db-btn-primary:hover { background: #b04600; }
.db-btn-secondary { background: #e0dad0; color: #5a2800; }
.db-btn-secondary:hover { background: #d0c8b8; }
.db-btn-export { background: #4a7857; color: #fff; }
.db-btn-export:hover { background: #3a6847; }
.db-btn-idem { background: #8e6fa3; color: #fff; }
.db-btn-idem:hover { background: #6b4f80; }
.db-btn-save { background: #d35400; color: #fff; }
.db-btn-save:hover { background: #b04600; }
.db-btn-finalize { background: #5a2800; color: #fff; }
.db-btn-finalize:hover { background: #3e1e09; }
.db-btn-delete { background: transparent; color: #c0392b; border: 1px solid #e74c3c; }
.db-btn-delete:hover { background: #c0392b; color: #fff; }
.db-btn-outline { background: transparent; color: #5a2800; border: 1px solid #d0c8b8; }
.db-btn-outline:hover { background: #faf6f0; border-color: #d35400; color: #d35400; }
.db-btn-danger-outline { background: transparent; color: #c0392b; border: 1px solid #e74c3c; }
.db-btn-danger-outline:hover { background: #fdf2f0; }

/* === Category tabs === */
.db-category-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    flex-wrap: wrap;
    border-bottom: 2px solid #e0dad0;
}
.db-cat-tab {
    padding: 10px 18px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    font-weight: 700;
    color: #8a7866;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -2px;
    font-family: inherit;
}
.db-cat-tab:hover { color: #5a2800; }
.db-cat-tab.is-active { color: #d35400; border-bottom-color: #d35400; }
.db-cat-tab-add {
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: #b89c80;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
}
.db-cat-tab-add:hover { color: #d35400; }

/* === Category content === */
.db-category-content { padding-top: 20px; }
.db-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.db-cat-name-input {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
    color: #2c1a0a;
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    padding: 4px 0;
    min-width: 150px;
}
.db-cat-name-input:focus { border-bottom-color: #d35400; }
.db-cat-name-input:disabled { color: #5a2800; }
.db-cat-count {
    font-size: 13px;
    color: #8a7866;
    background: #faf6f0;
    padding: 4px 12px;
    border-radius: 100px;
}
.db-category-empty, .db-no-columns {
    text-align: center;
    padding: 40px;
    color: #8a7866;
    font-size: 15px;
}

/* === Data table === */
.db-table-wrapper {
    overflow-x: auto;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e0dad0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.db-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.db-data-table th {
    background: #faf6f0;
    border-bottom: 2px solid #e0dad0;
    padding: 10px 12px;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 1;
}
.db-data-table td {
    border-bottom: 1px solid #f0ebe0;
    padding: 0;
}
.db-data-table tr:last-child td { border-bottom: none; }
.db-data-table tr:hover { background: #fdfaf6; }
.db-col-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.db-col-name {
    font-weight: 700;
    color: #5a2800;
    cursor: pointer;
    font-size: 13px;
}
.db-col-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.2s; }
th:hover .db-col-actions { opacity: 1; }
.db-col-move, .db-col-del {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 11px;
    padding: 4px;
    color: #8a7866;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}
.db-col-move:hover { background: #fff3e0; color: #d35400; }
.db-col-del:hover { background: #fdf2f0; color: #c0392b; }
.db-cell-input {
    width: 100%;
    border: none;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    background: transparent;
    color: #2c1a0a;
}
.db-cell-input:focus { background: #fff3e0; }

/* === Coluna de ações da linha === */
.db-row-actions-col {
    width: 190px; /* espaço para 5 botões: ↑ ↓ + ─ ✕ */
    text-align: center;
    white-space: nowrap;
    padding: 4px 6px !important;
}
.db-row-act {
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    color: #8a7866;
    font-size: 14px;
    font-weight: 700;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    padding: 0;
    margin: 0 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1;
}
.db-row-act:hover:not(:disabled) {
    background: #faf6f0;
    border-color: #d0c8b8;
    color: #5a2800;
}
.db-row-act:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}
.db-row-up:hover:not(:disabled),
.db-row-down:hover:not(:disabled) { color: #d35400; border-color: #d35400; background: #fff3e0; }
.db-row-insert { color: #4a7857; }
.db-row-insert:hover:not(:disabled) { color: #3a6847; border-color: #4a7857; background: #f0f6f2; }
.db-row-divider-insert { color: #8e6fa3; }
.db-row-divider-insert:hover:not(:disabled) { color: #6b4f80; border-color: #8e6fa3; background: #f5f0f8; }
.db-row-del { color: #c0392b; }
.db-row-del:hover:not(:disabled) { color: #fff; background: #c0392b; border-color: #c0392b; }

/* === Divisor de ano (linha full-width) === */
.db-row-divider td {
    background: linear-gradient(90deg, #3e1e09 0%, #5a2800 50%, #3e1e09 100%);
    color: #fff;
    padding: 10px 16px !important;
    border-bottom: 2px solid #d35400 !important;
    border-top: 2px solid #d35400 !important;
}
.db-divider-label {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: text;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    user-select: text;
}
.db-divider-label:hover { background: rgba(255,255,255,0.12); }
.db-divider-label:focus { outline: 2px solid #d35400; outline-offset: 2px; background: rgba(211,84,0,0.2); }
.db-divider-actions {
    display: inline-flex;
    gap: 2px;
    float: right;
}
.db-divider-edit-input {
    font-size: 15px;
    font-weight: 800;
    padding: 2px 8px;
    border: 2px solid #d35400;
    border-radius: 4px;
    background: #fff;
    color: #3e1e09;
    font-family: inherit;
}

/* === Modal Distribuir por anos === */
.db-distribute-fields {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.db-distribute-field {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.db-distribute-field span {
    font-size: 12px;
    font-weight: 700;
    color: #5a2800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.db-distribute-field .db-modal-input {
    margin-bottom: 0;
}

/* === Modals === */
.db-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.db-modal[hidden] { display: none; }
.db-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}
.db-modal-card {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    max-height: 85vh;
    overflow-y: auto;
}
.db-modal-card-wide { max-width: 680px; }
.db-modal-card h3 {
    font-size: 20px;
    font-weight: 800;
    color: #2c1a0a;
    margin: 0 0 20px;
}
.db-modal-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d0c8b8;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: #2c1a0a;
    margin-bottom: 20px;
    box-sizing: border-box;
}
.db-modal-input:focus { border-color: #d35400; }
.db-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* === Import === */
.db-import-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid #e0dad0; }
.db-import-tab {
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    font-weight: 700;
    color: #8a7866;
    cursor: pointer;
    font-family: inherit;
}
.db-import-tab.is-active { color: #d35400; border-bottom-color: #d35400; }
.db-import-pane { display: none; }
.db-import-pane.is-active { display: block; }
.db-import-hint { font-size: 13px; color: #8a7866; margin: 0 0 12px; }
.db-paste-area {
    width: 100%;
    min-height: 180px;
    padding: 12px;
    border: 1px solid #d0c8b8;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    box-sizing: border-box;
}
.db-paste-area:focus { border-color: #d35400; }
.db-file-input {
    width: 100%;
    padding: 12px;
    border: 2px dashed #d0c8b8;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    box-sizing: border-box;
}
.db-file-info { margin-top: 8px; font-size: 13px; color: #4a7857; font-weight: 600; }
.db-import-mapping { margin-top: 20px; padding-top: 16px; border-top: 1px solid #e0dad0; }
.db-import-mapping h4 { font-size: 16px; color: #2c1a0a; margin: 0 0 8px; }
.db-mapping-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0ebe0;
}
.db-mapping-source { font-size: 13px; color: #5a2800; }
.db-mapping-select {
    padding: 6px 10px;
    border: 1px solid #d0c8b8;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: #2c1a0a;
}

/* === Responsive: tablets (768px - 1023px) ===
   Em tablets, reduz a altura do header e a largura da sidebar para
   aproveitar melhor a tela. Esconde a nav do app (Tablets têm espaço
   limitado e a nav não é essencial aqui). */
@media (max-width: 1023px) {
    :root { --db-header-h: 64px; }
    .db-builder-header { box-shadow: 0 4px 14px rgba(0,0,0,0.25); }
    .db-builder-header-inner { padding: 0 16px; gap: 14px; }
    .db-builder-logo svg { width: 22px; height: 22px; }
    .db-builder-logo-text { font-size: 15px; }
    .db-builder-nav { display: none; } /* nav escondida em tablets */
    .db-user-avatar { width: 34px; height: 34px; }
    .db-user-initials { font-size: 13px; }

    .db-builder-sidebar {
        width: 220px;
    }
    .db-builder-layout {
        padding-left: 220px;
    }
    .db-builder-main { padding: 18px; }
    .db-workspace-header { flex-wrap: wrap; gap: 10px; }
    .db-workspace-title { font-size: 20px; min-width: 100%; }
    .db-workspace-actions { width: 100%; justify-content: flex-start; }
    .db-data-table { font-size: 13px; }
    .db-cell-input { padding: 6px 8px; font-size: 13px; }
    .db-row-actions-col { width: 160px; }
    .db-row-act { width: 24px; height: 24px; font-size: 12px; }
}

/* === Telas muito pequenas (< 768px): bloqueadas pelo mobile-blocker ===
   Mas se o JS falhar ou o CSS não carregar, ainda assim o layout
   degrada graciosamente. */
@media (max-width: 767px) {
    :root { --db-header-h: 54px; }
    .db-builder-sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e0dad0;
    }
    .db-builder-layout {
        padding-left: 0;
        flex-direction: column;
    }
    .db-user-dropdown { min-width: 220px; right: -8px; }
}
