/* ==========================================================================
   CREA-RS - Camada de responsividade e acessibilidade MOBILE
   --------------------------------------------------------------------------
   Este arquivo e carregado DEPOIS de style.css e contem, salvo os utilitarios
   de acessibilidade do bloco 0 (que nao alteram layout), apenas regras dentro
   de @media (max-width: 991.98px) e abaixo.
   O layout desktop (>= 992px) permanece exatamente como estava.
   ========================================================================== */

/* ==========================================================================
   0. Acessibilidade global (nao altera o layout desktop)
   ========================================================================== */

/* Link "pular para o conteudo" - so aparece ao receber foco pelo teclado */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100000;
    padding: 12px 20px;
    background: #0A478A;
    color: #fff;
    font-family: Poppins, Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 0 0 8px 0;
}

.skip-link:focus {
    left: 0;
    color: #fff;
    text-decoration: underline;
}

/* Conteudo apenas para leitores de tela */
.sr-only-crea {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Indicador de foco visivel (somente navegacao por teclado) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
    outline: 3px solid #CB9F00 !important;
    outline-offset: 2px !important;
    border-radius: 3px;
}

/* Fallback para navegadores sem :focus-visible */
@supports not selector(:focus-visible) {
    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus,
    [tabindex]:focus {
        outline: 3px solid #CB9F00 !important;
        outline-offset: 2px !important;
    }
}

