/* Tema "Livro-caixa" para a leitura de "A caderneta riscada": papel de escrituração verde-claro, tinta verde-garrafa,
   carimbo vermelho e fio de latão. Títulos em slab, rótulos em máquina de escrever, capítulos em tarja verde.
   Todas as regras começam em .tema para não vazar para o site.
   Fontes: Zilla Slab (títulos), Source Serif 4 (texto) e IBM Plex Mono (rótulos). */

.tema {
  --papel: #eef2e3;
  --papel2: #dde5cc;
  --nota: #fbf6dd;
  --verde: #17463a;
  --verde0: #0a231c;
  --verde2: #2a6a56;
  --carimbo: #b8322a;
  --carimbo2: #e5614f;
  --latao: #a67c1f;
  --latao2: #e7c66b;
  --lapis: #4d625c;
  --creme: #f4f2de;
  --texto: #16251f;
  --linha: #b8c7a8;
  --f-titulo: "Zilla Slab", Rockwell, Georgia, serif;
  --f-texto: "Source Serif 4", Constantia, Georgia, serif;
  --f-rotulo: "IBM Plex Mono", Consolas, "Courier New", monospace;
  background: var(--papel);
  color: var(--texto);
}
/* A fonte do tema vale só para o cabeçalho, o sumário e o texto; o convite para assinar mantém o visual do site */
.tema .tema-hero, .tema .tema-sumario, .tema .leitura-tematica { font-family: var(--f-texto); }

