/* ── Onda revisão UX (segunda iteração) ───────────────────────────
   - Navbar unificado (Funcap + Vitrine no mesmo bloco, sticky).
   - Peso do menu mais leve (semibold em vez de bold extra).
   - Search bar pílula + ícone verde.
   - Header icon buttons: theme toggle + a11y toolbar.
   - Hero scroll-down arrow visível com bob animation.
   - Dark mode total.
   Carrega DEPOIS do header.css para sobrescrever o legado.
   ─────────────────────────────────────────────────────────────── */

/* ── Navbar unificado e sticky (proporcional) ─────────────────── */
.navbar.navbar-unified {
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: 9px 0 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease, padding 0.2s ease;
    min-height: 66px;
    /* Mobile: navbar sólido (em desktop o gradient da header.css se aplica) */
}
@media (max-width: 768px) {
    .navbar.navbar-unified {
        background: #20764b !important;
        background-image: none !important;
    }
}
.navbar.navbar-unified.is-scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    padding: 6px 0 !important;
    min-height: 58px;
}
.navbar.navbar-unified .navbar-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.navbar-logos {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
}
.brand-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.brand-logo {
    height: 34px;
    width: auto;
    display: block;
    object-fit: contain;
}
.brand-divider {
    display: inline-block;
    width: 1px;
    height: 27px;
    background: rgba(255, 255, 255, 0.35);
}

/* Hide the legacy ".topo" since it's been merged into the unified navbar */
.topo { display: none; }

/* ── Itens do menu: peso semibold, respiro, wrap em 2 linhas ──── */
.navW.nav {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
    align-items: stretch;
    margin: 0;
    padding: 0;
    list-style: none;
}
.navW.nav .nav-li {
    color: #ffffff;
    background: transparent;
    transition: background 0.18s ease, color 0.18s ease;
    border-radius: 6px;
    padding: 7px 13px !important;
    max-width: 145px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 48px;
}
.navW.nav .nav-li .nav-inner {
    font-weight: 500;
    letter-spacing: 0.1px;
    color: #ffffff;
    cursor: pointer;
    user-select: none;
    line-height: 1.2;
    text-align: center;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: auto;
    font-size: 1.04rem;
    display: inline-block;
    /* Override any 'white-space: nowrap' inherited from legacy nav CSS so
       <br> inside the link actually breaks the line. */
    white-space: normal !important;
}
/* The injected <br> in 'Programa<br>Cientista Chefe' must be visible —
   some browsers collapse <br> in flex children unless display is block. */
.navW.nav .nav-li .nav-inner br { display: block; content: ""; }
.navW.nav .nav-li:hover,
.navW.nav .nav-li:focus-within {
    background-color: rgba(255, 255, 255, 0.14);
}
.navW.nav .nav-li.active .nav-inner {
    font-weight: 600;
}
.navW.nav .nav-li.active {
    background-color: rgba(255, 255, 255, 0.20);
}
.navW.nav .nav-li.nav-l { background: transparent; }
.navW.nav .nav-li.nav-l:hover,
.navW.nav .nav-li.nav-l.active { background-color: rgba(255, 255, 255, 0.20); }
.navW.nav .nav-li .seta {
    margin-left: 6px;
    flex-shrink: 0;
    width: 13px !important;
    height: 13px !important;
    opacity: 0.85;
}

