
   :root {
    --hp-primary: var(--portal-primary-hex, #1351B4);
    --hp-primary-light: var(--portal-primary-hex, #1351B4);
    --hp-secondary: var(--portal-accent-hex, #0ea5e9);
    --hp-orange: #f97316;
    --hp-text-light: var(--portal-text-on-primary, #ffffff);
    --hp-text-dark: var(--portal-text-on-primary, #1e293b);
    --hp-bg-white: #ffffff;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 160px; 
    overflow-x: clip; 
}

@media screen and (max-width: 991px) {
    html {
        scroll-padding-top: 120px; 
    }
}

.header-premium {
    width: 100%;
    font-family: 'Inter', 'Roboto', sans-serif;
    color: var(--hp-text);
    position: sticky;
    top: 0;
    z-index: 99998;
    transition: all 0.3s ease;
    background-color: var(--hp-primary, var(--portal-primary-hex, #1351B4));
}

.header-premium > * {
    position: relative;
}

.header-premium.is-sticky {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

   .admin-bar .header-premium {
       top: 32px;
   }
   @media screen and (max-width: 782px) {
       .admin-bar .header-premium {
           top: 46px;
       }
   }
   @media screen and (max-width: 600px) {
       .admin-bar .header-premium {
           top: 0 !important;
       }
   }

    .hp-middlebar {
        height: 250px;
        overflow: hidden;
        transition: height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
        opacity: 1;
    }
    
    .header-premium.is-sticky .hp-middlebar {
        height: 0 !important;
       padding-top: 0 !important;
       padding-bottom: 0 !important;
       opacity: 0 !important;
       pointer-events: none;
   }

.hp-topbar {
    background: var(--hp-primary-light);
    color: var(--hp-text-light);
    font-size: 0.85rem;
    padding: 8px 0;
    z-index: 10; 
    position: relative;
}

.hp-topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.hp-topbar-left {
    font-weight: 500;
}

.hp-topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.hp-topbar-right a, .hp-search-toggle {
    color: var(--hp-text-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.hp-topbar-right a:hover, .hp-search-toggle:hover,
.hp-topbar-right a:focus, .hp-search-toggle:focus {
    opacity: 0.8;
    outline: none;
}
.hp-topbar-right a:focus-visible, .hp-search-toggle:focus-visible {
    outline: 2px dashed rgba(255,255,255,0.8);
    outline-offset: 4px;
}

.hp-social-icons {
    display: flex;
    gap: 10px;
    margin-left: 10px;
    border-left: 1px solid rgba(255,255,255,0.3);
    padding-left: 15px;
}

.hp-middlebar {
    background-color: transparent;
    padding: 30px 0;
    height: 250px;
    display: flex;
    align-items: center;
}

.hp-middlebar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

body #hp-logo-link img,
body [class*="custom-logo-link"],
body .hp-logo img,
body .hp-logo a img {
    height: 140px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.custom-logo-link, .hp-logo a {
    display: block;
    flex-shrink: 0;
}

.hp-logo-text {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--hp-primary);
    text-decoration: none;
}

.hp-seals {
    display: flex;
    gap: 20px;
}

.hp-seal-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    padding: 8px 15px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--hp-text-dark);
    line-height: 1.2;
    text-decoration: none;
    transition: background 0.2s;
}

.hp-seal-item:hover {
    background: #e2e8f0;
}

.hp-navbar {
    background-color: var(--hp-primary);
}

.hp-main-navigation {
    display: flex;
    align-items: center;
    width: 100%;
}

.hp-home-link {
    color: var(--hp-text-light);
    font-size: 1.2rem;
    padding: 15px 20px;
    text-decoration: none;
    transition: background 0.2s;
    flex-shrink: 0;
}

.hp-home-link:hover {
    background: rgba(255,255,255,0.1);
}

.hp-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap; 
    width: 100%;
}

.hp-nav-list li {
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-block;
}

.hp-nav-list a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--hp-text-light);
    text-decoration: none;
    padding: 15px 20px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.hp-nav-list a i {
    font-size: 1rem;
}

.hp-nav-list a:hover,
.hp-nav-list a:focus {
    background: rgba(255,255,255,0.1);
    outline: none;
}
.hp-nav-list a:focus-visible {
    outline: 2px dashed rgba(255,255,255,0.8);
    outline-offset: -2px;
}

.hp-nav-list li ul {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--hp-primary-light);
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 260px;
    max-width: 380px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 100;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.hp-nav-list li:hover > ul,
.hp-nav-list li:focus-within > ul {
    display: block;
}

.hp-nav-list li ul li {
    display: block;
    width: 100%;
    white-space: normal; 
}

.hp-nav-list li ul li a {
    display: block;
    width: 100%;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-sizing: border-box;
    white-space: normal; 
    line-height: 1.3;
}

.hp-nav-list li.menu-item-home > a::before,
.hp-nav-list li a[href="/"]::before {
    content: "\f015";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 5px;
}

.hp-mobile-toggle {
    display: none;
    width: 100%;
    background: var(--hp-primary-light);
    color: white;
    border: none;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

@media (max-width: 991px) {
    .hp-topbar-inner {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 6px;
        padding: 4px 8px;
    }

    .hp-topbar-left {
        width: 100%;
        text-align: center;
        font-size: 0.82rem;
    }

    .hp-topbar-right {
        width: 100%;
        justify-content: center;
        font-size: 0.8rem;
        gap: 12px;
        flex-wrap: wrap;
    }

    .hp-social-icons {
        margin-left: 0;
        border-left: none;
        padding-left: 0;
        width: 100%;
        justify-content: center;
        gap: 14px;
    }

    .header-premium.is-sticky .hp-topbar {
        display: none !important;
    }

    .hp-middlebar {
        height: auto;
        min-height: 90px;
        padding: 14px 0;
        background-color: var(--hp-primary, var(--portal-primary-hex, #1351B4));
    }

    .header-premium.is-sticky .hp-middlebar {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        opacity: 0 !important;
        overflow: hidden !important;
    }

    .hp-middlebar-inner {
        justify-content: center;
        text-align: center;
    }

    body #hp-logo-link img,
    body [class*="custom-logo-link"],
    body .hp-logo img,
    body .hp-logo a img {
        height: 65px;
    }

    .hp-logo {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        gap: 6px !important;
        width: 100%;
    }

    .hp-logo-name {
        font-size: 1.35rem !important;
    }

    .hp-logo-slogan {
        font-size: 0.85rem !important;
    }
    
    .hp-seals {
        display: none; 
    }
    
    .hp-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        padding: 12px 18px;
        font-size: 1rem;
    }
    
    .hp-main-navigation {
        flex-direction: column;
        display: none; 
    }
    
    .hp-main-navigation.active {
        display: flex;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .hp-nav-list {
        flex-direction: column;
        width: 100%;
    }

    .hp-nav-list > li > a {
        padding: 12px 18px;
        font-size: 0.95rem;
    }
    
    .hp-home-link {
        display: none;
    }
    
    .hp-nav-list li ul {
        position: static;
        display: none;
        background: rgba(0,0,0,0.1);
    }
    
    .hp-nav-list li.menu-item-has-children > a::after {
        content: '\f0d7';
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        float: right;
    }

    body.mobile-menu-open [vw] [vw-access-button],
    body:has(.hp-main-navigation.active) [vw] [vw-access-button] {
        opacity: 0.15 !important;
        pointer-events: none !important;
        transition: opacity 0.2s ease;
    }
}

.wp-block-query-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0;
    padding: 0;
    list-style: none;
}

body .wp-block-query-pagination-numbers,
body .wp-block-query-pagination-next,
body .wp-block-query-pagination-previous {
    margin: 0;
}

body .wp-block-query-pagination a,
body .wp-block-query-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 15px;
    background-color: #f8fafc;
    color: var(--portal-primary-hex, #1351B4);
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.wp-block-query-pagination a:hover {
    background-color: var(--portal-primary-hex, #1351B4);
    color: #fff;
    border-color: var(--portal-primary-hex, #1351B4);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.wp-block-query-pagination .current {
    background-color: var(--portal-primary-hex, #1351B4);
    color: #fff;
    border-color: var(--portal-primary-hex, #1351B4);
}

[vw].enabled {
    z-index: 99999 !important;
}
html body [vw].enabled [vw-access-button],
[vw] [vw-access-button] {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    position: fixed !important;
    right: 0 !important;
    left: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 999999 !important;
}

html body [vw].enabled [vw-access-button] .access-button,
html body [vw].enabled [vw-access-button] .vw-access-button,
html body [vw].enabled [vw-access-button] {
    background-color: var(--portal-primary-hex, #1351B4) !important;
    color: var(--portal-text-on-primary, #ffffff) !important;
}

.hp-dropdown-menu .premium-accessibility-link {
    width: 100%;
    text-align: left;
    justify-content: flex-start;
    background: transparent;
    border: none;
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--portal-primary-hex, #1351B4) !important; 
    font-size: 0.95rem;
    text-decoration: none;
    box-sizing: border-box;
    transition: background 0.2s ease-in-out;
}

.hp-dropdown-menu .premium-accessibility-link:hover,
.hp-dropdown-menu .premium-accessibility-link:focus {
    background: #f8fafc;
    outline: none;
}
.hp-dropdown-menu .premium-accessibility-link:focus-visible {
    outline: 2px solid var(--portal-primary-hex, #1351B4);
    outline-offset: -2px;
}
body .premium-btt {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--portal-primary-hex, #1351B4);
    color: var(--portal-text-on-primary, #ffffff);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.premium-btt.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.premium-btt:hover,
.premium-btt:focus {
    background: var(--hp-primary-light, #0c326f);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

@media screen and (max-width: 991px) {
    .premium-btt {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    html body [vw].enabled [vw-access-button],
    [vw] [vw-access-button] {
        top: auto !important;
        bottom: 75px !important;
        transform: none !important;
        right: 15px !important;
        left: auto !important;
        border-radius: 8px !important;
    }
}


/* ---- Layouts do cabeçalho (Aparência > Personalizar > Imagem do cabeçalho) ---- */
.header-premium.hp-fundo-solido .hp-middlebar,
.header-premium.hp-fundo-solido .hp-navbar {
    background-color: var(--hp-header-cor);
    --hp-text-light: var(--hp-header-texto);
}

.header-premium.hp-fundo-solido .hp-middlebar {
    height: auto;
    min-height: 0;
    padding: 18px 0;
}

.header-premium.hp-fundo-solido .hp-logo-text-wrapper {
    text-shadow: none !important;
}

.header-premium.hp-fundo-solido .hp-logo-name,
.header-premium.hp-fundo-solido .hp-logo-slogan {
    color: var(--hp-header-texto) !important;
}

@media screen and (min-width: 1200px) {
    /* Compacto: brasão à esquerda e o menu ao lado, na mesma faixa */
    .header-premium.hp-layout-compacto {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: stretch;
    }

    .header-premium.hp-layout-compacto .hp-topbar,
    .header-premium.hp-layout-compacto .hp-search-container {
        grid-column: 1 / -1;
    }

    .header-premium.hp-layout-compacto .hp-middlebar {
        grid-column: 1;
        height: auto;
        min-height: 0;
        padding: 10px 0 10px 24px;
        overflow: visible;
    }

    .header-premium.hp-layout-compacto .hp-middlebar .container-lg {
        width: auto;
        max-width: none;
        padding: 0;
    }

    .header-premium.hp-layout-compacto .hp-navbar {
        grid-column: 2;
        display: flex;
        align-items: center;
        min-width: 0;
    }

    .header-premium.hp-layout-compacto:not(.hp-fundo-solido) .hp-navbar {
        background-color: var(--hp-primary);
    }

    .header-premium.hp-layout-compacto .hp-navbar .container-lg {
        width: 100%;
        max-width: none;
        padding: 0 24px 0 8px;
    }

    .header-premium.hp-layout-compacto .hp-seals {
        display: none;
    }

    .header-premium.hp-layout-compacto .hp-logo-text-wrapper {
        max-width: 280px;
    }

    .header-premium.hp-layout-compacto .hp-logo-name {
        font-size: 1.5rem !important;
    }

    .header-premium.hp-layout-compacto .hp-logo-slogan {
        font-size: 0.9rem !important;
    }

    body .header-premium.hp-layout-compacto .hp-logo img,
    body .header-premium.hp-layout-compacto .hp-logo a img,
    body .header-premium.hp-layout-compacto [class*="custom-logo-link"] {
        height: 80px !important;
        max-width: none;
    }

    .header-premium.hp-layout-compacto .hp-nav-list a {
        padding: 14px 12px;
        font-size: 0.9rem;
    }

    .header-premium.hp-layout-compacto .hp-nav-list {
        justify-content: flex-end;
    }

    /* Rolando a página, o brasão continua visível e do mesmo tamanho (sem encolher) */
    .header-premium.hp-layout-compacto.is-sticky .hp-middlebar {
        display: block !important;
        height: auto !important;
        padding: 10px 0 10px 24px !important;
        opacity: 1 !important;
        pointer-events: auto;
    }
}

/* Compacto usa sempre cor sólida (a imagem só cobriria o bloco do brasão); abaixo de 1200px volta ao empilhado */
@media screen and (min-width: 1200px) {
    .header-premium.hp-layout-compacto:not(.hp-fundo-solido) .hp-middlebar {
        background-image: none !important;
        background-color: var(--hp-header-cor);
    }
    .header-premium.hp-layout-compacto:not(.hp-fundo-solido) .hp-middlebar > div[style*="linear-gradient"] {
        display: none;
    }
    .header-premium.hp-layout-compacto:not(.hp-fundo-solido) .hp-navbar {
        background-color: var(--hp-header-cor);
    }
}

/* Submenus dos últimos itens abrem para a esquerda (não saem da tela) */
@media screen and (min-width: 992px) {
    .hp-nav-list > li:nth-last-child(-n+3) > ul {
        left: auto;
        right: 0;
    }
    .hp-nav-list li ul li a {
        white-space: normal;
    }
}

/* Barra superior enxuta */
.header-premium.hp-topo-enxuta .hp-topbar,
.header-premium.hp-topo-enxuto .hp-topbar {
    padding: 4px 0;
    font-size: 0.8rem;
}
.header-premium.hp-topo-enxuta .hp-topbar-left,
.header-premium.hp-topo-enxuta .hp-social-icons,
.header-premium.hp-topo-enxuta .hp-topbar-right a[href$="/transparencia"] {
    display: none;
}
.header-premium.hp-topo-enxuta .hp-topbar-inner {
    justify-content: flex-end;
}

/* Barra superior na cor de destaque */
.header-premium.hp-topocor-destaque .hp-topbar {
    background: var(--hp-topo-bg);
    color: var(--hp-topo-texto);
}
.header-premium.hp-topocor-destaque .hp-topbar a,
.header-premium.hp-topocor-destaque .hp-topbar button,
.header-premium.hp-topocor-destaque .hp-topbar i {
    color: var(--hp-topo-texto);
}
.header-premium.hp-topocor-destaque .hp-social-icons {
    border-left-color: color-mix(in srgb, var(--hp-topo-texto) 35%, transparent);
}
.header-premium.hp-topocor-destaque .hp-dropdown-menu a,
.header-premium.hp-topocor-destaque .hp-dropdown-menu button,
.header-premium.hp-topocor-destaque .hp-dropdown-menu i {
    color: #333;
}

/* Compacto: faixa superior fina e menu com mais presença (como no layout de referência) */
@media screen and (min-width: 1200px) {
    .header-premium.hp-layout-compacto .hp-topbar {
        padding: 5px 0;
        font-size: 0.78rem;
    }
    .header-premium.hp-layout-compacto .hp-nav-list a {
        font-weight: 600;
        padding: 12px 11px;
    }
    .header-premium.hp-layout-compacto .hp-middlebar {
        padding-top: 8px;
        padding-bottom: 8px;
    }
}

/* Barra superior no celular: fina (sem nome nem redes), links pequenos em até duas linhas */
@media screen and (max-width: 991px) {
    .header-premium .hp-topbar {
        padding: 3px 0;
        font-size: 0.72rem;
    }
    .header-premium .hp-topbar-inner {
        gap: 0;
        padding: 0 8px;
    }
    .header-premium .hp-topbar-left,
    .header-premium .hp-topbar .hp-social-icons {
        display: none;
    }
    .header-premium .hp-topbar-right {
        font-size: 0.72rem;
        gap: 2px 12px;
        row-gap: 0;
        justify-content: center;
    }
    .header-premium .hp-topbar-right a,
    .header-premium .hp-topbar-right .hp-search-toggle,
    .header-premium .hp-topbar-right .hp-accessibility-toggle {
        gap: 4px;
        padding: 4px 0;
        line-height: 1.2;
    }
    .header-premium .hp-topbar-right {
        align-content: flex-start;
        align-items: center;
    }
    .header-premium .hp-topbar-right .hp-dropdown-container {
        margin: 0 !important;
        display: flex !important;
        align-items: center;
    }
    .header-premium .hp-topbar-right button {
        height: auto !important;
        min-height: 24px;
        line-height: 1.2 !important;
        padding-block: 4px !important;
    }
    .header-premium .hp-topbar-right i {
        font-size: 0.85rem;
    }
}

/* Celular: brasão à esquerda e botão de menu à direita, na mesma linha; o menu aberto ocupa a largura toda embaixo */
@media screen and (max-width: 991px) {
    .header-premium {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }
    .header-premium .hp-topbar,
    .header-premium .hp-search-container {
        grid-column: 1 / -1;
        grid-row: auto;
    }
    .header-premium .hp-middlebar {
        grid-column: 1 / -1;
        grid-row: 3;
        min-height: 64px;
        padding: 6px 0;
    }
    .header-premium .hp-middlebar-inner {
        justify-content: flex-start;
        text-align: left;
        padding-right: 150px;
    }
    .header-premium .hp-logo {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        text-align: left;
        width: auto;
    }
    body .header-premium .hp-logo img,
    body .header-premium .hp-logo a img {
        height: 52px !important;
        max-width: none;
    }
    .header-premium .hp-navbar,
    .header-premium .hp-navbar .container-lg {
        display: contents;
    }
    .header-premium .hp-mobile-toggle {
        grid-column: 2;
        grid-row: 3;
        position: relative;
        z-index: 3;
        width: auto;
        margin-right: 12px;
        padding: 8px 12px;
        background: transparent;
        color: var(--hp-header-texto, #ffffff);
        border: 0;
        border-radius: 6px;
    }
    .header-premium .hp-main-navigation {
        grid-column: 1 / -1;
        grid-row: 4;
        background: var(--hp-header-cor, var(--hp-primary));
    }
    .header-premium.is-sticky .hp-mobile-toggle {
        grid-column: 1 / -1;
        justify-self: end;
    }
}

/* Celular estreito: links da barra superior numa linha só (sem ícones, só texto) */
@media screen and (max-width: 600px) {
    .header-premium .hp-topbar-right {
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 0 6px;
        width: 100%;
    }
    .header-premium .hp-topbar-right i {
        display: none;
    }
    .header-premium .hp-topbar-right a,
    .header-premium .hp-topbar-right button {
        white-space: nowrap;
        font-size: 0.7rem;
    }
}

/* Celular, variante com ícones: fonte menor e espaços curtos para caber numa linha */
@media screen and (max-width: 600px) {
    .header-premium.hp-topocel-icones .hp-topbar-right {
        gap: 0 4px;
        font-size: 0.6rem !important;
    }
    .header-premium.hp-topocel-icones .hp-topbar-right i {
        display: inline-block;
        font-size: 0.7rem;
    }
    .header-premium.hp-topocel-icones .hp-topbar-right a,
    .header-premium.hp-topocel-icones .hp-topbar-right button {
        gap: 3px;
        font-size: 0.6rem !important;
        letter-spacing: -0.1px;
    }
}

@media screen and (max-width: 340px) {
    .header-premium.hp-topocel-icones .hp-topbar-right i {
        display: none;
    }
}
