/* Publicação (boletim / artigo) -------------------------------------------- */

/* Cabeçalho escuro: kicker da série, título, resumo e dados */
.artigo-hero {
    background-color: var(--grafite);
    color: var(--branco);
    padding: calc(var(--topbar-h) + var(--header-h) + clamp(56px, 6.4vw, 104px)) 0 clamp(56px, 5.6vw, 88px);
}

.artigo-hero--com-capa { padding-bottom: clamp(48px, 4.4vw, 64px); }

.artigo-hero__kicker { margin-bottom: clamp(20px, 2vw, 28px); }

.artigo-hero__titulo {
    max-width: 16em;
    font-size: clamp(2.125rem, 4.8vw, 4.5rem);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.artigo-hero__rodape {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 36px clamp(40px, 4.6vw, 80px);
    margin-top: clamp(40px, 4.4vw, 64px);
}

.artigo-hero__resumo {
    max-width: 40rem;
    font-size: var(--fs-lead);
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.72);
}

.artigo-hero__meta {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 20px clamp(28px, 3.4vw, 48px);
    padding-top: 26px;
    border-top: 1px solid var(--linha-escura);
}

.artigo-hero__meta .meta-rotulo { margin-bottom: 8px; color: var(--texto-claro); }
.artigo-hero__meta dd { font-size: var(--fs-corpo); font-weight: 500; }

.artigo-hero__autor {
    padding-bottom: 3px;
    border-bottom: 1px solid var(--ouro);
    transition: color var(--dur-2) var(--ease-out);
}

.artigo-hero__autor:hover,
.artigo-hero__autor:focus-visible { color: var(--ouro-claro); }

/* Capa entre o cabeçalho e o texto: metade sobre o escuro, metade sobre o branco */
.artigo-capa { background: linear-gradient(var(--grafite) 50%, var(--branco) 50%); }

.artigo-capa__imagem { aspect-ratio: 21 / 9; }
.artigo-capa__imagem img { filter: grayscale(1) contrast(1.05); }

/* Corpo: ficha lateral + texto */
.artigo__grade {
    display: grid;
    grid-template-columns: 220px minmax(0, 720px);
    align-items: start;
    gap: 40px clamp(48px, 7vw, 120px);
}

.artigo__lateral {
    position: sticky;
    top: calc(var(--header-h) + 24px);
}

.artigo-ficha__item {
    padding: 16px 0 18px;
    border-top: 1px solid var(--linha);
}

.artigo-ficha__item:last-child { border-bottom: 1px solid var(--linha); }
.artigo-ficha .meta-rotulo { margin-bottom: 6px; font-size: 0.625rem; color: var(--texto-3); }

.artigo-ficha dd {
    font-size: var(--fs-pequeno);
    font-weight: 500;
    line-height: 1.45;
    color: var(--texto);
}

.artigo-ficha__autor {
    border-bottom: 1px solid var(--ouro);
    transition: color var(--dur-2) var(--ease-out);
}

.artigo-ficha__autor:hover { color: var(--ouro); }

.artigo-compartilhar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.artigo-compartilhar a,
.artigo-compartilhar button {
    padding: 0 0 2px;
    border: 0;
    border-bottom: 1px solid var(--linha-campo);
    background: none;
    font-size: var(--fs-meta);
    font-weight: 600;
    color: var(--texto);
    transition: color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}

.artigo-compartilhar a:hover,
.artigo-compartilhar button:hover { color: var(--ouro); border-bottom-color: var(--ouro); }

/* Texto */
.artigo__corpo { min-width: 0; }

.texto-artigo {
    font-size: var(--fs-lead);
    line-height: 1.85;
    color: var(--texto);
}

.texto-artigo > * + * { margin-top: 22px; }

.texto-artigo h2,
.texto-artigo h3,
.texto-artigo h4 {
    margin-top: 52px;
    margin-bottom: -6px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--texto);
    scroll-margin-top: calc(var(--header-h) + 32px);
}

.texto-artigo > :first-child { margin-top: 0; }
.texto-artigo h2 { font-size: clamp(1.375rem, 2vw, 1.625rem); }
.texto-artigo h3 { font-size: clamp(1.25rem, 1.7vw, 1.4375rem); }
.texto-artigo h4 { font-size: 1.125rem; }

.texto-artigo a {
    color: var(--verde);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--ouro);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color var(--dur-2) var(--ease-out);
}

.texto-artigo a:hover { color: var(--ouro); }

/* Chamada de nota: ¹ dourado, sem alterar o espaçamento da linha */
.texto-artigo .nota-ref { line-height: 0; }

.texto-artigo .nota-ref a {
    padding: 0 1px;
    font-size: 0.72em;
    font-weight: 600;
    color: var(--ouro);
    text-decoration: none;
    scroll-margin-top: calc(var(--header-h) + 32px);
}

.texto-artigo .nota-ref a:hover { color: var(--verde); }

.texto-artigo strong,
.texto-artigo b { font-weight: 700; color: var(--texto); }

.texto-artigo ul,
.texto-artigo ol { padding-left: 22px; }
.texto-artigo ul li { list-style: disc; }
.texto-artigo ol li { list-style: decimal; }
.texto-artigo li + li { margin-top: 10px; }
.texto-artigo li::marker { color: var(--ouro); }

.texto-artigo blockquote {
    position: relative;
    margin-block: 40px;
    padding: 30px 34px 32px;
    background-color: var(--verde);
    color: var(--branco);
}

