/* Selo da campanha. O contorno perfurado e a gravura são independentes do texto do destinatário. */
[data-selo] {
  position: relative;
  display: inline-block;
  width: var(--selo-largura, 72px);
  aspect-ratio: 76 / 94;
  flex: none;
  color: #713542;
  pointer-events: none;
  user-select: none;
  transform: rotate(5deg);
  filter: drop-shadow(0 1px 1px #4f302333);
}
[data-selo] .cs-papel {
  position: absolute;
  inset: 0;
  background: url("assets/selos/papel.svg") 50% 50% / 100% 100% no-repeat;
}
[data-selo] .cs-vinheta {
  position: absolute;
  inset: 12% 15.5% 23.5%;
  display: grid;
  place-items: center;
  background: url("assets/selos/roseta.svg") center / 100% 100% no-repeat;
  color: #733445;
}
[data-selo] .cs-vinheta img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  mix-blend-mode: multiply;
}
/* Produção: o retrato vem da foto real (endpoint autenticado), não de uma
   gravura pronta. O tratamento aproxima o efeito de estampa da referência. */
[data-selo] .cs-vinheta img.cs-foto {
  object-fit: cover;
  object-position: 50% 22%;
  border-radius: 2px;
  filter: grayscale(1) sepia(.45) contrast(1.12) brightness(1.04);
}
[data-selo] .cs-iniciais {
  font: 600 1em/1 Georgia, serif;
  letter-spacing: -.06em;
}
[data-selo] .cs-rodape {
  position: absolute;
  inset: 76% 0 auto;
  text-align: center;
  font-family: Georgia, serif;
  font-size: .65em;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .08em;
}
[data-selo] .cs-vazio {
  font: bold 1.45em/1 Georgia, serif;
  transform: translateY(.14em);
}

/* Brilho de foil ao colar o selo na carta (js/envio-selo.mjs): uma passada só, recortada no
   contorno perfurado. O pseudo-elemento só existe durante .is-brilho: as outras telas e a
   exportação em PNG não ganham camada nova. */
@property --selo-brilho {
  syntax: "<percentage>";
  inherits: false;
  initial-value: -40%;
}
[data-selo].is-brilho::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(112deg, transparent calc(var(--selo-brilho) - 20%), rgb(255 250 232 / .9) var(--selo-brilho), rgb(255 222 160 / .45) calc(var(--selo-brilho) + 6%), transparent calc(var(--selo-brilho) + 22%));
  mix-blend-mode: overlay;
  -webkit-mask: url("assets/selos/papel.svg") center / 100% 100% no-repeat;
  mask: url("assets/selos/papel.svg") center / 100% 100% no-repeat;
  animation: selo-brilho .85s cubic-bezier(.3, .1, .3, 1) both;
}
@keyframes selo-brilho {
  from { --selo-brilho: -40%; }
  to { --selo-brilho: 140%; }
}
@media (prefers-reduced-motion: reduce) {
  [data-selo].is-brilho::after { display: none; }
}
