/* Comunicação visual para redes, versão 2 (05/11/2026). Gramática "Registro": cada ato mostra a mesma peça
   em mais de um lugar ou em mais de uma cópia, sempre com fotos reais, e as marcas de corte da gráfica
   enquadram a peça. Carregado depois de scrollcraft.css, orcamento.css e identidade.css; não redefine tokens. */

.rg { --rg-fio: 2px; --rg-braco: 18px; --rg-folga: 8px; --rg-max: 1320px; }
.rg main { display: block; }
.rg picture { display: contents; }

/* Marcas de corte: um elemento só, quatro cantos em L desenhados por fundo. */
.rg-cantos, .rg .pc-orc .lp-oc::before {
  position: absolute; inset: calc(-1 * var(--rg-folga)); pointer-events: none;
  background:
    linear-gradient(var(--pc-amarelo) 0 0) left top / var(--rg-braco) var(--rg-fio),
    linear-gradient(var(--pc-amarelo) 0 0) left top / var(--rg-fio) var(--rg-braco),
    linear-gradient(var(--pc-amarelo) 0 0) right top / var(--rg-braco) var(--rg-fio),
    linear-gradient(var(--pc-amarelo) 0 0) right top / var(--rg-fio) var(--rg-braco),
    linear-gradient(var(--pc-amarelo) 0 0) left bottom / var(--rg-braco) var(--rg-fio),
    linear-gradient(var(--pc-amarelo) 0 0) left bottom / var(--rg-fio) var(--rg-braco),
    linear-gradient(var(--pc-amarelo) 0 0) right bottom / var(--rg-braco) var(--rg-fio),
    linear-gradient(var(--pc-amarelo) 0 0) right bottom / var(--rg-fio) var(--rg-braco);
  background-repeat: no-repeat;
}

/* Barra de cima: só na primeira tela, não acompanha a rolagem. */
.rg-topo { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: var(--rg-max); margin: 0 auto; padding: .6rem var(--pc-margem); }

/* 1. Topo: título do anúncio e a loja de uma rede. */
.rg-abre { max-width: var(--rg-max); margin: 0 auto; padding: .75rem var(--pc-margem) 2.75rem; display: grid; gap: 1.75rem; }
.rg-abre h1 { margin: 0 0 .9rem; font-size: var(--pc-t-h1); line-height: 1.04; text-wrap: balance; }
.rg-lide { margin: 0 0 1.4rem; max-width: 34em; font-size: var(--pc-t-lede); line-height: 1.5; color: var(--pc-tinta-suave); }
.rg-abre__foto { margin: var(--rg-folga); }
.rg-quadro { position: relative; }
.rg-quadro__janela { overflow: hidden; border-radius: var(--pc-r); aspect-ratio: 720 / 450; background: var(--pc-preto-2); }
.rg-quadro__janela img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; transform: translate3d(0, var(--rg-desce, 0px), 0) scale(1.1); }
.rg-abre__foto figcaption { margin-top: calc(.55rem + var(--rg-folga)); }

/* 2. Série: peças iguais. */
.rg-serie { max-width: var(--rg-max); margin: 0 auto; padding: clamp(2.5rem, 7vw, 5.5rem) var(--pc-margem); display: grid; gap: 1.5rem; border-top: 1px solid var(--pc-linha); }
.rg-serie h2, .rg-pecas h2, .rg-quem h2 { margin: 0 0 .8rem; font-size: var(--pc-t-titulo); line-height: 1.08; text-wrap: balance; }
.rg-serie p { margin: 0; max-width: 30em; color: var(--pc-tinta-suave); }

