/* ============ Página de artigo (/blogs/<blog>/<artigo>/) ============
   Abertura escura (foto ou tipográfica), corpo em papel claro com coluna de leitura de ~66 caracteres.
   O corpo não se move durante a leitura: apenas imagens e vídeos são revelados ao entrar na tela.
   A barra superior, o rodapé e o visualizador ampliado vêm de css/projeto-pagina.css. */
body.pagina-artigo { background: var(--bege); color: var(--tinta); }
.pagina-artigo main { overflow-x: clip; }

/* ---------- Progresso de leitura ---------- */
.ar-progresso { position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 70; pointer-events: none; }
.ar-progresso span { display: block; height: 100%; background: var(--ouro); transform-origin: 0 50%; transform: scaleX(var(--lido, 0)); }

/* ---------- Migalha (topo) ---------- */
.pp-migalha {
  display: flex; align-items: center; gap: 10px;
  font: 700 10px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase;
  opacity: .85;
}
.pp-migalha a { text-decoration: none; border-bottom: 1px solid transparent; padding-bottom: 2px; transition: border-color .3s, color .3s; }
.pp-migalha a:hover, .pp-migalha a:focus-visible { border-color: currentColor; }
.pp-migalha span { opacity: .45; }

/* ---------- Abertura ---------- */
.ar-abre {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 4vh 5vw; align-items: end;
  min-height: 88vh; min-height: 88svh;
  padding: clamp(120px, 18vh, 180px) var(--margem) clamp(56px, 9vh, 100px);
  background:
    radial-gradient(ellipse 60% 60% at 80% 30%, rgba(36, 74, 50, .6), transparent 100%),
    var(--noite);
  color: var(--bege);
  overflow: hidden;
}
.ar-abre-texto { position: relative; z-index: 2; grid-column: 1; grid-row: 1; }
.ar-abre-texto .rotulo { color: var(--bege); flex-wrap: wrap; row-gap: .6em; }
.ar-abre-texto .rotulo a { text-decoration: none; border-bottom: 1px solid rgba(242, 200, 138, .5); padding-bottom: 2px; }
.ar-abre-texto .rotulo a:hover, .ar-abre-texto .rotulo a:focus-visible { color: var(--ouro-reflexo); }
.ar-titulo {
  text-transform: none;
  font-size: clamp(36px, 4.4vw, 82px);
  line-height: 1;
  --soft: 50;
  text-wrap: balance;
  overflow-wrap: break-word; hyphens: manual;
}
.ar-titulo .letra { display: inline-block; }
.ar-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin: clamp(22px, 3.4vh, 36px) 0 0;
  font: 600 11px/1.5 var(--sans); letter-spacing: .18em; text-transform: uppercase;
  color: rgba(243, 239, 229, .72);
}
.ar-meta strong { color: var(--bege); font-weight: 800; }
.ar-meta time { color: var(--ouro-reflexo); }
.ar-meta-sep { display: none; }
.ar-meta { flex-direction: column; align-items: flex-start; gap: 6px; }
.ar-epigrafe {
  margin: 0 0 clamp(22px, 3vh, 34px); padding: 0 0 0 18px; max-width: 30em;
  border-left: 1px solid rgba(216, 167, 99, .6);
  font-family: 'Cormorant Garamond', var(--serif); font-style: italic; font-weight: 500;
  font-size: clamp(19px, 1.6vw, 26px); line-height: 1.3;
  color: var(--ouro-reflexo);
}
.ar-epigrafe p { margin: 0; }
.ar-epigrafe p + p { margin-top: .4em; font-family: var(--sans); font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: rgba(243, 239, 229, .65); }

/* capa: mostrada inteira (a imagem vem do próprio documento, sem recorte) */
.ar-capa { grid-column: 2; grid-row: 1; display: flex; justify-content: flex-end; align-items: flex-end; gap: clamp(10px, 1.4vw, 20px); min-width: 0; }
.ar-capa-foto { display: block; min-width: 0; }
.ar-capa-foto img {
  width: auto; height: auto; max-width: 100%;
  max-height: min(70vh, 820px);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9);
}
.ar-capa--dupla .ar-capa-foto { flex: 1 1 0; }
.ar-capa--dupla .ar-capa-foto img { width: 100%; max-height: none; }
.ar-capa--dupla .ar-capa-foto--extra { margin-bottom: clamp(30px, 8vh, 90px); }

