.apaferj-artigo {
  --artigo-navy: #081c3c;
  --artigo-surface: #f8f4ec;
  --artigo-paper: #eee9e0;
  --artigo-ink: #243044;
  --artigo-muted: #657083;
  --artigo-line: #d9dde4;
  --artigo-gold: #aa7b2f;
  color: var(--artigo-ink);
  background: var(--artigo-paper);
}

.apaferj-artigo * { box-sizing: border-box; }

html[data-apaferj-tema="escuro"] .apaferj-artigo {
  --artigo-surface: #293443;
  --artigo-paper: #202936;
  --artigo-ink: #f2efe8;
  --artigo-muted: #c1c8d2;
  --artigo-line: #435166;
  --artigo-gold: #e1bd72;
}

.apaferj-progresso-leitura { position: fixed; z-index: 60; inset: 0 0 auto; height: 3px; pointer-events: none; }
.apaferj-progresso-leitura span { display: block; width: calc(var(--apaferj-progresso, 0) * 1%); height: 100%; background: linear-gradient(90deg, #c62b39 0 76%, #d8e62d 76%); }

.apaferj-artigo-hero { position: relative; overflow: hidden; padding: clamp(2.75rem, 4.5vw, 4rem) 1.5rem clamp(3.5rem, 5.5vw, 5rem); color: #fff; background: radial-gradient(circle at 92% 8%, rgba(55,96,190,.38), transparent 34%), linear-gradient(125deg,#071a39,#0b2853 62%,#102f5d); }
.apaferj-artigo-hero::after { content: ""; position: absolute; right: -130px; bottom: -220px; width: 520px; height: 520px; opacity: .12; background: url("../images/brand/procurador-federal-watermark.png") center/contain no-repeat; }
.apaferj-artigo-hero__inner { position: relative; z-index: 1; max-width: 1140px; margin-inline: auto; text-align: center; }
.apaferj-artigo__voltar { margin-bottom: clamp(1.5rem, 3vw, 2.5rem); text-align: left; }
.apaferj-artigo__voltar a { color: #d6e0ef !important; font-size: .88rem; font-weight: 700; text-decoration: none; }
.apaferj-artigo__marca { justify-content: center; gap: .85rem; margin-bottom: 1.25rem; }
.apaferj-artigo__marca img { width: 54px; height: 54px; object-fit: contain; filter: drop-shadow(0 5px 8px rgba(0,0,0,.24)); }
.apaferj-artigo__marca p { margin: 0; line-height: 1.15; }
.apaferj-artigo__marca p:first-child { font-family: var(--wp--preset--font-family--serif); font-size: 1.05rem; font-weight: 700; letter-spacing: .05em; }
.apaferj-artigo__marca p:last-child { margin-top: .25rem; color: #aebed3; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.apaferj-artigo__categoria { margin-bottom: 1rem; }
.apaferj-artigo__categoria { color: #efd9a4; font-size: .74rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.apaferj-artigo__titulo { max-width: 1040px; margin: 0 auto; color: #fff !important; font-size: clamp(1.9rem, 3.25vw, 2.85rem) !important; line-height: 1.1 !important; letter-spacing: -.02em !important; text-wrap: balance; }
.apaferj-artigo__meta { justify-content: center; gap: .45rem; margin-top: 1.25rem; color: #bac8da; font-size: .86rem; }
.apaferj-artigo__meta p,
.apaferj-artigo__meta .wp-block-post-date { margin: 0; color: inherit; }
.apaferj-artigo__meta .wp-block-post-date { font-weight: 700; }

.apaferj-artigo-corpo { position: relative; z-index: 2; padding: 0 1.5rem clamp(5rem, 9vw, 8rem); }
.apaferj-artigo__destaque { max-width: 1100px !important; margin: clamp(-5rem, -7vw, -3.5rem) auto 0 !important; overflow: hidden; background: #203557; border: 8px solid var(--artigo-surface); border-radius: 28px; box-shadow: 0 28px 75px rgba(7,27,58,.2); }
.apaferj-artigo__destaque img { width: 100%; max-height: 670px; object-fit: cover; }
.apaferj-artigo__conteudo { margin-top: clamp(-2rem, -2vw, -1rem); padding: clamp(1.75rem, 4vw, 3.5rem); background: var(--artigo-surface); border: 1px solid var(--artigo-line); border-radius: 22px; box-shadow: 0 14px 40px rgba(7,27,58,.08); }
.apaferj-artigo-corpo > .apaferj-artigo__conteudo:first-child { margin-top: clamp(-4.5rem, -6vw, -3rem); }
.apaferj-artigo__conteudo .wp-block-post-content { color: var(--artigo-ink); font-size: clamp(.96rem, 1.15vw, 1.04rem); line-height: 1.72; }
.apaferj-artigo-layout { grid-template-columns: minmax(0, 1fr) minmax(16rem, 19rem); }
.apaferj-artigo-layout__principal { min-width: 0; }
.apaferj-artigo__conteudo .wp-block-post-content > :where(p, ul, ol, blockquote, h2, h3, h4) { max-width: 760px; margin-inline: auto; }
.apaferj-artigo__conteudo .wp-block-post-content p { margin-bottom: 1.65rem; text-wrap: pretty; }
.apaferj-artigo__conteudo .wp-block-post-content :where(h2,h3,h4) { margin-top: 2.6em; margin-bottom: .7em; color: var(--artigo-ink); line-height: 1.15; }
.apaferj-artigo__conteudo .wp-block-post-content :where(ul,ol) { margin-bottom: 1.8rem; padding-left: 1.35rem; }
.apaferj-artigo__conteudo .wp-block-post-content li { padding-left: .35rem; margin-bottom: .65rem; }
.apaferj-artigo__conteudo .wp-block-post-content :where(figure,.wp-block-image) { width: fit-content; max-width: 100%; margin: 2.8rem auto; }
.apaferj-artigo__conteudo .wp-block-post-content img { width: auto; max-width: 100%; height: auto; margin-inline: auto; border-radius: 18px; box-shadow: 0 16px 44px rgba(7,27,58,.12); }
.apaferj-artigo__conteudo .wp-block-post-content img[src*="/logo-apaferj.svg"] { width: min(14rem, 60vw); border-radius: 50%; box-shadow: none; }
.apaferj-artigo__conteudo .apaferj-marca-vetorial-no-conteudo { display: block; width: min(14rem, 60vw); height: auto; margin-inline: auto; border-radius: 50%; box-shadow: none; }
.apaferj-artigo__conteudo .wp-block-post-content figcaption { max-width: 60ch; margin: .8rem auto 0; color: var(--artigo-muted); font-size: .86rem; text-align: center; }
.apaferj-artigo__conteudo .wp-block-post-content blockquote { padding: 1.5rem 0 1.5rem 1.75rem; color: var(--artigo-ink); border-left: 4px solid var(--artigo-gold); font-family: var(--wp--preset--font-family--serif); font-size: 1.3rem; }
.apaferj-artigo__conteudo .wp-block-post-content a { overflow-wrap: anywhere; }
.apaferj-artigo__conteudo .wp-block-post-content :where(table,.wp-block-table) { max-width: 100%; overflow-x: auto; }
.apaferj-artigo__encerramento { max-width: 820px; gap: 1rem; margin: 2rem auto 0; padding: 1.25rem 1.5rem; color: var(--artigo-muted); background: color-mix(in srgb,var(--artigo-surface) 78%,transparent); border: 1px solid var(--artigo-line); border-radius: 18px; font-size: .86rem; }
.apaferj-artigo__encerramento p { margin: 0; }
.apaferj-artigo__encerramento a { color: var(--artigo-ink) !important; font-weight: 700; text-decoration: none; }
.apaferj-artigo .apaferj-post-nav { max-width: 820px; align-items: stretch; gap: 1rem; margin: 2rem auto 0; padding-top: 2rem; }
.apaferj-artigo .apaferj-post-nav > * { flex: 1 1 280px; }
.apaferj-artigo .apaferj-post-nav a { width: 100%; min-height: 100%; display: flex; flex-direction: column; align-items: flex-start; padding: 1.25rem 1.5rem; color: var(--artigo-ink) !important; background: var(--artigo-surface); border-radius: 18px; font-weight: 700; }

@media (max-width: 650px) {
  .apaferj-artigo-hero { padding: 2.5rem 1rem 4.25rem; }
  .apaferj-artigo__voltar { margin-bottom: 1.75rem; }
  .apaferj-artigo__titulo { font-size: clamp(1.95rem, 9vw, 2.75rem) !important; }
  .apaferj-artigo-corpo { padding-inline: .85rem; }
  .apaferj-artigo__destaque { border-width: 5px; border-radius: 22px; }
  .apaferj-artigo__conteudo { padding: 2rem 1.25rem; border-radius: 22px; }
  .apaferj-artigo__conteudo .wp-block-post-content { font-size: 1rem; line-height: 1.72; }
  .apaferj-artigo__encerramento { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .apaferj-progresso-leitura span { transition: none !important; }
}
