/* Páginas do livro (briefing v2): medidas em cqw (1% da largura da página) para valer em A5 e A4.
   Miolo: papel branco #FFF, texto #4D4D4D, auxiliar #777, divisórias #E2E2E2; fontes nos três papéis via --f-*. */
.folhas .pag{position:relative;width:100%;aspect-ratio:var(--ar,148/210);container-type:size;overflow:hidden;margin:0 0 22px;box-shadow:0 12px 30px -16px rgba(43,33,28,.5);-webkit-print-color-adjust:exact;print-color-adjust:exact;color:#4D4D4D;--z:var(--e,1)}
.folhas.mini .pag,.folhas.media .pag,.folhas.grande .pag{margin:0}
.pag .corpo{position:absolute;inset:0;padding:8cqw 9cqw 11cqw;display:flex;flex-direction:column;overflow:hidden}
.pag p{margin:0}
.pag .pf{background:#EFEAE4 center/cover no-repeat}
.pag svg{fill:none;stroke:currentColor;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round}
.pag svg .ch,.pag svg.cora path{fill:currentColor;stroke:none}

/* ---------- capa em linho ---------- */
.capa{background:var(--linho,none),radial-gradient(120% 90% at 50% 40%,rgba(255,255,255,.18),rgba(0,0,0,.06)),var(--cf);background-size:120px,auto,auto;color:var(--cn);text-align:center}
.capa .corpo{align-items:center;justify-content:center;padding:10cqw 10cqw}
.capa .ct{font:400 calc(var(--z)*3.1cqw)/1.5 var(--f-tit);letter-spacing:.24em;text-transform:uppercase;color:var(--ctt)}
.capa.longo .ct{font-size:calc(var(--z)*2.6cqw)}
.capa .ct.duas{max-width:36cqw}
.capa .cn{font:400 calc(var(--z)*15cqw*var(--ed))/1.15 var(--f-dest);color:var(--cn);margin:3cqw 0;overflow-wrap:anywhere;max-width:84cqw}
.capa .cn.maior{font-size:calc(var(--z)*18cqw*var(--ed))}
.capa .cn.caps{font:400 calc(var(--z)*6.4cqw*var(--et))/1.2 var(--f-tit);letter-spacing:.2em;text-transform:uppercase;margin:3cqw 0 2cqw}
.capa .fr{font:italic 400 calc(var(--z)*3cqw)/1.4 var(--f-tit);color:var(--ctt);margin-top:3cqw;max-width:70cqw}
.capa .orn{width:42cqw;height:auto;color:var(--cm);stroke-width:.9;margin:2cqw 0}
.capa .orn.curto{width:16cqw}.capa .orn.mini{width:4.5cqw}.capa .orn.simb{width:15cqw}
.capa .aq{display:block;object-fit:contain;width:30cqw;height:26cqw;margin:4cqw auto}
.capa .aq.peq{width:14cqw;height:10cqw;margin:2cqw auto 0}
.capa .aq.grande{width:34cqw;height:32cqw;margin:0}
.capa .pf.sem{background:color-mix(in srgb,var(--cm) 22%,var(--cf))}
.capa .moldura{position:absolute;inset:5.5cqw;border:1px solid var(--cm);pointer-events:none}
.c1 .ct{margin-bottom:1cqw}
.c2 .corpo{justify-content:flex-start;padding-top:12cqw}
.c2 .foto-q{width:62cqw;aspect-ratio:1;padding:1.6cqw;border:1px solid var(--cm);margin:5cqw 0 1cqw}
.c2 .foto-q .pf,.c8 .foto-arco .pf{width:100%;height:100%}
.c4 .mono{display:flex;align-items:center;justify-content:center;gap:1cqw;margin-bottom:2cqw}
.c4 .mono b{font:400 calc(var(--z)*30cqw)/1 var(--f-tit);color:var(--cm)}
.c4 .aq.lado{width:20cqw;height:30cqw;margin:0 -2cqw 0 0}
.c6 .ilustrado{display:flex;align-items:center;justify-content:center;margin:5cqw 0 1cqw}
.c6 .r{display:block;width:12cqw}.c6 .r .orn{width:12cqw;margin:0}.c6 .r.e{transform:rotate(-70deg) scaleX(-1)}.c6 .r.d{transform:rotate(70deg)}
.c7 .corpo>svg.orn.simb,.c7 .corpo>.aq{margin-bottom:5cqw}.c7 .aq.peq{width:20cqw;height:16cqw}
.c8 .corpo{justify-content:flex-start;padding-top:11cqw}
.c8 .foto-arco{width:60cqw;height:66cqw;padding:1.6cqw;border:1px solid var(--cm);border-radius:31cqw 31cqw 0 0;margin-bottom:4cqw}
.c8 .foto-arco .pf{border-radius:29cqw 29cqw 0 0}
.contra .corpo{justify-content:flex-end;padding-bottom:16cqw}.contra .ct{font-size:2.6cqw;margin-top:3cqw;max-width:70cqw}

/* ---------- miolo ---------- */
.miolo{background:#fff}
.miolo header{text-align:center;margin-bottom:calc(var(--z)*3cqw)}
.cap{display:flex;align-items:center;justify-content:center;gap:3cqw;font:500 calc(var(--z)*2.1cqw) var(--f-corpo);letter-spacing:.3em;text-transform:uppercase;color:#4D4D4D}
.cap i{display:block;width:13cqw;height:1px;background:#CFCAC4}
.miolo svg.cora{display:block;width:3.2cqw;height:2.9cqw;margin:1.4cqw auto 0;color:var(--dest);fill:none;stroke:currentColor}
.miolo svg.cora path{fill:none;stroke:currentColor;stroke-width:1.3}
.miolo h2{margin:1.6cqw 0 0;font-weight:400;line-height:1}
.miolo h2 .h{display:block;font:400 calc(var(--z)*6.6cqw*var(--et))/1.15 var(--f-tit);color:#4D4D4D}
.miolo h2 .a{display:block;font:400 calc(var(--z)*11cqw*var(--ed))/1 var(--f-dest);color:var(--dest);margin-top:-.4cqw}
.miolo h2.cont-h .h,.miolo h2.cont-h .a{display:inline;font-size:calc(var(--z)*4cqw)}.miolo h2.cont-h .a{font-size:calc(var(--z)*6cqw)}
.rq{font:500 calc(var(--z)*1.9cqw)/1.5 var(--f-corpo);letter-spacing:.2em;text-transform:uppercase;color:#4D4D4D}
.ra{font:400 calc(var(--z)*4.8cqw*var(--ed))/1.05 var(--f-dest);color:var(--dest)}
/* fotos: moldura branca com sombra leve, como foto colada */
.fotos{display:grid;gap:3cqw;margin:1cqw auto 3cqw;width:calc(var(--z)*var(--z)*100%)}
.fotos .pf{border:1.4cqw solid #fff;box-shadow:0 .5cqw 1.8cqw rgba(0,0,0,.16);aspect-ratio:4/3}
.fotos.n1 .pf{width:72%;margin:0 auto;transform:rotate(-1.5deg)}
.fotos.n1.grande{flex:1 1 0;min-height:30cqw}.fotos.n1.grande .pf{width:100%;height:100%;aspect-ratio:auto;transform:none}
.fotos.n2{grid-template-columns:1fr 1fr}.fotos.n2 .pf:first-child{transform:rotate(-1.5deg)}.fotos.n2 .pf:last-child{transform:rotate(1.2deg)}
.fotos.n3{grid-template-columns:1.4fr 1fr;grid-template-rows:1fr 1fr}.fotos.n3 .pf:first-child{grid-row:1/3;aspect-ratio:auto}
.fotos.n4,.fotos.n5,.fotos.n6{grid-template-columns:1fr 1fr}.fotos.n5,.fotos.n6{grid-template-columns:1fr 1fr 1fr}
.fotos .pf.sem{background:#FAF8F6;box-shadow:none;border:1px dashed #D5CFC8;display:grid;place-items:center}
.fotos .pf.sem:after{content:"foto";font:400 calc(var(--z)*4cqw) var(--f-dest);color:#B8B0A8}
.lado{display:grid;grid-template-columns:1.05fr 1fr;gap:5cqw;align-items:center;margin-bottom:2cqw}
.lado .fotos{margin:0;width:100%}.lado .fotos.n1 .pf{width:100%}
.dados{list-style:none;margin:0 0 2cqw;padding:0;display:grid;gap:calc(var(--z)*2.6cqw)}
.dados li{display:flex;align-items:flex-end;gap:1.6cqw;font:400 calc(var(--z)*2.6cqw) var(--f-corpo);color:#4D4D4D}
.dados svg{width:3.6cqw;flex:none;color:#777}
.dados li{flex-wrap:wrap}.dados b{font-weight:500;color:#4D4D4D;white-space:nowrap}
.dados i{flex:1;border-bottom:1px solid #CFCAC4;min-width:8cqw;height:2.6cqw}
.sep{flex:none;height:3cqw;margin:0 0 3cqw}.sep svg.cora{margin:0 auto}
.pag .corpo>*{flex-shrink:0}
/* 26/11 (Karol): caixa branca, sem o areia; ficam o contorno e as linhas. */
.qb{display:grid;grid-template-columns:1fr;grid-template-rows:auto 1fr;gap:1.6cqw;align-items:stretch;background:#fff;border:1px solid #DED1BE;border-radius:2.4cqw;padding:calc(var(--z)*2.2cqw) 4cqw;margin-top:calc(var(--z)*1.8cqw)}
.qb .rot{display:flex;flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:1.4cqw}
.qb .resp{min-height:calc(var(--z)*6cqw);display:flex;flex-direction:column;justify-content:center}
.qb.g{grid-template-columns:1fr;gap:2.4cqw;align-items:stretch}.qb.g .rot{flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:1.4cqw;border-right:0;border-bottom:1px solid #DCD6CF;padding:0 0 2cqw}
.qb.g .resp{min-height:calc(var(--z)*30cqw);justify-content:flex-start}
.qb .resp p,.flui,.lst p,.ded p{font:400 calc(var(--z)*2.9cqw*var(--ec)*var(--tq,1))/1.6 var(--f-corpo);color:#4D4D4D;white-space:pre-wrap;overflow-wrap:anywhere}
.ln{display:block}.ln i{display:block;height:calc(var(--z)*5cqw);border-bottom:1px solid #D9D3CC}
.qt{display:flex;align-items:baseline;gap:2cqw;margin-top:calc(var(--z)*2.6cqw);flex-wrap:wrap}
.qt .rot{display:flex;align-items:baseline;gap:1.4cqw}.qt b{font:400 calc(var(--z)*2.9cqw*var(--ec)) var(--f-corpo);color:#4D4D4D}
.qt i{flex:1;border-bottom:1px solid #D9D3CC;min-width:20cqw}
.flui{margin-top:2cqw;text-align:left}
.dica{text-align:center;font:400 calc(var(--z)*2.4cqw) var(--f-corpo);color:#777;margin-bottom:2cqw}
.lst{display:grid;gap:calc(var(--z)*2.4cqw)}
.it{border-bottom:1px solid #E2E2E2;padding-bottom:calc(var(--z)*2cqw)}
.it-t{font:400 calc(var(--z)*5cqw*var(--ed))/1.1 var(--f-dest)!important;color:var(--dest)!important;white-space:normal!important}
.it-t i,.it .vz i{display:inline-block;width:50%;border-bottom:1px solid #D9D3CC;height:3.4cqw}
.it p span{color:#777;font-size:.9em}
/* carta */
.carta .c-data{text-align:right;font:400 calc(var(--z)*2.4cqw) var(--f-corpo);color:#777;letter-spacing:.1em}
.carta .c-saud{font:400 calc(var(--z)*6cqw*var(--ed))/1.2 var(--f-dest);color:var(--dest);margin-top:2cqw}
.carta .flui{font-size:calc(var(--z)*3.1cqw*var(--ec)*var(--tq,1));line-height:1.75}
.carta .c-ass{text-align:right;font:400 calc(var(--z)*6cqw*var(--ed)) var(--f-dest);color:var(--dest);margin-top:3cqw}
.carta-f .pf{width:52%!important}
/* folha de rosto */
.rosto .corpo{justify-content:center;align-items:center;text-align:center}
.nome-r{font:400 calc(var(--z)*15cqw*var(--ed))/1.15 var(--f-dest);color:var(--dest);margin-top:3cqw}
.sub-r{font:italic 400 calc(var(--z)*3.4cqw) var(--f-tit);color:#4D4D4D;margin-top:2cqw}
.data-r{font:500 calc(var(--z)*2.2cqw) var(--f-corpo);letter-spacing:.3em;color:#777;margin-top:5cqw}
.ded{margin-top:9cqw;max-width:72cqw;width:100%}.ded p.ra{display:block;margin-bottom:2cqw;font:400 calc(var(--z)*6cqw*var(--ed))/1.1 var(--f-dest);color:var(--dest);white-space:normal}
.autor{margin-top:6cqw;font:500 calc(var(--z)*2.2cqw) var(--f-corpo);letter-spacing:.24em;text-transform:uppercase;color:#777}
/* continuação e número */
.cont .corpo{padding-top:9cqw}
.nr{position:absolute;left:0;right:0;bottom:4.4cqw;display:flex;align-items:center;justify-content:center;gap:2cqw;font:500 2cqw var(--f-corpo);letter-spacing:.2em;color:#777}
.nr i{width:18cqw;height:1px;background:#E2E2E2}.nr svg.cora{margin:0;width:2.4cqw;height:2.2cqw}
.nr b{font-weight:500}
.rosto .nr{display:none}
/* impressão: só as folhas, uma por página do papel escolhido */
@media print{
  html,body{background:#fff!important}
  .topo,.menu,.tela>*:not(.livro-todo){display:none!important}
  .app,.tela{max-width:none!important;padding:0!important;margin:0!important;display:block!important}
  .livro-todo{display:block!important;margin:0!important}
  .folhas .pag{margin:0!important;box-shadow:none!important;break-after:page;page-break-after:always}
  .folhas .pag:last-child{break-after:auto;page-break-after:auto}
  .encadernar .miolo:nth-child(even) .corpo{padding-left:13cqw}.encadernar .miolo:nth-child(odd) .corpo{padding-right:13cqw}
}
/* ---------- 22/11, retorno da Karol: caixas ocupam a página, fotos menores, páginas de fotos ---------- */
.corpo>.qb{flex-grow:1;align-items:stretch}
.qb .rot{justify-content:flex-start}
.flui.vazio{flex-grow:1;display:flex;flex-direction:column}.flui.vazio .ln{flex:1;min-height:30cqw;background:repeating-linear-gradient(to bottom,transparent 0,transparent calc(var(--z)*6cqw - 1px),#D9D3CC calc(var(--z)*6cqw - 1px),#D9D3CC calc(var(--z)*6cqw))}.flui.vazio .ln i{display:none}.qb .resp{justify-content:flex-start}
.qb .resp .ln{flex:1;min-height:calc(var(--z)*15cqw);background:repeating-linear-gradient(to bottom,transparent 0,transparent calc(var(--z)*5cqw - 1px),#D9D3CC calc(var(--z)*5cqw - 1px),#D9D3CC calc(var(--z)*5cqw))}
.qb .resp .ln i{display:none}
.corpo>.fotos.n1:not(.grande):not(.alb) .pf{width:56%}
.corpo>.fotos.n2:not(.alb){width:calc(var(--z)*var(--z)*78%)}
.corpo>.fotos.n3:not(.alb){width:calc(var(--z)*var(--z)*84%)}
.fotos.alb{grid-template-columns:1fr 1fr;gap:4cqw 5cqw;width:100%;align-content:start}
.fotos.alb.n1{grid-template-columns:1fr;width:calc(var(--z)*var(--z)*72%)}
.fotos.alb figure{margin:0;min-width:0}.fotos.alb .pf{transform:none!important;width:100%!important}
.fotos.alb figure:nth-child(odd) .pf{transform:rotate(-1deg)!important}.fotos.alb figure:nth-child(even) .pf{transform:rotate(.8deg)!important}
.fotos.alb figcaption{font:italic 400 calc(var(--z)*2.5cqw)/1.35 var(--f-tit);color:#777;text-align:center;margin-top:1.8cqw;overflow-wrap:anywhere}
.so-fotos .fotos.alb{flex:1;align-content:center;margin-bottom:0}
.so-fotos .fotos.alb:not(.n1):not(.n2) .pf{aspect-ratio:3/4}
.pag.branca{background:#fff}
/* árvore genealógica */
.arv{display:grid;row-gap:calc(var(--z)*9cqw);margin:4cqw 0 2cqw;text-align:center}
.arv .g1{display:grid;grid-template-columns:repeat(4,1fr);gap:2cqw}.arv .g2{display:grid;grid-template-columns:1fr 1fr;gap:2cqw}
.arv .no{position:relative;display:flex;flex-direction:column;align-items:center;gap:1.2cqw;min-width:0}
.arv .no .rq{font-size:calc(var(--z)*1.7cqw)}
.arv .no b{font:400 calc(var(--z)*3cqw*var(--ec))/1.25 var(--f-corpo);color:#4D4D4D;overflow-wrap:anywhere}
.arv .no i{display:block;width:80%;height:4cqw;border-bottom:1px solid #D9D3CC}
.arv .g2 .no:before,.arv .g3 .no:before{content:"";position:absolute;left:25%;right:25%;top:calc(var(--z)*-7.5cqw);height:calc(var(--z)*6cqw);border:1px solid #D9D3CC;border-top:0;border-radius:0 0 2cqw 2cqw}
.arv .g3 .no:before{left:25%;right:25%}
.arv .eu .ra{font-size:calc(var(--z)*8cqw*var(--ed));line-height:1.1}.arv .eu small{font:500 calc(var(--z)*2cqw) var(--f-corpo);letter-spacing:.2em;color:#777}
/* crescimento */
.cresc{width:100%;border-collapse:collapse;margin-top:3cqw;font:400 calc(var(--z)*2.8cqw*var(--ec)) var(--f-corpo);color:#4D4D4D}
.cresc th{font:500 calc(var(--z)*1.9cqw) var(--f-corpo);letter-spacing:.2em;text-transform:uppercase;text-align:left;padding:0 2cqw 2cqw;border-bottom:1px solid #CFCAC4}
.cresc td{padding:calc(var(--z)*2.2cqw) 2cqw;border-bottom:1px solid #E2E2E2;height:calc(var(--z)*4cqw)}
.cresc td:first-child{color:var(--dest);font:400 calc(var(--z)*4.2cqw*var(--ed)) var(--f-dest)}
.fotos.alb .pf{aspect-ratio:4/3!important;grid-row:auto!important}.fotos.alb{grid-template-rows:none!important}
.so-fotos .fotos.alb:not(.n1):not(.n2) .pf{aspect-ratio:1!important}
.qb .resp .ln{min-height:calc(var(--z)*6cqw)}
.cresc td{padding:calc(var(--z)*1.5cqw) 2cqw;height:calc(var(--z)*3.4cqw)}
.corpo>.fotos.n4:not(.alb){width:calc(var(--z)*var(--z)*72%)}
/* Nossos Momentos impresso em branco (23/11): 3 molduras numa faixa só, para sobrar espaço de escrever. */
.corpo>.fotos.tira{grid-template-columns:1fr 1fr 1fr;grid-template-rows:none;width:calc(var(--z)*var(--z)*100%)}.fotos.tira .pf:first-child{grid-row:auto;aspect-ratio:4/3}
/* Galeria só de fotos (24/11): 5 ou 6 fotos em 3 colunas para caber com as legendas. */
.fotos.alb.n5,.fotos.alb.n6{grid-template-columns:1fr 1fr 1fr!important;gap:3cqw 3.5cqw}
/* Retorno da Karol (24/11): página só de fotos, sem cabeçalho, em várias disposições. */
.sf .corpo{padding:9cqw 9cqw 12cqw}.sf .sfg{flex:1;display:grid;gap:3.2cqw;min-height:0}
.sf .pf{width:100%;height:100%;min-height:0;background:#EFEAE4 center/cover no-repeat;border:1.2cqw solid #fff;box-shadow:0 .5cqw 1.8cqw rgba(0,0,0,.14)}
.sf .pf.sem{background:#FAF8F6;box-shadow:none;border:1px dashed #D5CFC8;display:grid;place-items:center}.sf .pf.sem:after{content:"foto";font:400 calc(var(--z)*4cqw) var(--f-dest);color:#B8B0A8}
.sf:not(.lin) .pf.sem{visibility:hidden}
.sf.sang .corpo{padding:0}.sf.sang .pf{border:0;box-shadow:none}
.sf.d1 .corpo{padding:12cqw 11cqw 15cqw}
.sf.d2 .sfg{grid-template-rows:1fr 1fr}
.sf.d3 .sfg{grid-template:1.35fr 1fr/1fr 1fr}.sf.d3 .pf:first-child{grid-column:1/3}
.sf.d3v .sfg{grid-template:1fr/1fr 1fr 1fr;gap:2.6cqw}.sf.d3v .corpo{padding:14cqw 9cqw 17cqw}
.sf.d4 .sfg{grid-template:1fr 1fr/1fr 1fr}
.sf.d5 .sfg{grid-template:1fr 1fr 1fr/1.25fr 1fr}.sf.d5 .pf:first-child{grid-row:1/3}.sf.d5 .pf:nth-child(4){grid-column:1}.sf.d5 .pf:nth-child(5){grid-column:2}
.sf.d6 .sfg{grid-template:1fr 1fr 1fr/1fr 1fr}
.sf.d9 .sfg{grid-template:1fr 1fr 1fr/1fr 1fr 1fr;gap:2.4cqw}
.c4 .mono .ini{display:flex;flex-direction:column;align-items:center}.c4 .mono .ini .orn{width:18cqw;height:auto;margin:-1cqw 0 0}
.c4 .mono .ini b{font-family:var(--f-dest);font-size:calc(var(--z)*34cqw);line-height:.9}.c4 .mono .ini .orn{width:24cqw}