/* ── Cabeçalho ───────────────────────────────────────────── */
.tema .tema-hero { position: relative; color: var(--creme); background: repeating-linear-gradient(180deg, transparent 0 1.9rem, rgba(42, 106, 86, .4) 1.9rem calc(1.9rem + 1px)), linear-gradient(180deg, var(--verde0), var(--verde) 110%); border-bottom: .5rem solid var(--carimbo); }
.tema .tema-hero::before { content: ""; position: absolute; top: 0; bottom: 0; left: clamp(1rem, 6vw, 4.5rem); width: 2px; background: var(--carimbo); opacity: .45; pointer-events: none; }
.tema .tema-hero-in { position: relative; max-width: 64rem; margin: 0 auto; padding: 2rem 1.25rem 3rem; display: grid; gap: 2rem; align-items: center; }
@media (min-width: 768px) { .tema .tema-hero-in { grid-template-columns: 1fr 15.5rem; padding: 3.5rem 1.5rem 4.2rem; gap: 3rem; } }
.tema .tema-trilha { display: flex; flex-wrap: wrap; gap: .5rem; font-family: var(--f-rotulo); font-size: .78rem; color: #b9cdc2; margin-bottom: 1.75rem; }
.tema .tema-trilha a { color: #b9cdc2; text-decoration: none; }
.tema .tema-trilha a:hover { color: var(--latao2); text-decoration: underline; }
.tema .tema-sup { font-family: var(--f-rotulo); font-size: .76rem; letter-spacing: .36em; text-transform: uppercase; color: var(--latao2); margin: 0 0 1rem; }
.tema .tema-hero h1 { font-family: var(--f-titulo); font-weight: 700; font-size: clamp(2.6rem, 9vw, 4.4rem); line-height: 1; color: var(--creme); margin: 0; letter-spacing: -.01em; overflow-wrap: break-word; text-decoration: underline; text-decoration-color: var(--carimbo2); text-decoration-thickness: .22rem; text-underline-offset: -.38em; text-decoration-skip-ink: none; }
.tema .tema-orn { display: none; }
.tema .tema-sub { font-style: italic; color: #dfe7d4; font-size: 1.2rem; line-height: 1.45; max-width: 32rem; margin: 1.4rem 0 0; }
.tema .tema-meta { display: flex; flex-wrap: wrap; gap: .25rem .75rem; font-family: var(--f-rotulo); font-size: .8rem; color: #b9cdc2; margin: 1.6rem 0 0; }
.tema .tema-baixar { display: inline-block; margin-top: 1.4rem; padding: .65rem 1.3rem; border: 2px solid var(--carimbo2); border-radius: .15rem; color: var(--creme); font-family: var(--f-rotulo); font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; transition: background .15s, color .15s; }
.tema .tema-baixar:hover { background: var(--carimbo); color: var(--creme); }
.tema .tema-capa { justify-self: center; width: min(15.5rem, 70%); border: 1px solid rgba(231, 198, 107, .5); box-shadow: 0 1.4rem 2.6rem -1rem rgba(0, 0, 0, .75); }
.tema .tema-capa img { display: block; width: 100%; height: auto; }
@media (max-width: 767px) { .tema .tema-capa { width: 11.5rem; } }

/* ── Corpo ───────────────────────────────────────────────── */
.tema .tema-corpo { max-width: 42rem; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
@media (min-width: 640px) { .tema .tema-corpo { padding: 3.5rem 1.5rem 5rem; } }

/* Sumário */
.tema .tema-sumario { margin: 0 0 3.5rem; padding: 1.5rem 1.4rem; border-left: .4rem solid var(--carimbo); background: var(--nota); }
.tema .tema-sumario h2 { font-family: var(--f-titulo); font-weight: 700; font-size: 1.9rem; color: var(--verde); margin: 0 0 1rem; }
.tema .tema-sumario ol { list-style: none; margin: 0; padding: 0; }
.tema .tema-sumario li { border-bottom: 1px solid var(--linha); }
.tema .tema-sumario li:last-child { border-bottom: 0; }
.tema .tema-sumario a { display: flex; align-items: baseline; gap: .8rem; padding: .6rem .1rem; text-decoration: none; color: var(--texto); }
.tema .tema-sumario a:hover .nome { color: var(--carimbo); }
.tema .tema-sumario .rot { flex: 0 0 6.8rem; font-family: var(--f-rotulo); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--carimbo); }
.tema .tema-sumario .nome { flex: 1; font-size: 1.1rem; line-height: 1.3; }
@media (max-width: 480px) { .tema .tema-sumario a { flex-direction: column; gap: .1rem; } .tema .tema-sumario .rot { flex-basis: auto; } }

/* Texto de leitura (o tamanho muda com A− / A+, que adicionam .reading-sm / .reading-lg) */
.tema .leitura-tematica { font-size: 1.18rem; line-height: 1.7; counter-reset: capitulo; }
.tema .leitura-tematica.reading-sm { font-size: 1.06rem; }
.tema .leitura-tematica.reading-lg { font-size: 1.36rem; }
.tema .leitura-tematica p { margin: 0 0 1.05em; overflow-wrap: break-word; }
@media (min-width: 640px) { .tema .leitura-tematica p { text-align: justify; hyphens: auto; } }
.tema .leitura-tematica strong { color: var(--verde); }
.tema .leitura-tematica em { color: #20382f; }

/* Capítulos */
.tema .cap { position: relative; margin-top: 4.8rem; scroll-margin-top: 5rem; }
.tema .cap:first-child { margin-top: 0; }
.tema .ilus { margin: 0 0 1.8rem; border-bottom: .35rem solid var(--carimbo); background: var(--verde); }
.tema .ilus img { display: block; width: 100%; height: auto; }
.tema .cap h2 { position: relative; margin: 0 0 1.5rem; }
.tema .cap[data-tipo="introducao"] h2, .tema .cap[data-tipo="capitulo"] h2, .tema .cap[data-tipo="conclusao"] h2 { padding: 1rem 1.2rem; background: var(--verde); border-left: .4rem solid var(--latao); }
.tema .cap[data-tipo="capitulo"] h2 { counter-increment: capitulo; padding-left: 5.2rem; min-height: 4rem; display: flex; flex-direction: column; justify-content: center; }
.tema .cap[data-tipo="capitulo"] h2::before { content: counter(capitulo); position: absolute; left: .8rem; top: -2.2rem; width: 3.5rem; height: 3.5rem; box-sizing: border-box; border: .22rem double #f3b3aa; border-radius: 50%; background: #8f2a24; color: #f6c6bf; font-family: var(--f-titulo); font-weight: 700; font-size: 1.5rem; line-height: 3.05rem; text-align: center; transform: rotate(-9deg); }
.tema .cap h2 .rot { display: block; font-family: var(--f-rotulo); font-size: .7rem; letter-spacing: .26em; text-transform: uppercase; color: var(--latao2); margin-bottom: .3rem; }
.tema .cap h2 .nome { display: block; font-family: var(--f-titulo); font-weight: 700; font-size: clamp(1.6rem, 6vw, 2.2rem); line-height: 1.1; color: var(--creme); overflow-wrap: break-word; }
.tema .cap.glossario h2, .tema .cap.referencias h2 { background: transparent; border-left: 0; padding: 0 0 .5rem; border-bottom: .3rem solid var(--carimbo); }
.tema .cap.glossario h2 .nome, .tema .cap.referencias h2 .nome { color: var(--verde); }
.tema .cap h3 { font-family: var(--f-rotulo); font-weight: 600; font-size: .84rem; letter-spacing: .12em; text-transform: uppercase; color: var(--carimbo); margin: 2.2rem 0 .6rem; }
.tema .cap h3::before { content: "\2192"; margin-right: .6rem; color: var(--latao); }

/* Destaques */
.tema .cap blockquote { margin: 1.6rem 0; padding: .2rem 0 .2rem 1.2rem; border-left: 3px solid var(--latao); color: #2c4339; font-style: italic; }
.tema .cap blockquote p { margin: 0 0 .7em; text-align: left; hyphens: none; }
.tema .cap blockquote p:last-child { margin-bottom: 0; }
.tema .cap blockquote.ideia { margin: 0 0 1.8rem; padding: 1rem 1.2rem; background: var(--nota); border-left: .3rem solid var(--carimbo); border-bottom: 1px solid #d9c98a; color: var(--texto); }
.tema .cap blockquote.ideia strong { font-family: var(--f-rotulo); font-style: normal; font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--carimbo); }
.tema .cap blockquote.antes { padding: 1rem 1.2rem; background: var(--papel2); border: 1.5px dashed var(--verde2); font-style: normal; color: var(--texto); }
.tema .cap blockquote.antes strong { font-family: var(--f-rotulo); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--verde); }
.tema .cap blockquote.versiculo { margin: 2rem .2rem; padding: 1.4rem 1.5rem 1.5rem; text-align: center; background: var(--verde); border-left: 0; border-top: .35rem solid var(--carimbo); color: var(--creme); font-size: 1.04em; line-height: 1.5; }
.tema .cap blockquote.versiculo p { text-align: center; color: var(--creme); }
.tema .cap blockquote.versiculo strong { display: block; font-family: var(--f-rotulo); font-style: normal; font-size: .7rem; letter-spacing: .28em; text-transform: uppercase; color: var(--latao2); margin-bottom: .6rem; }

/* Listas, linhas, links */
.tema .cap ul, .tema .cap ol { margin: 0 0 1.2em; padding-left: 1.5rem; }
.tema .cap ul { list-style: disc; }
.tema .cap ol { list-style: decimal; }
.tema .cap li { margin-bottom: .45em; padding-left: .2rem; }
.tema .cap li::marker { color: var(--carimbo); font-weight: 700; }
.tema .cap hr { border: 0; border-top: 1px solid var(--linha); margin: 2rem 0; }
.tema .cap a { color: var(--verde2); text-decoration: underline; text-underline-offset: 3px; word-break: break-word; overflow-wrap: break-word; }
.tema .cap a:hover { color: var(--carimbo); }

/* Glossário e referências */
.tema .cap.glossario ul { list-style: none; padding: 0; }
.tema .cap.glossario li { padding: .6rem 0; border-bottom: 1px solid var(--linha); margin: 0; }
.tema .cap.glossario li strong { color: var(--carimbo); }
.tema .cap.ref p, .tema .cap.ref li { font-size: .88em; line-height: 1.5; text-align: left; hyphens: none; color: #34493f; }

.tema .tema-corpo > :not(.tema-sumario):not(.leitura-tematica) { margin-top: 2.5rem; }
@media (prefers-reduced-motion: reduce) { .tema .tema-baixar { transition: none; } }