/* Respeita a preferencia por menos animacao */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Tabelas do conteudo envolvidas por JS para rolarem sozinhas */
.tabela-responsiva-crea {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Embeds (YouTube etc.) proporcionais */
.embed-responsivo-crea {
    position: relative;
    width: 100%;
    max-width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin-bottom: 1rem;
}

.embed-responsivo-crea > iframe,
.embed-responsivo-crea > embed,
.embed-responsivo-crea > object {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0;
}


/* ==========================================================================
   1. MOBILE / TABLET  (< 992px)
   ========================================================================== */
@media (max-width: 991.98px) {

    /* --- 1.1 Base: sem rolagem horizontal e tipografia legivel ------------ */
    html {
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        max-width: 100%;
    }

    body {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    img,
    svg,
    video,
    canvas,
    iframe,
    embed,
    object {
        max-width: 100%;
    }

    img,
    video {
        height: auto;
    }

    p,
    li,
    h1, h2, h3, h4, h5, h6,
    address,
    td, th,
    .letters-14-footer,
    .title-events,
    .links-home {
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    header button,
    header .title,
    .top-header-mobile a,
    .top-header-mobile button {
        min-height: 44px;
    }

    /* --- 1.2 Cabecalho fixo com altura previsivel em px ------------------- */
    .main-header {
        height: 64px !important;
        min-height: 64px;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        background: #fff;
        box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
    }

    .main-header.active-menu {
        height: 64px !important;
    }

    .main-header .top-header-mobile {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        height: 64px;
        padding: 8px 12px;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1005;
        background: #fff;
    }

    .main-header .top-header-mobile .trigger-menu,
    .main-header .top-header-mobile .trigger-search {
        float: none;
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        padding: 0;
        background: none;
        border: none;
        border-radius: 6px;
        cursor: pointer;
    }

    .main-header .top-header-mobile .trigger-menu img,
    .main-header .top-header-mobile .trigger-search img {
        width: 24px;
        height: 24px;
        max-width: none;
        opacity: 1;
    }

    .main-header .top-header-mobile .close {
        float: none;
        font-size: inherit;
        opacity: 1;
        text-shadow: none;
    }

    .top-header-mobile .logo {
        display: flex !important;
        align-items: center;
        justify-content: center;
        float: none;
        height: auto;
        margin: 0;
        flex: 1 1 auto;
        min-width: 0;
    }

    .top-header-mobile .logo a {
        display: inline-flex;
        align-items: center;
    }

    .top-header-mobile .logo img {
        height: 34px;
        width: auto;
        max-width: 100%;
    }

    /* --- 1.3 Compensacao do header fixo no conteudo ----------------------- */
    main,
    #main,
    .conteudo {
        padding-top: 64px !important;
    }

    .conteudo main,
    .conteudo #main {
        padding-top: 0 !important;
    }

    :target {
        scroll-margin-top: 74px;
    }

    /* --- 1.4 Drawer do menu principal ------------------------------------- */
    .main-header .menu {
        position: fixed;
        top: 64px;
        left: -100%;
        width: 88%;
        max-width: 360px;
        height: calc(100vh - 64px);
        margin: 0;
        padding: 0 0 24px;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        background: #fff;
        border-bottom: 0;
        box-shadow: 2px 0 12px rgba(0, 0, 0, .18);
        transition: left .25s ease-in-out;
        z-index: 1002;
    }

    .main-header .menu.show-menu {
        left: 0;
        height: calc(100vh - 64px);
        z-index: 1002;
    }

    .main-header .menu .container-lg,
    .main-header .container-lg.align-left {
        padding: 0 !important;
        max-width: none;
    }

    .main-header .menu nav {
        height: auto !important;
    }

    .main-header .menu nav > ul {
        display: block !important;
        height: auto !important;
        margin: 0 !important;
        padding: 8px 0 0 !important;
        list-style: none;
    }

    .main-header .menu nav ul li {
        float: none;
        display: block;
        width: 100%;
        margin: 0;
        line-height: normal;
        border-bottom: 1px solid #eceff3;
    }

    .main-header .menu nav ul li a,
    .main-header .menu nav ul li .title {
        display: flex;
        align-items: center;
        min-height: 52px;
        padding: 12px 56px 12px 20px;
        font-size: 16px;
        line-height: 1.35;
        letter-spacing: 0;
        color: #0A478A;
        cursor: pointer;
    }

    .main-header .menu nav ul li:after {
        right: 20px;
        width: 16px;
        height: 16px;
    }

    .main-header .menu nav ul li:not(.dropdown):after {
        content: none;
        display: none;
    }

    .main-header .menu nav ul > div.d-block {
        display: block !important;
        margin: 16px 0 0 !important;
        padding: 16px 20px 4px !important;
        border-top: 1px solid #eceff3;
        height: auto !important;
        top: auto;
    }

    .main-header .menu nav ul > div.d-block .d-inline-flex {
        flex-wrap: wrap;
        gap: 4px;
        margin-top: 10px;
    }

    .main-header .menu nav ul > div.d-block a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        padding: 0 6px;
    }

    /* --- 1.5 Submenus (paineis deslizantes) ------------------------------- */
    header .submenu {
        position: fixed;
        top: 64px !important;
        left: -100%;
        width: 92%;
        max-width: 440px;
        height: calc(100vh - 64px) !important;
        padding: 0 0 32px;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        background: #F4F4F4;
        transition: left .25s ease-in-out;
        z-index: 1003;
    }

    header .submenu.show-menu {
        left: 0;
    }

    header .submenu .title-submenu {
        display: block;
        width: 100%;
        padding: 16px 20px 20px;
        background: #0C6AD0;
        border-right: 0;
    }

    header .submenu .title-submenu .back-link {
        display: block;
        margin-bottom: 12px;
        font-size: 14px;
    }

    header .submenu .title-submenu .back-link button {
        min-height: 44px;
        padding: 8px 14px 8px 30px;
        font-size: 14px;
        background: rgba(0, 0, 0, .18);
        border-radius: 6px;
        color: #fff;
    }

    header .submenu .title-submenu .back-link button::before {
        left: 10px;
        font-size: 16px;
    }

    header .submenu .title-submenu h2,
    header .submenu .title-submenu h2 a {
        font-size: 22px;
        line-height: 1.25;
        min-width: 0;
        max-width: none;
        margin-bottom: 0;
        padding-right: 0;
        color: #fff;
    }

    header .submenu .content-submenu {
        display: block;
        width: 100%;
        padding: 8px 20px 0 !important;
        border-left: 0;
    }

    header .submenu .content-submenu nav {
        display: block;
    }

    header .submenu .content-submenu nav ul {
        display: block;
        width: 100%;
        padding: 0 !important;
        margin: 0 0 8px;
    }

    header .submenu .content-submenu nav ul li {
        margin-top: 0;
        font-size: 15px;
        line-height: 1.4;
        border-bottom: 1px solid rgba(10, 71, 138, .10);
    }

    header .submenu .content-submenu nav ul li:last-child {
        border-bottom: 0;
    }

    header .submenu .content-submenu nav ul li a,
    header .submenu .content-submenu nav ul li .highlight-title {
        display: block;
        min-height: 44px;
        padding: 11px 0;
        font-size: 15px !important;
        line-height: 1.4 !important;
        color: #333 !important;
    }

    header .submenu .content-submenu nav ul li.highlight {
        margin-top: 18px;
        padding-bottom: 4px;
        font-size: 17px;
        font-weight: 700;
        color: #0A478A;
        border-bottom: 2px solid rgba(10, 71, 138, .45);
    }

    header .submenu .content-submenu nav ul li.highlight a,
    header .submenu .content-submenu nav ul li .highlight-title {
        font-size: 17px !important;
        font-weight: 700 !important;
        color: #0A478A !important;
    }

    header .submenu .content-submenu nav ul li.nav-warning {
        margin-top: 10px;
        padding: 12px;
        border-bottom: 0;
    }

    header .submenu .content-submenu nav ul li.nav-warning span {
        font-size: 13px;
        line-height: 1.45;
    }

    header .submenu .content-submenu nav ul li.nav-warning br {
        display: none;
    }

    /* --- Fundo escurecido quando o menu esta aberto ----------------------- */
    .mobile-nav-overlay {
        position: fixed;
        top: 64px;
        left: 0;
        width: 100%;
        height: calc(100vh - 64px);
        background: rgba(0, 0, 0, .45);
        border: 0;
        padding: 0;
        margin: 0;
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s ease-in-out, visibility 0s linear .25s;
        z-index: 1001;
    }

    body.crea-nav-aberto .mobile-nav-overlay {
        opacity: 1;
        visibility: visible;
        transition: opacity .25s ease-in-out;
    }

    body.crea-nav-aberto {
        overflow: hidden;
    }

    /* --- 1.6 Busca do topo mobile ----------------------------------------- */
    #search-box {
        top: 64px;
        left: 0;
        width: 100vw;
        padding: 12px;
        box-sizing: border-box;
        z-index: 1004;
    }

    #search-box #search-form {
        display: flex;
        align-items: stretch;
        gap: 8px;
        width: 100%;
        max-width: 640px;
        margin: 0 auto;
    }

    #search-box input {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        min-height: 44px;
        font-size: 16px;
    }

    #search-box .search-submit {
        flex: 0 0 auto;
        min-height: 44px;
        white-space: nowrap;
    }

    /* --- Barra de acessibilidade dentro do menu mobile --------------------- */
    .crea-a11y-mobile {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 14px;
    }

    .crea-a11y-mobile button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-width: 44px;
        min-height: 44px;
        padding: 8px 12px;
        font-family: Poppins, Arial, sans-serif;
        font-size: 14px;
        font-weight: 600;
        color: #0A478A;
        background: #fff;
        border: 1px solid #0A478A;
        border-radius: 8px;
        cursor: pointer;
    }

    .crea-a11y-mobile button:hover,
    .crea-a11y-mobile button[aria-pressed="true"] {
        background: #0A478A;
        color: #fff;
    }

    .crea-a11y-mobile .crea-a11y-legenda {
        flex: 1 0 100%;
        margin: 0 0 2px;
        font-family: Poppins, Arial, sans-serif;
        font-size: 13px;
        font-weight: 600;
        color: #0A478A;
    }

    /* ======================================================================
       2. HOME - banner principal e botoes de servico
       ====================================================================== */
    /* Proporcao real dos banners: 330 / 1035 = 31.884% */
    .slider-container {
        max-width: 100%;
        padding-bottom: 31.884%;
    }

    /* A faixa de slides ocupa toda a caixa proporcional, sem sobra embaixo */
    .slider {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
    }

    .slide {
        position: relative;
        height: 100%;
        min-width: 0;
    }

    .slide img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    button-slide {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        font-size: 20px;
        border-radius: 50%;
        background-color: rgba(0, 0, 0, .55);
    }

    .prev {
        left: 8px;
    }

    .next {
        right: 8px;
    }

    .home-button-orange,
    .home-button-blue {
        width: 100%;
        flex-basis: 100%;
        height: auto !important;
        min-height: 56px;
        padding: 12px 16px !important;
        justify-content: flex-start;
        gap: 12px;
    }

    /* A faixa laranja se separa do banner; as azuis se empilham juntas */
    .home-button-orange {
        margin-top: 10px;
    }

    .home-button-blue {
        margin-top: 3px;
    }

    .home-button-orange img,
    .home-button-blue img {
        width: 26px !important;
        max-width: 26px;
        height: auto;
        flex: 0 0 auto;
    }

    .home-button-icone,
    .home-button-orange .home-button-icone {
        width: 26px;
        font-size: 22px;
        flex: 0 0 auto;
    }

    .home-letters-buttons-orange,
    .home-letters-buttons-blue {
        display: block;
        padding-left: 0 !important;
        line-height: 1.3 !important;
        text-align: left;
    }

    .home-letters-buttons-orange {
        font-size: 17px;
    }

    .home-letters-buttons-blue {
        font-size: 15px;
    }

    .div-banner {
        max-width: 100%;
    }

    /* ======================================================================
       3. HOME - cartoes de servico (flip cards)
       ====================================================================== */
    .home .flip-cards {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 0;
        margin-bottom: 10px;
    }

    .home .flip-cards .flip-card {
        position: relative;
        width: 100%;
        height: 150px;
        margin-bottom: 0;
        perspective: none;
        border-radius: 10px;
        background: #f4f4f4;
    }

    /* Sem hover no toque: o cartao vira um bloco clicavel inteiro */
    .home .flip-cards .flip-card-inner,
    .home .flip-cards .flip-card:hover .flip-card-inner {
        transform: none !important;
        transform-style: flat;
        transition: none;
    }

    .home .flip-cards .flip-card-front {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        padding: 10px;
        transform: none;
        -webkit-backface-visibility: visible;
        backface-visibility: visible;
    }

    .home .flip-cards .flip-card-back {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: transparent;
        transform: none;
        -webkit-backface-visibility: visible;
        backface-visibility: visible;
    }

    .home .flip-cards .flip-card-back .btn-submit {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        background: transparent;
        color: transparent;
        border-radius: 10px;
        font-size: 0;
    }

    .home .flip-cards .flip-card-back .btn-submit:focus-visible {
        outline: 3px solid #CB9F00 !important;
        outline-offset: -3px !important;
    }

    .home .flip-cards .flip-card:active {
        background: #e6eef8;
    }

    .home .flip-cards .flip-card-front h1,
    .home .flip-cards .flip-card-front h2,
    .home .flip-cards .flip-card-front h3 {
        font-size: 13px;
        line-height: 1.25;
    }

    .home .flip-cards .icons-header {
        font-size: 26px;
        margin-top: 4px;
        margin-bottom: 6px;
    }

    .home .flip-cards .flip-card-front img.icons-header {
        width: 46px !important;
        height: auto;
    }

    /* ======================================================================
       4. HOME - noticias, eventos e coluna lateral
       ====================================================================== */
    .container.bg-white.w-100,
    .container-lg {
        max-width: 100%;
    }

    /* Anula larguras "min-content"/"fit-content" que causavam scroll lateral */
    .w-xs-fit,
    .row.w-xs-fit {
        width: 100% !important;
    }

    .grid-posts {
        width: 100% !important;
        grid-gap: 20px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-posts .post {
        width: 100% !important;
        height: auto !important;
        min-width: 0;
    }

    .grid-posts .post > a {
        display: block;
        position: relative;
    }

    .grid-posts .post .post-image,
    .grid-posts .post > a > img {
        width: 100% !important;
        height: 210px !important;
        object-fit: cover;
    }

    .post-title {
        padding: 12px;
    }

    .post-title a h3 {
        font-size: 15px !important;
        line-height: 1.3 !important;
    }

    .notice-time {
        font-size: 11px;
        padding: 4px 8px;
    }

    .fz48 {
        font-size: 26px;
        line-height: 1.25 !important;
    }

    .fz48:before {
        width: 52px;
        height: 4px;
        margin-top: 2px;
    }

    .description-h2 {
        margin-top: 8px !important;
        margin-bottom: 16px;
        font-size: 15px;
        line-height: 1.5;
    }

    .description-h2 br {
        display: none;
    }

    .btn-home {
        width: 100%;
        max-width: 320px;
        min-height: 48px;
        height: auto;
        margin: 24px auto 0;
        padding: 12px 16px;
        font-size: 15px;
    }

    .btns-intitucionais .btn-home {
        max-width: none;
        margin-top: 0;
    }

    .grid-events {
        grid-gap: 16px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: flex-start;
    }

    .style-events {
        flex: 0 0 auto;
        width: 58px !important;
        min-width: 58px;
        height: 66px;
    }

    .day-event {
        font-size: 22px;
        line-height: 1.1;
    }

    .month-event {
        font-size: 13px;
    }

    .title-events {
        font-size: 15px !important;
        line-height: 1.35 !important;
    }

    .w-70 {
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Anuncio lateral */
    .ads {
        text-align: center;
    }

    .ads img {
        width: 100% !important;
        max-width: 360px;
        height: auto;
    }

    /* Lista de atalhos institucionais */
    .home-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 0;
        margin: 16px 0 0;
    }

    .home-list li {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
        gap: 10px;
        width: 100%;
        min-height: 56px;
        margin-bottom: 0;
        padding: 10px 12px !important;
        border-radius: 10px;
        background-color: #F4F4F4;
    }

    .home-list li:hover {
        transform: none;
    }

    .home-list a {
        display: block;
        font-size: 14px;
        line-height: 1.3;
    }

    .links-home {
        top: 0;
        margin: 0;
        font-size: 14px;
    }

    .icon-sidebar {
        font-size: 18px;
    }

    aside .next-events::before {
        content: none;
        display: none;
    }

    /* ======================================================================
       5. HOME - camaras especializadas (carrossel) e cartoes finais
       ====================================================================== */
    .bg-blue {
        height: auto !important;
        padding: 24px 0 32px;
    }

    /* .carousel tambem tem a classe .p-0 do Bootstrap: precisa de !important */
    .carousel {
        padding-left: 44px !important;
        padding-right: 44px !important;
    }

    .carousel-item .row {
        margin: 0;
    }

    .carrousel-image {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
    }

    .carousel-item .col-8,
    .carousel-item .col-lg-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .camara-especializada {
        font-size: 19px !important;
        line-height: 1.3 !important;
    }

    .camara-especializada-desc {
        font-size: 14px !important;
        line-height: 1.6 !important;
    }

    .carousel-control-prev,
    .carousel-control-next {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: rgba(0, 0, 0, .25);
        border-radius: 50%;
    }

    .carousel-control-prev {
        left: 0;
    }

    .carousel-control-next {
        right: 0;
    }

    /* Cartoes "Diretoria / Inspetorias": a proporcao e a etiqueta vem do
       bloco no fim do style.css; aqui so a largura e o respiro entre eles. */
    .last-section {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 16px;
    }

    /* Revistas */
    .revista-atual {
        height: auto;
    }

    /* ======================================================================
       6. Pagina de noticias (grid de destaques)
       ====================================================================== */
    .grid-container {
        grid-template-columns: 1fr !important;
        grid-gap: 16px;
    }

    .left-column,
    .top-right,
    .bottom-right {
        grid-column: auto !important;
        grid-row: auto !important;
        width: 100% !important;
        height: auto !important;
        position: relative;
    }

    .left-column img,
    .top-right img,
    .bottom-right img {
        width: 100%;
        height: auto;
        min-width: 0;
        object-fit: cover;
    }

    .left-column div,
    .top-right div,
    .bottom-right div {
        position: static !important;
        top: auto !important;
        width: 100%;
        max-width: 100% !important;
        height: auto !important;
        padding: 16px !important;
        border-radius: 0 0 16px 16px;
    }

    .left-column span {
        font-size: 18px !important;
        line-height: 1.35 !important;
    }

    .top-right span,
    .bottom-right span {
        font-size: 16px !important;
        line-height: 1.35 !important;
    }

    /* Lista "Noticias Anteriores" */
    .block {
        flex-wrap: wrap;
        padding-bottom: 10px;
    }

    .block .img {
        width: 96px !important;
        height: 84px !important;
        flex: 0 0 96px;
    }

    .block .text {
        width: auto !important;
        flex: 1 1 auto;
        min-width: 0;
        padding-left: 14px !important;
        font-size: 15px !important;
        line-height: 1.35 !important;
    }

    .block span {
        width: 100% !important;
        justify-content: flex-start !important;
        min-height: 44px;
        padding: 0 0 0 14px;
        font-size: 14px !important;
    }

    /* ======================================================================
       7. Paginas internas (page.php / single.php / search.php / 404.php)
       ====================================================================== */
    /* Barra de destaque e data: proporcoes menores no mobile */
    .header h1::after,
    .header-single h1::after {
        width: 44px;
        height: 3px;
        margin-top: 14px;
    }

    .time-single {
        margin-top: 14px;
        padding: 6px 13px;
        font-size: 12.5px;
    }

    .breadcrumb {
        padding: 14px 15px;
        font-size: 12px;
    }

    .breadcrumb .breadcrumb-item {
        font-size: 12px;
    }

    .intern-page-content .col {
        min-width: 0;
    }

    /* Conteudo vindo do editor: nunca estoura a tela */
    .intern-page-content img,
    .intern-page-content iframe,
    .intern-page-content video,
    .intern-page-content object,
    .intern-page-content embed {
        max-width: 100% !important;
        height: auto;
    }

    .intern-page-content pre,
    .intern-page-content code {
        white-space: pre-wrap;
        word-break: break-word;
    }

    .imagem-noticia-responsiva {
        width: 100% !important;
        max-width: 100% !important;
        height: auto;
    }

    .post .imagem-noticia-responsiva {
        max-width: 100%;
    }

    .legendaNoticias {
        font-size: 13px;
        line-height: 1.4;
    }

    /* Resultados de busca */
    .result-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .result-title-container,
    .result-item .w-75 {
        width: 100% !important;
        min-width: 0;
    }

    .result-title {
        font-size: 1.15em;
        line-height: 1.3;
    }

    .result-item .ml-3 {
        margin-left: 0 !important;
    }

    .botao,
    .botao-ler-mais {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        text-align: center;
    }

    .botao:hover,
    .botao-ler-mais:hover {
        transform: none;
    }

    /* Paginacao com area de toque adequada */
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }

    .page-numbers {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        padding: 10px 12px !important;
    }

    /* Formulario de busca padrao do WordPress */
    .searchform {
        flex-wrap: wrap;
        gap: 8px;
    }

    .searchform input[type="text"],
    .searchform input[type="search"] {
        flex: 1 1 200px;
        min-width: 0;
        min-height: 44px;
        font-size: 16px;
    }

    .searchform input[type="submit"],
    .searchform button {
        min-height: 44px;
    }

    /* ======================================================================
       8. Rodape
       ====================================================================== */
    .sociais-footer {
        height: auto;
        padding: 6px 0;
    }

    .menu-social {
        display: flex;
        width: 100%;
        float: none;
    }

    .menu-social .social-item {
        flex: 1 1 25%;
        width: 25%;
        height: 64px;
        min-height: 44px;
    }

    .letters-21-bold-footer {
        font-size: 18px;
        line-height: 1.3;
    }

    .letters-14-footer {
        font-size: 14px;
        line-height: 1.5;
    }

    footer .row [class*="col-"] {
        min-width: 0;
    }

    footer a {
        display: inline-block;
    }

    footer .pb-3 a,
    footer .custom-menu-footer a {
        min-height: 44px;
        line-height: 1.5;
        padding: 6px 0;
    }

    .border-footer {
        border: 0;
        justify-content: center;
    }

    .go-to-top {
        top: -22px;
        right: 16px;
        width: 46px;
        height: 46px;
    }

    /* Botao flutuante do WhatsApp: sai do meio da tela e do chat online */
    footer > a[href*="whatsapp"],
    .crea-whats-fixo {
        bottom: 96px !important;
        top: auto !important;
        right: 0 !important;
        margin-right: 10px !important;
    }

    /* Mapa do site */
    #acesso-rapido > a {
        min-height: 56px;
        font-size: 16px;
        text-align: center;
    }

    #acessorapido .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    #acessorapido .row > [class*="col-"] {
        margin-bottom: 22px;
    }

    #acessorapido input#search-acesso {
        min-height: 44px;
        font-size: 16px;
    }

    #acessorapido a {
        display: inline-block;
        min-height: 40px;
        line-height: 1.5;
        padding: 4px 0;
    }

    /* Popup de busca: campo e botao empilhados; a barra amarela do
       ::before precisa acompanhar o padding menor do painel. */
    .search-popup {
        padding: 8vh 16px 16px;
    }

    .popup-content {
        width: 100%;
        padding: 30px 22px 26px;
    }

    .popup-content::before {
        top: 30px;
        left: 22px;
        width: 38px;
    }

    .popup-title {
        margin-top: 16px;
        font-size: 20px;
    }

    .popup-subtitulo {
        margin-bottom: 18px;
        font-size: 13.5px;
    }

    .search-form {
        flex-direction: column;
    }

    .search-form input[type="text"] {
        height: 50px;
        font-size: 16px;
        min-height: 44px;
    }

    .search-form button {
        height: 50px;
        min-height: 44px;
    }

    .popup-dica {
        margin-top: 14px;
    }

    .close-btn {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Popup de cookies */
    #cookie-popup {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        max-width: none;
    }

    .cookie-btn {
        min-height: 44px;
    }

    /* Tabelas dentro do conteudo */
    .tabela-responsiva-crea table {
        min-width: 600px;
    }
}