/* ── Search bar redesenhada ──────────────────────────────────── */
.div-buscar-midias {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    padding: 4px 4px 4px 16px;
    max-width: 260px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    margin-left: auto;
}
.div-buscar-midias #search,
.div-buscar-midias input[type="search"] {
    flex: 1;
    border: 0 !important;
    background: transparent !important;
    outline: none;
    font-size: 0.92rem;
    color: #1a3447;
    padding: 6px 0;
    min-width: 0;
}
.div-buscar-midias #search::placeholder { color: #6b7787; }
.div-buscar-midias .buscar-midias {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #21774d !important;
    color: #fff !important;
    border: 0;
    border-radius: 999px;
    width: 34px;
    height: 34px;
    padding: 0;
    cursor: pointer;
    transition: background 0.15s ease;
}
.div-buscar-midias .buscar-midias:hover { background: #1a5b3a !important; }
.div-buscar-midias .buscar-midias svg { color: #fff; }

/* ── Header actions: theme + a11y ────────────────────────────── */
.header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex: 0 0 auto;
}
.header-icon-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 0;
    width: 38px;
    height: 38px;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, transform 0.18s ease;
}
.header-icon-btn:hover { background: rgba(255, 255, 255, 0.24); transform: scale(1.06); }
.header-icon-btn:focus-visible { outline: 2px solid #f9931b; outline-offset: 2px; }

/* ── Hero ─────────────────────────────────────────────────────── */

/* Scroll-down arrow: SVG limpa, sem pílula escura nem blur. Animação
   sutil de bob para sinalizar que existe conteúdo abaixo. */
#carouselExampleIndicators .banner-navigation a[href="/#home_ultima_noticias"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border-radius: 0;
    padding: 0;
    margin-top: 8px;
    backdrop-filter: none;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
    transition: transform 0.2s ease, filter 0.2s ease;
    animation: vt-bob 1.8s ease-in-out infinite;
    opacity: 0.95;
}
#carouselExampleIndicators .banner-navigation a[href="/#home_ultima_noticias"]:hover {
    background: transparent !important;
    transform: translateY(3px) scale(1.08);
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
    opacity: 1;
}
#carouselExampleIndicators .banner-navigation a[href="/#home_ultima_noticias"] svg {
    width: 36px;
    height: 36px;
}
@keyframes vt-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(6px); }
}
@media (prefers-reduced-motion: reduce) {
    #carouselExampleIndicators .banner-navigation a[href="/#home_ultima_noticias"] {
        animation: none;
    }
}
html.a11y-reduce-motion #carouselExampleIndicators .banner-navigation a[href="/#home_ultima_noticias"] {
    animation: none;
}

/* Caixa do título do banner: card mais elegante, gradient sutil,
   borda arredondada, sombra suave. Substitui o '.carousel-item-inner > p'
   chapado da banners.css (que tinha bg verde flat com 9px de padding). */
