/*
 * Alto contraste integral — Portal da Transparência de Goiana
 * Regras exclusivamente ativas quando html.tg-high-contrast / body.a11y-contrast.
 * Não altera o layout ou as cores no modo normal.
 */
html.tg-high-contrast,
html.tg-high-contrast body,
body.a11y-contrast,
body.contrast {
  --blue:#000 !important;
  --blue2:#000 !important;
  --yellow:#ff0 !important;
  --text:#fff !important;
  --muted:#fff !important;
  --bg:#000 !important;
  --card:#000 !important;
  --line:#fff !important;
  --shadow:none !important;
  color-scheme:dark !important;
  background:#000 !important;
  color:#fff !important;
}

html.tg-high-contrast body,
html.tg-high-contrast body *:not(script):not(style):not(meta):not(link),
body.a11y-contrast,
body.a11y-contrast *:not(script):not(style):not(meta):not(link),
body.contrast,
body.contrast *:not(script):not(style):not(meta):not(link) {
  background-color:#000 !important;
  background-image:none !important;
  color:#fff !important;
  border-color:#fff !important;
  box-shadow:none !important;
  text-shadow:none !important;
  opacity:1 !important;
}

html.tg-high-contrast body *::before,
html.tg-high-contrast body *::after,
body.a11y-contrast *::before,
body.a11y-contrast *::after,
body.contrast *::before,
body.contrast *::after {
  background-color:transparent !important;
  background-image:none !important;
  color:inherit !important;
  border-color:currentColor !important;
  box-shadow:none !important;
  text-shadow:none !important;
}

/* Conteúdo textual */
html.tg-high-contrast :is(h1,h2,h3,h4,h5,h6,p,span,small,strong,b,em,i,label,legend,dt,dd,li,address,time,caption,figcaption),
body.a11y-contrast :is(h1,h2,h3,h4,h5,h6,p,span,small,strong,b,em,i,label,legend,dt,dd,li,address,time,caption,figcaption),
body.contrast :is(h1,h2,h3,h4,h5,h6,p,span,small,strong,b,em,i,label,legend,dt,dd,li,address,time,caption,figcaption) {
  color:#fff !important;
}

/* Links e controles interativos */
html.tg-high-contrast :is(a,a *,button,button *,.btn,.btn *,[role="button"],[role="button"] *,summary,.chip,.expense-chip,.pd-btn,.home-btn,.btn-hero,.drive-download,.drive-doc-item),
body.a11y-contrast :is(a,a *,button,button *,.btn,.btn *,[role="button"],[role="button"] *,summary,.chip,.expense-chip,.pd-btn,.home-btn,.btn-hero,.drive-download,.drive-doc-item),
body.contrast :is(a,a *,button,button *,.btn,.btn *,[role="button"],[role="button"] *,summary,.chip,.expense-chip,.pd-btn,.home-btn,.btn-hero,.drive-download,.drive-doc-item) {
  background:#000 !important;
  color:#ff0 !important;
  border-color:#ff0 !important;
  text-decoration-color:#ff0 !important;
  box-shadow:none !important;
}

html.tg-high-contrast :is(a,button,.btn,[role="button"],summary,.chip,.expense-chip,.pd-btn,.home-btn,.btn-hero,.drive-download,.drive-doc-item):is(:hover,:focus,:focus-visible),
body.a11y-contrast :is(a,button,.btn,[role="button"],summary,.chip,.expense-chip,.pd-btn,.home-btn,.btn-hero,.drive-download,.drive-doc-item):is(:hover,:focus,:focus-visible),
body.contrast :is(a,button,.btn,[role="button"],summary,.chip,.expense-chip,.pd-btn,.home-btn,.btn-hero,.drive-download,.drive-doc-item):is(:hover,:focus,:focus-visible) {
  background:#ff0 !important;
  color:#000 !important;
  border-color:#ff0 !important;
  text-decoration-color:#000 !important;
}