/* abertura tipográfica (artigos sem fotografia) */
.ar-abre--tipo { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); min-height: 78vh; min-height: 78svh; }
.ar-numeral {
  position: absolute; right: calc(var(--margem) - .06em); bottom: -.16em; z-index: 1;
  font-family: var(--serif); font-weight: 300; line-height: .8;
  font-size: clamp(200px, 34vw, 560px);
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
  color: transparent; -webkit-text-stroke: 1px rgba(216, 167, 99, .45);
  pointer-events: none; user-select: none;
}
.ar-ramo { position: absolute; right: 18vw; top: 8vh; width: 22vw; height: 60vh; color: var(--ouro); opacity: .28; z-index: 0; }

/* ---------- Corpo ---------- */
.ar { display: grid; grid-template-columns: minmax(0, 1fr) min(680px, calc(100% - 40px)) minmax(0, 1fr); }
.ar > * { grid-column: 1 / -1; }
.ar > .ar-corpo { grid-column: 2; }
.ar-corpo {
  padding: clamp(60px, 10vh, 110px) 0 clamp(70px, 12vh, 130px);
  font-family: var(--serif); font-weight: 380;
  font-size: clamp(18px, 1.22vw, 20.5px); line-height: 1.72;
  font-variation-settings: 'opsz' 14, 'SOFT' 50, 'WONK' 0;
  color: var(--tinta);
  overflow-wrap: break-word;
}
.ar-corpo p { margin: 0 0 1.15em; }
.ar-corpo strong { font-weight: 640; }
.ar-corpo em { font-style: italic; }
.ar-corpo sup { font-size: .68em; line-height: 0; }
.ar-corpo a { color: var(--amazonia); text-decoration-color: rgba(183, 104, 67, .6); text-underline-offset: 3px; overflow-wrap: anywhere; }
.ar-corpo a:hover { color: var(--terracota); }
.ar-primeiro::first-letter {
  font-size: 3.6em; float: left; line-height: .8;
  padding: .07em .09em 0 0; color: var(--terracota);
  font-weight: 340;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
}
.ar-h2 {
  margin: 2.2em 0 .8em;
  font-family: var(--serif); font-weight: 460; text-transform: none;
  font-size: clamp(24px, 1.9vw, 32px); line-height: 1.18;
  font-variation-settings: 'opsz' 72, 'SOFT' 60, 'WONK' 0;
  color: var(--floresta);
  scroll-margin-top: 110px;
}
.ar-h2::before { content: ''; display: block; width: 36px; height: 2px; margin-bottom: .7em; background: var(--terracota); }
.ar-citacao {
  margin: 1.8em 0; padding: .2em 0 .2em 1.3em;
  border-left: 2px solid var(--terracota);
  font-style: italic; font-size: 1.06em; line-height: 1.6;
  color: var(--floresta);
}
.ar-citacao p { margin: 0 0 .5em; }
.ar-citacao cite { display: block; font: normal 700 11px/1.5 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--tinta-suave); }
.ar-lista { margin: 0 0 1.3em; padding-left: 1.4em; }
.ar-lista li { margin: 0 0 .55em; padding-left: .3em; }
.ar-lista li::marker { color: var(--terracota); font-family: var(--sans); font-weight: 700; font-size: .85em; }

/* referências bibliográficas */
.ar-refs { margin-top: 3em; padding-top: 1.6em; border-top: 1px solid rgba(18, 38, 26, .18); }
.ar-refs-titulo {
  margin: 0 0 1.2em;
  font: 700 11px/1.5 var(--sans); letter-spacing: .26em; text-transform: uppercase;
  color: var(--terracota);
}
.ar-refs-titulo strong { font-weight: inherit; }
.ar-refs-lista { font-family: var(--sans); font-size: 14px; line-height: 1.6; color: var(--tinta-suave); }
.ar-refs-lista p { margin: 0 0 .9em; padding-left: 1.6em; text-indent: -1.6em; }
.ar-corpo .ar-ref { font-family: var(--sans); font-size: 14px; line-height: 1.6; color: var(--tinta-suave); padding-left: 1.6em; text-indent: -1.6em; }