/* 3. Pico: a mesma campanha em agências diferentes. Sem JS ou com movimento reduzido: folha 2 por 2. */
.rg-pico { position: relative; border-top: 1px solid var(--pc-linha); }
.rg-pico__palco { max-width: var(--rg-max); margin: 0 auto; padding: clamp(2.5rem, 7vw, 5rem) var(--pc-margem); display: grid; gap: 1.1rem; }
.rg-pico h2 { margin: 0 0 .6rem; font-size: clamp(1.45rem, 1.05rem + 1.9vw, 2.6rem); line-height: 1.1; max-width: 19ch; text-wrap: balance; }
.rg-pico__legenda { margin: 0; font: 500 var(--pc-t-legenda)/1.45 var(--pc-texto); color: var(--pc-tinta-suave); }
.rg-rotulo { display: block; margin-bottom: .2rem; font: 700 .95rem/1.3 var(--pc-display); color: var(--pc-amarelo); }
.rg-visor { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.rg-f { position: relative; margin: 0; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--pc-r); background: var(--pc-preto-2); }
.rg-f img { width: 100%; height: 100%; object-fit: cover; object-position: var(--ox) var(--oy); }
.rg-f__leg { position: absolute; left: .4rem; bottom: .4rem; padding: .2rem .45rem; border-radius: 2px; background: rgba(25, 25, 25, .82); font: 600 .72rem/1.3 var(--pc-texto); color: var(--pc-tinta); }
.rg-marcas { display: none; }
html:not(.js) .rg-f picture, html:not(.js) .rg-f > img[data-src] { display: none; }

/* 4. Peças: chão de papel. */
.rg-pecas { position: relative; color: var(--pc-preto); isolation: isolate; }
.rg-pecas::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--pc-papel); transform: scaleX(var(--rg-folha-s, 1)); transform-origin: 50% 0; border-radius: calc((1 - var(--rg-folha-s, 1)) * 120px); }
.rg-pecas__dentro { max-width: var(--rg-max); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--pc-margem); }
.rg-pecas__texto p { margin: 0 0 2rem; max-width: 36em; color: var(--pc-tinta-papel); }
.rg-pecas a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.rg-pecas__grade { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem .75rem; }
.rg-p img { aspect-ratio: 4 / 5; background: #e2e0d6; }
.rg-p--fachada, .rg-p--parede { grid-column: 1 / -1; }
.rg-p--fachada img { aspect-ratio: 720 / 399; }
.rg-p--parede img { aspect-ratio: 720 / 177; }
.rg-pecas .pc-foto figcaption { color: var(--pc-tinta-papel); }

/* 5. Para quem é e perguntas. */
.rg-quem { border-top: 1px solid var(--pc-linha); }
.rg-quem__dentro { max-width: var(--rg-max); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--pc-margem); display: grid; gap: 3rem; }
.rg-lista, .rg-fatos, .rg-pauta { margin: 0; padding: 0; list-style: none; }
.rg-lista li { padding: .7rem 0; border-bottom: 1px solid var(--pc-linha); font: 600 1.05rem/1.4 var(--pc-texto); }
.rg-nao { margin: 1rem 0 2rem; font-weight: 600; color: var(--pc-amarelo); }
.rg-fatos li, .rg-pauta li { position: relative; padding-left: 1.4rem; margin: 0 0 .55rem; color: var(--pc-tinta); }
.rg-fatos li::before, .rg-pauta li::before { content: ""; position: absolute; left: 0; top: .45em; width: 10px; height: 10px; border-left: 2px solid var(--pc-amarelo); border-top: 2px solid var(--pc-amarelo); }
.rg-prova { margin: 1.6rem 0 1rem; max-width: 34em; color: var(--pc-tinta-suave); }
.rg-ag { margin: 0; color: var(--pc-tinta-suave); }
.rg-quem__btn { margin-top: 1.75rem; }
.rg-pico__btn { justify-self: start; }
.rg-ag a, .pc-orc p a { color: var(--pc-tinta); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.rg-faq details { border-bottom: 1px solid var(--pc-linha); }
.rg-faq summary { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 0; cursor: pointer; list-style: none; font: 600 1rem/1.4 var(--pc-texto); }
.rg-faq summary::-webkit-details-marker { display: none; }
.rg-faq summary::after { content: "+"; flex: none; color: var(--pc-amarelo); font-weight: 700; }
.rg-faq summary::after { transition: transform .2s ease-out; }
.rg-faq details[open] summary::after { transform: rotate(45deg); }
.rg-faq p { margin: 0 0 1.1rem; color: var(--pc-tinta-suave); max-width: 40em; }

/* Fecho: o formulário entre as mesmas marcas de corte. O bloco .lp-oc não muda. */
.rg .pc-orc .lp-oc { position: relative; }
.rg .pc-orc .lp-oc::before { content: ""; inset: -12px; }
.rg-pauta { margin: .2rem 0 1.4rem; }


/* Entrada das fotos: só quando o script da página rodou. */
.rg-vivo [data-rg-in] { opacity: 0; transform: translateY(18px); transition: opacity .5s ease-out, transform .6s cubic-bezier(.2, .7, .2, 1); }
.rg-vivo [data-rg-in].rg-dentro { opacity: 1; transform: none; }

/* Computador. */
@media (min-width: 900px) {
  .rg-abre { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: 3.5rem; min-height: calc(100svh - 4.5rem); padding-bottom: 3rem; }
  .rg-abre h1 { max-width: 11ch; }
  .rg-serie { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); align-items: end; gap: 3.5rem; }
  .rg-serie__foto { grid-column: 1; grid-row: 1; }
  .rg-serie__texto { grid-column: 2; grid-row: 1; padding-bottom: 2.2rem; }
  .rg-pico__palco { grid-template-columns: minmax(0, 3.2fr) minmax(0, 8.8fr); grid-template-rows: auto auto; align-items: center; gap: 1.5rem 3rem; }
  .rg-pico__texto { grid-column: 1; grid-row: 1; align-self: end; }
  .rg-visor { grid-column: 2; grid-row: 1 / span 2; }
  .rg-pico__btn { grid-column: 1; grid-row: 2; align-self: start; }
  /* fachada em 2 de 4 partes com 720/399; vitrine e painel em 1 parte com 9/10 ficam da mesma altura */
  .rg-pecas__grade { grid-template-columns: 2fr 1fr 1fr; gap: 2rem 1.25rem; align-items: start; }
  .rg-p--fachada { grid-column: 1; }
  .rg-p img { aspect-ratio: 9 / 10; }
  .rg-p--fachada img { aspect-ratio: 720 / 399; }
  .rg-p--parede img { aspect-ratio: 1280 / 314; }
  .rg-quem__dentro { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 5rem; }
  .rg .pc-orc .lp-oc::before { inset: -16px; }
}