.carousel-item-inner > p {
    background: #21774d !important;
    padding: 16px 22px !important;
    border-radius: 8px;
    border-left: 4px solid #F9931B;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    width: auto !important;
    max-width: 460px;
    line-height: 1.3 !important;
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.2px;
    color: #ffffff !important;
    margin-bottom: 14px !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Botão "VER MAIS" mais polido: gradient, micro-shadow, hover de elevação,
   chevron animado em hover. Texto vem do blade ("VER MAIS"); a seta é
   renderizada via ::after pra ficar elegante e animar. */
.ver_mais_banner {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    width: auto !important;
    height: auto !important;
    padding: 10px 22px !important;
    background: linear-gradient(135deg, #F9931B 0%, #E07A0B 100%) !important;
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 8px;
    font-family: 'Trivia_Gothic_C3_Regular', 'Roboto', sans-serif !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    letter-spacing: 1.4px !important;
    text-transform: uppercase;
    line-height: 1 !important;
    box-shadow: 0 4px 14px rgba(249, 147, 27, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    position: relative;
}
.ver_mais_banner::after {
    content: "→";
    display: inline-block;
    margin-left: 4px;
    transition: transform 0.25s ease;
    font-weight: 400;
    font-size: 1.1em;
    line-height: 1;
}
.ver_mais_banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(249, 147, 27, 0.55),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.ver_mais_banner:hover::after {
    transform: translateX(4px);
}
.ver_mais_banner:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .carousel-item-inner > p {
        font-size: 1.15rem !important;
        padding: 12px 16px !important;
        max-width: 90%;
    }
    .ver_mais_banner {
        padding: 8px 18px !important;
        font-size: 0.85rem !important;
    }
    #carouselExampleIndicators .banner-navigation a[href="/#home_ultima_noticias"] svg {
        width: 30px;
        height: 30px;
    }
}
@media (max-width: 480px) {
    .carousel-item-inner > p {
        font-size: 1rem !important;
        padding: 10px 14px !important;
    }
}

/* ── Dark theme ──────────────────────────────────────────────── */
html.vt-theme-dark { background: #0f1722; color: #e6ebef; }
html.vt-theme-dark body { background: #0f1722; color: #e6ebef; }
html.vt-theme-dark .navbar.navbar-unified {
    background: linear-gradient(90deg, #0e3325 0%, #0f3a4a 100%);
    border-bottom-color: #5a7339;
}
html.vt-theme-dark main { background: #0f1722; }
html.vt-theme-dark .container { color: #e6ebef; }
html.vt-theme-dark .home_info_gerais_titulo,
html.vt-theme-dark .home_ultima_noticias_titulo,
html.vt-theme-dark .titulo_info_quem_somos,
html.vt-theme-dark .site_field_title { color: #b8e0c5 !important; }
html.vt-theme-dark p,
html.vt-theme-dark .texto_info_quem_somos,
html.vt-theme-dark .midias_noticias_conteudo { color: #d0d7de; }
html.vt-theme-dark a { color: #8ed5a8; }
html.vt-theme-dark a:hover { color: #b8e0c5; }
html.vt-theme-dark .div-buscar-midias { background: rgba(255, 255, 255, 0.08); }
html.vt-theme-dark .div-buscar-midias #search { color: #e6ebef; }
html.vt-theme-dark .div-buscar-midias #search::placeholder { color: #9aa5b0; }
html.vt-theme-dark .home_ultima_noticias_capa_item { box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
html.vt-theme-dark footer { background: #07101a; color: #d0d7de; }
html.vt-theme-dark .brand-divider { background: rgba(255, 255, 255, 0.18); }

/* Theme icon swap */
html.vt-theme-dark .theme-icon-sun { display: none; }
html.vt-theme-dark .theme-icon-moon { display: block !important; }
.theme-icon-sun { display: block; }

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .div-buscar-midias { max-width: 220px; }
    .brand-logo { height: 38px; }
    .brand-divider { height: 30px; }
}
@media (max-width: 768px) {
    .navbar.navbar-unified .navbar-inner { gap: 8px; }
    .div-buscar-midias { display: none; } /* search migra pro menu mobile */
    .brand-logo { height: 34px; }
    .brand-divider { display: none; }
}
@media (max-width: 480px) {
    .navbar-logos { gap: 10px; }
    .brand-logo { height: 30px; }
    .header-icon-btn { width: 34px; height: 34px; padding: 6px; }
}

/* ──────────────────────────────────────────────────────────────────────
 * MOBILE DRAWER — comportamento off-canvas + accordions para subitens
 * ────────────────────────────────────────────────────────────────────── */

/* Por padrão (desktop) o drawer fica oculto */
.navM { display: none; }
.menu-MV { display: none; }

@media (max-width: 768px) {
    /* Mostra o conjunto mobile, esconde o desktop. As regras em
     * header.css:334-352 já cuidam dos filhos desktop; aqui reforçamos. */
    .navM {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        flex: 1 1 auto;
        min-width: 0;
    }
    .navbar.navbar-unified .navbar-inner {
        flex-wrap: nowrap;
        gap: 10px;
        align-items: center;
    }

    /* Barra superior fixa: hambúrguer + atalhos */
    .menuM-inner {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
        margin-left: auto;
    }
    .menu-M2,
    .menu-MV {
        background: transparent;
        border: 0;
        padding: 6px;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #ffffff;
    }
    .menu-MV { display: none; }
    .menu-M2 img,
    .menu-MV img { width: 30px; height: 30px; filter: brightness(0) invert(1); }

    .theme-toggle-mobile,
    .acessibility-toggle-mobile {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.10);
        color: #ffffff;
        border: 0;
        border-radius: 50%;
        cursor: pointer;
        padding: 8px;
        transition: background-color 0.2s ease;
    }
    .theme-toggle-mobile:hover,
    .acessibility-toggle-mobile:hover {
        background: rgba(255, 255, 255, 0.20);
    }

    /* Drawer off-canvas — força layout vertical estrito (Bootstrap .nav
     * do projeto adiciona flex-wrap, então sobreescrevemos aqui).
     * Fundo sólido — gradient causava percepção de mudança de cor ao
     * scrollar conteúdo dentro do drawer. */
    .navMB {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: min(86vw, 380px);
        max-width: 380px;
        /* Verde institucional um pouco mais fechado para maximizar
         * contraste com os textos claros do drawer mobile. */
        background: #1f6f4b !important;
        padding: 70px 0 24px;
        margin: 0;
        z-index: 9998;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        box-shadow: -10px 0 32px rgba(0, 0, 0, 0.34), inset 1px 0 0 rgba(255, 255, 255, 0.08);
        list-style: none;
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        gap: 0;
    }
    .navMB.is-open { transform: translateX(0); }
    .navMB > * {
        flex-shrink: 0;
        width: 100%;
        max-width: 100%;
    }

    /* Backdrop como elemento separado pra não causar artefatos no
     * stacking context do drawer */
    body.navMB-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 9997;
        pointer-events: none;
        animation: navMB-fade-in 0.3s ease forwards;
    }
    @keyframes navMB-fade-in {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    body.navMB-open { overflow: hidden; }

    /* Quando aberto, alterna ícones de hambúrguer/X */
    body.navMB-open .menu-M2 { display: none; }
    body.navMB-open .menu-MV {
        display: flex;
        position: fixed;
        top: 14px;
        right: 14px;
        z-index: 9999;
        background: transparent;
        border-radius: 50%;
    }

    /* Busca dentro do drawer — !important pra vencer cascade do
     * .div-buscar-midias legado (que aplicava margin-left negativo,
     * background transparente etc.) */
    .navMB-search.navMB-search {
        display: flex !important;
        align-items: stretch !important;
        margin: 0 18px 22px !important;
        height: 46px !important;
        max-width: none !important;
        width: calc(100% - 36px) !important;
        background: #ffffff !important;
        border: 0 !important;
        border-radius: 10px !important;
        overflow: hidden !important;
        padding: 0 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    }
    .navMB-search input,
    .navMB-search input[type="search"],
    .navMB-search input[type="text"] {
        flex: 1 !important;
        width: auto !important;
        height: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        border: 0 !important;
        padding: 0 14px !important;
        background: transparent !important;
        font-family: 'Trivia_Gothic_C2', 'Roboto', sans-serif !important;
        font-size: 0.95rem !important;
        font-weight: 400 !important;
        line-height: 1 !important;
        color: #1a3447 !important;
        margin: 0 !important;
    }
    .navMB-search input::placeholder { color: #6b7787 !important; opacity: 1 !important; }
    .navMB-search input:focus { outline: 0 !important; }
    .navMB-search .buscar-midias {
        width: 52px !important;
        height: 100% !important;
        flex-shrink: 0 !important;
        background: #f9931b !important;
        color: #ffffff !important;
        border: 0 !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        transition: background-color 0.2s ease;
    }
    .navMB-search .buscar-midias:hover { background: #e07a0b !important; }
    .navMB-search .buscar-midias svg { color: #ffffff !important; }
    .navMB-search .buscar-midias svg path { fill: currentColor !important; }

    /* Lista de itens do menu — coluna estrita */
    .navMB-list {
        list-style: none !important;
        margin: 0;
        padding: 0;
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        width: 100%;
    }
    .navMB-item {
        display: block;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.13);
    }
    .navMB-item:last-child { border-bottom: 0; }

    .navMB-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        padding: 11px 20px;
        background: transparent;
        border: 0;
        color: #ffffff;
        font-family: 'Trivia_Gothic_C2', 'Roboto', sans-serif;
        font-size: 1rem;
        font-weight: 650;
        text-decoration: none;
        text-align: left;
        cursor: pointer;
        transition: background-color 0.2s ease;
        min-height: 44px;
        outline: 0;
    }
    .navMB-link:hover {
        background: rgba(255, 255, 255, 0.12);
        color: #ffffff;
    }
    /* :focus-visible (só keyboard) — :focus puro persistia em touch
     * e iluminava itens aleatoriamente após cada tap, criando a
     * percepção de "cor mudando ao longo do menu" */
    .navMB-link:focus-visible {
        background: rgba(255, 255, 255, 0.14);
        outline: 2px solid #f9931b;
        outline-offset: -2px;
    }
    .navMB-toggle .navMB-chevron {
        transition: transform 0.25s ease;
        flex-shrink: 0;
    }
    .navMB-toggle[aria-expanded="true"] .navMB-chevron {
        transform: rotate(180deg);
    }

    /* ── Hierarquia visual do drawer (tree-style) ───────────────
     * Sem mudar layout: o sub-bloco recebe uma linha vertical na
     * esquerda (tronco) que conecta os 3 níveis, com pequenos
     * "ramos" horizontais e marcadores que tornam claros os níveis:
     *
     *   Programa Cientista Chefe ▼      (nivel 0 — toggle)
     *   │
     *   ├── Sobre o Programa            (nivel 1 — main link)
     *   │
     *   ◆ PESQUISA                      (nivel 2 label — type)
     *     ├ Programa de Saúde           (nivel 2 — programa)
     *     └ Programa de Educação        (nivel 2 — programa)
     *       ◦ Ação Cientista Chefe ...  (nivel 3 — ação fomento)
     */
    /* ── Hierarquia visual EXPLÍCITA do drawer (tree-style) ─────
     * 4 níveis com diferenciação clara:
     *   Nível 0: toggle (Programa Cientista Chefe ▼)
     *   Nível 1: "Sobre o Programa" — chip laranja ▶
     *   Nível 2a: PESQUISA / BOLSAS — separador laranja c/ linha horizontal
     *   Nível 2b: programa — bullet diamond ◇ + medium weight
     *   Nível 3:  ação fomento — arrow ↳ + smaller font + indentação dupla
     */
    .navMB-sub {
        display: block;
        position: relative;
        width: 100%;
        background: rgba(13, 54, 42, 0.22);
        padding: 4px 0 12px;
        box-sizing: border-box;
        margin-left: 0;
    }
    /* Tronco vertical: laranja sólido, alinhado com markers */
    .navMB-sub::before {
        content: '';
        position: absolute;
        top: 4px;
        bottom: 12px;
        left: 31px;
        width: 2px;
        background: linear-gradient(to bottom, #ffac3d 0%, #ffac3d 78%, rgba(255, 172, 61, 0.42) 100%);
        border-radius: 1px;
    }
    .navMB-sub[hidden] { display: none !important; }

    .navMB-sublink {
        display: block !important;
        position: relative;
        width: 100%;
        box-sizing: border-box;
        padding: 9px 16px 9px 54px;
        color: #ffffff;
        font-family: 'Trivia_Gothic_C2', 'Roboto', sans-serif;
        font-size: 0.94rem;
        font-weight: 560;
        text-decoration: none;
        line-height: 1.35;
        word-wrap: break-word;
        overflow-wrap: anywhere;
        white-space: normal;
        transition: background-color 0.2s ease;
    }
    /* Ramo horizontal — sai do tronco até o marker (sem overlap) */
    .navMB-sublink::before {
        content: '';
        position: absolute;
        left: 31px;
        top: 50%;
        width: 9px;
        height: 3px;
        background: rgba(255, 172, 61, 0.88);
        border-radius: 2px;
        transform: translateY(-1.5px);
    }
    /* Marker — círculo CSS preciso, centralizado alinhado ao ramo */
    .navMB-sublink::after {
        content: '';
        position: absolute;
        left: 38px;
        top: 50%;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: transparent;
        border: 2px solid #ffac3d;
        box-sizing: border-box;
        transform: translateY(-50%);
        transition: background-color 0.2s ease;
    }
    .navMB-sublink:hover {
        background: rgba(255, 255, 255, 0.13);
        color: #ffffff;
    }
    .navMB-sublink:hover::after { background: #ffac3d; }
    .navMB-sublink:focus-visible {
        background: rgba(255, 255, 255, 0.15);
        outline: 2px solid #ffac3d;
        outline-offset: -2px;
    }
    .navMB-sublink:focus { outline: 0; }

    /* Nível 1: "Sobre o Programa X" — círculo SÓLIDO laranja com anel branco */
    .navMB-sublink--main {
        font-weight: 700;
        color: #ffffff;
        padding: 10px 16px 10px 54px;
        margin-bottom: 6px;
        font-size: 0.96rem;
    }
    .navMB-sublink--main::after {
        background: #ffac3d;
        border: 2px solid #ffffff;
        width: 12px;
        height: 12px;
        left: 37px;
    }
    .navMB-sublink--main:hover::after { background: #ffd9a8; }

    /* Nível 3: Ação de fomento — dot pequeno branco, indentação dupla */
    .navMB-sublink--nested {
        padding: 7px 16px 7px 80px;
        font-size: 0.84rem;
        color: rgba(255, 255, 255, 0.94);
        font-weight: 520;
    }
    .navMB-sublink--nested::before {
        left: 50px;
        width: 14px;
        background: rgba(255, 255, 255, 0.58);
    }
    .navMB-sublink--nested::after {
        left: 64px;
        width: 6px;
        height: 6px;
        background: rgba(255, 255, 255, 0.88);
        border: 0;
        border-radius: 50%;
    }
    .navMB-sublink--nested:hover { color: #ffffff; }
    .navMB-sublink--nested:hover::before { background: #ffffff; }
    .navMB-sublink--nested:hover::after { background: #ffffff; }

    /* Grupo de tipo */
    .navMB-sub-group {
        display: block;
        position: relative;
        width: 100%;
        padding: 4px 0 4px;
        margin-top: 6px;
        box-sizing: border-box;
    }

    /* Nível 2a: Label de tipo (PESQUISA, BOLSAS) — separador de seção */
    .navMB-sub-label {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 10px 0 4px;
        padding: 6px 16px 6px 24px;
        font-size: 0.72rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: #ffd08f;
        word-wrap: break-word;
        position: relative;
    }
    .navMB-sub-label::before {
        content: '';
        flex-shrink: 0;
        width: 14px;
        height: 14px;
        background: #ffac3d;
        clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    }
    .navMB-sub-label::after {
        content: '';
        flex: 1;
        height: 1px;
        background: linear-gradient(to right, rgba(255, 172, 61, 0.72) 0%, transparent 100%);
    }

    /* Quebra título do toggle se for longo (Programa Cientista Chefe etc) */
    .navMB-toggle > span {
        word-wrap: break-word;
        overflow-wrap: anywhere;
        white-space: normal;
        flex: 1;
        min-width: 0;
    }
}

/* ──────────────────────────────────────────────────────────────────────
 * Mega menu desktop — overlay com posicionamento absoluto pra evitar
 * empurrar a página. Aplicado só em desktop (>768px).
 * ────────────────────────────────────────────────────────────────────── */
@media (min-width: 769px) {
    .navbar.navbar-unified { position: relative; }
    .dropdown-content2 {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
}

/* Mobile: o mega menu desktop fica completamente escondido (subitens
 * são acessíveis via accordion no drawer) */
@media (max-width: 768px) {
    .dropdown-content2 { display: none !important; }
}