.texto-artigo blockquote::before {
    content: "\201C";
    display: block;
    height: 30px;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    color: var(--ouro-claro);
}

.texto-artigo blockquote p {
    font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: -0.01em;
}

.texto-artigo blockquote p + p { margin-top: 12px; }

/* Dentro da citação o fundo é escuro: as cores pensadas para o texto corrido
   (negrito #222, link verde) ficavam quase pretas. O grifo vira dourado. */
.texto-artigo blockquote :is(strong, b) { color: var(--ouro-claro); }
.texto-artigo blockquote :is(em, i, u, s, del, ins, span, code) { color: inherit; }
.texto-artigo blockquote code { background-color: rgba(255, 255, 255, 0.08); }

.texto-artigo blockquote a {
    color: var(--ouro-claro);
    text-decoration-color: currentColor;
}

.texto-artigo blockquote a:hover { color: var(--branco); }

.texto-artigo img {
    max-width: 100%;
    height: auto;
    margin-block: 12px;
}

.texto-artigo figure.table,
.texto-artigo .tabela-rolavel { overflow-x: auto; }

.texto-artigo .tabela-rolavel table { min-width: 520px; }

.texto-artigo table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-pequeno);
    line-height: 1.5;
}

.texto-artigo th,
.texto-artigo td {
    padding: 12px 14px;
    border: 1px solid var(--linha);
    text-align: left;
    vertical-align: top;
}

.texto-artigo th {
    background-color: rgba(1, 38, 38, 0.06);
    color: var(--verde);
    font-weight: 700;
}

.texto-artigo hr {
    border: 0;
    height: 1px;
    background-color: var(--linha);
}

/* Notas de rodapé */
.artigo-notas {
    margin-top: 56px;
    padding-top: 26px;
    border-top: 1px solid var(--linha);
}

.artigo-notas li {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    font-size: var(--fs-meta);
    line-height: 1.65;
    color: var(--texto-3);
    scroll-margin-top: calc(var(--header-h) + 32px);
}

.artigo-notas li + li { margin-top: 10px; }
.artigo-notas li:target .artigo-notas__texto { color: var(--texto); }
.artigo-notas__numero { font-weight: 600; color: var(--texto-2); }
.artigo-notas__texto { overflow-wrap: anywhere; transition: color var(--dur-2) var(--ease-out); }

.artigo-notas__texto a {
    color: var(--texto-2);
    text-decoration: underline;
    text-decoration-color: var(--linha-campo);
    text-underline-offset: 2px;
}

.artigo-notas__texto a:hover { color: var(--ouro); }
.artigo-notas__voltar { margin-left: 2px; text-decoration: none !important; color: var(--ouro) !important; }

.artigo__aviso {
    margin-top: 32px;
    font-size: var(--fs-meta);
    font-style: italic;
    line-height: 1.6;
    color: var(--texto-3);
}

.artigo-notas + .artigo__aviso { margin-top: 20px; }
.texto-artigo + .artigo__aviso { padding-top: 22px; border-top: 1px solid var(--linha); }

/* Sobre o autor */
.artigo-autor {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: start;
    gap: 28px;
    margin-top: clamp(48px, 5vw, 72px);
    padding-top: clamp(28px, 3vw, 40px);
    border-top: 1px solid var(--linha);
}

.artigo-autor__foto { aspect-ratio: 4 / 5; }
.artigo-autor__corpo .meta-rotulo { margin-bottom: 8px; font-size: 0.625rem; color: var(--texto-3); }

.artigo-autor__nome {
    font-size: clamp(1.25rem, 1.8vw, 1.5rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--texto);
}

.artigo-autor__cargo { margin-top: 4px; font-size: var(--fs-pequeno); color: var(--texto-3); }

.artigo-autor__acoes {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px 28px;
    margin-top: 22px;
}

/* Leia também: cards sem caixa (foto, tipo + data, título) */
.grade-pub {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 48px clamp(24px, 3.4vw, 48px);
}

.card-pub {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.card-pub__capa { aspect-ratio: 4 / 3; margin-bottom: 22px; }
.card-pub__capa img { filter: grayscale(1) contrast(1.05); }

.card-pub__meta {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-bottom: 12px;
}

.card-pub__titulo {
    font-size: clamp(1.0625rem, 1.5vw, 1.3125rem);
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.015em;
    color: var(--texto);
    text-wrap: pretty;
    transition: color var(--dur-2) var(--ease-out);
}

.card-pub:hover .card-pub__titulo,
.card-pub:focus-visible .card-pub__titulo { color: var(--verde); }

/* Responsivo */
@media (max-width: 1000px) {
    .artigo__grade { grid-template-columns: minmax(0, 1fr); }
    /* autor, data e leitura já estão no cabeçalho: no fim do texto fica só "Compartilhar" */
    .artigo__lateral { position: static; order: 2; }
    .artigo-ficha__item:not(.artigo-ficha__item--compartilhar) { display: none; }
    .grade-pub { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .artigo-hero__rodape { grid-template-columns: minmax(0, 1fr); }
    .artigo-hero__meta { grid-column: 1; }
    .artigo-capa__imagem { aspect-ratio: 16 / 9; }
}

@media (max-width: 640px) {
    .artigo-capa__imagem { aspect-ratio: 3 / 2; }
    .artigo-autor { grid-template-columns: 72px minmax(0, 1fr); gap: 18px; }
    .grade-pub { grid-template-columns: minmax(0, 1fr); }
    .texto-artigo blockquote { padding: 24px; }
}