/* ==========================================================================
   9. CELULARES  (< 576px)
   ========================================================================== */
@media (max-width: 575.98px) {

    main,
    #main,
    .conteudo {
        padding-top: 64px !important;
    }

    .container-lg {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .slider-container {
        padding-bottom: 31.884%;
    }

    /* Cartoes de servico: 2 colunas */
    .home .flip-cards {
        grid-template-columns: repeat(2, 1fr);
        padding-right: 0;
        padding-left: 0;
    }

    .home .flip-cards .flip-card {
        height: 140px;
    }

    .home .flip-cards .flip-card-front h1,
    .home .flip-cards .flip-card-front h2,
    .home .flip-cards .flip-card-front h3 {
        font-size: 12.5px;
    }

    /* Noticias: 1 coluna */
    .grid-posts {
        grid-template-columns: 1fr;
        grid-gap: 18px !important;
    }

    .grid-posts .post .post-image,
    .grid-posts .post > a > img {
        height: 200px !important;
    }

    .post-title a h3 {
        font-size: 16px !important;
    }

    /* Eventos: 1 coluna */
    .grid-events {
        grid-template-columns: 1fr;
        grid-gap: 12px;
    }

    /* Atalhos institucionais: 1 coluna, mais legivel */
    .home-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .home-list li {
        min-height: 52px;
    }

    .fz48 {
        font-size: 23px;
    }

    .btn-home {
        max-width: 100%;
    }

    .carousel {
        padding-left: 40px !important;
        padding-right: 40px !important;
    }

    .camara-especializada {
        font-size: 17px !important;
    }

    /* Rodape: uma coluna por bloco */
    footer #top > .container-lg > .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    footer .menu-social .social-item {
        height: 58px;
    }

    .cookie-footer {
        flex-wrap: wrap;
    }

    .cookie-btn {
        flex-grow: 1;
    }
}


