/* Site das encíclicas: folha de estilo base (gerada para site_dist/assets/ por src/site_build.py).
   Nomes de classes e ids: "Contrato de marcação do documento" em docs/superpowers/plans/2026-10-29-site.md. */

@font-face { font-family: "Libertinus Serif"; src: url("fonts/LibertinusSerif-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Libertinus Serif"; src: url("fonts/LibertinusSerif-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Libertinus Serif"; src: url("fonts/LibertinusSerif-Semibold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Libertinus Serif"; src: url("fonts/LibertinusSerif-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Libertinus Serif"; src: url("fonts/LibertinusSerif-BoldItalic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

/* Cores: claro (padrão), sépia e escuro; sem escolha gravada, segue o tema do sistema. */
:root {
  --papel: #faf8f3; --tinta: #1f1d1a; --suave: #6b665e; --linha: #e2ddd2; --destaque: #7a2e2a; --bloco: #f2eee5; --controle: #efebe2;
  --fonte: "Libertinus Serif", Georgia, serif;
  --tam: 19px; --entre: 1.6; --largura: 36em; --recuo: 1.5em; --alinhar: justify; --espaco: 0;
  color-scheme: light;
}
:root[data-tema="sepia"] { --papel: #f4ecd8; --tinta: #3b2f22; --suave: #6a5b47; --linha: #e0d3b8; --destaque: #8a3b1f; --bloco: #ebe0c6; --controle: #ebe1c9; }
:root[data-tema="escuro"] { --papel: #1b1a18; --tinta: #e6e1d6; --suave: #a39d92; --linha: #34312c; --destaque: #d9877e; --bloco: #25231f; --controle: #2a2824; color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-tema]) { --papel: #1b1a18; --tinta: #e6e1d6; --suave: #a39d92; --linha: #34312c; --destaque: #d9877e; --bloco: #25231f; --controle: #2a2824; color-scheme: dark; }
}
:root[data-fonte="georgia"] { --fonte: Georgia, "Times New Roman", serif; }
:root[data-fonte="sans"] { --fonte: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
:root[data-alinhar="esquerda"] { --alinhar: left; }
:root[data-par="espaco"] { --espaco: .9em; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--papel); color: var(--tinta); font-family: var(--fonte); font-size: var(--tam); line-height: var(--entre); }
a { color: var(--destaque); }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; display: block; flex: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* Alvos de link (parágrafos, intertítulos, blocos, notas) não ficam sob a barra fixa */
[id] { scroll-margin-top: 64px; }
:focus-visible { outline: 2px solid var(--destaque); outline-offset: 2px; }

/* Barra fixa */
.barra { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: var(--papel); border-bottom: 1px solid var(--linha); font-size: 15px; line-height: 1.3; }
.barra .titulo { flex: 1; min-width: 0; text-align: center; font-style: italic; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icone { color: var(--tinta); background: none; border: 0; border-radius: 50%; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; }
.icone:active, .icone:focus-visible { background: var(--controle); }

main { max-width: var(--largura); margin: 0 auto; padding: 0 16px 80px; }

/* Cabeçalho do documento: vinheta com passe-partout leve, gênero, título, papa e data */
figure.vinheta { margin: 20px 0 0; padding: 10px; background: var(--bloco); border: 1px solid var(--linha); }
figure.vinheta img { display: block; width: 100%; height: auto; }
:root[data-tema="escuro"] figure.vinheta img { opacity: .85; }
@media (prefers-color-scheme: dark) { :root:not([data-tema]) figure.vinheta img { opacity: .85; } }
.genero { text-align: center; font-variant: small-caps; letter-spacing: .08em; color: var(--suave); font-size: .85em; margin: 1.6em 0 0; }
.doc h1 { font-size: 1.9em; font-weight: 600; line-height: 1.15; margin: .2em 0 .15em; text-align: center; }
.meta { text-align: center; color: var(--suave); margin: 0 0 1.2em; }
.meta strong { font-weight: 600; color: var(--tinta); }

/* Contexto histórico, recolhido */
details.contexto { border-top: 1px solid var(--linha); border-bottom: 1px solid var(--linha); margin: 0 0 1.6em; }
details.contexto summary { cursor: pointer; list-style: none; padding: .55em 0; color: var(--suave); font-size: .9em; display: flex; align-items: center; gap: .5em; }
details.contexto summary span { flex: 1; }
details.contexto summary::-webkit-details-marker { display: none; }
details.contexto summary .seta { transition: transform .2s; }
details.contexto[open] summary .seta { transform: rotate(180deg); }
details.contexto .corpo { font-size: .92em; padding-bottom: 1em; }
details.contexto h3 { font-size: 1em; font-weight: 600; margin: 1em 0 .2em; }
ul.fontes { padding-left: 1.2em; font-size: .92em; }
ul.fontes li { margin-bottom: .3em; overflow-wrap: anywhere; }

/* Corpo e contexto seguem os mesmos ajustes de parágrafo (recuo, espaço, alinhamento) */
.texto p, .contexto .corpo p { margin: 0 0 var(--espaco); text-align: var(--alinhar); hyphens: auto; -webkit-hyphens: auto; }
.texto > p, .texto blockquote > p, .contexto .corpo p { text-indent: var(--recuo); }
.texto p.intertitulo { text-indent: 0; text-align: center; margin: 1.4em 0 .6em; }
.texto p.abertura { text-indent: 0; text-align: center; margin: 0 0 1.4em; }
.texto blockquote { margin: .6em 0 .6em 1.5em; font-size: .95em; }
.texto ul, .texto ol { margin: .4em 0 .8em; padding-left: 1.6em; }
.texto li p { text-indent: 0; }
details.contexto .corpo li p { text-indent: 0; }
/* Citação direta em itálico; a ênfase do autor dentro dela volta ao redondo, para não sumir */
em.q { font-style: italic; }
.q-enfase { font-style: normal; }

/* Chamadas de nota */
a.nota { font-size: .68em; vertical-align: super; line-height: 0; color: var(--destaque); text-decoration: none; padding: 0 .12em; }
a.nota sup { font-size: 1em; vertical-align: baseline; }
a.nota[aria-expanded="true"] { background: var(--bloco); border-radius: 3px; }

/* Bloco bíblico: oculto; abre pelo link da chamada (sem JavaScript) ou por classe (com JavaScript) */
.bloco { display: none; background: var(--bloco); border-left: 3px solid var(--linha); margin: .4em 0 .9em; padding: .7em .9em; font-size: .84em; line-height: 1.5; text-indent: 0; }
.no-js .bloco:target, .bloco.aberto, :root[data-bib="aberto"] .bloco { display: block; }
.bloco .marca { float: left; margin-right: .5em; color: var(--destaque); font-weight: 600; }
.bloco p, .bloco .nota-texto p { text-indent: 0; text-align: left; margin: 0 0 .5em; }
.bloco .ref { font-weight: 600; margin-bottom: .4em; }
.bloco strong { font-weight: 600; }
.bloco sup { font-size: .7em; color: var(--suave); }
.bloco .nota-texto, .bloco .passagem { overflow-wrap: anywhere; }
.bloco .passagem + .passagem { border-top: 1px solid var(--linha); padding-top: .5em; }

/* Notas no fim (sem JavaScript) */
section.notas-fim { border-top: 1px solid var(--linha); margin-top: 2.5em; font-size: .88em; }
section.notas-fim h2 { font-size: 1em; font-weight: 600; color: var(--suave); margin: 1em 0 .5em; }
section.notas-fim ol { list-style: none; padding: 0; margin: 0; }
section.notas-fim li { margin-bottom: .4em; overflow-wrap: anywhere; }
.js .notas-fim { display: none; }
section.notas-fim li p { margin: 0; text-indent: 0; }
section.notas-fim .marca { color: var(--destaque); margin-right: .3em; }

/* Página inicial */
.inicio h1 { font-size: 1.9em; font-weight: 600; line-height: 1.15; margin: 1.2em 0 1em; text-align: center; }
ol.lista { list-style: none; padding: 0; margin: 0 0 2.5em; }
ol.lista li { padding: .6em 0; border-bottom: 1px solid var(--linha); line-height: 1.35; }
ol.lista a { font-style: italic; font-size: 1.1em; text-decoration: none; color: var(--tinta); }
ol.lista .linha { display: block; color: var(--suave); font-size: .85em; }
ol.lista .genero-item { font-variant: small-caps; letter-spacing: .04em; }
section#sobre { border-top: 1px solid var(--linha); }
section#sobre h2 { font-size: 1.1em; font-weight: 600; margin: 1.4em 0 .4em; }
section#sobre p { margin: 0 0 .8em; text-align: var(--alinhar); hyphens: auto; -webkit-hyphens: auto; }

/* Folhas (painéis que sobem de baixo) */
.folha { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; max-width: 40rem; margin: 0 auto; background: var(--papel); color: var(--tinta); border-top: 1px solid var(--linha); border-radius: 14px 14px 0 0; box-shadow: 0 -6px 24px rgba(0, 0, 0, .18); padding: 6px 16px 22px; max-height: 78vh; overflow: auto; transform: translateY(105%); visibility: hidden; transition: transform .25s, visibility .25s; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.4; }
.folha.aberta { transform: none; visibility: visible; }
.folha .topo { display: flex; align-items: center; justify-content: space-between; }
.folha .topo h2 { margin: 0; font-weight: 600; font-size: 15px; color: var(--suave); }
.folha .texto-nota { font-family: var(--fonte); font-size: calc(var(--tam) * .9); line-height: 1.5; overflow-wrap: anywhere; padding-bottom: .4em; }
.folha .texto-nota p { margin: .3em 0; }
.veu { position: fixed; inset: 0; z-index: 8; background: rgba(0, 0, 0, .35); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.veu.aberto { opacity: 1; visibility: visible; }
.folha ul { list-style: none; padding: 0; margin: .3em 0 .8em; }
.folha li a { display: block; padding: .35em 0; text-decoration: none; color: var(--tinta); }
.folha li a[aria-current="page"] { color: var(--destaque); font-weight: 600; }
.folha .secoes { border-top: 1px solid var(--linha); padding-top: .3em; }

.linha-aj { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--linha); }
.linha-aj > svg.i { color: var(--suave); }
.seg { flex: 1; display: flex; background: var(--controle); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: none; color: var(--tinta); border-radius: 8px; height: 38px; display: grid; place-items: center; cursor: pointer; font-size: 16px; }
.seg button:disabled { opacity: .35; cursor: default; }
.seg button[aria-pressed="true"] { background: var(--papel); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.seg .valor { flex: 1.2; display: grid; place-items: center; color: var(--suave); font-variant-numeric: tabular-nums; font-size: 14px; }
.amostra-l { font-family: "Libertinus Serif", serif; font-size: 20px; }
.amostra-g { font-family: Georgia, serif; font-size: 19px; }
.amostra-s { font-family: system-ui, sans-serif; font-size: 18px; }
.bola { width: 22px; height: 22px; border-radius: 50%; border: 1px solid #999; }
.bola.claro { background: #faf8f3; }
.bola.sepia { background: #f4ecd8; }
.bola.escuro { background: #1b1a18; }

/* Os controles só funcionam com JavaScript */
.no-js .barra .icone { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  .folha, .veu, details.contexto summary .seta { transition: none; }
}

@media print {
  .barra, .folha, .veu { display: none; }
  .bloco, .js .notas-fim { display: block; }
  main { max-width: none; }
}
