/* Tema "Azulejo da Atalaia" para a leitura de "Ainda que tarde": calcário claro, azul-lápis esmaltado, ouro, tijolo e noite estrelada.
   Títulos em caixa alta; capítulos marcados por um azulejo numerado. Todas as regras começam em .tema.
   Fontes: Josefin Sans (títulos e rótulos) e Bitter (texto). */

.tema {
  --cal: #eceee9;
  --cal2: #dde1d9;
  --lap: #1d3f8f;
  --lap2: #0e2257;
  --lap3: #2f5bb0;
  --ouro: #d6a02b;
  --ouro2: #f1cf74;
  --tij: #a8401f;
  --texto: #141a33;
  --linha: #c9cfc3;
  --f-titulo: "Josefin Sans", "Century Gothic", sans-serif;
  --f-texto: "Bitter", Georgia, serif;
  background: var(--cal);
  color: var(--texto);
}
.tema .tema-hero, .tema .tema-sumario, .tema .leitura-tematica { font-family: var(--f-texto); }

/* Cabeçalho */
.tema .tema-hero { background: linear-gradient(180deg, var(--lap2) 0%, #14307a 100%); border-bottom: 5px solid var(--ouro); color: var(--cal); }
.tema .tema-hero-in { max-width: 64rem; margin: 0 auto; padding: 2rem 1.25rem 2.75rem; 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 4rem; gap: 3rem; } }
.tema .tema-trilha { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .9rem; color: #b8c8ec; margin-bottom: 1.75rem; }
.tema .tema-trilha a { color: #b8c8ec; text-decoration: none; }
.tema .tema-trilha a:hover { color: var(--ouro2); text-decoration: underline; }
.tema .tema-sup { font-family: var(--f-titulo); font-size: .8rem; font-weight: 700; letter-spacing: .42em; text-transform: uppercase; color: var(--ouro2); margin: 0 0 1.1rem; }
.tema .tema-hero h1 { font-family: var(--f-titulo); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: clamp(2.3rem, 8vw, 4rem); line-height: 1.05; color: var(--cal); margin: 0; overflow-wrap: break-word; }
.tema .tema-orn { display: block; width: 5rem; height: .7rem; margin-top: 1.4rem; border-top: 2px solid var(--ouro); border-bottom: 2px solid var(--ouro); font-size: 0; }
.tema .tema-sub { font-style: italic; color: var(--cal); font-size: 1.15rem; line-height: 1.5; max-width: 32rem; margin: 1.3rem 0 0; }
.tema .tema-meta { display: flex; flex-wrap: wrap; gap: .25rem .75rem; font-size: .95rem; color: #b8c8ec; margin: 1.5rem 0 0; }
.tema .tema-baixar { display: inline-block; margin-top: 1.4rem; padding: .65rem 1.3rem; background: var(--ouro); border: 2px solid var(--ouro); color: var(--lap2); font-family: var(--f-titulo); font-size: .85rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; transition: background .15s, color .15s; }
.tema .tema-baixar:hover { background: transparent; color: var(--ouro2); border-color: var(--ouro2); }
.tema .tema-capa { justify-self: center; width: min(15.5rem, 70%); box-shadow: 0 0 0 .3rem var(--lap2), 0 0 0 calc(.3rem + 2px) var(--ouro), 0 1.5rem 3rem -1rem rgba(0, 0, 0, .7); }
.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; background: var(--cal2); border-top: 4px solid var(--lap); outline: 1px solid var(--ouro); outline-offset: -.6rem; }
.tema .tema-sumario h2 { font-family: var(--f-titulo); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: 1.6rem; color: var(--lap); 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(--tij); }
.tema .tema-sumario .rot { flex: 0 0 6.6rem; font-family: var(--f-titulo); font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--tij); }
.tema .tema-sumario .nome { flex: 1; font-size: 1.02rem; 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 */
.tema .leitura-tematica { font-size: 1.1rem; line-height: 1.75; }
.tema .leitura-tematica.reading-sm { font-size: 1rem; }
.tema .leitura-tematica.reading-lg { font-size: 1.3rem; }
.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(--lap); }

/* Capítulos */
.tema .cap { position: relative; margin-top: 4.5rem; scroll-margin-top: 5rem; }
.tema .cap:first-child { margin-top: 0; }
.tema .ilus { margin: 0 0 2rem; border-bottom: 3px solid var(--ouro); background: var(--lap2); }
.tema .ilus img { display: block; width: 100%; height: auto; }
.tema .cap[data-tipo="capitulo"]:has(.ilus)::before { content: attr(data-n); position: absolute; top: .6rem; right: .8rem; z-index: 2; width: 3.2rem; height: 3.2rem; line-height: 2.7rem; text-align: center; background: var(--lap2); color: var(--ouro2); border: .25rem solid var(--lap); outline: 2px solid var(--ouro); outline-offset: 2px; font-family: var(--f-titulo); font-weight: 700; font-size: 1.4rem; }
.tema .cap h2 { margin: 0 0 1.5rem; }
.tema .cap h2 .rot { display: block; font-family: var(--f-titulo); font-size: .78rem; font-weight: 700; letter-spacing: .38em; text-transform: uppercase; color: var(--tij); margin-bottom: .3rem; }
.tema .cap h2 .nome { display: block; font-family: var(--f-titulo); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: clamp(1.7rem, 6vw, 2.5rem); line-height: 1.12; color: var(--lap); overflow-wrap: break-word; }
.tema .cap h2 .nome::after { content: ""; display: block; width: 5rem; height: .35rem; margin-top: .8rem; background: repeating-linear-gradient(90deg, var(--ouro) 0 .35rem, transparent .35rem .6rem); }
.tema .cap h3 { font-family: var(--f-titulo); font-weight: 700; font-size: .88rem; letter-spacing: .18em; text-transform: uppercase; color: var(--lap3); margin: 2.2rem 0 .6rem; }

/* Destaques */
.tema .cap blockquote { margin: 1.6rem 0; padding: .2rem 0 .2rem 1.2rem; border-left: 3px solid var(--ouro); color: #2d3657; 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 1rem 1.4rem; background: var(--lap2); border: 0; border-bottom: .3rem solid var(--ouro); color: var(--cal); }
.tema .cap blockquote.ideia strong { font-family: var(--f-titulo); font-style: normal; font-size: .75rem; letter-spacing: .26em; text-transform: uppercase; color: var(--ouro2); }
.tema .cap blockquote.ideia + p::first-letter { float: left; font-family: var(--f-titulo); font-weight: 700; font-size: 3.8em; line-height: .85; color: var(--tij); padding: .06em .12em 0 0; }
.tema .cap blockquote.antes { padding: 1rem 1.2rem; background: rgba(47, 91, 176, .08); border: 1.5px dashed var(--lap3); font-style: normal; color: var(--texto); }
.tema .cap blockquote.antes strong { font-family: var(--f-titulo); font-size: .75rem; letter-spacing: .22em; text-transform: uppercase; color: var(--tij); }
.tema .cap blockquote.versiculo { margin: 2rem .2rem; padding: 1.6rem 1.4rem 1.3rem; border: .35rem solid var(--lap2); outline: 2px solid var(--ouro); outline-offset: -.8rem; background: var(--cal2); text-align: center; color: var(--lap2); font-size: 1.05em; }
.tema .cap blockquote.versiculo p { text-align: center; }
.tema .cap blockquote.versiculo strong { display: block; font-family: var(--f-titulo); font-style: normal; font-size: .75rem; letter-spacing: .3em; text-transform: uppercase; color: var(--tij); margin-bottom: .5rem; }

/* 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(--tij); }
.tema .cap hr { border: 0; border-top: 2px solid var(--ouro); margin: 2rem 0; }
.tema .cap a { color: var(--lap3); text-decoration: underline; text-underline-offset: 3px; word-break: break-word; overflow-wrap: break-word; }
.tema .cap a:hover { color: var(--tij); }

/* 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(--tij); }
.tema .cap.ref p, .tema .cap.ref li { font-size: .88em; line-height: 1.5; text-align: left; hyphens: none; color: #2d3657; overflow-wrap: break-word; }

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