/* ==========================================================================
   10. Telas muito estreitas (< 360px)
   ========================================================================== */
@media (max-width: 359.98px) {

    .home .flip-cards {
        grid-template-columns: 1fr;
    }

    .home .flip-cards .flip-card {
        height: 120px;
    }

    .top-header-mobile .logo img {
        height: 28px;
    }

    .fz48 {
        font-size: 21px;
    }
}


/* ==========================================================================
   11. Modo paisagem em celulares (altura curta)
   ========================================================================== */
@media (max-width: 991.98px) and (orientation: landscape) and (max-height: 480px) {

    .main-header .menu,
    .main-header .menu.show-menu,
    header .submenu,
    .mobile-nav-overlay {
        height: calc(100vh - 64px) !important;
    }
}


/* ==========================================================================
   12. Ajustes finais de empilhamento e foco (mobile)
   ========================================================================== */
@media (max-width: 991.98px) {

    /* O cabecalho cria o contexto de empilhamento do drawer: precisa ficar
       acima do overlay para que o menu apareca sobre o fundo escurecido. */
    .main-header {
        z-index: 1010;
    }

    /* Fora da tela = fora da ordem de tabulacao e do leitor de tela */
    .main-header .menu,
    header .submenu {
        visibility: hidden;
    }

    .main-header .menu.show-menu,
    header .submenu.show-menu {
        visibility: visible;
    }

    html.crea-nav-aberto,
    body.crea-nav-aberto {
        overflow: hidden;
        height: 100%;
    }

    /* Foco sempre visivel dentro do menu, mesmo sobre fundo azul */
    .main-header .menu a:focus-visible,
    .main-header .menu .title:focus-visible,
    header .submenu a:focus-visible,
    header .submenu button:focus-visible {
        outline: 3px solid #CB9F00 !important;
        outline-offset: -3px !important;
    }
}


