/* Leitura em formato editorial: abertura ampla, texto e índice lateral. */
.post-page {
    --site-width: 1360px;
    --page-gutter: clamp(1.25rem, 3vw, 3.5rem);
    --font-editorial: Georgia, "Times New Roman", serif;
}

.detalhe-container {
    max-width: var(--site-width);
    margin: 0 auto;
    padding: 1.75rem var(--page-gutter) 5rem;
}

.btn-voltar {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.post-opening {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: clamp(2rem, 5vw, 4.5rem);
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 2px solid var(--text-color);
}

.post-opening--text-only { grid-template-columns: 1fr; }
.detalhe-meta { margin: 0 0 1rem; color: var(--text-secondary); font-size: 0.875rem; font-weight: 600; }
.detalhe-titulo {
    margin: 0;
    font-family: var(--font-editorial);
    font-size: clamp(2rem, 3.5vw, 3.5rem);
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
    text-wrap: balance;
}
.detalhe-resumo { max-width: 55ch; margin: 1.25rem 0 0; color: var(--text-secondary); font-size: 1.125rem; line-height: 1.7; }
.post-cover { min-width: 0; margin: 0; }
.post-cover-button { display: block; width: 100%; padding: 0; border: 0; background: var(--card-bg); cursor: zoom-in; }
.post-cover .img-artigo { width: 100%; max-height: none; aspect-ratio: 4 / 3; border: 0; border-radius: 0; box-shadow: none; object-fit: contain; }
.post-cover figcaption { margin-top: 0.75rem; color: var(--text-secondary); font-size: 0.875rem; text-align: left; }

.post-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 14rem;
    grid-template-areas: "content sidebar";
    align-items: start;
    gap: clamp(2rem, 4vw, 4rem);
}
.post-body--single { grid-template-columns: minmax(0, 1fr); grid-template-areas: "content"; }
.post-main { grid-area: content; min-width: 0; }
.post-sidebar { grid-area: sidebar; position: sticky; top: 7rem; min-width: 0; max-height: calc(100dvh - 9rem); overflow-y: auto; border-top: 2px solid var(--text-color); }
.article-outline { padding-top: 1rem; }
.article-outline summary { padding: 0.25rem 0; font-weight: 700; cursor: pointer; }
.article-outline ol { margin: 1rem 0 0; padding: 0; list-style: none; }
.article-outline li + li { margin-top: 0.75rem; }
.article-outline a { display: inline-block; color: var(--text-secondary); font-size: 0.875rem; line-height: 1.5; overflow-wrap: anywhere; }
.article-outline a:hover { color: var(--text-color); text-decoration: underline; text-underline-offset: 3px; }

/* Parágrafos preservam uma largura confortável; mídias usam a coluna inteira. */
.post-page .detalhe-texto { max-width: none; margin: 0; }
.detalhe-texto > :is(p, ul, ol, blockquote) { max-width: 70ch; }
.detalhe-texto > .article-media { max-width: none; }
.detalhe-texto > :first-child { margin-top: 0; }
.detalhe-texto :is(h2, h3) { scroll-margin-top: 1.5rem; }
.detalhe-texto h2 { margin-top: 3rem; padding-bottom: 0.75rem; font-family: var(--font-editorial); font-weight: 600; }
.detalhe-texto .img-artigo { max-height: 600px; }
.post-page .detalhe-texto video { max-width: 100%; max-height: 560px; }
.detalhe-texto .galeria-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1rem; }
.detalhe-texto .galeria-grid img { height: 220px; }
.detalhe-botoes { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border-color); }

@media (max-width: 1049px) {
    .post-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "sidebar" "content"; gap: 2rem; }
    .post-sidebar { position: static; max-height: none; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color); }
}

@media (max-width: 760px) {
    .post-opening { grid-template-columns: 1fr; gap: 1.5rem; margin-bottom: 2rem; padding-bottom: 2rem; }
    .detalhe-container { padding-top: 1.5rem; }
    .btn-voltar { margin-bottom: 1.5rem; }
    .detalhe-titulo { font-size: clamp(2rem, 7vw, 2.75rem); }
    .detalhe-resumo { font-size: 1rem; }
    .post-cover .img-artigo { aspect-ratio: 4 / 3; }
    .post-page .detalhe-texto video { max-height: 360px; }
}
