/* ==========================================================================
   Portal público — layout institucional, cartões, galerias e acessibilidade
   ========================================================================== */
body.portal { background: #f7f9fc; font-size: 1rem; line-height: 1.6; }
body.portal h1, body.portal h2, body.portal h3 { color: var(--c-navy-900); }
.a11y-bar { background: #eef2f7; border-bottom: 1px solid var(--c-line); font-size: .8rem; }
.a11y-btn { background: #fff; border: 1px solid #c5cdd8; border-radius: 6px; padding: .1rem .55rem; color: var(--c-ink-900); }
.a11y-btn:hover, .a11y-btn[aria-pressed="true"] { background: var(--c-navy-900); color: #fff; }

.portal-header { background: var(--c-navy-900); color: #fff; }
.portal-mark { width: 52px; height: 52px; border-radius: 14px; background: var(--c-gold-500); color: var(--c-navy-900); display: grid; place-items: center; font-weight: 800; font-size: 1.5rem; }
.portal-tag { color: #b8cbe0; max-width: 34rem; }
.portal-nav { background: rgba(255, 255, 255, .06); border-top: 1px solid rgba(255, 255, 255, .1); }
.portal-nav .nav-link { color: #e6eef8; padding: .8rem 1rem; font-weight: 500; border-bottom: 3px solid transparent; }
.portal-nav .nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.portal-nav .nav-link.active { color: #fff; border-bottom-color: var(--c-gold-500); font-weight: 700; }
.portal-footer { background: var(--c-navy-900); color: #d6e2f0; }
.portal-footer a { color: #fff; }
.portal-footer h2 { color: var(--c-gold-500); letter-spacing: .06em; }
.text-muted-footer { color: #9db3cc; }

.hero { background: linear-gradient(135deg, var(--c-navy-900), #14487f); color: #fff; padding: 3.5rem 0; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(200, 150, 43, .35), transparent 65%); }
body.portal .hero h1, .hero h1 { color: #fff; font-weight: 800; font-size: clamp(1.7rem, 4vw, 2.6rem); max-width: 40rem; }
.hero p { color: #cfe0f3; font-size: 1.1rem; max-width: 40rem; }
.section { padding: 2.4rem 0 .4rem; }
.section-title { font-weight: 800; font-size: 1.5rem; margin-bottom: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.section-title::after { content: none; }
.section-title a.more { font-size: .9rem; font-weight: 600; }

.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem; margin-top: 1.6rem; position: relative; z-index: 2; }
/* sobrepõe o hero apenas quando é o bloco logo abaixo dele */
.hero + .container > .quick { margin-top: -2.2rem; }
.quick a { background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); padding: 1rem; text-decoration: none; color: var(--c-ink-900); box-shadow: var(--shadow-md); display: flex; align-items: center; gap: .8rem; font-weight: 600; }
.quick a:hover { border-color: var(--c-navy-600); transform: translateY(-2px); }
.quick i { width: 44px; height: 44px; border-radius: 12px; background: #e4eefb; color: var(--c-navy-700); display: grid; place-items: center; font-size: 1.35rem; flex: none; }

.news-card { background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden; height: 100%; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.news-card:hover { box-shadow: var(--shadow-md); }
.news-card .thumb { aspect-ratio: 16 / 9; background: #dfe7f0 center / cover no-repeat; display: block; }
.news-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-card .body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.news-card h3 { font-size: 1.08rem; margin: .3rem 0; }
.news-card h3 a { color: var(--c-navy-900); text-decoration: none; }
.news-card h3 a:hover { text-decoration: underline; }
.news-meta { font-size: .78rem; color: var(--c-ink-500); }
.badge-cat { background: #e4eefb; color: #0e3d78; font-weight: 600; }
.news-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; }
.news-hero .lead-card { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 320px; background: #14487f center / cover no-repeat; color: #fff; display: flex; align-items: flex-end; }
.news-hero .lead-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(10, 37, 64, .92)); }
.news-hero .lead-card .txt { position: relative; padding: 1.2rem; }
.news-hero .lead-card h3 { color: #fff; font-size: 1.5rem; }
.news-hero .lead-card a { color: #fff; text-decoration: none; }

.muni-card { background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); padding: 1rem; text-align: center; height: 100%; text-decoration: none; color: inherit; display: block; box-shadow: var(--shadow-sm); }
.muni-card:hover { border-color: var(--c-navy-600); box-shadow: var(--shadow-md); }
.muni-card .crest { height: 84px; width: 84px; object-fit: contain; margin: 0 auto .5rem; display: block; }
.muni-card .crest-ph { height: 84px; width: 84px; margin: 0 auto .5rem; border-radius: 50%; background: #e4eefb; color: var(--c-navy-700); display: grid; place-items: center; font-size: 2rem; font-weight: 700; }

.gal-card { display: block; position: relative; border-radius: var(--radius); overflow: hidden; background: #dfe7f0; text-decoration: none; color: #fff; aspect-ratio: 3 / 2; }
.gal-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gal-card:hover img { transform: scale(1.04); }
.gal-card .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: .7rem .9rem; background: linear-gradient(transparent, rgba(10, 37, 64, .9)); font-weight: 600; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .7rem; }
.photo-grid button { border: 0; padding: 0; background: #dfe7f0; border-radius: .5rem; overflow: hidden; aspect-ratio: 3 / 2; display: block; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }

.insta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.insta-grid a { display: block; aspect-ratio: 1; border-radius: .5rem; overflow: hidden; background: #dfe7f0; }
.insta-grid img { width: 100%; height: 100%; object-fit: cover; }

.link-card { background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); padding: .9rem 1rem; display: flex; gap: .8rem; align-items: center; text-decoration: none; color: inherit; height: 100%; }
.link-card:hover { border-color: var(--c-navy-600); box-shadow: var(--shadow-md); }
.link-card .ico { width: 44px; height: 44px; border-radius: 12px; background: #fdf0d3; color: #8a5a00; display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.link-card img { width: 44px; height: 44px; object-fit: contain; }

.article { max-width: 780px; }
.article h1 { font-weight: 800; }
.article .cover { width: 100%; border-radius: var(--radius); margin: 1rem 0; }
.prose { font-size: 1.06rem; }
.prose h3 { margin-top: 1.6rem; font-size: 1.3rem; }
.prose h4 { margin-top: 1.2rem; font-size: 1.1rem; }
.prose blockquote { border-left: 4px solid var(--c-gold-500); margin: 1rem 0; padding: .4rem 1rem; color: var(--c-ink-700); background: #f1f5fa; border-radius: 0 .5rem .5rem 0; }
.prose a { text-decoration: underline; }

/* tamanho do texto e alto contraste (controlados por portal.js) */
html.a11y-large { font-size: 118%; }
html.a11y-larger { font-size: 135%; }
html.a11y-small { font-size: 92%; }
html.a11y-contrast body.portal { background: #000; color: #fff; }
html.a11y-contrast body.portal .card, html.a11y-contrast body.portal .news-card, html.a11y-contrast body.portal .muni-card, html.a11y-contrast body.portal .link-card,
html.a11y-contrast body.portal .quick a, html.a11y-contrast body.portal .filters { background: #000; color: #fff; border-color: #fff; }
html.a11y-contrast body.portal h1, html.a11y-contrast body.portal h2, html.a11y-contrast body.portal h3, html.a11y-contrast body.portal h4, html.a11y-contrast body.portal .news-card h3 a { color: #ffea00; }
html.a11y-contrast body.portal a { color: #7fd1ff; }
html.a11y-contrast body.portal .text-muted, html.a11y-contrast body.portal .news-meta { color: #ddd !important; }
html.a11y-contrast .portal-header, html.a11y-contrast .portal-footer, html.a11y-contrast .hero { background: #000; border-bottom: 2px solid #ffea00; }

@media (max-width: 991.98px) {
    .news-hero { grid-template-columns: 1fr; }
    .hero { padding: 2.2rem 0; }
    .hero + .container > .quick { margin-top: -1.4rem; }
    .portal-nav .nav-link { padding: .65rem 0; }
}

.portal-nav .nav-link { padding: .8rem .7rem; font-size: .93rem; }
.portal-nav .nav { flex-wrap: wrap; }

/* faixa inicial com o logotipo ocupando o centro */
.hero.hero-logo { padding: clamp(1.5rem, 5vw, 3.5rem) 0; text-align: center; min-height: min(62vh, 560px); display: flex; align-items: center; }
.hero.hero-logo::after { display: none; }
.hero.hero-logo .container { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; }
.hero-logo-img { display: block; width: min(1000px, 94%); max-height: min(48vh, 440px); height: auto; object-fit: contain; }
.hero.hero-claro { background: #fff; color: var(--c-ink-900, #1b2a3b); border-bottom: 4px solid var(--c-gold-500); }
.hero.hero-escuro { background: linear-gradient(135deg, var(--c-navy-900), #14487f); color: #fff; }
.hero.hero-logo .hero-tagline { margin: 0; font-size: 1.15rem; max-width: 46rem; }
.hero.hero-claro .hero-tagline { color: #4b5b6d; }
.hero.hero-escuro .hero-tagline { color: #cfe0f3; }
.hero.hero-logo + .container > .quick, .hero.hero-logo + .quick { margin-top: 1.4rem; }
html.a11y-contrast .hero.hero-claro, html.a11y-contrast .hero.hero-escuro { background: #000; border-bottom: 2px solid #ffea00; }

/* menu suspenso "Transparência" */
.portal-nav .dropdown-menu { border-radius: .5rem; border: 1px solid var(--c-line); box-shadow: var(--shadow-md, 0 6px 18px rgba(10, 37, 64, .18)); margin-top: 0; }
.portal-nav .dropdown-item.active, .portal-nav .dropdown-item:active { background: var(--c-navy-900); color: #fff; }
.portal-nav .dropdown-toggle::after { vertical-align: .15em; }

/* barra de acessibilidade ampliada */
.a11y-link { color: var(--c-navy-900); font-weight: 600; text-decoration: none; }
.a11y-link:hover { text-decoration: underline; }
.a11y-btn:focus-visible, .a11y-link:focus-visible, .portal-nav a:focus-visible, main a:focus-visible, main button:focus-visible, footer a:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }
html.a11y-links main a:not(.btn) { text-decoration: underline !important; background: #fff3b0; color: #001a4d !important; padding: 0 .15em; border-radius: 2px; }
html.a11y-spacing body.portal { letter-spacing: .06em; word-spacing: .16em; line-height: 1.9; }
html.a11y-spacing body.portal p, html.a11y-spacing body.portal li { line-height: 1.9; margin-bottom: 1em; }
html.a11y-nomotion *, html.a11y-nomotion *::before, html.a11y-nomotion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
.a11y-ruler { position: fixed; left: 0; right: 0; top: 40%; height: 36px; background: rgba(255, 234, 0, .28); border-top: 2px solid #b39b00; border-bottom: 2px solid #b39b00; pointer-events: none; z-index: 1080; }
html.a11y-contrast .a11y-bar { background: #000; border-bottom: 1px solid #ffea00; }
html.a11y-contrast .a11y-link { color: #ffea00; }
html.a11y-contrast .a11y-btn { background: #000; color: #fff; border-color: #fff; }
html.a11y-contrast .a11y-btn[aria-pressed="true"] { background: #ffea00; color: #000; }
html.a11y-contrast .portal-nav .dropdown-menu { background: #000; border-color: #fff; }
html.a11y-contrast .portal-nav .dropdown-item { color: #7fd1ff; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
@media (min-width: 992px) { .portal-nav .dropdown:hover > .dropdown-menu { display: block; } }
