/* Museu ODC 3.0.25 — modo de apresentação estável e leve. */

:root {
  --odc325-content-max: 1180px;
  --odc325-gutter: clamp(14px, 3vw, 34px);
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

html body :where(main,.site-main,.entry-content,.wp-block-post-content,.wp-site-blocks) * {
  box-sizing: border-box;
}

/* Evita a pintura do HTML antigo por alguns milissegundos enquanto a camada
   curatorial já existente aplica suas classes. Há uma trava de segurança no JS. */
html.odc325-prepaint body:is(.odc16-page-home,.odc16-page-acervo,.odc16-page-collection,.odc16-page-item) :where(main,.site-main,#content,.site-content) {
  opacity: 0.001;
}
html.odc325-painted body :where(main,.site-main,#content,.site-content) {
  opacity: 1;
}

/* Texto natural em todas as larguras. A justificação é mantida apenas onde há
   largura real; colunas estreitas nunca distribuem palavras artificialmente. */
html body :where(main,.site-main,.entry-content,.wp-block-post-content,.tainacan-item-single-page) :where(p,li,dd,blockquote,.wp-block-paragraph,.metadata-type-textarea,.metadata-type-core_description) {
  letter-spacing: normal;
  word-spacing: normal;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: none;
}

@container (max-width: 620px) {
  html body :where(p,li,dd,blockquote,.wp-block-paragraph) {
    text-align: left !important;
    text-align-last: left !important;
  }
}

/* Elementos editoriais nunca podem reduzir a coluna a uma letra. */
html body :where(h1,h2,h3,h4,h5,h6,.entry-title,.wp-block-heading) {
  min-width: 0;
  max-width: 100%;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  hyphens: none !important;
}

/* Botões e links de navegação: resposta imediata, sem animações demoradas. */
html body :where(a,button,[role="button"],input[type="submit"],input[type="button"]) {
  touch-action: manipulation;
}
html body :where(.odc25-home-primary-nav,.odc15-nav,.odc306-toolbar,.wp-block-buttons) :where(a,button,[role="button"]) {
  transition: background-color .14s ease, color .14s ease, border-color .14s ease, box-shadow .14s ease !important;
}

/* Imagens responsivas sem estourar as laterais do tema. */
html body :where(main,.site-main,.entry-content,.wp-block-post-content) img {
  max-width: 100%;
}

/* Home e áreas institucionais: limite único e seguro para monitores, notebooks,
   tablets e celulares. */
html body.odc16-page-home :where(.odc272-safe-panel,.odc25-home-primary-nav,.odc272-fic-panel,.odc272-institutional-panel,.odc272-cartography-panel,.odc16-home-closing-panel),
html body.odc16-page-acervo :where(#odc261-acervo-apresentacao,.odc16-acervo-grid,.odc274-uniform-grid) {
  width: min(var(--odc325-content-max), calc(100% - (2 * var(--odc325-gutter)))) !important;
  max-width: var(--odc325-content-max) !important;
  margin-inline: auto !important;
}

/* Impede a regressão do bloco FIC em telas intermediárias. Não reorganiza DOM;
   apenas garante que qualquer coluna textual tenha largura utilizável. */
html body.odc16-page-home .odc272-fic-panel {
  min-width: 0 !important;
}
html body.odc16-page-home .odc272-fic-panel > * {
  min-width: 0 !important;
  max-width: 100% !important;
}
html body.odc16-page-home .odc272-fic-panel :where(h1,h2,h3,h4,h5,h6) {
  width: 100% !important;
  max-width: 24ch !important;
  line-height: 1.08 !important;
  letter-spacing: 0 !important;
  word-spacing: normal !important;
  text-align: left !important;
  text-align-last: left !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}
html body.odc16-page-home .odc272-fic-panel :where(p,li,blockquote) {
  width: 100% !important;
  max-width: 60ch !important;
  line-height: 1.55 !important;
  letter-spacing: 0 !important;
  word-spacing: normal !important;
  text-align: left !important;
  text-align-last: left !important;
}

/* Faixas de consentimento conhecidas: leves, legíveis e sem bloquear toda a
   tela. A lógica do plugin de consentimento permanece intacta. */
:where(#cookie-notice,#cookie-law-info-bar,.cky-consent-container,.cmplz-cookiebanner,.moove-gdpr-info-bar,.cc-window,.cookie-banner,.cookie-consent-banner) {
  max-width: min(960px, calc(100vw - 24px)) !important;
  max-height: min(54vh, 560px) !important;
  overflow: auto !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
  contain: layout paint;
}
:where(#cookie-notice,#cookie-law-info-bar,.cky-consent-container,.cmplz-cookiebanner,.moove-gdpr-info-bar,.cc-window,.cookie-banner,.cookie-consent-banner) :where(button,a,[role="button"]) {
  min-height: 42px;
  white-space: normal !important;
  word-break: normal !important;
}

/* Modo leve automático para computadores modestos e economia de dados. */
html.odc325-lite,
html.odc325-lite body {
  scroll-behavior: auto !important;
}
html.odc325-lite body *,
html.odc325-lite body *::before,
html.odc325-lite body *::after {
  animation: none !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}
html.odc325-lite body :where(.site,.wp-site-blocks,main,section,article,[class*="panel"],[class*="hero"],[class*="cover"]) {
  background-attachment: scroll !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
}
html.odc325-lite body :where(.odc272-fic-panel,.odc272-institutional-panel,.odc272-cartography-panel,.odc15-item-description,.odc315-accessible) {
  box-shadow: none !important;
}

@media (max-width: 980px) {
  html body.odc16-page-home .odc272-fic-panel {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) !important;
    gap: 20px !important;
  }
  html body.odc16-page-home .odc272-fic-panel > * {
    grid-column: 1 !important;
    width: 100% !important;
  }
  html body.odc16-page-home .odc272-fic-panel :where(h1,h2,h3,h4,h5,h6,p,li,blockquote) {
    max-width: 100% !important;
  }
}

@media (max-width: 680px) {
  :root { --odc325-gutter: 10px; }
  html,body { overflow-x: hidden; }
  html body :where(main,.site-main,.entry-content,.wp-block-post-content,.tainacan-item-single-page) :where(p,li,dd,blockquote,.wp-block-paragraph,.metadata-type-textarea,.metadata-type-core_description) {
    text-align: left !important;
    text-align-last: left !important;
    line-height: 1.55 !important;
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
  }
  :where(#cookie-notice,#cookie-law-info-bar,.cky-consent-container,.cmplz-cookiebanner,.moove-gdpr-info-bar,.cc-window,.cookie-banner,.cookie-consent-banner) {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    max-height: 62vh !important;
    margin: 8px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html,body { scroll-behavior: auto !important; }
  *,*::before,*::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