/* ==========================================================================
   13. Modo alto contraste no mobile
   --------------------------------------------------------------------------
   O tema aplica "filter: invert(1)" no <body>. Um elemento com filter passa a
   ser o bloco de contencao dos descendentes "position: fixed", o que faria o
   cabecalho e o menu sairem do lugar. Aqui o cabecalho passa a ser sticky
   (nao afetado pelo filter) e os paineis passam a ser absolutos em relacao a
   ele, mantendo o menu utilizavel com o contraste ligado.
   ========================================================================== */
@media (max-width: 991.98px) {

    body.contraste .main-header {
        position: sticky !important;
        top: 0;
    }

    body.contraste .main-header .menu,
    body.contraste .main-header .menu.show-menu,
    body.contraste header .submenu {
        position: absolute !important;
        top: 64px !important;
        height: calc(100vh - 64px) !important;
    }

    /* O overlay e filho do <body>: sem posicionamento confiavel aqui.
       Fechar o menu continua possivel pelo botao e pela tecla Esc. */
    body.contraste .mobile-nav-overlay {
        display: none !important;
    }

    /* Com o cabecalho no fluxo, o espacador deixa de ser necessario */
    body.contraste main,
    body.contraste #main,
    body.contraste .conteudo {
        padding-top: 0 !important;
    }
}


