/* ========================================================================
   NARRATIVA VISUAL — PÁGINAS INTERNAS
   Esta camada não é carregada no index. Ela transforma cada página numa
   sequência: abertura, desenvolvimento, prova e convite à ação.
   ======================================================================== */
:root {
  --story-ink: #081b2b;
  --story-deep: #06263a;
  --story-cyan: #22b8df;
  --story-sky: #8ee6f7;
  --story-mist: #eff9fc;
  --story-line: rgba(15, 141, 173, .16);
  --story-shadow: 0 26px 70px rgba(7, 35, 54, .12);
}

body.page-internal {
  background: #f7fbfd;
  color: #183249;
  overflow-x: clip;
  animation: story-page-settle .62s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes story-page-settle {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.page-internal::before {
  content: '';
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: .78;
  background:
    radial-gradient(circle at 8% 22%, rgba(34, 184, 223, .11), transparent 24rem),
    radial-gradient(circle at 92% 68%, rgba(14, 116, 144, .08), transparent 30rem);
}

/* Abertura: todos os heróis internos passam a ter presença de capa editorial. */
body.page-internal :is(
  .iaped-sobre-hero, .iaped-contacts-hero, .iaped-carreiras-hero, .iaped-noticias-hero,
  .iaped-parcerias-hero, .iaped-legal-hero, .iaped-cand-hero,
  .iaped-search-hero, .iaped-entrar
) {
  isolation: isolate;
  min-height: min(69vh, 690px);
  display: grid;
  align-items: end;
  padding-top: clamp(145px, 16vw, 220px);
  padding-bottom: clamp(70px, 9vw, 128px);
  background-color: var(--story-deep);
  background-image:
    linear-gradient(118deg, rgba(3, 20, 34, .96) 0%, rgba(5, 46, 66, .82) 47%, rgba(15, 141, 173, .46) 100%),
    radial-gradient(circle at 82% 16%, rgba(125, 226, 246, .3), transparent 23rem);
}

body.page-internal :is(
  .iaped-sobre-hero, .iaped-contacts-hero, .iaped-carreiras-hero, .iaped-noticias-hero,
  .iaped-parcerias-hero, .iaped-legal-hero, .iaped-cand-hero,
  .iaped-search-hero, .iaped-entrar
)::after {
  content: '';
  position: absolute;
  z-index: -1;
  right: -9rem;
  bottom: -12rem;
  width: min(45vw, 620px);
  aspect-ratio: 1;
  border: 1px solid rgba(186, 230, 253, .28);
  border-radius: 48% 52% 56% 44%;
  box-shadow: 0 0 0 48px rgba(56, 189, 248, .045), 0 0 0 96px rgba(56, 189, 248, .03);
  transform: rotate(-18deg);
}

body.page-internal :is(
  .iaped-sobre-hero-content, .iaped-contacts-hero-content, .iaped-carreiras-hero-content, .iaped-noticias-hero-content,
  .iaped-parcerias-hero-content, .iaped-legal-hero-content, .iaped-cand-hero-inner,
  .iaped-search-hero-content, .iaped-entrar-container
) {
  position: relative;
  width: min(1280px, calc(100% - 64px));
  max-width: 1280px !important;
  margin-inline: auto;
  text-align: left;
}

body.page-internal :is(
  .iaped-sobre-hero h1, .iaped-contacts-hero h1, .iaped-carreiras-hero h1, .iaped-noticias-hero h1,
  .iaped-parcerias-hero h1, .iaped-legal-hero h1, .iaped-cand-hero h1,
  .iaped-search-hero h1
) {
  max-width: 880px;
  margin: 0 0 18px;
  font-size: clamp(2.45rem, 5.4vw, 5.15rem);
  line-height: .99;
  letter-spacing: -.065em;
  text-wrap: balance;
  text-shadow: 0 12px 30px rgba(0, 0, 0, .2);
}

body.page-internal :is(
  .iaped-sobre-hero p, .iaped-contacts-hero p, .iaped-carreiras-hero p, .iaped-noticias-hero p,
  .iaped-parcerias-hero p, .iaped-legal-hero p, .iaped-cand-hero p,
  .iaped-search-hero p
) {
  max-width: 670px;
  font-size: clamp(1rem, 1.5vw, 1.16rem);
  color: rgba(237, 252, 255, .82);
}

body.page-internal :is(
  .iaped-sobre-hero-content, .iaped-contacts-hero-content, .iaped-carreiras-hero-content, .iaped-noticias-hero-content,
  .iaped-parcerias-hero-content, .iaped-legal-hero-content, .iaped-cand-hero-inner,
  .iaped-search-hero-content
) > * {
  animation: story-hero-line .76s cubic-bezier(.16, 1, .3, 1) both;
}

body.page-internal :is(
  .iaped-sobre-hero-content, .iaped-contacts-hero-content, .iaped-carreiras-hero-content, .iaped-noticias-hero-content,
  .iaped-parcerias-hero-content, .iaped-legal-hero-content, .iaped-cand-hero-inner,
  .iaped-search-hero-content
) > *:nth-child(2) { animation-delay: .08s; }
body.page-internal :is(
  .iaped-sobre-hero-content, .iaped-contacts-hero-content, .iaped-carreiras-hero-content, .iaped-noticias-hero-content,
  .iaped-parcerias-hero-content, .iaped-legal-hero-content, .iaped-cand-hero-inner,
  .iaped-search-hero-content
) > *:nth-child(3) { animation-delay: .16s; }

@keyframes story-hero-line {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

body.page-internal :is(
  .iaped-sobre-badge, .iaped-contacts-badge, .iaped-carreiras-badge, .iaped-noticias-badge,
  .iaped-parcerias-badge, .iaped-legal-badge, .iaped-cand-badge, .ian-badge
) {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  margin-bottom: 22px;
  border-color: rgba(186, 230, 253, .38);
  background: rgba(215, 249, 255, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 12px 28px rgba(0, 0, 0, .13);
  backdrop-filter: blur(13px);
}

/* Áreas de negócio segue a mesma abertura editorial das restantes páginas internas. */
body.page-internal .ian-hero {
  isolation: isolate;
  min-height: min(69vh, 690px);
  display: grid;
  align-items: end;
  padding: clamp(145px, 16vw, 220px) 0 clamp(70px, 9vw, 128px);
  background-color: var(--story-deep);
  background-image:
    linear-gradient(118deg, rgba(3, 20, 34, .96) 0%, rgba(5, 46, 66, .82) 47%, rgba(15, 141, 173, .46) 100%),
    radial-gradient(circle at 82% 16%, rgba(125, 226, 246, .3), transparent 23rem);
}

body.page-internal .ian-hero::after {
  content: '';
  position: absolute;
  z-index: 0;
  right: -9rem;
  bottom: -12rem;
  width: min(45vw, 620px);
  aspect-ratio: 1;
  border: 1px solid rgba(186, 230, 253, .28);
  border-radius: 48% 52% 56% 44%;
  box-shadow: 0 0 0 48px rgba(56, 189, 248, .045), 0 0 0 96px rgba(56, 189, 248, .03);
  transform: rotate(-18deg);
  pointer-events: none;
}

body.page-internal .ian-hero-content {
  width: min(1280px, calc(100% - 64px));
  max-width: 1280px;
  margin-inline: auto;
  text-align: left;
}

body.page-internal .ian-hero h1 {
  max-width: 880px;
  margin: 0 0 18px;
  font-size: clamp(2.45rem, 5.4vw, 5.15rem);
  line-height: .99;
  letter-spacing: -.065em;
  text-wrap: balance;
  text-shadow: 0 12px 30px rgba(0, 0, 0, .2);
}

body.page-internal .ian-hero p {
  max-width: 670px;
  margin: 0 0 36px;
  font-size: clamp(1rem, 1.5vw, 1.16rem);
  color: rgba(237, 252, 255, .82);
}

body.page-internal .ian-hero-pills { justify-content: flex-start; }

/* O conteúdo do cabeçalho de carreiras partilha a margem das restantes páginas. */
body.page-internal .iaped-carreiras-hero-content > p { margin-left: 0; }
body.page-internal .iaped-carreiras-hero-stats {
  justify-content: flex-start;
  margin-inline: 0 auto;
}
body.page-internal .iaped-carreiras-stat-card {
  align-items: flex-start;
  text-align: left;
}
body.page-internal .iaped-carreiras-stat-label { text-align: left; }

/* O hero e a lista de vagas alinham-se com a margem global do cabeçalho. */
body.page-internal.page-carreiras .iaped-carreiras-hero-content {
  box-sizing: border-box;
  width: min(1280px, calc(100% - 64px)) !important;
  max-width: 1280px !important;
  margin-inline: auto !important;
  justify-self: center;
  text-align: left;
}

/* O grid do hero precisa de uma coluna à largura total para o conteúdo
   respeitar a mesma margem lateral de 1280 px de Áreas de Negócio. */
body.page-internal.page-carreiras .iaped-carreiras-hero {
  grid-template-columns: minmax(0, 1fr);
}

body.page-internal.page-carreiras .iaped-carreiras-hero-content h1 {
  margin-left: 0;
  margin-right: 0;
}

/* Este selo pertence ao cabeçalho editorial da secção, não ao alinhamento do herói. */
body.page-internal .iaped-sobre-areas-container > .iaped-sobre-badge {
  display: flex;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* As secções mantêm um ritmo visual contínuo, sem rótulos adicionais. */
body.page-internal .story-chapter {
  position: relative;
  isolation: isolate;
  border-top: 1px solid rgba(15, 141, 173, .08);
}

body.page-internal .story-chapter:nth-of-type(even) {
  background-image: linear-gradient(135deg, rgba(225, 247, 252, .54), rgba(255, 255, 255, .74));
}

/* A chamada de parceria tem o seu próprio ambiente escuro; nunca herda o fundo alternado. */
body.page-parcerias .iaped-parcerias-seja.story-chapter {
  background-color: #06263a !important;
  background-image:
    radial-gradient(circle at 17% 10%, rgba(125, 226, 246, .25), transparent 23rem),
    linear-gradient(120deg, #061c2d 0%, #074359 56%, #0f8dad 130%) !important;
}

/* Cartões deixam de ser apenas blocos: ganham aresta, luz e resposta tátil. */
body.page-internal .story-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(15, 141, 173, .15) !important;
  box-shadow: 0 14px 34px rgba(8, 41, 57, .075);
  transition: transform .45s cubic-bezier(.16, 1, .3, 1), box-shadow .45s ease, border-color .35s ease !important;
}

body.page-internal .story-card::before {
  content: '';
  position: absolute;
  z-index: 0;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--story-cyan), transparent 76%);
  opacity: .74;
}

body.page-internal .story-card > * { position: relative; z-index: 1; }

body.page-internal .story-card:hover {
  transform: translateY(-10px) !important;
  border-color: rgba(34, 184, 223, .46) !important;
  box-shadow: var(--story-shadow) !important;
}

/* Os quatro valores devem conservar uma linha-base rigorosa, mesmo em hover. */
body.page-sobre .iaped-valor-card.story-card:hover { transform: none !important; }

body.page-internal .story-media {
  transform-origin: center;
  transition: transform .75s cubic-bezier(.16, 1, .3, 1), filter .5s ease;
}

body.page-internal .story-card:hover .story-media {
  transform: scale(1.055);
  filter: saturate(1.1) contrast(1.03);
}

/* Leads de leitura e formulários: reduzem o ruído e criam foco. */
body.page-internal :is(.iaped-legal-card, .iaped-cand-form-container, .iaped-contacts-form-box, .iaped-entrar-card) {
  border-color: rgba(15, 141, 173, .16);
  box-shadow: 0 22px 60px rgba(8, 42, 59, .1);
}

body.page-internal :is(.iaped-contacts-form-box, .iaped-cand-form-container, .iaped-entrar-card) {
  background: linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(236, 249, 252, .78));
  backdrop-filter: blur(16px);
}

body.page-internal :is(.iaped-contacts-form-group input, .iaped-contacts-form-group select, .iaped-contacts-form-group textarea, .iaped-cand-step input, .iaped-cand-step select, .iaped-cand-step textarea, .iaped-entrar input) {
  border-color: rgba(100, 148, 167, .3);
  background-color: rgba(255, 255, 255, .88);
}

body.page-internal :is(.iaped-contacts-form-group input, .iaped-contacts-form-group select, .iaped-contacts-form-group textarea, .iaped-cand-step input, .iaped-cand-step select, .iaped-cand-step textarea, .iaped-entrar input):focus {
  border-color: var(--story-cyan);
  box-shadow: 0 0 0 4px rgba(34, 184, 223, .13), 0 10px 24px rgba(15, 141, 173, .08);
}

/* Ritmo editorial das notícias, pesquisa e documentos legais. */
body.page-internal .iaped-article-magazine,
body.page-internal .iaped-search-page,
body.page-internal .iaped-legal-body { position: relative; }

body.page-internal .iaped-article-container,
body.page-internal .iaped-search-container,
body.page-internal .iaped-legal-container { position: relative; }

body.page-internal .iaped-article-container::before,
body.page-internal .iaped-legal-container::before {
  content: '';
  position: absolute;
  top: 3rem;
  bottom: 3rem;
  left: -26px;
  width: 1px;
  background: linear-gradient(transparent, rgba(15, 141, 173, .28) 12%, rgba(15, 141, 173, .28) 88%, transparent);
}

body.page-internal .iaped-article-footer-share,
body.page-internal .iaped-legal-contact-box,
body.page-internal .iaped-parcerias-seja-container,
body.page-internal .iaped-detalhe-cta {
  box-shadow: 0 24px 58px rgba(2, 37, 53, .16);
}

/* Fecho: newsletter e rodapé funcionam como epílogo da navegação. */
body.page-internal .iaped-newsletter {
  position: relative;
  overflow: hidden;
}

body.page-internal .iaped-newsletter::before {
  content: '';
  position: absolute;
  inset: auto -15% -70% auto;
  width: 460px;
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
}

@media (max-width: 768px) {
  body.page-internal.page-carreiras .iaped-carreiras-hero-content {
    width: min(100% - 32px, 1180px) !important;
  }

  body.page-internal .ian-hero {
    min-height: 440px;
    padding: 130px 0 50px;
  }

  body.page-internal .ian-hero-content { width: min(100% - 32px, 1180px); }
  body.page-internal .ian-hero h1 { font-size: clamp(2rem, 5.5vw, 2.6rem); line-height: 1.15; letter-spacing: -.03em; }
  body.page-internal .ian-hero p { font-size: .98rem; line-height: 1.65; }

  body.page-internal :is(
    .iaped-sobre-hero, .iaped-contacts-hero, .iaped-carreiras-hero, .iaped-noticias-hero,
    .iaped-parcerias-hero, .iaped-legal-hero, .iaped-cand-hero,
    .iaped-search-hero, .iaped-entrar
  ) {
    min-height: 440px;
    padding-top: 130px;
    padding-bottom: 50px;
    padding-inline: 0;
  }

  body.page-internal :is(
    .iaped-sobre-hero-content, .iaped-contacts-hero-content, .iaped-carreiras-hero-content, .iaped-noticias-hero-content,
    .iaped-parcerias-hero-content, .iaped-legal-hero-content, .iaped-cand-hero-inner,
    .iaped-search-hero-content, .iaped-entrar-container
  ) {
    width: min(100% - 32px, 1180px);
  }

  body.page-internal :is(
    .iaped-sobre-hero h1, .iaped-contacts-hero h1, .iaped-carreiras-hero h1, .iaped-noticias-hero h1,
    .iaped-parcerias-hero h1, .iaped-legal-hero h1, .iaped-cand-hero h1,
    .iaped-search-hero h1
  ) {
    font-size: clamp(2rem, 5.5vw, 2.6rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
  }

  body.page-internal :is(
    .iaped-sobre-hero p, .iaped-contacts-hero p, .iaped-carreiras-hero p, .iaped-noticias-hero p,
    .iaped-parcerias-hero p, .iaped-legal-hero p, .iaped-cand-hero p,
    .iaped-search-hero p
  ) {
    font-size: 0.98rem;
    line-height: 1.65;
  }

  body.page-internal .iaped-article-container::before,
  body.page-internal .iaped-legal-container::before { display: none; }

  body.page-internal .story-card:hover { transform: translateY(-5px) !important; }
}

@media (max-width: 480px) {
  body.page-internal.page-carreiras .iaped-carreiras-hero-content {
    width: calc(100% - 24px) !important;
  }

  body.page-internal .ian-hero { min-height: 380px; padding: 115px 0 40px; }
  body.page-internal .ian-hero-content { width: calc(100% - 24px); }
  body.page-internal .ian-hero h1 { font-size: 1.75rem; line-height: 1.2; letter-spacing: -.02em; margin-bottom: 12px; }
  body.page-internal .ian-hero p { font-size: .9rem; line-height: 1.6; }

  body.page-internal :is(
    .iaped-sobre-hero, .iaped-contacts-hero, .iaped-carreiras-hero, .iaped-noticias-hero,
    .iaped-parcerias-hero, .iaped-legal-hero, .iaped-cand-hero,
    .iaped-search-hero, .iaped-entrar
  ) {
    min-height: 380px;
    padding-top: 115px;
    padding-bottom: 40px;
  }

  body.page-internal :is(
    .iaped-sobre-hero-content, .iaped-contacts-hero-content, .iaped-carreiras-hero-content, .iaped-noticias-hero-content,
    .iaped-parcerias-hero-content, .iaped-legal-hero-content, .iaped-cand-hero-inner,
    .iaped-search-hero-content, .iaped-entrar-container
  ) {
    width: calc(100% - 24px);
  }

  body.page-internal :is(
    .iaped-sobre-hero h1, .iaped-contacts-hero h1, .iaped-carreiras-hero h1, .iaped-noticias-hero h1,
    .iaped-parcerias-hero h1, .iaped-legal-hero h1, .iaped-cand-hero h1,
    .iaped-search-hero h1
  ) {
    font-size: 1.75rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
  }

  body.page-internal :is(
    .iaped-sobre-hero p, .iaped-contacts-hero p, .iaped-carreiras-hero p, .iaped-noticias-hero p,
    .iaped-parcerias-hero p, .iaped-legal-hero p, .iaped-cand-hero p,
    .iaped-search-hero p
  ) {
    font-size: 0.9rem;
    line-height: 1.6;
  }
}

@media (max-width: 360px) {
  body.page-internal :is(
    .iaped-sobre-hero h1, .iaped-contacts-hero h1, .iaped-carreiras-hero h1, .iaped-noticias-hero h1,
    .iaped-parcerias-hero h1, .iaped-legal-hero h1, .iaped-cand-hero h1,
    .iaped-search-hero h1
  ) {
    font-size: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.page-internal,
  body.page-internal :is(
    .iaped-sobre-hero-content, .iaped-contacts-hero-content, .iaped-carreiras-hero-content, .iaped-noticias-hero-content,
    .iaped-parcerias-hero-content, .iaped-legal-hero-content, .iaped-cand-hero-inner,
    .iaped-search-hero-content
  ) > * { animation: none !important; }

  body.page-internal .story-card,
  body.page-internal .story-media { transition: none !important; }
}
