/* Shared PT-BR shell additions. Keep page-specific CSS out of translated HTML. */
:root {
  --pt-page-max: 1180px;
  --pt-reading-max: 820px;
}

/* PT pages must never grow wider than the viewport. */
html[lang^="pt"],
html[lang^="pt"] body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

/* Shrink-safe children. Do not put .container or .wrap in this group: setting
   max-width:100% there overrides the normal centered VANIV desktop width. */
html[lang^="pt"] main,
html[lang^="pt"] main > *,
html[lang^="pt"] .layout,
html[lang^="pt"] .card,
html[lang^="pt"] .toc,
html[lang^="pt"] .header-content,
html[lang^="pt"] .footer-grid,
html[lang^="pt"] .footer-col,
html[lang^="pt"] .footer-brand,
html[lang^="pt"] .footer-bottom,
html[lang^="pt"] .footer-legal-links {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* One desktop layout contract for all PT-BR pages. Background sections may stay
   full width, but their content container is centered and capped like the rest
   of VANIV Studio. */
html[lang^="pt"] .container,
html[lang^="pt"] .wrap {
  width: 100%;
  max-width: var(--pt-page-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

@media (min-width: 1025px) {
  html[lang^="pt"] main > .container,
  html[lang^="pt"] main > .wrap,
  html[lang^="pt"] main > section > .container,
  html[lang^="pt"] main > section > .wrap,
  html[lang^="pt"] .blog-hub-content,
  html[lang^="pt"] .blog-section > .container,
  html[lang^="pt"] .article-shell,
  html[lang^="pt"] .article-container {
    width: calc(100% - 48px) !important;
    max-width: var(--pt-page-max) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

html[lang^="pt"] main a,
html[lang^="pt"] main code,
html[lang^="pt"] main p,
html[lang^="pt"] main li,
html[lang^="pt"] .footer a,
html[lang^="pt"] .vaniv-footer a {
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Keep translated media inside the viewport even when legacy page CSS is rigid. */
html[lang^="pt"] main img,
html[lang^="pt"] main video,
html[lang^="pt"] main canvas,
html[lang^="pt"] main svg {
  max-width: 100%;
  height: auto;
}

/* Every table is wrapped by pt-br-runtime-fixes.js. This prevents page-level
   horizontal overflow while preserving every column through touch scrolling. */
.pt-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  margin: 1.25rem 0;
  border-radius: 18px;
  box-shadow: inset -18px 0 24px -24px rgba(0, 212, 255, 0.9);
}

.pt-table-scroll > table {
  width: 100%;
  min-width: 680px;
  max-width: none;
  margin: 0 !important;
}

.pt-table-scroll th,
.pt-table-scroll td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Legal pages combine their compact legal layout with the global site shell. */
html[lang^="pt"] body.pt-legal-page .wrap,
html[lang^="pt"] body.pt-legal-page .layout,
html[lang^="pt"] body.pt-legal-page .hero,
html[lang^="pt"] body.pt-legal-page .toc,
html[lang^="pt"] body.pt-legal-page .card,
html[lang^="pt"] body.pt-legal-page .actions {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

html[lang^="pt"] body.pt-legal-page .wrap {
  max-width: var(--pt-page-max) !important;
}

html[lang^="pt"] body.pt-legal-page .hero {
  display: block !important;
  grid-template-columns: none !important;
  align-items: initial !important;
  gap: 0 !important;
  max-width: 940px !important;
  margin: 0 0 38px !important;
}

html[lang^="pt"] body.pt-legal-page .hero > *,
html[lang^="pt"] body.pt-legal-page .hero h1,
html[lang^="pt"] body.pt-legal-page .hero .updated,
html[lang^="pt"] body.pt-legal-page .hero .lead {
  display: block;
  width: auto;
  max-width: 100%;
  min-width: 0;
}

html[lang^="pt"] body.pt-legal-page .hero .lead {
  max-width: 850px;
}

html[lang^="pt"] body.pt-legal-page .actions > *,
html[lang^="pt"] body.pt-legal-page .button,
html[lang^="pt"] body.pt-legal-page .cookie-settings {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

html[lang^="pt"] #vaniv-cookie-banner,
html[lang^="pt"] #vaniv-cookie-banner .vaniv-cookie-card,
html[lang^="pt"] #vaniv-cookie-banner .vaniv-cookie-copy,
html[lang^="pt"] #vaniv-cookie-banner .vaniv-cookie-actions {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 720px) {
  html[lang^="pt"] .badge,
  html[lang^="pt"] .section-badge,
  html[lang^="pt"] .eyebrow,
  html[lang^="pt"] .hero-badge,
  html[lang^="pt"] .trust-pill {
    max-width: 100%;
    white-space: normal !important;
    overflow-wrap: anywhere;
    text-align: center;
    line-height: 1.35;
    box-sizing: border-box;
  }

  html[lang^="pt"] .hero-ctas,
  html[lang^="pt"] .actions,
  html[lang^="pt"] .vaniv-workflow-links,
  html[lang^="pt"] .footer-bottom,
  html[lang^="pt"] .footer-legal-links {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
  }

  html[lang^="pt"] .hero-ctas > *,
  html[lang^="pt"] .actions > *,
  html[lang^="pt"] .vaniv-workflow-links > * {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
  }

  html[lang^="pt"] body.pt-legal-page .wrap {
    padding-left: 18px;
    padding-right: 18px;
  }

  html[lang^="pt"] body.pt-legal-page .hero {
    margin-bottom: 30px !important;
  }

  html[lang^="pt"] body.pt-legal-page .hero h1 {
    width: 100% !important;
    max-width: 100% !important;
    font-size: clamp(2.25rem, 11vw, 3.45rem) !important;
    line-height: 1.02 !important;
    letter-spacing: -0.045em !important;
    overflow-wrap: normal !important;
  }

  html[lang^="pt"] body.pt-legal-page .hero .updated,
  html[lang^="pt"] body.pt-legal-page .hero .lead {
    width: 100% !important;
    max-width: 100% !important;
  }

  html[lang^="pt"] body.pt-legal-page .card,
  html[lang^="pt"] body.pt-legal-page .toc {
    padding-left: 20px;
    padding-right: 20px;
  }

  html[lang^="pt"] #vaniv-cookie-banner .vaniv-cookie-actions button {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
  }

  .pt-table-scroll::before {
    content: "Deslize para ver toda a tabela →";
    display: block;
    position: sticky;
    left: 0;
    width: max-content;
    max-width: calc(100vw - 44px);
    padding: 0 0 0.55rem;
    color: #8feaff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
  }

  .pt-table-scroll > table {
    min-width: 620px;
  }
}

/* PT mobile language switch: stable across stylesheet order */
@media(max-width:1024px){html[lang^="pt"] .header-content>.language-switch{display:flex!important;visibility:visible!important;opacity:1!important;flex:0 0 auto!important;order:20!important;margin-left:auto!important;position:relative!important;z-index:10040!important}}