/* ---------- Índice lateral (somente quando o documento tem títulos) ---------- */
.ar-indice {
  grid-column: 2; margin: clamp(48px, 8vh, 80px) 0 0;
  padding: 18px 20px; border: 1px solid rgba(18, 38, 26, .14);
  font-family: var(--sans);
}
.ar-indice + .ar-corpo { padding-top: clamp(36px, 6vh, 60px); }
.ar-indice-rot { margin: 0 0 10px; font: 700 10px/1.4 var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--terracota); }
.ar-indice ol { list-style: none; margin: 0; padding: 0; counter-reset: ind; }
.ar-indice li { counter-increment: ind; }
.ar-indice a {
  display: grid; grid-template-columns: 2em 1fr; padding: 7px 0;
  font-size: 13px; line-height: 1.4; color: var(--tinta-suave); text-decoration: none;
  transition: color .3s;
}
.ar-indice a::before { content: counter(ind, decimal-leading-zero); font-weight: 700; font-size: 11px; color: var(--ouro); padding-top: 1px; }
.ar-indice a:hover, .ar-indice a:focus-visible, .ar-indice a[aria-current="true"] { color: var(--floresta); }
.ar-indice a[aria-current="true"] { font-weight: 700; }
@media (min-width: 1240px) {
  .ar > .ar-indice {
    grid-column: 1; grid-row: 2; align-self: start; justify-self: end;
    position: sticky; top: 110px;
    width: min(240px, calc(100% - 60px)); margin: clamp(60px, 10vh, 110px) 50px 0 0;
    border: 0; border-top: 1px solid rgba(18, 38, 26, .18); padding: 16px 0 0;
  }
  .ar > .ar-indice + .ar-corpo { grid-row: 2; padding-top: clamp(60px, 10vh, 110px); }
}

/* ---------- Imagens no corpo ---------- */
.ar-fig { margin: 2.2em 0; }
.ar-fig figcaption { margin-top: 12px; font: 600 11px/1.5 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--tinta-suave); text-align: center; }
.ar-ampliar {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  cursor: zoom-in;
}
.ar-ampliar picture { display: block; }
.ar-ampliar img {
  width: auto; height: auto; max-width: 100%; margin: 0 auto;
  max-height: 84vh;
  box-shadow: 0 1px 2px rgba(18, 38, 26, .1), 0 22px 40px -28px rgba(18, 38, 26, .55);
  transition: transform .9s var(--ease-org), box-shadow .9s var(--ease-org);
}
.ar-ampliar:hover img, .ar-ampliar:focus-visible img { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(18, 38, 26, .1), 0 30px 50px -28px rgba(64, 38, 18, .55); }
.ar-ampliar:focus-visible { outline-offset: 6px; }
/* imagem larga: sai da coluna de leitura */
.ar-fig--larga, .ar-video--horizontal {
  width: min(1100px, calc(100vw - 2 * var(--margem)));
  margin-left: calc(50% - min(550px, 50vw - var(--margem)));
}
.ar-fig--larga { margin-top: 2.8em; margin-bottom: 2.8em; }
/* par/montagem: imagens lado a lado quando o documento pede para juntá-las */
.ar-fig--par { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 20px); align-items: center; }
.ar-fig--par figcaption { grid-column: 1 / -1; }
.ar-fig--par .ar-ampliar img { width: 100%; }

