/* Camada visual compartilhada do portal — carregada depois do Tailwind. */
:root {
    --color-brand-900: #003821;
    --color-brand-800: #004b2c;
    --color-brand-700: #005b35;
    --color-brand-600: #007044;
    --color-accent: #f6c515;
    --color-focus: #ffd84d;
    --color-text: #172033;
    --color-muted: #526078;
    --color-surface: #ffffff;
    --color-page: #f4f7f6;
    --shadow-card: 0 8px 28px rgb(15 45 31 / 9%);
}

html { color-scheme: light; }
body {
    min-width: 320px;
    overflow-x: hidden;
    background: var(--color-page);
    color: var(--color-text);
    line-height: 1.6;
}
img, svg, video, iframe { max-width: 100%; }

/* Um foco claro e consistente, inclusive sobre a navegação verde. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid var(--color-focus) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px rgb(0 56 33 / 35%);
}
:where(a, button, input, select, textarea, [tabindex]):focus:not(:focus-visible) {
    outline: none !important;
}
.skip-link {
    top: 0 !important;
    left: 1rem !important;
    z-index: 10000 !important;
    padding: .75rem 1rem !important;
    border-radius: 0 0 .75rem .75rem;
    transform: translateY(-120%);
    transition: transform .2s ease !important;
}
.skip-link:focus { transform: translateY(0); }

/* Cabeçalho com hierarquia mais limpa e sem saltos de largura. */
header { border-bottom: 1px solid rgb(0 91 53 / 14%); }
header > .container { max-width: 1280px; }
header nav { box-shadow: inset 0 1px rgb(255 255 255 / 10%); }
header nav a { min-height: 52px; }
#campo-busca { color: var(--color-text); }
#campo-busca::placeholder { color: #68758a; opacity: 1; }