/* Com movimento e com JS: o visor de registro. */
@media (prefers-reduced-motion: no-preference) {
  .js .rg-pico { height: calc(100svh + 5 * 55svh); }
  .js .rg-pico__palco { position: sticky; top: 0; height: 100svh; min-height: 0; align-content: center; padding-top: 1.25rem; padding-bottom: 1.25rem; }
  .js .rg-visor {
    display: block; height: min(50svh, 620px); container-type: size; overflow: hidden; border-radius: var(--pc-r); background: var(--pc-preto-2);
    --aw: min(70cqw, 470px); --ah: 78cqh;
    --ow-at: min(var(--aw), calc(var(--ah) * var(--a-at, 1.6851)));
    --oh-at: calc(var(--ow-at) / var(--a-at, 1.6851));
  }
  .js .rg-f { position: absolute; inset: 0; aspect-ratio: auto; overflow: visible; border-radius: 0; background: none; opacity: 0; transition: opacity .3s ease-out; }
  .js .rg-f.rg-ativa { opacity: 1; }
  .js .rg-f img {
    position: absolute; max-width: none; height: auto; object-fit: fill; border-radius: 2px;
    --ow: min(var(--aw), calc(var(--ah) * var(--a)));
    width: calc(var(--ow) / var(--w));
    left: calc((100cqw - var(--ow)) / 2 - var(--x) * var(--ow) / var(--w));
    top: calc((100cqh - var(--ow) / var(--a)) / 2 - var(--y) * var(--r) * var(--ow) / var(--w));
  }
  .js .rg-f__leg { display: none; }
  .js .rg-marcas { display: block; position: absolute; inset: 0; z-index: 2; pointer-events: none; }
  .js .rg-marcas i { position: absolute; left: 0; top: 0; width: 22px; height: 22px; border: 0 solid var(--pc-amarelo); transition: transform .5s cubic-bezier(.2, .7, .2, 1); will-change: transform; }
  .js .rg-marcas i:nth-child(1) { border-width: 2px 0 0 2px; transform: translate(calc((100cqw - var(--ow-at)) / 2 - 8px), calc((100cqh - var(--oh-at)) / 2 - 8px)); }
  .js .rg-marcas i:nth-child(2) { border-width: 2px 2px 0 0; transform: translate(calc((100cqw + var(--ow-at)) / 2 - 14px), calc((100cqh - var(--oh-at)) / 2 - 8px)); }
  .js .rg-marcas i:nth-child(3) { border-width: 0 0 2px 2px; transform: translate(calc((100cqw - var(--ow-at)) / 2 - 8px), calc((100cqh + var(--oh-at)) / 2 - 14px)); }
  .js .rg-marcas i:nth-child(4) { border-width: 0 2px 2px 0; transform: translate(calc((100cqw + var(--ow-at)) / 2 - 14px), calc((100cqh + var(--oh-at)) / 2 - 14px)); }
  /* Último passo: a folha de conferência dentro do visor. */
  .js .rg-visor.rg-folha { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; padding: 26px; --ow-at: calc(100cqw - 20px); --oh-at: calc(100cqh - 20px); }
  .js .rg-folha .rg-f { position: relative; inset: auto; opacity: 1; overflow: hidden; border-radius: 2px; animation: rg-folha .45s ease-out both; }
  .js .rg-folha .rg-f img { position: static; width: 100%; height: 100%; object-fit: cover; object-position: var(--ox) var(--oy); }
  .js .rg-folha .rg-f__leg { display: block; }
  .js .rg-folha .rg-marcas i:nth-child(1) { transform: translate(10px, 10px); }
  .js .rg-folha .rg-marcas i:nth-child(2) { transform: translate(calc(100cqw - 32px), 10px); }
  .js .rg-folha .rg-marcas i:nth-child(3) { transform: translate(10px, calc(100cqh - 32px)); }
  .js .rg-folha .rg-marcas i:nth-child(4) { transform: translate(calc(100cqw - 32px), calc(100cqh - 32px)); }
  @keyframes rg-folha { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
  @media (min-width: 900px) {
    .js .rg-pico { height: calc(100svh + 5 * 50svh); }
    .js .rg-visor { height: min(56svh, 540px); --aw: min(54cqw, 440px); }
  }
}

/* Celular leve: a classe lp-leve vem do script no <head> (até 700 px). Sem trecho preso: o visor já chega
   na folha 2 por 2 (redes.js) e as fotos entram no estado final, sem animação presa à rolagem. */
.lp-leve.js .rg-pico { height: auto; }
.lp-leve.js .rg-pico__palco { position: relative; height: auto; padding-top: clamp(2.5rem, 7vw, 5rem); padding-bottom: clamp(2.5rem, 7vw, 5rem); }
.lp-leve .rg-folha .rg-f { animation: none; }
/* Na folha, 100cqw e 100cqh medem a caixa sem os 26px de respiro; os cantos somam esse respiro para fechar no visor. */
.lp-leve .rg-marcas i { transition: none; }
.lp-leve .rg-folha .rg-marcas i:nth-child(2) { transform: translate(calc(100cqw + 20px), 10px); }
.lp-leve .rg-folha .rg-marcas i:nth-child(3) { transform: translate(10px, calc(100cqh + 20px)); }
.lp-leve .rg-folha .rg-marcas i:nth-child(4) { transform: translate(calc(100cqw + 20px), calc(100cqh + 20px)); }
.lp-leve [data-rg-in] { opacity: 1; transform: none; transition: none; }

@media (prefers-reduced-motion: reduce) {
  .rg-quadro__janela img { transform: none; }
  .rg-vivo [data-rg-in] { opacity: 1; transform: none; transition: none; }
}

/* GEO: resumo, passos e subtítulos. */
.rg-resumo { margin: 0 0 1rem; max-width: 40em; font-size: .95rem; line-height: 1.55; color: var(--pc-tinta-suave); }
.rg-como { padding: 3rem var(--pc-margem); }
.rg-como__dentro { max-width: 60rem; margin: 0 auto; }
.rg-passos { margin: 1.2rem 0 0; padding: 0; list-style: none; counter-reset: rgp; }
.rg-passos li { counter-increment: rgp; position: relative; padding: .7rem 0 .7rem 2.6rem; border-bottom: 1px solid var(--pc-linha); }
.rg-passos li::before { content: counter(rgp); position: absolute; left: 0; top: .7rem; font: 700 1.1rem/1.4 var(--pc-display); color: var(--pc-amarelo); }
.rg-sub { margin: 1.6rem 0 .6rem; font-size: 1.05rem; }