html.tg-high-contrast :is([aria-current="page"],[aria-selected="true"],[aria-pressed="true"],.active,.selected,.chip.active,.expense-chip.active,.pd-primary),
body.a11y-contrast :is([aria-current="page"],[aria-selected="true"],[aria-pressed="true"],.active,.selected,.chip.active,.expense-chip.active,.pd-primary),
body.contrast :is([aria-current="page"],[aria-selected="true"],[aria-pressed="true"],.active,.selected,.chip.active,.expense-chip.active,.pd-primary) {
  background:#ff0 !important;
  color:#000 !important;
  border-color:#ff0 !important;
}

html.tg-high-contrast :is([disabled],[aria-disabled="true"],.disabled),
body.a11y-contrast :is([disabled],[aria-disabled="true"],.disabled),
body.contrast :is([disabled],[aria-disabled="true"],.disabled) {
  background:#000 !important;
  color:#ddd !important;
  border-color:#ddd !important;
  opacity:1 !important;
  text-decoration:line-through !important;
}

/* Formulários */
html.tg-high-contrast :is(input,textarea,select,option,optgroup,fieldset,datalist),
body.a11y-contrast :is(input,textarea,select,option,optgroup,fieldset,datalist),
body.contrast :is(input,textarea,select,option,optgroup,fieldset,datalist) {
  background:#000 !important;
  color:#fff !important;
  border:2px solid #fff !important;
  box-shadow:none !important;
  caret-color:#ff0 !important;
}
html.tg-high-contrast :is(input,textarea)::placeholder,
body.a11y-contrast :is(input,textarea)::placeholder,
body.contrast :is(input,textarea)::placeholder {
  color:#fff !important;
  opacity:1 !important;
}
html.tg-high-contrast :is(input[type="checkbox"],input[type="radio"]),
body.a11y-contrast :is(input[type="checkbox"],input[type="radio"]),
body.contrast :is(input[type="checkbox"],input[type="radio"]) {
  accent-color:#ff0 !important;
}

/* Tabelas e dados públicos */
html.tg-high-contrast :is(table,thead,tbody,tfoot,tr,th,td,.pd-table,.pd-table-wrap,.pd-toolbar,.pd-pager,.public-data,.public-data-shell,.public-data-shell .card,.group-row,.group-total-row,.group-total-box),
body.a11y-contrast :is(table,thead,tbody,tfoot,tr,th,td,.pd-table,.pd-table-wrap,.pd-toolbar,.pd-pager,.public-data,.public-data-shell,.public-data-shell .card,.group-row,.group-total-row,.group-total-box),
body.contrast :is(table,thead,tbody,tfoot,tr,th,td,.pd-table,.pd-table-wrap,.pd-toolbar,.pd-pager,.public-data,.public-data-shell,.public-data-shell .card,.group-row,.group-total-row,.group-total-box) {
  background:#000 !important;
  color:#fff !important;
  border-color:#fff !important;
}
html.tg-high-contrast :is(th,.pd-table th),
body.a11y-contrast :is(th,.pd-table th),
body.contrast :is(th,.pd-table th) {
  color:#ff0 !important;
  border-bottom:2px solid #ff0 !important;
}
html.tg-high-contrast :is(tr:hover,tbody tr:hover,tbody tr:focus-within),
body.a11y-contrast :is(tr:hover,tbody tr:hover,tbody tr:focus-within),
body.contrast :is(tr:hover,tbody tr:hover,tbody tr:focus-within) {
  outline:2px solid #ff0 !important;
  outline-offset:-2px !important;
}