/* Superfícies e cartões da página inicial. */
.home-banner-section,
.main-slider { background: #0f172a; }
.main-slider,
.main-slider .slick-list,
.main-slider .slick-track,
.main-slider .slick-slide,
.main-slider .slick-slide > div,
.home-banner-slide { height: clamp(260px, 32vw, 480px); }
.main-slider .slick-slide > div { line-height: 0; }
.home-banner-slide { line-height: 1.6; }
.main-slider:not(.slick-initialized) > .home-banner-slide:not(:first-child) { display: none; }
.main-slider .slick-dots {
    position: absolute;
    z-index: 20;
    right: 0;
    bottom: 1rem;
    left: 0;
    display: flex;
    justify-content: center;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.main-slider .slick-dots li { width: auto; height: auto; margin: 0; }
.main-slider .slick-dots button {
    display: block;
    width: .75rem;
    height: .75rem;
    padding: 0;
    overflow: hidden;
    border: 2px solid #fff;
    border-radius: 999px;
    background: rgb(255 255 255 / 45%);
    color: transparent;
    font-size: 0;
    cursor: pointer;
}
.main-slider .slick-dots .slick-active button { background: var(--color-accent); border-color: var(--color-accent); }
.home-news-section,
.home-transparency-section { background-color: var(--color-surface) !important; }
.home-ods-section,
.home-quick-access { background-color: var(--color-page) !important; }
.home-news-grid article {
    padding: 1rem;
    border: 1px solid #e1e9e5;
    border-radius: 1.5rem;
    background: #fff;
    box-shadow: var(--shadow-card);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.home-news-grid article:hover {
    transform: translateY(-4px);
    border-color: rgb(0 91 53 / 30%);
    box-shadow: 0 18px 38px rgb(15 45 31 / 14%);
}
.home-news-grid article img { background: #e9efec; }
.home-quick-access a {
    border: 1px solid #e1e9e5;
    box-shadow: var(--shadow-card);
}
.ods-overview-item { box-shadow: 0 5px 16px rgb(15 23 42 / 8%); }
.cidade-rich-text > * + * { margin-top: 1rem; }
.cidade-rich-text h2 { margin-top: 1.75rem; font-size: 1.5rem; font-weight: 800; color: var(--color-brand-700); }
.cidade-rich-text h3 { margin-top: 1.5rem; font-size: 1.2rem; font-weight: 750; color: var(--color-text); }
.cidade-rich-text :where(ul, ol) { padding-left: 1.5rem; }
.cidade-rich-text ul { list-style: disc; }
.cidade-rich-text ol { list-style: decimal; }
.cidade-rich-text a { color: var(--color-brand-700); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.dark .cidade-rich-text h2, .dark .cidade-rich-text a { color: #5ee0a3; }
.dark .cidade-rich-text h3 { color: #f1f5f9; }
.cidade-blocks { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1.5rem; align-items: stretch; }
.cidade-content-card { grid-column: span 12; overflow: hidden; border: 1px solid #dde6e1; border-radius: 1.25rem; background: #fff; box-shadow: var(--shadow-card); }
.cidade-span-3 { grid-column: span 3; }.cidade-span-4 { grid-column: span 4; }.cidade-span-6 { grid-column: span 6; }.cidade-span-8 { grid-column: span 8; }.cidade-span-12 { grid-column: span 12; }
.cidade-card-header { display: flex; align-items: center; gap: .9rem; padding: 1.35rem 1.5rem 0; border: 0; box-shadow: none; }
.cidade-card-header h3 { font-size: 1.25rem; line-height: 1.25; font-weight: 800; color: #101827; }
.cidade-card-header p { margin-top: .25rem; color: #637083; font-size: .92rem; }
.cidade-card-icon { display: grid; place-items: center; flex: 0 0 2.5rem; width: 2.5rem; height: 2.5rem; border-radius: .75rem; background: color-mix(in srgb, var(--card-color) 12%, white); color: var(--card-color); font-size: 1.15rem; }
.cidade-rich-text { padding: 1rem 1.5rem 1.5rem; color: #334155; }
.cidade-color-verde { --card-color: #00663c; --card-color-2: #008d54; }.cidade-color-azul { --card-color: #2563eb; --card-color-2: #4b8df8; }.cidade-color-amarelo { --card-color: #bd8200; --card-color-2: #e5aa00; }.cidade-color-vermelho { --card-color: #dc2626; --card-color-2: #ef4444; }.cidade-color-roxo { --card-color: #7c3aed; --card-color-2: #a044ed; }.cidade-color-neutro { --card-color: #475569; --card-color-2: #64748b; }
.cidade-style-colorido .cidade-card-header { min-height: 7.5rem; justify-content: center; text-align: center; padding: 1.5rem; background: linear-gradient(135deg,var(--card-color),var(--card-color-2)); }
.cidade-style-colorido .cidade-card-header h3, .cidade-style-colorido .cidade-card-header p { color: #fff; }.cidade-style-colorido .cidade-card-icon { background: rgb(255 255 255 / 17%); color: #fff; font-size: 1.8rem; }
.cidade-style-destaque { border-color: color-mix(in srgb,var(--card-color) 35%,white); background: linear-gradient(135deg,color-mix(in srgb,var(--card-color) 10%,white),#fff); text-align: center; }.cidade-style-destaque .cidade-card-header { justify-content: center; padding-top: 2rem; }.cidade-style-destaque .cidade-card-header h3 { color: var(--card-color); font-size: clamp(1.8rem,4vw,3rem); }.cidade-style-destaque .cidade-card-icon { display: none; }
.cidade-style-horizontal { display: grid; grid-template-columns: minmax(220px, .4fr) 1fr; }.cidade-style-horizontal .cidade-card-header { align-items: center; justify-content: center; flex-direction: column; text-align: center; padding: 2rem; background: linear-gradient(135deg,var(--card-color),var(--card-color-2)); }.cidade-style-horizontal .cidade-card-header :where(h3,p) { color:#fff; }.cidade-style-horizontal .cidade-card-icon { color:#fff; background:rgb(255 255 255 / 18%); font-size:2rem; width:4rem; height:4rem; }
.cidade-style-simples { border: 0; border-radius: 0; background: transparent; box-shadow: none; }.cidade-style-simples .cidade-card-header,.cidade-style-simples .cidade-rich-text { padding-inline: 0; }
.dark .cidade-content-card { background:#182231; border-color:#334155; }.dark .cidade-card-header h3 { color:#f8fafc; }.dark .cidade-card-header p,.dark .cidade-rich-text { color:#cbd5e1; }

/* Evita que ações fixas cubram links e rodapé. */
.site-floating-actions { bottom: max(1rem, env(safe-area-inset-bottom)); }
[vw].site-floating-accessibility {
    position: fixed !important;
    top: auto !important;
    right: auto !important;
    bottom: max(1rem, env(safe-area-inset-bottom)) !important;
    left: 1rem !important;
    z-index: 2147483000 !important;
}
[vw].site-floating-accessibility [vw-access-button] {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    width: 3.5rem !important;
    height: 3.5rem !important;
    border-radius: .85rem !important;
    box-shadow: 0 8px 24px rgb(15 23 42 / 24%);
}
#menu-acessibilidade-flutuante {
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
}

/* Modo escuro completo, inclusive nas seções que tinham branco fixo. */
html.dark { color-scheme: dark; }
.dark .home-news-section,
.dark .home-transparency-section { background-color: #111827 !important; }
.dark .home-ods-section,
.dark .home-quick-access { background-color: #0b1220 !important; border-color: #263244; }
.dark .home-news-grid article,
.dark .home-quick-access a {
    background: #182231 !important;
    border-color: #334155;
}
.dark .home-news-grid h3,
.dark .home-quick-access span,
.dark .home-section-heading,
.dark .home-ods-section h2,
.dark .home-quick-access h2,
.dark .home-transparency-section h2 { color: #f1f5f9 !important; }
.dark .home-news-grid p,
.dark .home-ods-section p { color: #bdc8d7 !important; }

/* Alto contraste sem filtros que distorcem imagens e ícones. */
body.alto-contraste { filter: none !important; background: #000 !important; color: #fff !important; }
body.alto-contraste :where(header, main, footer, section, nav, article, div) {
    background-color: #000 !important;
    background-image: none !important;
    color: #fff !important;
    border-color: #fff !important;
}
body.alto-contraste :where(a, button) { color: #ffeb3b !important; text-decoration-thickness: 2px !important; }
body.alto-contraste :where(input, select, textarea) { background: #000 !important; color: #fff !important; border: 2px solid #fff !important; }
body.alto-contraste img { filter: none !important; opacity: 1 !important; }

@media (max-width: 1023px) {
    header { position: relative !important; top: auto !important; }
    header > .container { padding-top: .75rem !important; padding-bottom: .75rem !important; }
    header > .container > div { gap: .85rem !important; }
}

@media (max-width: 640px) {
    #barra-acessibilidade > .container > div:first-child { flex-wrap: wrap; gap: .75rem; }
    #barra-acessibilidade > .container > div:first-child > .font-semibold,
    #barra-acessibilidade > .container > div:first-child > a[href="#conteudo-principal"] { display: none; }
    #barra-acessibilidade > .container > div:last-child { width: 100%; justify-content: space-between; gap: .5rem; }
    #botao-status-atendimento-barra { padding-inline: .4rem !important; }
    header > .container > div > a:first-child { gap: .75rem; align-self: flex-start; }
    header > .container > div > a:first-child img { width: 3.75rem; height: 3.75rem; }
    header > .container > div > a:first-child h2 { font-size: 1.35rem; }
    header > .container > div > a:first-child p { display: none; }
    #campo-busca { min-height: 46px; font-size: 16px; }
    .main-slider,
    .main-slider .slick-list,
    .main-slider .slick-track,
    .main-slider .slick-slide,
    .main-slider .slick-slide > div,
    .home-banner-slide { height: clamp(220px, 62vw, 300px); min-height: 0; }
    .home-news-section, .home-transparency-section { padding-block: 2.25rem !important; }
    .home-quick-access { padding-block: 2.25rem !important; }
    .home-quick-access .grid { grid-template-columns: 1fr 1fr; gap: .75rem; }
    .home-quick-access a { padding: 1rem .5rem !important; min-height: 132px; }
    .site-floating-actions { right: .75rem !important; gap: .65rem !important; }
    .site-floating-actions > * { width: 3rem !important; height: 3rem !important; font-size: 1.1rem !important; }
    #menu-acessibilidade-flutuante { right: .75rem !important; bottom: 4.75rem !important; padding: 1rem !important; }
    [vw].site-floating-accessibility {
        right: auto !important;
        bottom: max(.75rem, env(safe-area-inset-bottom)) !important;
        left: .75rem !important;
    }
    [vw].site-floating-accessibility [vw-access-button] { width: 3.25rem !important; height: 3.25rem !important; }
    footer { padding-top: 2.5rem !important; padding-bottom: 6rem !important; }
    .cidade-blocks { gap: 1rem; }.cidade-content-card { grid-column: span 12 !important; }.cidade-style-horizontal { display:block; }.cidade-card-header,.cidade-rich-text { padding-inline:1.15rem; }
}

@media (min-width: 641px) and (max-width: 1023px) { .cidade-span-3,.cidade-span-4 { grid-column:span 6; }.cidade-span-8 { grid-column:span 12; } }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

@media print {
    body { background: #fff !important; color: #000 !important; }
    a { color: #000 !important; text-decoration: underline; }
    .site-floating-actions, #menu-acessibilidade-flutuante, [vw] { display: none !important; }
}