/* ---------- Vídeos (fachada leve; o YouTube só carrega no clique) ---------- */
.ar-video { position: relative; margin-top: 2.8em; margin-bottom: 2.8em; }
.ar-video-poster, .ar-video-quadro {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 16 / 9; background: var(--igapo);
  box-shadow: 0 30px 60px -36px rgba(18, 38, 26, .8);
}
.ar-video-poster img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.82) saturate(.95); transition: transform 1.2s var(--ease-org), filter .8s; }
.ar-video-poster--vazio { background: radial-gradient(circle at 50% 40%, rgba(36, 74, 50, .9), var(--igapo)); }
.ar-video-quadro iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ar-video--vertical { width: min(380px, 100%); margin-left: auto; margin-right: auto; }
.ar-video--vertical .ar-video-poster, .ar-video--vertical .ar-video-quadro { aspect-ratio: 9 / 16; }
.ar-video-tocar {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 14px;
  padding: 10px 24px 10px 10px; border-radius: 100px;
  border: 1px solid rgba(242, 200, 138, .7);
  background: rgba(5, 13, 8, .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--bege); cursor: pointer;
  font: 700 11px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; white-space: nowrap;
  transition: background-color .4s, color .4s, transform .6s var(--ease-org);
}
.ar-video-tocar svg { width: 44px; height: 44px; padding: 12px 11px 12px 13px; border-radius: 50%; background: var(--ouro); fill: var(--noite); transition: transform .6s var(--ease-org); }
.ar-video:has(.ar-video-poster) .ar-video-tocar { top: calc(50% - 14px); }
.ar-video-tocar:hover, .ar-video-tocar:focus-visible { background: var(--ouro); color: var(--noite); }
.ar-video-tocar:hover svg, .ar-video-tocar:focus-visible svg { transform: scale(1.08); background: var(--noite); fill: var(--ouro); }
.ar-video:hover .ar-video-poster img { transform: scale(1.04); filter: brightness(.9) saturate(1); }
.ar-video-link {
  display: inline-block; margin-top: 12px;
  font: 700 10px/1.4 var(--sans); letter-spacing: .22em; text-transform: uppercase;
  color: var(--tinta-suave); text-decoration: none; border-bottom: 1px solid rgba(18, 38, 26, .3); padding-bottom: 2px;
}
.ar-video-link:hover, .ar-video-link:focus-visible { color: var(--terracota); border-color: currentColor; }
.ar-video--vertical .ar-video-link { display: table; margin-left: auto; margin-right: auto; }
.ar-video--local video { width: 100%; height: auto; background: var(--igapo); box-shadow: 0 30px 60px -36px rgba(18, 38, 26, .8); }
.ar-video.tocando .ar-video-tocar { display: none; }

/* ---------- Galeria final ---------- */
.ar-galeria { padding: 0 var(--margem) clamp(80px, 13vh, 150px); }
.ar-galeria .rotulo { color: var(--tinta); }
.ar-galeria-titulo { font-size: clamp(32px, 3.8vw, 66px); color: var(--floresta); --soft: 60; margin-bottom: clamp(30px, 5vh, 60px); }
.ar-galeria-grade { columns: 3; column-gap: clamp(12px, 1.8vw, 26px); }
.ar-galeria-grade .ar-ampliar { break-inside: avoid; margin-bottom: clamp(12px, 1.8vw, 26px); overflow: hidden; }
.ar-galeria-grade .ar-ampliar img { width: 100%; max-height: none; }

/* ---------- Navegação entre artigos ---------- */
.ar-nav { background: var(--noite); color: var(--bege); padding: clamp(70px, 12vh, 130px) var(--margem) clamp(60px, 10vh, 110px); }
.ar-vizinhos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid rgba(243, 239, 229, .14); border-bottom: 1px solid rgba(243, 239, 229, .14); }
.ar-vizinho {
  display: flex; flex-direction: column; gap: 12px;
  padding: clamp(28px, 5vh, 54px) clamp(10px, 3vw, 50px) clamp(28px, 5vh, 54px) 0;
  color: inherit; text-decoration: none;
}
.ar-vizinho[rel="next"] { text-align: right; align-items: flex-end; padding: clamp(28px, 5vh, 54px) 0 clamp(28px, 5vh, 54px) clamp(10px, 3vw, 50px); border-left: 1px solid rgba(243, 239, 229, .14); }
.ar-vizinho--vazio + .ar-vizinho[rel="next"] { grid-column: 2; }
.ar-vizinho-rot { display: inline-flex; align-items: center; gap: 10px; font: 700 11px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--ouro-reflexo); }
.ar-vizinho-rot svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform .5s var(--ease-org); }
.ar-vizinho-num { font-family: var(--serif); font-weight: 300; font-size: clamp(40px, 4vw, 70px); line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(216, 167, 99, .7); transition: color .5s; }
.ar-vizinho-titulo {
  font-family: var(--serif); font-weight: 380; font-size: clamp(20px, 1.9vw, 32px); line-height: 1.15;
  font-variation-settings: 'opsz' 72, 'SOFT' 60, 'WONK' 0;
  text-wrap: balance; max-width: 22em;
}
.ar-vizinho:hover .ar-vizinho-num, .ar-vizinho:focus-visible .ar-vizinho-num { color: var(--ouro); }
.ar-vizinho[rel="prev"]:hover .ar-vizinho-rot svg { transform: translateX(-5px); }
.ar-vizinho[rel="next"]:hover .ar-vizinho-rot svg { transform: translateX(5px); }
.ar-nav-voltar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px 34px; margin-top: clamp(40px, 7vh, 70px); }
.ar-nav-blogs { font: 700 11px/1.4 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: rgba(243, 239, 229, .75); text-decoration: none; border-bottom: 1px solid rgba(243, 239, 229, .3); padding-bottom: 3px; }
.ar-nav-blogs:hover, .ar-nav-blogs:focus-visible { color: var(--ouro-reflexo); border-color: currentColor; }

