/* Câmara de Tucuruí — apresentação pública V4.
 * Opt-in no template; não modifica visibilidade, eventos, URLs ou plugins.
 * Sem !important: preferências da barra de acessibilidade têm prioridade.
 * Somente tela: a exportação/impressão conserva sua apresentação original.
 */
@media screen {
  body.cmt-public-visual:not(.high-contrast) {
    --cmt-visual-bg: #f3f5f0;
    --cmt-visual-surface: #ffffff;
    --cmt-visual-ink: #173c40;
    --cmt-visual-muted: #546b68;
    --cmt-visual-brand: #073e45;
    --cmt-visual-action: #075b63;
    --cmt-visual-gold: #dfbd6e;
    --cmt-visual-line: #d7e1da;
    --cmt-visual-soft: #e7ede5;
    --cmt-visual-radius: 16px;
    --cmt-visual-shadow: 0 8px 24px rgb(7 62 69 / 5%);
    background-color: var(--cmt-visual-bg);
    color: var(--cmt-visual-ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
  }

  /* Navegação institucional: preservar o logo claro e o funcionamento original. */
  body.cmt-public-visual:not(.high-contrast) :is(.menu-cmt-header, .portal-header) {
    background: var(--cmt-visual-brand);
    border-bottom: 1px solid rgb(223 189 110 / 24%);
    box-shadow: 0 2px 16px rgb(7 62 69 / 8%);
  }
  body.cmt-public-visual:not(.high-contrast) :is(.menu-cmt-list > li > a, .portal-menu-list > li > a, .portal-menu-list > li > button) {
    font-family: inherit;
    font-weight: 600;
  }
  body.cmt-public-visual:not(.high-contrast) :is(.menu-cmt-submenu, .portal-submenu) {
    background: #0c4a50;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgb(7 62 69 / 18%);
  }
  body.cmt-public-visual:not(.high-contrast) :is(.menu-cmt-list a:hover, .portal-menu-list a:hover) {
    color: #f1d58c;
  }
  body.cmt-public-visual:not(.high-contrast) :is(.menu-cmt-toggle, .portal-menu-toggle) {
    background-color: var(--cmt-visual-brand);
    border-radius: 12px;
  }
  body.cmt-public-visual:not(.high-contrast) :is(.cmt-search .form-control, .portal-search input) {
    border-color: #739590;
    border-radius: 10px;
    font-family: inherit;
  }
  body.cmt-public-visual:not(.high-contrast) :is(#site-footer, .site-footer) {
    background: #082f36;
    border-top: 1px solid rgb(223 189 110 / 25%);
  }
  body.cmt-public-visual:not(.high-contrast) #site-footer .footer-card {
    border-color: rgb(215 225 218 / 18%);
    border-radius: var(--cmt-visual-radius);
    box-shadow: none;
  }

  /* Páginas existentes: não usar seletores por substring nem reset universal. */
  body.cmt-public-visual:not(.high-contrast) :is(.parl-page, .units-page, .cotas-page, .works-page, .strategy-page, .folha-page, .ex-page, .rx-page, .rp-page, .ps-page, .sic-page, .ct-page, .eo-page, .vp-page, .ap-public, .dip-public, .sitemap-wrap, .transparency-section, .cat-section, .page-news) {
    background: var(--cmt-visual-bg);
    color: var(--cmt-visual-ink);
    font-family: inherit;
  }
  body.cmt-public-visual:not(.high-contrast) :is(.hero-lic, .breadcrumb-area, .mesa-public-hero, .parl-hero, .units-hero, .cotas-hero, .em-hero, .cpp-hero, .works-hero, .san-hero, .strategy-hero, .cvp-hero, .ex-hero, .rx-hero, .rp-hero, .pc-hero, .news-hero, .ps-hero, .sic-hero, .ct-hero, .eo-hero, .nf-hero, .cc-hero, .vp-hero, .norm-hero, .dip-hero, .ap-hero) {
    background: var(--cmt-visual-brand);
    color: #fff;
    border-bottom: 1px solid rgb(223 189 110 / 30%);
  }
  body.cmt-public-visual:not(.high-contrast) :is(.hero-lic, .breadcrumb-area, .mesa-public-hero, .parl-hero, .units-hero, .norm-hero, .dip-hero, .ap-hero) :is(h1, h2) {
    font-family: inherit;
    letter-spacing: -.035em;
    line-height: 1.15;
    font-weight: 650;
  }
  body.cmt-public-visual:not(.high-contrast) :is(.tp-title, .sitemap-root-text h2, .cat-title, .transparency-header h2) {
    color: var(--cmt-visual-ink);
    font-family: inherit;
    letter-spacing: -.025em;
    font-weight: 700;
  }
  body.cmt-public-visual:not(.high-contrast) :is(.cat-card, .sitemap-root-card, .sm-card, .page-card, .dt-card, .modern-table-card, .filter-card, .norm-panel, .ex-panel, .rx-panel, .rp-panel, .cpp-panel, .cvp-panel, .eo-panel, .cc-panel, .docs-card, .folha-table-card, .nf-card, .nf-detail-panel, .san-card, .strategy-card, .unit-card, .comm-card, .news-card, .parl-card, .cotas-card, .ps-card, .dip-card, .dip-filter, .ap-filter) {
    border-color: var(--cmt-visual-line);
    border-radius: var(--cmt-visual-radius);
    box-shadow: var(--cmt-visual-shadow);
  }
  body.cmt-public-visual:not(.high-contrast) :is(.cat-card, .unit-card, .news-card, .parl-card, .dip-card) {
    background-color: var(--cmt-visual-surface);
  }
  body.cmt-public-visual:not(.high-contrast) :is(.cat-icon, .sitemap-root-icon, .dip-icon, .ap-card-icon) {
    background: var(--cmt-visual-soft);
    color: var(--cmt-visual-action);
    box-shadow: none;
  }
  body.cmt-public-visual:not(.high-contrast) :is(.cat-divider, .tp-nav .nav-link.active, .tp-smart-entry) {
    background: var(--cmt-visual-action);
    box-shadow: var(--cmt-visual-shadow);
  }
  body.cmt-public-visual:not(.high-contrast) :is(.cat-links a, .sitemap-root-text span) {
    color: var(--cmt-visual-muted);
  }
  body.cmt-public-visual:not(.high-contrast) .cat-links a:hover {
    color: var(--cmt-visual-action);
    text-decoration: underline;
    text-underline-offset: .2em;
  }
  body.cmt-public-visual:not(.high-contrast) :is(.tp-nav .nav-link, .tp-search-input) {
    border-color: var(--cmt-visual-line);
    border-radius: 12px;
  }

  /* Controles de consulta: nenhuma regra de display/width/overflow nas tabelas. */
  body.cmt-public-visual:not(.high-contrast) :is(.norm-btn, .btn-primary, .dip-button) {
    background: var(--cmt-visual-action);
    border-color: var(--cmt-visual-action);
    color: #fff;
    border-radius: 10px;
    box-shadow: none;
  }
  body.cmt-public-visual:not(.high-contrast) :is(.norm-btn, .btn-primary, .dip-button):hover {
    background: var(--cmt-visual-brand);
    border-color: var(--cmt-visual-brand);
  }
  body.cmt-public-visual:not(.high-contrast) :is(.form-control, .form-select):not(.is-invalid):not(.is-valid):not(.was-validated *) {
    border-radius: 10px;
    border-color: #bdcec4;
  }
  body.cmt-public-visual:not(.high-contrast) :is(.form-control, .form-select):not(.is-invalid):not(.is-valid):not(.was-validated *):focus {
    border-color: var(--cmt-visual-action);
    box-shadow: 0 0 0 3px rgb(7 91 99 / 14%);
  }
  body.cmt-public-visual:not(.high-contrast) :is(.dt-container, .dataTables_wrapper) {
    --cmt-table-brand: #075b63;
    --cmt-table-brand-2: #073e45;
    --cmt-table-ink: #173c40;
    --cmt-table-muted: #546b68;
    --cmt-table-line: #d7e1da;
    --cmt-table-soft: #f3f5f0;
    font-family: inherit;
  }
  body.cmt-public-visual:not(.high-contrast) :is(.page-item.active .page-link, .ex-pages .active, .rx-pages .active, .rp-pages .active) {
    background-color: var(--cmt-visual-action);
    border-color: var(--cmt-visual-action);
    color: #fff;
  }
  body.cmt-public-visual:not(.high-contrast) :is(.modern-table-card, .norm-panel, .ex-panel, .rx-panel, .rp-panel) .modal-content {
    border-radius: var(--cmt-visual-radius);
  }

  /* Canais públicos independentes (classe adicionada só ao visitante público). */
  body.cmt-public-visual:not(.high-contrast) .site-header {
    background: #f8faf5;
    border-color: var(--cmt-visual-line);
  }
  body.cmt-public-visual:not(.high-contrast) :is(.hero, .topbar) {
    background: var(--cmt-visual-brand);
  }
  body.cmt-public-visual:not(.high-contrast) .hero::after {
    background: var(--cmt-visual-bg);
  }
  body.cmt-public-visual:not(.high-contrast) :is(.panel, .public-card, .search-panel, .deadline-card, .channel-card, .stats-grid) {
    border-color: var(--cmt-visual-line);
    border-radius: var(--cmt-visual-radius);
    box-shadow: var(--cmt-visual-shadow);
  }
  body.cmt-public-visual:not(.high-contrast) .section-soft {
    background: var(--cmt-visual-soft);
  }
  body.cmt-public-visual:not(.high-contrast) .button:not(.button-light):not(.button-ghost):not(.button-secondary):not(.button-danger) {
    background: var(--cmt-visual-action);
    border-color: var(--cmt-visual-action);
    color: #fff;
    box-shadow: none;
  }

  /* Foco não interfere nos widgets, apenas nos controles próprios do portal. */
  body.cmt-public-visual :is(.menu-cmt-header, .portal-header, main, .tp-nav, .cat-card, .sitemap-wrap, #site-footer) :is(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid #b78827;
    outline-offset: 3px;
  }
}

@media screen and (prefers-reduced-motion: reduce) {
  body.cmt-public-visual :is(.cat-card, .news-card, .parl-card, .button, .btn, .menu-cmt-submenu, .portal-submenu) {
    transition: none;
    animation: none;
  }
}