/* ==========================================================================
   14. Correcoes de contraste de texto (WCAG AA) - somente mobile
   --------------------------------------------------------------------------
   Unica regra que altera COR no mobile. Se o cliente preferir manter a
   identidade exatamente como no desktop, basta remover este bloco.
   ========================================================================== */
@media (max-width: 991.98px) {

    /* Branco sobre o amarelo #ffc924 tem contraste ~1.9:1 (reprovado).
       O azul #1653a1 fica entre 4.1:1 e 4.9:1 sobre o degrade amarelo. */
    .home-letters-buttons-orange {
        color: #1653a1;
    }
}


/* ==========================================================================
   15. Ajustes de acabamento (banner, atalhos laterais e cartoes)
   ========================================================================== */
@media (max-width: 991.98px) {

    /* --- Banner: cada slide usa a largura definida pelo JS ---------------- */
    .slide {
        flex: 0 0 auto;
    }

    /* --- Atalhos institucionais: icone a esquerda, texto ao lado ---------- */
    .home-list a {
        text-align: left;
    }

    .home-list li i.icon-sidebar {
        flex: 0 0 24px;
        width: 24px;
        min-width: 24px;
        margin-bottom: 0;
        text-align: center;
    }

    .home-list .links-home {
        flex: 1 1 auto;
        min-width: 0;
        text-align: left;
    }

    /* --- Cartoes de servico: respiro entre os dois blocos ----------------- */
    .home .flip-cards + .flip-cards {
        margin-top: 0;
    }

    /* Respiro antes de "Noticias": a barra amarela do titulo encostava nos
       cartoes */
    .home .flip-cards:last-of-type {
        margin-bottom: 32px;
    }
}