/* ---------- Estados iniciais da animação (apenas com JS + movimento) ---------- */
html.anim .ar-titulo { visibility: hidden; }
html.anim .ar-abre-texto .rotulo, html.anim .ar-meta, html.anim .ar-epigrafe { opacity: 0; }

/* ---------- Celular ---------- */
@media (max-width: 1100px) {
  .pp-migalha { display: none; }
}
@media (max-width: 860px) {
  .ar-abre, .ar-abre--tipo { grid-template-columns: 1fr; min-height: 0; padding: 104px 20px 44px; gap: 30px; align-items: start; }
  .ar-capa { grid-column: 1; grid-row: 1; justify-content: center; }
  .ar-abre-texto { grid-column: 1; grid-row: 2; }
  .ar-abre--tipo { min-height: 70svh; align-content: end; }
  .ar-abre--tipo .ar-abre-texto { grid-row: 1; }
  .ar-capa-foto img { max-height: 58vh; }
  .ar-titulo { font-size: clamp(32px, 9.6vw, 48px); }
  .ar-numeral { font-size: 62vw; right: 12px; bottom: auto; top: 70px; }
  .ar-ramo { right: -10vw; width: 50vw; height: 40vh; }
  .ar { grid-template-columns: 20px minmax(0, 1fr) 20px; }
  .ar-corpo { padding: 48px 0 64px; font-size: 18px; line-height: 1.68; }
  .ar-fig--larga, .ar-video--horizontal { width: calc(100vw - 24px); margin-left: calc(50% - 50vw + 12px); }
  .ar-fig--par { grid-template-columns: 1fr; }
  .ar-ampliar img { max-height: none; }
  .ar-video-tocar { padding: 8px 18px 8px 8px; gap: 10px; }
  .ar-video-tocar svg { width: 38px; height: 38px; padding: 10px 9px 10px 11px; }
  .ar-galeria { padding: 0 20px 64px; }
  .ar-galeria-grade { columns: 2; column-gap: 10px; }
  .ar-galeria-grade .ar-ampliar { margin-bottom: 10px; }
  .ar-nav { padding: 64px 20px 56px; }
  .ar-vizinhos { grid-template-columns: 1fr; }
  .ar-vizinho, .ar-vizinho[rel="next"] { padding: 26px 0; }
  .ar-vizinho[rel="next"] { border-left: 0; border-top: 1px solid rgba(243, 239, 229, .14); }
  .ar-vizinho--vazio { display: none; }
  .ar-vizinho--vazio + .ar-vizinho[rel="next"] { grid-column: 1; border-top: 0; }
}

/* ---------- Movimento reduzido ---------- */
html.reduzido .ar-ampliar:hover img, html.reduzido .ar-ampliar:focus-visible img,
html.reduzido .ar-video:hover .ar-video-poster img { transform: none; }
@media print {
  .pp-topo, .ar-progresso, .grao, .ar-nav, .pp-rodape, .ar-indice, .ar-video-tocar { display: none !important; }
  .ar-abre { min-height: 0; background: none; color: #000; padding: 0 0 20px; }
  body.pagina-artigo { background: #fff; }
}