/* Regiões, cards, cabeçalhos, rodapés, modais e conteúdo dinâmico */
html.tg-high-contrast :is(header,footer,nav,main,section,article,aside,dialog,details,.modal,.modal-content,.modal-dialog,.modal-backdrop,.drive-modal,.drive-modal-box,.drive-modal-top,.hero,.subpage-hero,.brandbar,.nav,.access-top,.footer-main,.footer-bottom,.card,.page-box,.page-card,.transp-card,.sitemap-card,.sitemap-group,.drive-docs,.drive-docs-head,.drive-docs-filters,.drive-empty,.k,.blue,.green,.red,.purple,.badge,.alert,.toast,.dropdown-menu,.menu),
body.a11y-contrast :is(header,footer,nav,main,section,article,aside,dialog,details,.modal,.modal-content,.modal-dialog,.modal-backdrop,.drive-modal,.drive-modal-box,.drive-modal-top,.hero,.subpage-hero,.brandbar,.nav,.access-top,.footer-main,.footer-bottom,.card,.page-box,.page-card,.transp-card,.sitemap-card,.sitemap-group,.drive-docs,.drive-docs-head,.drive-docs-filters,.drive-empty,.k,.blue,.green,.red,.purple,.badge,.alert,.toast,.dropdown-menu,.menu),
body.contrast :is(header,footer,nav,main,section,article,aside,dialog,details,.modal,.modal-content,.modal-dialog,.modal-backdrop,.drive-modal,.drive-modal-box,.drive-modal-top,.hero,.subpage-hero,.brandbar,.nav,.access-top,.footer-main,.footer-bottom,.card,.page-box,.page-card,.transp-card,.sitemap-card,.sitemap-group,.drive-docs,.drive-docs-head,.drive-docs-filters,.drive-empty,.k,.blue,.green,.red,.purple,.badge,.alert,.toast,.dropdown-menu,.menu) {
  background:#000 !important;
  background-image:none !important;
  color:#fff !important;
  border-color:#fff !important;
  box-shadow:none !important;
}

/* Preserva legibilidade de ícones e mídias sem manter fundos coloridos */
html.tg-high-contrast :is(img,picture,video,canvas,iframe,embed,object),
body.a11y-contrast :is(img,picture,video,canvas,iframe,embed,object),
body.contrast :is(img,picture,video,canvas,iframe,embed,object) {
  background:#fff !important;
  border:2px solid #fff !important;
  filter:grayscale(100%) contrast(175%) !important;
  opacity:1 !important;
}
html.tg-high-contrast :is(svg,svg *),
body.a11y-contrast :is(svg,svg *),
body.contrast :is(svg,svg *) {
  fill:currentColor !important;
  stroke:currentColor !important;
}

/* Código, citações e divisores */
html.tg-high-contrast :is(pre,code,kbd,samp,blockquote,hr),
body.a11y-contrast :is(pre,code,kbd,samp,blockquote,hr),
body.contrast :is(pre,code,kbd,samp,blockquote,hr) {
  background:#000 !important;
  color:#fff !important;
  border-color:#fff !important;
}

/* Elementos com estilo inline ou fundos herdados */
html.tg-high-contrast [style],
body.a11y-contrast [style],
body.contrast [style] {
  background-color:#000 !important;
  background-image:none !important;
  color:#fff !important;
  border-color:#fff !important;
  box-shadow:none !important;
  text-shadow:none !important;
}
html.tg-high-contrast [style] :is(a,button,[role="button"]),
body.a11y-contrast [style] :is(a,button,[role="button"]),
body.contrast [style] :is(a,button,[role="button"]) {
  color:#ff0 !important;
}

/* Foco, seleção e barra de rolagem */
html.tg-high-contrast :focus-visible,
body.a11y-contrast :focus-visible,
body.contrast :focus-visible {
  outline:4px solid #ff0 !important;
  outline-offset:3px !important;
}
html.tg-high-contrast ::selection,
body.a11y-contrast ::selection,
body.contrast ::selection {
  background:#ff0 !important;
  color:#000 !important;
}
html.tg-high-contrast *,body.a11y-contrast *,body.contrast * {
  scrollbar-color:#ff0 #000 !important;
}
html.tg-high-contrast *::-webkit-scrollbar,body.a11y-contrast *::-webkit-scrollbar,body.contrast *::-webkit-scrollbar {background:#000 !important;}
html.tg-high-contrast *::-webkit-scrollbar-thumb,body.a11y-contrast *::-webkit-scrollbar-thumb,body.contrast *::-webkit-scrollbar-thumb {background:#ff0 !important;border:2px solid #000 !important;}

/* O atalho para conteúdo deve permanecer claramente visível. */
html.tg-high-contrast .skip,
body.a11y-contrast .skip,
body.contrast .skip {
  background:#ff0 !important;
  color:#000 !important;
  border:3px solid #fff !important;
  z-index:2147483647 !important;
}

@media (forced-colors:active) {
  * { forced-color-adjust:auto; }
  img,video,canvas,iframe { forced-color-adjust:none; }
}
