/* /cartinha-gratis/: gerador da cartinha. Fontes próprias (OFL) em /fonts, sem CDN. */
@font-face { font-family: "Great Vibes"; src: url(/fonts/GreatVibes-Regular-latin.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url(/fonts/Lora-latin.woff2) format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url(/fonts/Lora-Italic-latin.woff2) format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }

.gerador { padding: 1.5rem 0 2rem; }
.gerador-grid { display: grid; gap: 1.5rem; align-items: start; }
.gerador .form-card { margin: 0; }
.gerador fieldset { min-width: 0; }
.opcoes { display: grid; gap: .6rem; }
.opcoes label { display: flex; gap: .7rem; align-items: center; font-weight: 500; border: 2px solid #cfc4a9; border-radius: 10px; padding: .55rem .8rem; margin: 0; cursor: pointer; min-height: 3rem; }
.opcoes label:has(input:checked) { border-color: var(--green); background: #f1f8f3; }
.opcoes input { width: 1.2rem; height: 1.2rem; accent-color: var(--green); flex: none; }
.opcoes small { display: block; color: var(--muted); font-weight: 400; font-size: .85rem; line-height: 1.3; }
.designs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.designs label { flex-direction: column; text-align: center; padding: .5rem; gap: .35rem; align-items: stretch; font-size: .88rem; }
.designs .mini { aspect-ratio: 210 / 297; width: 100%; border-radius: 4px; overflow: hidden; box-shadow: 0 1px 4px #0003; background: #fff; }
.designs .mini svg { display: block; width: 100%; height: 100%; }
.designs input { position: absolute; opacity: 0; pointer-events: none; }
.designs label { position: relative; }
.designs label:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.acoes { display: grid; gap: .6rem; margin: 1rem 0 .5rem; }
.privado { font-size: .92rem; background: #f1f8f3; border: 1px solid #9ccaa9; border-radius: 10px; padding: .7rem .9rem; margin: 1rem 0 0; }
.status { min-height: 1.4em; font-size: .92rem; color: var(--green); margin: .3rem 0 0; }

.previa { position: sticky; top: .5rem; }
.exemplo { text-align: center; font-size: .88rem; background: #fffaf0; border: 1px dashed var(--gold); border-radius: 8px; padding: .4rem .6rem; margin: 0 0 .6rem; }

/* A folha: tudo em cqw (1cqw = 1% da largura da folha), então tela e papel têm a mesma proporção */
.folha-box { container-type: inline-size; width: 100%; max-width: 26rem; margin-inline: auto; aspect-ratio: 210 / 297; box-shadow: 0 6px 24px #0003; background: #fff; }
.folha { position: relative; width: 100%; height: 100%; overflow: hidden; }
.folha .arte { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.folha-conteudo { position: absolute; left: 12.4cqw; right: 12.4cqw; top: 20cqw; bottom: 17cqw; display: flex; flex-direction: column; font-family: Lora, Georgia, "Times New Roman", serif; font-size: calc(var(--fs, 2.7) * 1cqw); line-height: 1.5; color: #2a2118; }
.folha-conteudo p { margin: 0; }
.folha-conteudo .oficina { text-align: center; font-size: .72em; letter-spacing: .16em; text-transform: uppercase; color: #7a5a14; font-weight: 600; }
.folha-conteudo .local { text-align: right; font-style: italic; font-size: .8em; color: #5b4a38; margin: .5em 0 .4em; }
.folha-conteudo .saudacao { font-family: "Great Vibes", "Brush Script MT", cursive; font-size: 2.05em; line-height: 1.15; color: #9e1b32; margin-bottom: .25em; overflow-wrap: anywhere; }
.folha-corpo { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.folha-corpo p { margin-bottom: .75em; text-wrap: pretty; }
.folha-corpo .ps { font-style: italic; font-size: .88em; color: #5b4a38; }
.rodape { display: flex; align-items: center; gap: 4cqw; margin-top: .6em; flex: none; }
.rodape-selo { flex: none; width: 17cqw; }
.rodape-selo .selo { display: block; width: 100%; height: auto; }
.assina { flex: 1 1 auto; text-align: center; }
.despedida { text-wrap: balance; font-size: .86em; font-style: italic; color: #5b4a38; }
.assinatura { font-family: "Great Vibes", "Brush Script MT", cursive; font-size: 3.2em; line-height: 1.05; color: #12263a; margin-top: .05em; }
.assina-floreio .floreio { display: block; width: 60%; height: 1.6em; margin: -.2em auto 0; }
.folha[data-design="neve"] .saudacao { color: #12263a; }
.folha[data-design="neve"] .oficina { color: #3a5f86; }
.folha[data-design="alegria"] .saudacao { color: #c4263c; }

@media (min-width: 52rem) {
  .gerador-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); gap: 2rem; }
  .acoes { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 24rem) { .designs { gap: .4rem; } .designs label { padding: .35rem; font-size: .8rem; } }

.passo-lista { padding-left: 1.2rem; }
.dicas dt { font-weight: 700; margin-top: .8rem; }
.dicas dd { margin: .15rem 0 0; }

/* Impressão: só a folha, A4 inteira, sem margem. Fundo e moldura são SVG (imprimem mesmo sem "gráficos de fundo"). */
@page { size: A4; margin: 0; }
@media print {
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; height: auto !important; }
  body > :not(main), main > :not(#gerador), .nao-imprimir { display: none !important; }
  #gerador, #gerador .wrap, .gerador-grid { display: block !important; width: auto !important; padding: 0 !important; margin: 0 !important; }
  #gerador .form-card, .exemplo, .status { display: none !important; }
  .previa { position: static; margin: 0; padding: 0; }
  .folha-box { width: 210mm; max-width: none; height: 296mm; aspect-ratio: auto; box-shadow: none; margin: 0; overflow: hidden; break-inside: avoid; break-after: avoid; page-break-after: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