/* ==========================================================================
   16. Rodape no mobile - ritmo visual
   --------------------------------------------------------------------------
   Ordem das colunas dentro de #top .row:
   1) Endereco  2) Contato  3) Saiba mais  4) Foto da presidente
   ========================================================================== */
@media (max-width: 991.98px) {

    footer #top > .container-lg {
        padding-top: 28px !important;
    }

    footer #top .row {
        margin-left: 0;
        margin-right: 0;
    }

    footer .letters-21-bold-footer {
        font-size: 18px;
        line-height: 1.3;
    }

    /* Titulos das colunas com respiro menor que no desktop */
    footer #top .row .pb-4 {
        padding-bottom: .8rem !important;
    }

    /* Linhas de contato: icone e texto na mesma linha, altura de toque de 44px */
    footer #top .row > div:nth-child(2) .pb-3 {
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 44px;
        padding-bottom: 0 !important;
    }

    footer #top .row > div:nth-child(2) .pb-3 > img {
        flex: 0 0 22px;
        margin-right: 0 !important;
    }

    footer #top .row > div:nth-child(2) .pb-3 a {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 0;
    }

    footer #top .row > div:nth-child(2) .letters-14-footer {
        line-height: 1.4;
    }

    /* Menu "Saiba mais" */
    footer .custom-menu-footer li {
        padding-bottom: 0;
    }

    footer .custom-menu-footer a {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 0;
    }

    /* Selo PNPC e foto da presidente: a imagem original tem 693x850 e sem
       limite ocupava a largura toda da coluna. */
    footer #top .row > div:nth-child(1) > div:last-child img {
        max-width: 120px;
    }

    footer #top .row > div:nth-child(4) img {
        width: auto;
        max-width: 150px;
        height: auto;
    }
}


/* ==========================================================================
   17. Rodape em celulares (< 576px) - uma coluna com separadores
   ========================================================================== */
@media (max-width: 575.98px) {

    footer #top .row.p-4 {
        padding: 8px 16px 24px !important;
    }

    /* Uma coluna por bloco, separadas por uma linha sutil para nao virar
       um amontoado de textos sem hierarquia. */
    footer #top > .container-lg > .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 0 !important;
        padding: 20px 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, .22);
    }

    footer #top > .container-lg > .row > [class*="col-"]:first-child {
        padding-top: 8px !important;
    }

    footer #top > .container-lg > .row > [class*="col-"]:last-child {
        padding-bottom: 4px !important;
        border-bottom: 0;
    }

    /* Blocos alinhados a esquerda (a foto da presidente segue centralizada) */
    footer #top .row > div:nth-child(2),
    footer #top .row > div:nth-child(3) {
        justify-content: flex-start !important;
    }

    footer #top .row > div:nth-child(1) > div:last-child img {
        width: auto !important;
        max-width: 100px;
    }

    footer #top .row > div:nth-child(4) img {
        max-width: 130px;
    }

    footer .letters-21-bold-footer {
        font-size: 17px;
    }

    footer .letters-14-footer {
        font-size: 14px;
    }
}


