/* FUCAM V4.5 — ajuste visual incremental da home, sem alterar menus, CMS ou dados.
   Carregado DEPOIS do fucam-home-v4.css para retirar a coluna antiga. */

/* Impede deslocamento lateral da página, sem desabilitar o scroll vertical. */
html:has(> body.fucam-home-v4),
body.fucam-home-v4 {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}
body.fucam-home-v4 { min-width: 0; }
.fucam-home-v4 #conteudo { width:100%; max-width:100%; min-width:0; }
.fucam-home-v4 .home-v4-shell {
    display: block !important;
    grid-template-columns: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    margin-inline: auto;
}
.fucam-home-v4 .home-v4-main {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
}
/* A sidebar antiga não ocupa espaço: as três seções estão no dropdown do topo. */
.fucam-home-v4 .home-v4-sidebar { display:none !important; }
.fucam-home-v4 .home-v4-main > .legacy-hero,
.fucam-home-v4 .home-v4-main > .home-service-strip,
.fucam-home-v4 .home-v4-main > .home-mission-band {
    display:block;
    width:100%;
    max-width:100%;
    min-width:0;
}
.fucam-home-v4 .fucam-banner-carousel,
.fucam-home-v4 .fucam-banner-slide { max-width:100%; min-width:0; }

/* Notícias ocupam a largura útil, com respiro equilibrado em telas grandes. */
.fucam-home-v4 .home-news-panel {
    width: 100%;
    max-width: 1700px;
    min-width: 0;
    margin-inline: auto;
    padding: clamp(26px, 3vw, 45px) clamp(22px, 3.2vw, 60px) 48px;
}
.fucam-home-v4 .legacy-news-grid,
.fucam-home-v4 .home-service-grid { min-width:0; max-width:100%; }
.fucam-home-v4 .legacy-news-grid > *,
.fucam-home-v4 .home-service-grid > * { min-width:0; }

/* A antiga margem negativa do menu institucional podia alargar a página. */
.fucam-home-v4 .utility-actions { margin-right:0 !important; }
.fucam-home-v4 .utility-inner,
.fucam-home-v4 .header-inner { max-width:100%; }

/* Popover independente do conteúdo principal, respeitando a viewport. */
.fucam-home-v4 .home-v4-header-quick-wrap { position:relative; }
.fucam-home-v4 .home-v4-quick-popover {
    box-sizing:border-box;
    max-width:calc(100vw - 24px);
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior-y:contain;
}
.fucam-home-v4 .home-v4-quick-popover[hidden] { display:none !important; }

/* Barra de rolagem verde da FUCAM na home e no menu suspenso. */
html:has(> body.fucam-home-v4),
.fucam-home-v4,
.fucam-home-v4 .home-v4-quick-popover {
    scrollbar-color:var(--brand-700) var(--surface-2);
    scrollbar-width:thin;
}
html:has(> body.fucam-home-v4)::-webkit-scrollbar,
.fucam-home-v4::-webkit-scrollbar,
.fucam-home-v4 .home-v4-quick-popover::-webkit-scrollbar { width:10px; height:10px; }
html:has(> body.fucam-home-v4)::-webkit-scrollbar-track,
.fucam-home-v4::-webkit-scrollbar-track,
.fucam-home-v4 .home-v4-quick-popover::-webkit-scrollbar-track { background:var(--surface-2); }
html:has(> body.fucam-home-v4)::-webkit-scrollbar-thumb,
.fucam-home-v4::-webkit-scrollbar-thumb,
.fucam-home-v4 .home-v4-quick-popover::-webkit-scrollbar-thumb {
    background:var(--brand-700);
    border:2px solid var(--surface-2);
    border-radius:var(--radius-md);
}
html:has(> body.fucam-home-v4)::-webkit-scrollbar-thumb:hover,
.fucam-home-v4::-webkit-scrollbar-thumb:hover,
.fucam-home-v4 .home-v4-quick-popover::-webkit-scrollbar-thumb:hover { background:var(--brand-800); }

/* Ajuste proporcional dos cards e menu em notebooks/tablets. */
@media (min-width:761px) and (max-width:1280px) {
    .fucam-home-v4 .header-inner {
        display:grid;
        grid-template-columns:minmax(155px,1fr) minmax(150px,230px) auto;
        column-gap:1rem;
        row-gap:.2rem;
    }
    .fucam-home-v4 .main-nav {
        grid-column:1/-1;
        grid-row:2;
        flex-wrap:wrap;
        justify-content:center;
        min-width:0;
        padding-bottom:.65rem;
    }
    .fucam-home-v4 .site-search {
        grid-column:2;
        grid-row:1;
        width:100%;
        max-width:none;
        justify-self:stretch;
        margin:0;
    }
    .fucam-home-v4 .home-v4-header-quick-wrap { grid-column:3; grid-row:1; }
    .fucam-home-v4 .home-service-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width: 960px) and (min-width:761px) {
    .fucam-home-v4 .legacy-news-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:760px) {
    .fucam-home-v4 .header-inner { width:calc(100% - 30px); max-width:100%; }
    .fucam-home-v4 .utility-inner { flex-wrap:wrap; justify-content:center; }
    .fucam-home-v4 .utility-links { flex-wrap:wrap; min-width:0; }
    .fucam-home-v4 .home-service-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .fucam-home-v4 .legacy-news-grid { grid-template-columns:minmax(0,1fr); }
    .fucam-home-v4 .home-news-panel { padding:26px 16px 36px; }
    .fucam-home-v4 .home-v4-quick-popover { width:min(425px,calc(100vw - 24px)); }
}
@media (max-width:420px) {
    .fucam-home-v4 .home-service-grid { grid-template-columns:minmax(0,1fr); }
    .fucam-home-v4 .home-service-grid a { min-height:58px; }
    .fucam-home-v4 .home-mission-inner > a { max-width:100%; white-space:normal; }
}
@supports not (overflow:clip) {
    html:has(> body.fucam-home-v4), body.fucam-home-v4 { overflow-x:hidden; }
}