/* ==========================================================================
   18. Rodape em celulares - pareamento dos blocos
   --------------------------------------------------------------------------
   A coluna do endereco e "d-flex flex-column" no tema, o que empilhava o
   endereco sobre o selo PNPC. No mobile os dois passam a dividir a linha.
   ========================================================================== */
@media (max-width: 575.98px) {

    /* --- Linha 1: endereco a esquerda, selo PNPC a direita --------------- */
    footer #top .row > div:nth-child(1) {
        flex-direction: row !important;
        flex-wrap: nowrap;
        align-items: center;
        gap: 14px;
    }

    footer #top .row > div:nth-child(1) > .d-flex {
        flex: 1 1 auto;
        min-width: 0;
        align-items: flex-start;
        margin-bottom: 0 !important;
    }

    footer #top .row > div:nth-child(1) > .d-flex > a {
        flex: 0 0 auto;
    }

    /* Pin do endereco: o arquivo original tem 16x24 */
    footer #top .row > div:nth-child(1) > .d-flex > a img {
        width: 16px !important;
        max-width: 16px;
        height: auto;
    }

    footer #top .row > div:nth-child(1) address {
        line-height: 1.55;
    }

    footer #top .row > div:nth-child(1) > div:last-child {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        margin: 0;
    }

    footer #top .row > div:nth-child(1) > div:last-child .pb-3 {
        display: block;
        padding-bottom: 0 !important;
        margin-right: 0 !important;
    }

    footer #top .row > div:nth-child(1) > div:last-child img {
        width: 92px !important;
        max-width: 92px;
        height: auto;
    }
}


/* ==========================================================================
   19. Rodape em celulares - arranjo pedido
   --------------------------------------------------------------------------
   Linha 1: endereco | selo   (dentro da mesma coluna, ver secao 18)
   Linha 2: Saiba mais | Contato
   Linha 3: foto centralizada
   A ordem visual inverte os blocos 2 e 3 do HTML via "order".
   ========================================================================== */
@media (max-width: 575.98px) {

    footer #top > .container-lg > .row > [class*="col-"]:nth-child(1) {
        order: 1;
    }

    /* "Saiba mais" a esquerda */
    footer #top > .container-lg > .row > [class*="col-"]:nth-child(3) {
        order: 2;
        flex: 0 0 46%;
        max-width: 46%;
        padding-right: 10px !important;
        align-self: flex-start;
        border-bottom: 0;
    }

    /* "Contato" a direita */
    footer #top > .container-lg > .row > [class*="col-"]:nth-child(2) {
        order: 3;
        flex: 0 0 54%;
        max-width: 54%;
        padding-left: 10px !important;
        align-self: flex-start;
        border-bottom: 1px solid rgba(255, 255, 255, .22);
    }

    /* A borda da linha 2 precisa atravessar as duas metades */
    footer #top > .container-lg > .row > [class*="col-"]:nth-child(3) {
        box-shadow: 0 1px 0 0 rgba(255, 255, 255, .22);
    }

    /* Foto centralizada, sozinha na ultima linha */
    footer #top > .container-lg > .row > [class*="col-"]:nth-child(4) {
        order: 4;
        flex: 0 0 100%;
        max-width: 100%;
        border-bottom: 0;
    }

    /* Textos mais compactos para caber em meia largura */
    footer #top .row > div:nth-child(2) .letters-14-footer,
    footer #top .row > div:nth-child(3) .letters-14-footer,
    footer #top .row > div:nth-child(3) .custom-menu-footer a {
        font-size: 13px;
        line-height: 1.35;
    }

    footer #top .row > div:nth-child(2) .pb-3 {
        align-items: flex-start;
        min-height: 40px;
    }

    footer #top .row > div:nth-child(2) .pb-3 > img {
        margin-top: 2px;
    }
}


/* ==========================================================================
   17. Tablet e celular - margens laterais iguais em todas as secoes da home
   --------------------------------------------------------------------------
   Ate 850px o style.css aplica "padding: 30px !important" em todo
   .container-lg (16px no celular). Na home ha .container e .container-lg
   aninhados, entao os recuos se somavam: no iPad "Noticias" comecava em
   30px, "Camaras" em 45px e o cartao "Diretoria" em 75px. Aqui o recuo fica
   so no container mais externo.
   ========================================================================== */
@media (max-width: 991.98px) {

    .home .container-lg .container-lg {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .home .container:has(> .container-lg),
    .home .container:has(> .container > .container-lg) {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Diretoria / Inspetorias lado a lado: empilhados, cada cartao ocupava
   uma tela inteira do iPad */
@media (min-width: 768px) and (max-width: 991.98px) {

    .home .container-lg:has(> .last-section) {
        flex-direction: row !important;
        gap: 16px;
    }

    .home .container-lg > .last-section {
        flex: 1 1 0;
        min-width: 0;
        margin-bottom: 0;
    }
}
